WebKit Bugzilla
Attachment 349151 Details for
Bug 189410
: [JSC] Put .throwStackOverflow code after the fast path in LLInt doVMEntry
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189410-20180908012504.patch (text/plain), 6.96 KB, created by
Yusuke Suzuki
on 2018-09-07 09:25:05 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Yusuke Suzuki
Created:
2018-09-07 09:25:05 PDT
Size:
6.96 KB
patch
obsolete
>Subversion Revision: 235781 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 99460871fe6907d271a4d0086f2354a858998bbd..e686ad2cc19ee344673bfb8a5774ddc223eb5e8c 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,20 @@ >+2018-09-07 Yusuke Suzuki <yusukesuzuki@slowstart.org> >+ >+ [JSC] Put .throwStackOverflow code after the fast path in LLInt doVMEntry >+ https://bugs.webkit.org/show_bug.cgi?id=189410 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Put .throwStackOverflow code after the fast path in LLInt doVMEntry to >+ make doVMEntry code tight. >+ >+ * llint/LLIntThunks.cpp: >+ (JSC::vmEntryToWasm): Deleted. >+ * llint/LLIntThunks.h: >+ (JSC::vmEntryToWasm): >+ * llint/LowLevelInterpreter32_64.asm: >+ * llint/LowLevelInterpreter64.asm: >+ > 2018-09-06 Yusuke Suzuki <yusukesuzuki@slowstart.org> > > [WebAssembly] Optimize JS to Wasm call by removing Vector allocation >diff --git a/Source/JavaScriptCore/llint/LLIntThunks.cpp b/Source/JavaScriptCore/llint/LLIntThunks.cpp >index 28b9a8eb994153ba6ff7b97d1b744de90e085457..2446bdbfe76cf96294025dc65757da0e49930e8a 100644 >--- a/Source/JavaScriptCore/llint/LLIntThunks.cpp >+++ b/Source/JavaScriptCore/llint/LLIntThunks.cpp >@@ -42,12 +42,6 @@ > > namespace JSC { > >-EncodedJSValue JS_EXPORT_PRIVATE vmEntryToWasm(void* code, VM* vm, ProtoCallFrame* frame) >-{ >- code = retagCodePtr<WasmEntryPtrTag, JSEntryPtrTag>(code); >- return vmEntryToJavaScript(code, vm, frame); >-} >- > #if ENABLE(JIT) > > namespace LLInt { >diff --git a/Source/JavaScriptCore/llint/LLIntThunks.h b/Source/JavaScriptCore/llint/LLIntThunks.h >index f6a84b8110dd73cd4fe57310e0e5a0af3dc05185..839ff1e0eaccb0e062cb549153c4f0401af87321 100644 >--- a/Source/JavaScriptCore/llint/LLIntThunks.h >+++ b/Source/JavaScriptCore/llint/LLIntThunks.h >@@ -38,7 +38,11 @@ extern "C" { > EncodedJSValue vmEntryToNative(void*, VM*, ProtoCallFrame*); > } > >-EncodedJSValue JS_EXPORT_PRIVATE vmEntryToWasm(void*, VM*, ProtoCallFrame*); >+inline EncodedJSValue vmEntryToWasm(void* code, VM* vm, ProtoCallFrame* frame) >+{ >+ code = retagCodePtr<WasmEntryPtrTag, JSEntryPtrTag>(code); >+ return vmEntryToJavaScript(code, vm, frame); >+} > > namespace LLInt { > >diff --git a/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm b/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm >index 0bcb05411156d6439c765190787d3ed49bef1611..daaa8a402964918574032d6ee93cba2a27a78a3e 100644 >--- a/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm >+++ b/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm >@@ -157,11 +157,6 @@ macro doVMEntry(makeCall) > # before we start copying the args from the protoCallFrame below. > if C_LOOP > bpaeq t3, VM::m_cloopStackLimit[vm], .stackHeightOK >- else >- bpaeq t3, VM::m_softStackLimit[vm], .stackHeightOK >- end >- >- if C_LOOP > move entry, t4 > move vm, t5 > cloopCallSlowPath _llint_stack_check_at_vm_entry, vm, t3 >@@ -173,38 +168,11 @@ macro doVMEntry(makeCall) > .stackCheckFailed: > move t4, entry > move t5, vm >- end >- >-.throwStackOverflow: >- subp 8, sp # Align stack for cCall2() to make a call. >- move vm, a0 >- move protoCallFrame, a1 >- cCall2(_llint_throw_stack_overflow_error) >- >- if ARMv7 >- vmEntryRecord(cfr, t3) >- move t3, sp >- else >- vmEntryRecord(cfr, sp) >- end >- >- loadp VMEntryRecord::m_vm[sp], t5 >- loadp VMEntryRecord::m_prevTopCallFrame[sp], t4 >- storep t4, VM::topCallFrame[t5] >- loadp VMEntryRecord::m_prevTopEntryFrame[sp], t4 >- storep t4, VM::topEntryFrame[t5] >- >- if ARMv7 >- subp cfr, CalleeRegisterSaveSize, t5 >- move t5, sp >+ jmp .throwStackOverflow > else >- subp cfr, CalleeRegisterSaveSize, sp >+ bpb t3, VM::m_softStackLimit[vm], .throwStackOverflow > end > >- popCalleeSaves() >- functionEpilogue() >- ret >- > .stackHeightOK: > move t3, sp > move 4, t3 >@@ -267,6 +235,36 @@ macro doVMEntry(makeCall) > subp cfr, CalleeRegisterSaveSize, sp > end > >+ popCalleeSaves() >+ functionEpilogue() >+ ret >+ >+.throwStackOverflow: >+ subp 8, sp # Align stack for cCall2() to make a call. >+ move vm, a0 >+ move protoCallFrame, a1 >+ cCall2(_llint_throw_stack_overflow_error) >+ >+ if ARMv7 >+ vmEntryRecord(cfr, t3) >+ move t3, sp >+ else >+ vmEntryRecord(cfr, sp) >+ end >+ >+ loadp VMEntryRecord::m_vm[sp], t5 >+ loadp VMEntryRecord::m_prevTopCallFrame[sp], t4 >+ storep t4, VM::topCallFrame[t5] >+ loadp VMEntryRecord::m_prevTopEntryFrame[sp], t4 >+ storep t4, VM::topEntryFrame[t5] >+ >+ if ARMv7 >+ subp cfr, CalleeRegisterSaveSize, t5 >+ move t5, sp >+ else >+ subp cfr, CalleeRegisterSaveSize, sp >+ end >+ > popCalleeSaves() > functionEpilogue() > ret >diff --git a/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm b/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm >index d0d49b2efd9a9e07b9a56b28c398cc100855345b..ece418d660ce28b1a927d6acd4c23b9f14503eb6 100644 >--- a/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm >+++ b/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm >@@ -146,11 +146,6 @@ macro doVMEntry(makeCall) > # before we start copying the args from the protoCallFrame below. > if C_LOOP > bpaeq t3, VM::m_cloopStackLimit[vm], .stackHeightOK >- else >- bpaeq t3, VM::m_softStackLimit[vm], .stackHeightOK >- end >- >- if C_LOOP > move entry, t4 > move vm, t5 > cloopCallSlowPath _llint_stack_check_at_vm_entry, vm, t3 >@@ -162,27 +157,11 @@ macro doVMEntry(makeCall) > .stackCheckFailed: > move t4, entry > move t5, vm >+ jmp .throwStackOverflow >+ else >+ bpb t3, VM::m_softStackLimit[vm], .throwStackOverflow > end > >-.throwStackOverflow: >- move vm, a0 >- move protoCallFrame, a1 >- cCall2(_llint_throw_stack_overflow_error) >- >- vmEntryRecord(cfr, t4) >- >- loadp VMEntryRecord::m_vm[t4], vm >- loadp VMEntryRecord::m_prevTopCallFrame[t4], extraTempReg >- storep extraTempReg, VM::topCallFrame[vm] >- loadp VMEntryRecord::m_prevTopEntryFrame[t4], extraTempReg >- storep extraTempReg, VM::topEntryFrame[vm] >- >- subp cfr, CalleeRegisterSaveSize, sp >- >- popCalleeSaves() >- functionEpilogue() >- ret >- > .stackHeightOK: > move t3, sp > move 4, t3 >@@ -244,6 +223,25 @@ macro doVMEntry(makeCall) > > subp cfr, CalleeRegisterSaveSize, sp > >+ popCalleeSaves() >+ functionEpilogue() >+ ret >+ >+.throwStackOverflow: >+ move vm, a0 >+ move protoCallFrame, a1 >+ cCall2(_llint_throw_stack_overflow_error) >+ >+ vmEntryRecord(cfr, t4) >+ >+ loadp VMEntryRecord::m_vm[t4], vm >+ loadp VMEntryRecord::m_prevTopCallFrame[t4], extraTempReg >+ storep extraTempReg, VM::topCallFrame[vm] >+ loadp VMEntryRecord::m_prevTopEntryFrame[t4], extraTempReg >+ storep extraTempReg, VM::topEntryFrame[vm] >+ >+ subp cfr, CalleeRegisterSaveSize, sp >+ > popCalleeSaves() > functionEpilogue() > ret
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
mark.lam
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189410
: 349151