Title: [273217] trunk/Source/_javascript_Core
Revision
273217
Author
[email protected]
Date
2021-02-21 04:35:49 -0800 (Sun, 21 Feb 2021)

Log Message

[JSC] Remove vm.topCallFrame storing in Baseline JIT
https://bugs.webkit.org/show_bug.cgi?id=222162

Reviewed by Mark Lam.

This patch removes vm.topCallFrame storing in the Baseline JIT for ports that can USE(BUILTIN_FRAME_ADDRESS).
Also refactored some CommonSlowPath functions so that they can start using __builtin_frame_address later
instead of requiring that CallFrame be passed in.

* jit/JITInlines.h:
(JSC::JIT::updateTopCallFrame):
* runtime/CommonSlowPaths.cpp:
(JSC::iteratorOpenTryFastImpl):
(JSC::JSC_DEFINE_COMMON_SLOW_PATH):
(JSC::iteratorNextTryFastImpl):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (273216 => 273217)


--- trunk/Source/_javascript_Core/ChangeLog	2021-02-21 07:27:31 UTC (rev 273216)
+++ trunk/Source/_javascript_Core/ChangeLog	2021-02-21 12:35:49 UTC (rev 273217)
@@ -1,3 +1,21 @@
+2021-02-21  Yusuke Suzuki  <[email protected]>
+
+        [JSC] Remove vm.topCallFrame storing in Baseline JIT
+        https://bugs.webkit.org/show_bug.cgi?id=222162
+
+        Reviewed by Mark Lam.
+
+        This patch removes vm.topCallFrame storing in the Baseline JIT for ports that can USE(BUILTIN_FRAME_ADDRESS).
+        Also refactored some CommonSlowPath functions so that they can start using __builtin_frame_address later
+        instead of requiring that CallFrame be passed in.
+
+        * jit/JITInlines.h:
+        (JSC::JIT::updateTopCallFrame):
+        * runtime/CommonSlowPaths.cpp:
+        (JSC::iteratorOpenTryFastImpl):
+        (JSC::JSC_DEFINE_COMMON_SLOW_PATH):
+        (JSC::iteratorNextTryFastImpl):
+
 2021-02-19  Yusuke Suzuki  <[email protected]>
 
         JS Modules in Workers

Modified: trunk/Source/_javascript_Core/jit/JITInlines.h (273216 => 273217)


--- trunk/Source/_javascript_Core/jit/JITInlines.h	2021-02-21 07:27:31 UTC (rev 273216)
+++ trunk/Source/_javascript_Core/jit/JITInlines.h	2021-02-21 12:35:49 UTC (rev 273217)
@@ -109,11 +109,7 @@
 {
     uint32_t locationBits = CallSiteIndex(m_bytecodeIndex.offset()).bits();
     store32(TrustedImm32(locationBits), tagFor(CallFrameSlot::argumentCountIncludingThis));
-    
-    // FIXME: It's not clear that this is needed. JITOperations tend to update the top call frame on
-    // the C++ side.
-    // https://bugs.webkit.org/show_bug.cgi?id=155693
-    storePtr(callFrameRegister, &m_vm->topCallFrame);
+    prepareCallOperation(*m_vm);
 }
 
 ALWAYS_INLINE MacroAssembler::Call JIT::appendCallWithExceptionCheck(const FunctionPtr<CFunctionPtrTag> function)

Modified: trunk/Source/_javascript_Core/runtime/CommonSlowPaths.cpp (273216 => 273217)


--- trunk/Source/_javascript_Core/runtime/CommonSlowPaths.cpp	2021-02-21 07:27:31 UTC (rev 273216)
+++ trunk/Source/_javascript_Core/runtime/CommonSlowPaths.cpp	2021-02-21 12:35:49 UTC (rev 273217)
@@ -852,11 +852,8 @@
 }
 
 template<OpcodeSize width>
-ALWAYS_INLINE SlowPathReturnType iteratorOpenTryFastImpl(CallFrame* callFrame, const Instruction* pc)
+ALWAYS_INLINE SlowPathReturnType iteratorOpenTryFastImpl(VM& vm, JSGlobalObject* globalObject, CodeBlock* codeBlock, CallFrame* callFrame, const Instruction* pc)
 {
-    // Don't set PC; we can't throw and it's relatively slow.
-    BEGIN_NO_SET_PC();
-
     auto bytecode = pc->asKnownWidth<OpIteratorOpen, width>();
     auto& metadata = bytecode.metadata(codeBlock);
     JSValue iterable = GET_C(bytecode.m_iterable).jsValue();
@@ -881,24 +878,28 @@
 
 JSC_DEFINE_COMMON_SLOW_PATH(iterator_open_try_fast_narrow)
 {
-    return iteratorOpenTryFastImpl<Narrow>(callFrame, pc);
+    // Don't set PC; we can't throw and it's relatively slow.
+    BEGIN_NO_SET_PC();
+    return iteratorOpenTryFastImpl<Narrow>(vm, globalObject, codeBlock, callFrame, pc);
 }
 
 JSC_DEFINE_COMMON_SLOW_PATH(iterator_open_try_fast_wide16)
 {
-    return iteratorOpenTryFastImpl<Wide16>(callFrame, pc);
+    // Don't set PC; we can't throw and it's relatively slow.
+    BEGIN_NO_SET_PC();
+    return iteratorOpenTryFastImpl<Wide16>(vm, globalObject, codeBlock, callFrame, pc);
 }
 
 JSC_DEFINE_COMMON_SLOW_PATH(iterator_open_try_fast_wide32)
 {
-    return iteratorOpenTryFastImpl<Wide32>(callFrame, pc);
+    // Don't set PC; we can't throw and it's relatively slow.
+    BEGIN_NO_SET_PC();
+    return iteratorOpenTryFastImpl<Wide32>(vm, globalObject, codeBlock, callFrame, pc);
 }
 
 template<OpcodeSize width>
-ALWAYS_INLINE SlowPathReturnType iteratorNextTryFastImpl(CallFrame* callFrame, const Instruction* pc)
+ALWAYS_INLINE SlowPathReturnType iteratorNextTryFastImpl(VM& vm, JSGlobalObject* globalObject, CodeBlock* codeBlock, CallFrame* callFrame, ThrowScope& throwScope, const Instruction* pc)
 {
-    BEGIN();
-
     auto bytecode = pc->asKnownWidth<OpIteratorNext, width>();
     auto& metadata = bytecode.metadata(codeBlock);
 
@@ -938,17 +939,20 @@
 
 JSC_DEFINE_COMMON_SLOW_PATH(iterator_next_try_fast_narrow)
 {
-    return iteratorNextTryFastImpl<Narrow>(callFrame, pc);
+    BEGIN();
+    return iteratorNextTryFastImpl<Narrow>(vm, globalObject, codeBlock, callFrame, throwScope, pc);
 }
 
 JSC_DEFINE_COMMON_SLOW_PATH(iterator_next_try_fast_wide16)
 {
-    return iteratorNextTryFastImpl<Wide16>(callFrame, pc);
+    BEGIN();
+    return iteratorNextTryFastImpl<Wide16>(vm, globalObject, codeBlock, callFrame, throwScope, pc);
 }
 
 JSC_DEFINE_COMMON_SLOW_PATH(iterator_next_try_fast_wide32)
 {
-    return iteratorNextTryFastImpl<Wide32>(callFrame, pc);
+    BEGIN();
+    return iteratorNextTryFastImpl<Wide32>(vm, globalObject, codeBlock, callFrame, throwScope, pc);
 }
 
 JSC_DEFINE_COMMON_SLOW_PATH(slow_path_del_by_val)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to