[JSC] Drop ArityCheckData
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Oct 2017 16:36:37 +0000 (16:36 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Oct 2017 16:36:37 +0000 (16:36 +0000)
https://bugs.webkit.org/show_bug.cgi?id=178648

Reviewed by Mark Lam.

ArityCheckData is used to return a pair of `slotsToAdd` and `thunkToCall`.
However, use of `thunkToCall` is removed in 64bit environment at r189575.

We remove `thunkToCall` and align 32bit implementation to 64bit implementation.
Since we no longer need to have the above pair, we can remove ArityCheckData too.

* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
(JSC::setupArityCheckData): Deleted.
* runtime/CommonSlowPaths.h:
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223891 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
Source/JavaScriptCore/runtime/CommonSlowPaths.cpp
Source/JavaScriptCore/runtime/CommonSlowPaths.h
Source/JavaScriptCore/runtime/VM.cpp
Source/JavaScriptCore/runtime/VM.h

index 00d6ae8..ed2ef8f 100644 (file)
@@ -1,3 +1,26 @@
+2017-10-22  Yusuke Suzuki  <utatane.tea@gmail.com>
+
+        [JSC] Drop ArityCheckData
+        https://bugs.webkit.org/show_bug.cgi?id=178648
+
+        Reviewed by Mark Lam.
+
+        ArityCheckData is used to return a pair of `slotsToAdd` and `thunkToCall`.
+        However, use of `thunkToCall` is removed in 64bit environment at r189575.
+
+        We remove `thunkToCall` and align 32bit implementation to 64bit implementation.
+        Since we no longer need to have the above pair, we can remove ArityCheckData too.
+
+        * llint/LowLevelInterpreter32_64.asm:
+        * llint/LowLevelInterpreter64.asm:
+        * runtime/CommonSlowPaths.cpp:
+        (JSC::SLOW_PATH_DECL):
+        (JSC::setupArityCheckData): Deleted.
+        * runtime/CommonSlowPaths.h:
+        * runtime/VM.cpp:
+        (JSC::VM::VM):
+        * runtime/VM.h:
+
 2017-10-23  Keith Miller  <keith_miller@apple.com>
 
         Unreviewed, reland r223866
index 0e712b6..b1ec1de 100644 (file)
@@ -579,20 +579,7 @@ macro functionArityCheck(doneLabel, slowPath)
     jmp _llint_throw_from_slow_path_trampoline
 
 .noError:
-    # r1 points to ArityCheckData.
-    loadp CommonSlowPaths::ArityCheckData::thunkToCall[r1], t3
-    btpz t3, .proceedInline
-    
-    loadp CommonSlowPaths::ArityCheckData::paddedStackSpace[r1], a0
-    call t3
-    if ASSERT_ENABLED
-        loadp ReturnPC[cfr], t0
-        loadp [t0], t0
-    end
-    jmp .continue
-
-.proceedInline:
-    loadi CommonSlowPaths::ArityCheckData::paddedStackSpace[r1], t1
+    move r1, t1 # r1 contains slotsToAdd.
     btiz t1, .continue
     loadi PayloadOffset + ArgumentCount[cfr], t2
     addi CallFrameHeaderSlots, t2
index 9771409..a5aa7f7 100644 (file)
@@ -514,7 +514,7 @@ macro functionArityCheck(doneLabel, slowPath)
     jmp _llint_throw_from_slow_path_trampoline
 
 .noError:
-    loadi CommonSlowPaths::ArityCheckData::paddedStackSpace[r1], t1
+    move r1, t1 # r1 contains slotsToAdd.
     btiz t1, .continue
     loadi PayloadOffset + ArgumentCount[cfr], t2
     addi CallFrameHeaderSlots, t2
index 4d5441d..b10182b 100644 (file)
@@ -167,19 +167,6 @@ namespace JSC {
         CALL_END_IMPL(crExec, crCallTarget);                \
     } while (false)
 
-static CommonSlowPaths::ArityCheckData* setupArityCheckData(VM& vm, int slotsToAdd)
-{
-    CommonSlowPaths::ArityCheckData* result = vm.arityCheckData.get();
-    result->paddedStackSpace = slotsToAdd;
-#if ENABLE(JIT)
-    if (vm.canUseJIT())
-        result->thunkToCall = vm.getCTIStub(arityFixupGenerator).code().executableAddress();
-    else
-#endif
-        result->thunkToCall = 0;
-    return result;
-}
-
 SLOW_PATH_DECL(slow_path_call_arityCheck)
 {
     BEGIN();
@@ -192,7 +179,7 @@ SLOW_PATH_DECL(slow_path_call_arityCheck)
         CommonSlowPaths::interpreterThrowInCaller(exec, createStackOverflowError(exec));
         RETURN_TWO(bitwise_cast<void*>(static_cast<uintptr_t>(1)), exec);
     }
-    RETURN_TWO(0, setupArityCheckData(vm, slotsToAdd));
+    RETURN_TWO(0, bitwise_cast<void*>(static_cast<uintptr_t>(slotsToAdd)));
 }
 
 SLOW_PATH_DECL(slow_path_construct_arityCheck)
@@ -206,7 +193,7 @@ SLOW_PATH_DECL(slow_path_construct_arityCheck)
         CommonSlowPaths::interpreterThrowInCaller(exec, createStackOverflowError(exec));
         RETURN_TWO(bitwise_cast<void*>(static_cast<uintptr_t>(1)), exec);
     }
-    RETURN_TWO(0, setupArityCheckData(vm, slotsToAdd));
+    RETURN_TWO(0, bitwise_cast<void*>(static_cast<uintptr_t>(slotsToAdd)));
 }
 
 SLOW_PATH_DECL(slow_path_create_direct_arguments)
index f4d6ebe..98b6122 100644 (file)
@@ -45,11 +45,6 @@ namespace JSC {
 
 namespace CommonSlowPaths {
 
-struct ArityCheckData {
-    unsigned paddedStackSpace;
-    void* thunkToCall;
-};
-
 ALWAYS_INLINE int numberOfExtraSlots(int argumentCountIncludingThis)
 {
     int frameSize = argumentCountIncludingThis + CallFrame::headerSizeInRegisters;
index 73a37e7..bbbd708 100644 (file)
@@ -292,7 +292,6 @@ VM::VM(VMType vmType, HeapType heapType)
 #if ENABLE(JIT)
     jitStubs = std::make_unique<JITThunks>();
 #endif
-    arityCheckData = std::make_unique<CommonSlowPaths::ArityCheckData>();
 
 #if ENABLE(FTL_JIT)
     ftlThunks = std::make_unique<FTL::Thunks>();
index 2650864..62202bc 100644 (file)
@@ -147,9 +147,6 @@ namespace FTL {
 class Thunks;
 }
 #endif // ENABLE(FTL_JIT)
-namespace CommonSlowPaths {
-struct ArityCheckData;
-}
 namespace Profiler {
 class Database;
 }
@@ -480,7 +477,6 @@ public:
     }
 
 #endif // ENABLE(JIT)
-    std::unique_ptr<CommonSlowPaths::ArityCheckData> arityCheckData;
 #if ENABLE(FTL_JIT)
     std::unique_ptr<FTL::Thunks> ftlThunks;
 #endif