Title: [161219] branches/jsCStack/Source/_javascript_Core
Revision
161219
Author
mark....@apple.com
Date
2014-01-02 12:42:13 -0800 (Thu, 02 Jan 2014)

Log Message

CStack: Get the C Loop LLINT to build again.
https://bugs.webkit.org/show_bug.cgi?id=126393.

Not yet reviewed.

* jit/JITCode.cpp:
(JSC::DirectJITCode::addressForCall):
- #if ENABLE(JIT) out the use of RegisterPreservationWrappers.

* llint/LLIntCLoop.cpp:
(JSC::LLInt::CLoop::initialize):
- Update CLoop::initialize() to call the new CLoop::execute().

* llint/LLIntCLoop.h:
- CLoop::execute() now takes the arguments for callToJavaScript, and it
  effectively acts as the gateway for re-entering the VM in place for
  callToJavaScript (and callToNativeFunction).

  CLoop::execute() should set up the "CPU" execution environment i.e.
  CLoopRegisters should be initialized with the incoming args, stack
  pointer, base pointer, and return address. We'll take care of this
  part in a subsequent patch.

* llint/LLIntOpcode.h:
- Added C loop only llint opcodes llint_call_to_javascript, and
  llint_call_to_native_function. These will be used as the opcodeID for
  the llint interpreter blob for callToJavaScript and callToNativeFunction.

  Meanwhile, the LLINT thunk will provide C functions for callToJavaScript
  and callToNativeFunction which calls CLoop::execute() with the opcodeID
  for llint_call_to_javascript and llint_call_to_native_function
  respectively.

* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::llint_throw_stack_overflow_error):
- Changed llint_throw_stack_overflow_error()'s return type so that it
  is easier for the C Loop LLINT to generate boilerplate code to call it.

  The return value is not used by anyone. But since this is code that
  rarely executed, we'll opt to take this small hit of returning an
  unused value rather than having to spin some way to make the C Loop
  offlineasm smarter only for handling this one case.

* llint/LLIntSlowPaths.h:
* llint/LLIntThunks.cpp:
(JSC::callToJavaScript):
(JSC::callToNativeFunction):
- Updated to call the new CLoop::execute().

  We're going to try to use the doCallToJavaScript code defined in the
  LLINT assembly instead of spinning our own version in C++ as we did
  previously.

* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter.cpp:
(JSC::CLoopRegister::operator ExecState*):
(JSC::CLoopRegister::operator Instruction*):
(JSC::CLoopRegister::operator VM*):
(JSC::CLoopRegister::operator ProtoCallFrame*):
- Added these cast operators to the CLoopRegister to simplify the C Loop
  call slow path boilerplate.

(JSC::CLoop::execute):
* llint/LowLevelInterpreter64.asm:
* offlineasm/cloop.rb:
- Define C Loop registers to match ARM as expected by the code.
- Replaced a #error with a RELEASE_ASSERT_NOT_REACHED().
- Reworked the call slow path boilerplate to take advantage of the CLoopRegister
  cast operators. We need this in order to be able to call slow path functions
  that take different argument types e.g. llint_throw_stack_overflow_error().

* runtime/CommonSlowPaths.cpp:
(JSC::setupArityCheckData):
* runtime/VM.cpp:
(JSC::VM::getHostFunction):
* runtime/VMEntryScope.cpp:
(JSC::VMEntryScope::requiredCapacity):

Modified Paths

Diff

Modified: branches/jsCStack/Source/_javascript_Core/ChangeLog (161218 => 161219)


--- branches/jsCStack/Source/_javascript_Core/ChangeLog	2014-01-02 20:15:25 UTC (rev 161218)
+++ branches/jsCStack/Source/_javascript_Core/ChangeLog	2014-01-02 20:42:13 UTC (rev 161219)
@@ -1,3 +1,83 @@
+2014-01-02  Mark Lam  <mark....@apple.com>
+
+        CStack: Get the C Loop LLINT to build again.
+        https://bugs.webkit.org/show_bug.cgi?id=126393.
+
+        Not yet reviewed.
+
+        * jit/JITCode.cpp:
+        (JSC::DirectJITCode::addressForCall):
+        - #if ENABLE(JIT) out the use of RegisterPreservationWrappers.
+
+        * llint/LLIntCLoop.cpp:
+        (JSC::LLInt::CLoop::initialize):
+        - Update CLoop::initialize() to call the new CLoop::execute().
+
+        * llint/LLIntCLoop.h:
+        - CLoop::execute() now takes the arguments for callToJavaScript, and it
+          effectively acts as the gateway for re-entering the VM in place for
+          callToJavaScript (and callToNativeFunction).
+
+          CLoop::execute() should set up the "CPU" execution environment i.e.
+          CLoopRegisters should be initialized with the incoming args, stack
+          pointer, base pointer, and return address. We'll take care of this
+          part in a subsequent patch.
+
+        * llint/LLIntOpcode.h:
+        - Added C loop only llint opcodes llint_call_to_javascript, and
+          llint_call_to_native_function. These will be used as the opcodeID for
+          the llint interpreter blob for callToJavaScript and callToNativeFunction.
+
+          Meanwhile, the LLINT thunk will provide C functions for callToJavaScript
+          and callToNativeFunction which calls CLoop::execute() with the opcodeID
+          for llint_call_to_javascript and llint_call_to_native_function
+          respectively.
+
+        * llint/LLIntSlowPaths.cpp:
+        (JSC::LLInt::llint_throw_stack_overflow_error):
+        - Changed llint_throw_stack_overflow_error()'s return type so that it
+          is easier for the C Loop LLINT to generate boilerplate code to call it.
+
+          The return value is not used by anyone. But since this is code that
+          rarely executed, we'll opt to take this small hit of returning an
+          unused value rather than having to spin some way to make the C Loop
+          offlineasm smarter only for handling this one case.
+
+        * llint/LLIntSlowPaths.h:
+        * llint/LLIntThunks.cpp:
+        (JSC::callToJavaScript):
+        (JSC::callToNativeFunction):
+        - Updated to call the new CLoop::execute().
+
+          We're going to try to use the doCallToJavaScript code defined in the
+          LLINT assembly instead of spinning our own version in C++ as we did
+          previously.
+
+        * llint/LowLevelInterpreter.asm:
+        * llint/LowLevelInterpreter.cpp:
+        (JSC::CLoopRegister::operator ExecState*):
+        (JSC::CLoopRegister::operator Instruction*):
+        (JSC::CLoopRegister::operator VM*):
+        (JSC::CLoopRegister::operator ProtoCallFrame*):
+        - Added these cast operators to the CLoopRegister to simplify the C Loop
+          call slow path boilerplate.
+
+        (JSC::CLoop::execute):
+        * llint/LowLevelInterpreter64.asm:
+        * offlineasm/cloop.rb:
+        - Define C Loop registers to match ARM as expected by the code.
+        - Replaced a #error with a RELEASE_ASSERT_NOT_REACHED().
+        - Reworked the call slow path boilerplate to take advantage of the CLoopRegister
+          cast operators. We need this in order to be able to call slow path functions
+          that take different argument types e.g. llint_throw_stack_overflow_error().
+
+        * runtime/CommonSlowPaths.cpp:
+        (JSC::setupArityCheckData):
+        * runtime/VM.cpp:
+        (JSC::VM::getHostFunction):
+        * runtime/VMEntryScope.cpp:
+        (JSC::VMEntryScope::requiredCapacity):
+
 2014-01-02  Filip Pizlo  <fpi...@apple.com>
 
         Some crashes in C stack on Mountain Lion, for example on crypto-aes, due to misaligned stack

Modified: branches/jsCStack/Source/_javascript_Core/jit/JITCode.cpp (161218 => 161219)


--- branches/jsCStack/Source/_javascript_Core/jit/JITCode.cpp	2014-01-02 20:15:25 UTC (rev 161218)
+++ branches/jsCStack/Source/_javascript_Core/jit/JITCode.cpp	2014-01-02 20:42:13 UTC (rev 161219)
@@ -161,10 +161,16 @@
             RELEASE_ASSERT(m_ref);
             return m_ref.code();
         case MustPreserveRegisters: {
+#if ENABLE(JIT)
             RegisterPreservationWrappers* wrappers = ensureWrappers();
             if (!wrappers->withoutArityCheck)
                 wrappers->withoutArityCheck = generateRegisterPreservationWrapper(vm, executable, m_ref.code());
             return wrappers->withoutArityCheck.code();
+#else
+            UNUSED_PARAM(vm);
+            UNUSED_PARAM(executable);
+            RELEASE_ASSERT_NOT_REACHED();
+#endif
         } }
     case MustCheckArity:
         switch (registers) {
@@ -172,10 +178,14 @@
             RELEASE_ASSERT(m_withArityCheck);
             return m_withArityCheck;
         case MustPreserveRegisters: {
+#if ENABLE(JIT)
             RegisterPreservationWrappers* wrappers = ensureWrappers();
             if (!wrappers->withArityCheck)
                 wrappers->withArityCheck = generateRegisterPreservationWrapper(vm, executable, m_withArityCheck);
             return wrappers->withArityCheck.code();
+#else
+            RELEASE_ASSERT_NOT_REACHED();
+#endif
         } }
     }
     RELEASE_ASSERT_NOT_REACHED();

Modified: branches/jsCStack/Source/_javascript_Core/llint/LLIntCLoop.cpp (161218 => 161219)


--- branches/jsCStack/Source/_javascript_Core/llint/LLIntCLoop.cpp	2014-01-02 20:15:25 UTC (rev 161218)
+++ branches/jsCStack/Source/_javascript_Core/llint/LLIntCLoop.cpp	2014-01-02 20:42:13 UTC (rev 161219)
@@ -35,7 +35,7 @@
 
 void CLoop::initialize()
 {
-    execute(0, getOpcode(llint_unused), true);
+    execute(llint_unused, 0, 0, 0, true);
 }
 
 } // namespace LLInt

Modified: branches/jsCStack/Source/_javascript_Core/llint/LLIntCLoop.h (161218 => 161219)


--- branches/jsCStack/Source/_javascript_Core/llint/LLIntCLoop.h	2014-01-02 20:15:25 UTC (rev 161218)
+++ branches/jsCStack/Source/_javascript_Core/llint/LLIntCLoop.h	2014-01-02 20:42:13 UTC (rev 161219)
@@ -31,6 +31,7 @@
 #include "CallFrame.h"
 #include "JSCJSValue.h"
 #include "Opcode.h"
+#include "ProtoCallFrame.h"
 
 namespace JSC {
 namespace LLInt {
@@ -40,7 +41,7 @@
 class CLoop {
 public:
     static void initialize();
-    static JSValue execute(CallFrame*, Opcode entryOpcode, bool isInitializationPass = false);
+    static JSValue execute(OpcodeID entryOpcodeID, void* executableAddress, VM*, ProtoCallFrame*, bool isInitializationPass = false);
 };
 
 } } // namespace JSC::LLInt

Modified: branches/jsCStack/Source/_javascript_Core/llint/LLIntOpcode.h (161218 => 161219)


--- branches/jsCStack/Source/_javascript_Core/llint/LLIntOpcode.h	2014-01-02 20:15:25 UTC (rev 161218)
+++ branches/jsCStack/Source/_javascript_Core/llint/LLIntOpcode.h	2014-01-02 20:42:13 UTC (rev 161219)
@@ -34,6 +34,8 @@
 
 #define FOR_EACH_LLINT_NOJIT_NATIVE_HELPER(macro) \
     macro(getHostCallReturnValue, 1) \
+    macro(llint_call_to_javascript, 1) \
+    macro(llint_call_to_native_function, 1) \
     macro(handleUncaughtException, 1)
 
 #else // !ENABLE(LLINT_C_LOOP)

Modified: branches/jsCStack/Source/_javascript_Core/llint/LLIntSlowPaths.cpp (161218 => 161219)


--- branches/jsCStack/Source/_javascript_Core/llint/LLIntSlowPaths.cpp	2014-01-02 20:15:25 UTC (rev 161218)
+++ branches/jsCStack/Source/_javascript_Core/llint/LLIntSlowPaths.cpp	2014-01-02 20:42:13 UTC (rev 161219)
@@ -1414,12 +1414,13 @@
     LLINT_END();
 }
 
-void llint_throw_stack_overflow_error(VM* vm, ProtoCallFrame* protoFrame)
+SlowPathReturnType llint_throw_stack_overflow_error(VM* vm, ProtoCallFrame* protoFrame)
 {
     ExecState* exec = vm->topCallFrame;
     if (!exec)
         exec = protoFrame->scope()->globalObject()->globalExec();
     throwStackOverflowError(exec);
+    return encodeResult(0, 0);
 }
 
 } } // namespace JSC::LLInt

Modified: branches/jsCStack/Source/_javascript_Core/llint/LLIntSlowPaths.h (161218 => 161219)


--- branches/jsCStack/Source/_javascript_Core/llint/LLIntSlowPaths.h	2014-01-02 20:15:25 UTC (rev 161218)
+++ branches/jsCStack/Source/_javascript_Core/llint/LLIntSlowPaths.h	2014-01-02 20:42:13 UTC (rev 161219)
@@ -123,7 +123,7 @@
 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_resolve_scope);
 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_get_from_scope);
 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_put_to_scope);
-extern "C" void llint_throw_stack_overflow_error(VM*, ProtoCallFrame*);
+extern "C" SlowPathReturnType llint_throw_stack_overflow_error(VM*, ProtoCallFrame*);
 
 } } // namespace JSC::LLInt
 

Modified: branches/jsCStack/Source/_javascript_Core/llint/LLIntThunks.cpp (161218 => 161219)


--- branches/jsCStack/Source/_javascript_Core/llint/LLIntThunks.cpp	2014-01-02 20:15:25 UTC (rev 161218)
+++ branches/jsCStack/Source/_javascript_Core/llint/LLIntThunks.cpp	2014-01-02 20:42:13 UTC (rev 161219)
@@ -94,60 +94,18 @@
 
 // Non-JIT (i.e. C Loop LLINT) case:
 
-typedef JSValue (*ExecuteCode) (CallFrame*, void* executableAddress);
-
-template<ExecuteCode execute>
-EncodedJSValue doCallToJavaScript(void* executableAddress, ProtoCallFrame* protoCallFrame)
+EncodedJSValue callToJavaScript(void* executableAddress, VM* vm, ProtoCallFrame* protoCallFrame)
 {
-    CodeBlock* codeBlock = protoCallFrame->codeBlock();
-    JSScope* scope = protoCallFrame->scope();
-    JSObject* callee = protoCallFrame->callee();
-    int argCountIncludingThis = protoCallFrame->argumentCountIncludingThis();
-    int argCount = protoCallFrame->argumentCount();
-    JSValue thisValue = protoCallFrame->thisValue();
-    JSStack& stack = scope->vm()->interpreter->stack();
-
-    CallFrame* newCallFrame = stack.pushFrame(codeBlock, scope, argCountIncludingThis, callee);
-    if (UNLIKELY(!newCallFrame)) {
-        JSGlobalObject* globalObject = scope->globalObject();
-        ExecState* exec = globalObject->globalExec();
-        return JSValue::encode(throwStackOverflowError(exec));
-    }
-
-    // Set the arguments for the callee:
-    newCallFrame->setThisValue(thisValue);
-    for (int i = 0; i < argCount; ++i)
-        newCallFrame->setArgument(i, protoCallFrame->argument(i));
-
-    JSValue result = execute(newCallFrame, executableAddress);
-
-    stack.popFrame(newCallFrame);
-
+    JSValue result = CLoop::execute(llint_call_to_javascript, executableAddress, vm, protoCallFrame);
     return JSValue::encode(result);
 }
 
-static inline JSValue executeJS(CallFrame* newCallFrame, void* executableAddress)
+EncodedJSValue callToNativeFunction(void* executableAddress, VM* vm, ProtoCallFrame* protoCallFrame)
 {
-    Opcode entryOpcode = *reinterpret_cast<Opcode*>(&executableAddress);
-    return CLoop::execute(newCallFrame, entryOpcode);
+    JSValue result = CLoop::execute(llint_call_to_native_function, executableAddress, vm, protoCallFrame);
+    return JSValue::encode(result);
 }
 
-EncodedJSValue callToJavaScript(void* executableAddress, ExecState**, ProtoCallFrame* protoCallFrame, Register*)
-{
-    return doCallToJavaScript<executeJS>(executableAddress, protoCallFrame);
-}
-
-static inline JSValue executeNative(CallFrame* newCallFrame, void* executableAddress)
-{
-    NativeFunction function = reinterpret_cast<NativeFunction>(executableAddress);
-    return JSValue::decode(function(newCallFrame));
-}
-
-EncodedJSValue callToNativeFunction(void* executableAddress, ExecState**, ProtoCallFrame* protoCallFrame, Register*)
-{
-    return doCallToJavaScript<executeNative>(executableAddress, protoCallFrame);
-}
-
 #endif // ENABLE(JIT)
 
 } // namespace JSC

Modified: branches/jsCStack/Source/_javascript_Core/llint/LowLevelInterpreter.asm (161218 => 161219)


--- branches/jsCStack/Source/_javascript_Core/llint/LowLevelInterpreter.asm	2014-01-02 20:15:25 UTC (rev 161218)
+++ branches/jsCStack/Source/_javascript_Core/llint/LowLevelInterpreter.asm	2014-01-02 20:42:13 UTC (rev 161219)
@@ -517,18 +517,25 @@
     ret
 end
 
-if C_LOOP
-else
 # stub to call into _javascript_ or Native functions
 # EncodedJSValue callToJavaScript(void* code, ExecState** vmTopCallFrame, ProtoCallFrame* protoFrame)
 # EncodedJSValue callToNativeFunction(void* code, ExecState** vmTopCallFrame, ProtoCallFrame* protoFrame)
 # Note, if these stubs or one of their related macros are changed, make the
 # equivalent changes in jit/JITStubsX86.h and/or jit/JITStubsMSVC64.asm
+
+if C_LOOP
+_llint_call_to_javascript:
+else
 _callToJavaScript:
+end
     doCallToJavaScript(makeJavaScriptCall)
 
 
+if C_LOOP
+_llint_call_to_native_function:
+else
 _callToNativeFunction:
+end
     doCallToJavaScript(makeHostFunctionCall)
 
 
@@ -560,8 +567,8 @@
 .zeroFillDone:
     storep sp, VM::m_lastStackTop[vm]
     ret
-end
 
+
 # Indicate the beginning of LLInt.
 _llint_begin:
     crash()

Modified: branches/jsCStack/Source/_javascript_Core/llint/LowLevelInterpreter.cpp (161218 => 161219)


--- branches/jsCStack/Source/_javascript_Core/llint/LowLevelInterpreter.cpp	2014-01-02 20:15:25 UTC (rev 161218)
+++ branches/jsCStack/Source/_javascript_Core/llint/LowLevelInterpreter.cpp	2014-01-02 20:42:13 UTC (rev 161219)
@@ -216,6 +216,8 @@
         void* vp;
         ExecState* execState;
         void* instruction;
+        VM* vm;
+        ProtoCallFrame* protoCallFrame;
         NativeFunction nativeFunc;
 #if USE(JSVALUE64)
         int64_t i64;
@@ -226,6 +228,11 @@
         Opcode opcode;
     };
 
+    operator ExecState*() { return execState; }
+    operator Instruction*() { return reinterpret_cast<Instruction*>(instruction); }
+    operator VM*() { return vm; }
+    operator ProtoCallFrame*() { return protoCallFrame; }
+
 #if USE(JSVALUE64)
     inline void clearHighWord() { i32padding = 0; }
 #else
@@ -237,7 +244,7 @@
 // The llint C++ interpreter loop:
 //
 
-JSValue CLoop::execute(CallFrame* callFrame, Opcode entryOpcode, bool isInitializationPass)
+JSValue CLoop::execute(OpcodeID entryOpcodeID, void* executableAddress, VM* vm, ProtoCallFrame* protoCallFrame, bool isInitializationPass)
 {
     #define CAST reinterpret_cast
     #define SIGN_BIT32(x) ((x) & 0x80000000)
@@ -272,8 +279,6 @@
         return JSValue();
     }
 
-    ASSERT(callFrame->vm().topCallFrame == callFrame);
-
     // Define the pseudo registers used by the LLINT C Loop backend:
     ASSERT(sizeof(CLoopRegister) == sizeof(intptr_t));
 
@@ -315,25 +320,17 @@
     CLoopRegister rRetVPC;
     CLoopDoubleRegister d0, d1;
 
-    // Keep the compiler happy. We don't really need this, but the compiler
-    // will complain. This makes the warning go away.
-    t0.i = 0;
-    t1.i = 0;
-
-    VM* vm = &callFrame->vm();
-
-    CodeBlock* codeBlock = callFrame->codeBlock();
     Instruction* vPC;
 
     // rPC is an alias for vPC. Set up the alias:
     CLoopRegister& rPC = *CAST<CLoopRegister*>(&vPC);
 
-#if USE(JSVALUE32_64)
-    vPC = codeBlock->instructions().begin();
-#else // USE(JSVALUE64)
-    vPC = 0;
-    rBasePC.vp = codeBlock->instructions().begin();
+    // Initialize the incoming args for doCallToJavaScript:
+    t0.vp = executableAddress;
+    t1.vm = vm;
+    t2.protoCallFrame = protoCallFrame;
 
+#if USE(JSVALUE64)
     // For the ASM llint, JITStubs takes care of this initialization. We do
     // it explicitly here for the C loop:
     tagTypeNumber.i = 0xFFFF000000000000;
@@ -341,6 +338,7 @@
 #endif // USE(JSVALUE64)
 
     // cfr is an alias for callFrame. Set up this alias:
+    CallFrame* callFrame;
     CLoopRegister& cfr = *CAST<CLoopRegister*>(&callFrame);
 
     // Simulate a native return PC which should never be used:
@@ -349,10 +347,8 @@
     // Interpreter variables for value passing between opcodes and/or helpers:
     NativeFunction nativeFunc = 0;
     JSValue functionReturnValue;
-    Opcode opcode;
+    Opcode opcode = getOpcode(entryOpcodeID);
 
-    opcode = entryOpcode;
-
     #if ENABLE(OPCODE_STATS)
         #define RECORD_OPCODE_STATS(__opcode) \
             OpcodeStats::recordInstruction(__opcode)
@@ -431,11 +427,6 @@
             goto doReturnHelper;
         }
 
-        OFFLINE_ASM_GLUE_LABEL(handleUncaughtException)
-        {
-            return vm->exception();
-        }
-
 #if !ENABLE(COMPUTED_GOTO_OPCODES)
     default:
         ASSERT(false);
@@ -478,7 +469,7 @@
         // bytecode offset before we dispatch via the usual dispatch mechanism
         // i.e. NEXT_INSTRUCTION():
 
-        codeBlock = callFrame->codeBlock();
+        CodeBlock* codeBlock = callFrame->codeBlock();
         ASSERT(codeBlock);
         rPC.vp = callFrame->currentVPC();
         rPC.i = rPC.i8p - reinterpret_cast<int8_t*>(codeBlock->instructions().begin());

Modified: branches/jsCStack/Source/_javascript_Core/llint/LowLevelInterpreter64.asm (161218 => 161219)


--- branches/jsCStack/Source/_javascript_Core/llint/LowLevelInterpreter64.asm	2014-01-02 20:15:25 UTC (rev 161218)
+++ branches/jsCStack/Source/_javascript_Core/llint/LowLevelInterpreter64.asm	2014-01-02 20:42:13 UTC (rev 161219)
@@ -101,7 +101,7 @@
         const temp1 = t0
         const temp2 = t3
         const temp3 = t6
-    elsif ARM64
+    elsif ARM64 or C_LOOP
         const entry = a0
         const vm = a1
         const protoCallFrame = a2
@@ -1874,7 +1874,10 @@
 
 
 _llint_throw_during_call_trampoline:
+if C_LOOP
+else
     pop t2
+end
     jmp _llint_throw_from_slow_path_trampoline
 
 

Modified: branches/jsCStack/Source/_javascript_Core/offlineasm/cloop.rb (161218 => 161219)


--- branches/jsCStack/Source/_javascript_Core/offlineasm/cloop.rb	2014-01-02 20:15:25 UTC (rev 161218)
+++ branches/jsCStack/Source/_javascript_Core/offlineasm/cloop.rb	2014-01-02 20:42:13 UTC (rev 161219)
@@ -68,22 +68,17 @@
 class RegisterID
     def clDump
         case name
+        # The cloop is modelled on the ARM implementation. Hence, the a0-a3
+        # registers are aliases for r0-r3 i.e. t0-t3 in our case.
         when "a0"
-            "a0"
+            "t0"
         when "a1"
-            "a1"
+            "t1"
         when "a2"
-            "a2"
+            "t2"
         when "a3"
-            "a3"
-        when "a4"
-            "a4"
-        when "a5"
-            "a5"
-        when "a6"
-            "a6"
-        when "a6"
-            "a6"
+            "t3"
+
         when "t0"
             "t0"
         when "t1"
@@ -557,9 +552,7 @@
 # operands: callTarget, currentFrame, currentPC
 def cloopEmitCallSlowPath(operands)
     $asm.putc "{"
-    $asm.putc "    ExecState* exec = CAST<ExecState*>(#{operands[1].clValue(:voidPtr)});"
-    $asm.putc "    Instruction* pc = CAST<Instruction*>(#{operands[2].clValue(:voidPtr)});"
-    $asm.putc "    SlowPathReturnType result = #{operands[0].cLabel}(exec, pc);"
+    $asm.putc "    SlowPathReturnType result = #{operands[0].cLabel}(#{operands[1].clDump}, #{operands[2].clDump});"
     $asm.putc "    decodeResult(result, t0.instruction, t1.vp);"
     $asm.putc "}"
 end
@@ -1100,7 +1093,8 @@
             
         when "memfence"
         when "pop"
-            $asm.putc "#error FIXME: Need implementation for pop"
+            $asm.putc "RELEASE_ASSERT_NOT_REACHED(); // pop not implemented."
+
         when "pushCalleeSaves"
         when "popCalleeSaves"
 

Modified: branches/jsCStack/Source/_javascript_Core/runtime/CommonSlowPaths.cpp (161218 => 161219)


--- branches/jsCStack/Source/_javascript_Core/runtime/CommonSlowPaths.cpp	2014-01-02 20:15:25 UTC (rev 161218)
+++ branches/jsCStack/Source/_javascript_Core/runtime/CommonSlowPaths.cpp	2014-01-02 20:42:13 UTC (rev 161219)
@@ -174,10 +174,13 @@
 {
     CommonSlowPaths::ArityCheckData* result = vm.arityCheckData.get();
     result->paddedStackSpace = slotsToAdd;
+#if ENABLE(JIT)
     if (vm.canUseJIT()) {
         result->thunkToCall = vm.getCTIStub(arityFixup).code().executableAddress();
         result->returnPC = vm.arityCheckFailReturnThunks->returnPCFor(vm, slotsToAdd * stackAlignmentRegisters()).executableAddress();
-    } else {
+    } else
+#endif
+    {
         result->thunkToCall = 0;
         result->returnPC = 0;
     }

Modified: branches/jsCStack/Source/_javascript_Core/runtime/VM.cpp (161218 => 161219)


--- branches/jsCStack/Source/_javascript_Core/runtime/VM.cpp	2014-01-02 20:15:25 UTC (rev 161218)
+++ branches/jsCStack/Source/_javascript_Core/runtime/VM.cpp	2014-01-02 20:42:13 UTC (rev 161219)
@@ -51,6 +51,7 @@
 #include "Identifier.h"
 #include "IncrementalSweeper.h"
 #include "Interpreter.h"
+#include "JITCode.h"
 #include "JSAPIValueWrapper.h"
 #include "JSActivation.h"
 #include "JSArray.h"
@@ -467,8 +468,8 @@
 NativeExecutable* VM::getHostFunction(NativeFunction function, NativeFunction constructor)
 {
     return NativeExecutable::create(*this,
-        MacroAssemblerCodeRef::createLLIntCodeRef(llint_native_call_trampoline), function,
-        MacroAssemblerCodeRef::createLLIntCodeRef(llint_native_construct_trampoline), constructor,
+        adoptRef(new NativeJITCode(MacroAssemblerCodeRef::createLLIntCodeRef(llint_native_call_trampoline), JITCode::HostCallThunk)), function,
+        adoptRef(new NativeJITCode(MacroAssemblerCodeRef::createLLIntCodeRef(llint_native_construct_trampoline), JITCode::HostCallThunk)), constructor,
         NoIntrinsic);
 }
 

Modified: branches/jsCStack/Source/_javascript_Core/runtime/VMEntryScope.cpp (161218 => 161219)


--- branches/jsCStack/Source/_javascript_Core/runtime/VMEntryScope.cpp	2014-01-02 20:15:25 UTC (rev 161218)
+++ branches/jsCStack/Source/_javascript_Core/runtime/VMEntryScope.cpp	2014-01-02 20:42:13 UTC (rev 161219)
@@ -169,6 +169,7 @@
             excessCStackSize = availableCStack - availableJSStack;
     }
 #else
+    UNUSED_PARAM(topOfStack);
     UNUSED_PARAM(type);
     ASSERT(type == NativeStackCapacity);
 #endif
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to