Title: [160253] branches/jsCStack/Source/_javascript_Core
Revision
160253
Author
[email protected]
Date
2013-12-06 14:54:41 -0800 (Fri, 06 Dec 2013)

Log Message

    Merged from trunk r160244: <http://trac.webkit.org/changeset/160244>

        Split sizing of VarArgs frames from loading arguments for the frame
        https://bugs.webkit.org/show_bug.cgi?id=125331

        Reviewed by Filip Pizlo.

        Split loadVarargs into sizeAndAllocFrameForVarargs() and loadVarargs() in
        preparation for moving onto the C stack.  sizeAndAllocFrameForVarargs() will
        compute the size of the callee frame and allocate it, while loadVarargs()
        actually loads the argument values.

        As part of moving onto the C stack, sizeAndAllocFrameForVarargs() will be
        changed to a function that just computes the size.  The caller will use that
        size to allocate the new frame on the stack before calling loadVargs() and
        actually making the call.

        * interpreter/Interpreter.cpp:
        (JSC::sizeAndAllocFrameForVarargs):
        (JSC::loadVarargs):
        * interpreter/Interpreter.h:
        * jit/JIT.h:
        * jit/JITCall.cpp:
        (JSC::JIT::compileLoadVarargs):
        * jit/JITCall32_64.cpp:
        (JSC::JIT::compileLoadVarargs):
        * jit/JITInlines.h:
        (JSC::JIT::callOperation):
        * jit/JITOperations.cpp:
        * jit/JITOperations.h:
        * llint/LLIntSlowPaths.cpp:
        (JSC::LLInt::LLINT_SLOW_PATH_DECL):
        * llint/LLIntSlowPaths.h:
        * llint/LowLevelInterpreter.asm:
        * llint/LowLevelInterpreter32_64.asm:
        * llint/LowLevelInterpreter64.asm:
        * runtime/VM.h:

Modified Paths

Diff

Modified: branches/jsCStack/Source/_javascript_Core/ChangeLog (160252 => 160253)


--- branches/jsCStack/Source/_javascript_Core/ChangeLog	2013-12-06 22:54:02 UTC (rev 160252)
+++ branches/jsCStack/Source/_javascript_Core/ChangeLog	2013-12-06 22:54:41 UTC (rev 160253)
@@ -1,3 +1,81 @@
+2013-12-06  Michael Saboff  <[email protected]>
+
+    Merged from trunk r160244: <http://trac.webkit.org/changeset/160244>
+
+        Split sizing of VarArgs frames from loading arguments for the frame
+        https://bugs.webkit.org/show_bug.cgi?id=125331
+
+        Reviewed by Filip Pizlo.
+
+        Split loadVarargs into sizeAndAllocFrameForVarargs() and loadVarargs() in
+        preparation for moving onto the C stack.  sizeAndAllocFrameForVarargs() will
+        compute the size of the callee frame and allocate it, while loadVarargs()
+        actually loads the argument values.
+
+        As part of moving onto the C stack, sizeAndAllocFrameForVarargs() will be
+        changed to a function that just computes the size.  The caller will use that
+        size to allocate the new frame on the stack before calling loadVargs() and
+        actually making the call.
+
+        * interpreter/Interpreter.cpp:
+        (JSC::sizeAndAllocFrameForVarargs):
+        (JSC::loadVarargs):
+        * interpreter/Interpreter.h:
+        * jit/JIT.h:
+        * jit/JITCall.cpp:
+        (JSC::JIT::compileLoadVarargs):
+        * jit/JITCall32_64.cpp:
+        (JSC::JIT::compileLoadVarargs):
+        * jit/JITInlines.h:
+        (JSC::JIT::callOperation):
+        * jit/JITOperations.cpp:
+        * jit/JITOperations.h:
+        * llint/LLIntSlowPaths.cpp:
+        (JSC::LLInt::LLINT_SLOW_PATH_DECL):
+        * llint/LLIntSlowPaths.h:
+        * llint/LowLevelInterpreter.asm:
+        * llint/LowLevelInterpreter32_64.asm:
+        * llint/LowLevelInterpreter64.asm:
+        * runtime/VM.h:
+
+2013-12-06  Michael Saboff  <[email protected]>
+
+        Split sizing of VarArgs frames from loading arguments for the frame
+        https://bugs.webkit.org/show_bug.cgi?id=125331
+
+        Reviewed by Filip Pizlo.
+
+        Split loadVarargs into sizeAndAllocFrameForVarargs() and loadVarargs() in
+        preparation for moving onto the C stack.  sizeAndAllocFrameForVarargs() will
+        compute the size of the callee frame and allocate it, while loadVarargs()
+        actually loads the argument values.
+
+        As part of moving onto the C stack, sizeAndAllocFrameForVarargs() will be
+        changed to a function that just computes the size.  The caller will use that
+        size to allocate the new frame on the stack before calling loadVargs() and
+        actually making the call.
+
+        * interpreter/Interpreter.cpp:
+        (JSC::sizeAndAllocFrameForVarargs):
+        (JSC::loadVarargs):
+        * interpreter/Interpreter.h:
+        * jit/JIT.h:
+        * jit/JITCall.cpp:
+        (JSC::JIT::compileLoadVarargs):
+        * jit/JITCall32_64.cpp:
+        (JSC::JIT::compileLoadVarargs):
+        * jit/JITInlines.h:
+        (JSC::JIT::callOperation):
+        * jit/JITOperations.cpp:
+        * jit/JITOperations.h:
+        * llint/LLIntSlowPaths.cpp:
+        (JSC::LLInt::LLINT_SLOW_PATH_DECL):
+        * llint/LLIntSlowPaths.h:
+        * llint/LowLevelInterpreter.asm:
+        * llint/LowLevelInterpreter32_64.asm:
+        * llint/LowLevelInterpreter64.asm:
+        * runtime/VM.h:
+
 2013-12-06  Laszlo Vidacs  <[email protected]>
 
         Define SHA1 hash size in SHA1.h and use it at various places.

Modified: branches/jsCStack/Source/_javascript_Core/interpreter/Interpreter.cpp (160252 => 160253)


--- branches/jsCStack/Source/_javascript_Core/interpreter/Interpreter.cpp	2013-12-06 22:54:02 UTC (rev 160252)
+++ branches/jsCStack/Source/_javascript_Core/interpreter/Interpreter.cpp	2013-12-06 22:54:41 UTC (rev 160253)
@@ -152,7 +152,7 @@
     return interpreter->execute(eval, callFrame, thisValue, callerScopeChain);
 }
 
-CallFrame* loadVarargs(CallFrame* callFrame, JSStack* stack, JSValue thisValue, JSValue arguments, int firstFreeRegister)
+CallFrame* sizeAndAllocFrameForVarargs(CallFrame* callFrame, JSStack* stack, JSValue arguments, int firstFreeRegister)
 {
     if (!arguments) { // f.apply(x, arguments), with arguments unmodified.
         unsigned argumentCountIncludingThis = callFrame->argumentCountIncludingThis();
@@ -161,11 +161,6 @@
             callFrame->vm().throwException(callFrame, createStackOverflowError(callFrame));
             return 0;
         }
-
-        newCallFrame->setArgumentCountIncludingThis(argumentCountIncludingThis);
-        newCallFrame->setThisValue(thisValue);
-        for (size_t i = 0; i < callFrame->argumentCount(); ++i)
-            newCallFrame->setArgument(i, callFrame->argumentAfterCapture(i));
         return newCallFrame;
     }
 
@@ -175,8 +170,6 @@
             callFrame->vm().throwException(callFrame, createStackOverflowError(callFrame));
             return 0;
         }
-        newCallFrame->setArgumentCountIncludingThis(1);
-        newCallFrame->setThisValue(thisValue);
         return newCallFrame;
     }
 
@@ -193,9 +186,6 @@
             callFrame->vm().throwException(callFrame, createStackOverflowError(callFrame));
             return 0;
         }
-        newCallFrame->setArgumentCountIncludingThis(argCount + 1);
-        newCallFrame->setThisValue(thisValue);
-        argsObject->copyToArguments(callFrame, newCallFrame, argCount);
         return newCallFrame;
     }
 
@@ -207,9 +197,6 @@
             callFrame->vm().throwException(callFrame, createStackOverflowError(callFrame));
             return 0;
         }
-        newCallFrame->setArgumentCountIncludingThis(argCount + 1);
-        newCallFrame->setThisValue(thisValue);
-        array->copyToArguments(callFrame, newCallFrame, argCount);
         return newCallFrame;
     }
 
@@ -220,14 +207,54 @@
         callFrame->vm().throwException(callFrame,  createStackOverflowError(callFrame));
         return 0;
     }
+    return newCallFrame;
+}
+
+void loadVarargs(CallFrame* callFrame, CallFrame* newCallFrame, JSValue thisValue, JSValue arguments)
+{
+    if (!arguments) { // f.apply(x, arguments), with arguments unmodified.
+        unsigned argumentCountIncludingThis = callFrame->argumentCountIncludingThis();
+
+        newCallFrame->setArgumentCountIncludingThis(argumentCountIncludingThis);
+        newCallFrame->setThisValue(thisValue);
+        for (size_t i = 0; i < callFrame->argumentCount(); ++i)
+            newCallFrame->setArgument(i, callFrame->argumentAfterCapture(i));
+        return;
+    }
+    
+    if (arguments.isUndefinedOrNull()) {
+        newCallFrame->setArgumentCountIncludingThis(1);
+        newCallFrame->setThisValue(thisValue);
+        return;
+    }
+    
+    if (asObject(arguments)->classInfo() == Arguments::info()) {
+        Arguments* argsObject = asArguments(arguments);
+        unsigned argCount = argsObject->length(callFrame);
+        newCallFrame->setArgumentCountIncludingThis(argCount + 1);
+        newCallFrame->setThisValue(thisValue);
+        argsObject->copyToArguments(callFrame, newCallFrame, argCount);
+        return;
+    }
+    
+    if (isJSArray(arguments)) {
+        JSArray* array = asArray(arguments);
+        unsigned argCount = array->length();
+        newCallFrame->setArgumentCountIncludingThis(argCount + 1);
+        newCallFrame->setThisValue(thisValue);
+        array->copyToArguments(callFrame, newCallFrame, argCount);
+        return;
+    }
+    
+    JSObject* argObject = asObject(arguments);
+    unsigned argCount = argObject->get(callFrame, callFrame->propertyNames().length).toUInt32(callFrame);
     newCallFrame->setArgumentCountIncludingThis(argCount + 1);
     newCallFrame->setThisValue(thisValue);
     for (size_t i = 0; i < argCount; ++i) {
         newCallFrame->setArgument(i, asObject(arguments)->get(callFrame, i));
         if (UNLIKELY(callFrame->vm().exception()))
-            return 0;
+            return;
     }
-    return newCallFrame;
 }
 
 Interpreter::Interpreter(VM& vm)

Modified: branches/jsCStack/Source/_javascript_Core/interpreter/Interpreter.h (160252 => 160253)


--- branches/jsCStack/Source/_javascript_Core/interpreter/Interpreter.h	2013-12-06 22:54:02 UTC (rev 160252)
+++ branches/jsCStack/Source/_javascript_Core/interpreter/Interpreter.h	2013-12-06 22:54:41 UTC (rev 160253)
@@ -286,8 +286,8 @@
     };
 
     JSValue eval(CallFrame*);
-    CallFrame* loadVarargs(CallFrame*, JSStack*, JSValue thisValue, JSValue arguments, int firstFreeRegister);
-
+    CallFrame* sizeAndAllocFrameForVarargs(CallFrame*, JSStack*, JSValue, int);
+    void loadVarargs(CallFrame*, CallFrame*, JSValue, JSValue);
 } // namespace JSC
 
 #endif // Interpreter_h

Modified: branches/jsCStack/Source/_javascript_Core/jit/JIT.h (160252 => 160253)


--- branches/jsCStack/Source/_javascript_Core/jit/JIT.h	2013-12-06 22:54:02 UTC (rev 160252)
+++ branches/jsCStack/Source/_javascript_Core/jit/JIT.h	2013-12-06 22:54:41 UTC (rev 160253)
@@ -670,7 +670,7 @@
         MacroAssembler::Call callOperation(C_JITOperation_EO, GPRReg);
         MacroAssembler::Call callOperation(C_JITOperation_ESt, Structure*);
         MacroAssembler::Call callOperation(C_JITOperation_EZ, int32_t);
-        MacroAssembler::Call callOperation(F_JITOperation_EJJZ, GPRReg, GPRReg, int32_t);
+        MacroAssembler::Call callOperation(F_JITOperation_EJZ, GPRReg, int32_t);
         MacroAssembler::Call callOperation(J_JITOperation_E, int);
         MacroAssembler::Call callOperation(J_JITOperation_EAapJ, int, ArrayAllocationProfile*, GPRReg);
         MacroAssembler::Call callOperation(J_JITOperation_EAapJcpZ, int, ArrayAllocationProfile*, GPRReg, int32_t);
@@ -711,6 +711,7 @@
 #endif
         MacroAssembler::Call callOperation(V_JITOperation_EJIdJJ, RegisterID, const Identifier*, RegisterID, RegisterID);
 #if USE(JSVALUE64)
+        MacroAssembler::Call callOperation(F_JITOperation_EFJJ, RegisterID, RegisterID, RegisterID);
         MacroAssembler::Call callOperation(V_JITOperation_ESsiJJI, StructureStubInfo*, RegisterID, RegisterID, StringImpl*);
 #else
         MacroAssembler::Call callOperation(V_JITOperation_ESsiJJI, StructureStubInfo*, RegisterID, RegisterID, RegisterID, RegisterID, StringImpl*);
@@ -724,7 +725,8 @@
         MacroAssembler::Call callOperationWithCallFrameRollbackOnException(V_JITOperation_ECb, CodeBlock*);
         MacroAssembler::Call callOperationWithCallFrameRollbackOnException(Z_JITOperation_E);
 #if USE(JSVALUE32_64)
-        MacroAssembler::Call callOperation(F_JITOperation_EJJZ, GPRReg, GPRReg, GPRReg, GPRReg, int32_t);
+        MacroAssembler::Call callOperation(F_JITOperation_EFJJ, RegisterID, RegisterID, RegisterID, RegisterID, RegisterID);
+        MacroAssembler::Call callOperation(F_JITOperation_EJZ, GPRReg, GPRReg, int32_t);
         MacroAssembler::Call callOperation(J_JITOperation_EAapJ, int, ArrayAllocationProfile*, GPRReg, GPRReg);
         MacroAssembler::Call callOperation(J_JITOperation_EJ, int, GPRReg, GPRReg);
         MacroAssembler::Call callOperation(J_JITOperation_EJIdc, int, GPRReg, GPRReg, const Identifier*);

Modified: branches/jsCStack/Source/_javascript_Core/jit/JITCall.cpp (160252 => 160253)


--- branches/jsCStack/Source/_javascript_Core/jit/JITCall.cpp	2013-12-06 22:54:02 UTC (rev 160252)
+++ branches/jsCStack/Source/_javascript_Core/jit/JITCall.cpp	2013-12-06 22:54:41 UTC (rev 160253)
@@ -104,9 +104,11 @@
     if (canOptimize)
         slowCase.link(this);
 
-    emitGetVirtualRegister(thisValue, regT0);
     emitGetVirtualRegister(arguments, regT1);
-    callOperation(operationLoadVarargs, regT0, regT1, firstFreeRegister);
+    callOperation(operationSizeAndAllocFrameForVarargs, regT1, firstFreeRegister);
+    emitGetVirtualRegister(thisValue, regT1);
+    emitGetVirtualRegister(arguments, regT2);
+    callOperation(operationLoadVarargs, returnValueGPR, regT1, regT2);
     move(returnValueGPR, regT1);
 
     if (canOptimize)

Modified: branches/jsCStack/Source/_javascript_Core/jit/JITCall32_64.cpp (160252 => 160253)


--- branches/jsCStack/Source/_javascript_Core/jit/JITCall32_64.cpp	2013-12-06 22:54:02 UTC (rev 160252)
+++ branches/jsCStack/Source/_javascript_Core/jit/JITCall32_64.cpp	2013-12-06 22:54:41 UTC (rev 160253)
@@ -184,9 +184,12 @@
     if (canOptimize)
         slowCase.link(this);
 
+    emitLoad(arguments, regT1, regT0);
+    callOperation(operationSizeAndAllocFrameForVarargs, regT1, regT0, firstFreeRegister);
+    move(returnValueGPR, regT5);
     emitLoad(thisValue, regT1, regT0);
     emitLoad(arguments, regT3, regT2);
-    callOperation(operationLoadVarargs, regT1, regT0, regT3, regT2, firstFreeRegister);
+    callOperation(operationLoadVarargs, regT5, regT1, regT0, regT3, regT2);
     move(returnValueGPR, regT3);
 
     if (canOptimize)

Modified: branches/jsCStack/Source/_javascript_Core/jit/JITInlines.h (160252 => 160253)


--- branches/jsCStack/Source/_javascript_Core/jit/JITInlines.h	2013-12-06 22:54:02 UTC (rev 160252)
+++ branches/jsCStack/Source/_javascript_Core/jit/JITInlines.h	2013-12-06 22:54:41 UTC (rev 160253)
@@ -285,12 +285,18 @@
 
 
 #if USE(JSVALUE64)
-ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(F_JITOperation_EJJZ operation, GPRReg arg1, GPRReg arg2, int32_t arg3)
+ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(F_JITOperation_EJZ operation, GPRReg arg1, int32_t arg3)
 {
-    setupArgumentsWithExecState(arg1, arg2, TrustedImm32(arg3));
+    setupArgumentsWithExecState(arg1, TrustedImm32(arg3));
     return appendCallWithExceptionCheck(operation);
 }
 
+ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(F_JITOperation_EFJJ operation, GPRReg arg1, GPRReg arg2, GPRReg arg3)
+{
+    setupArgumentsWithExecState(arg1, arg2, arg3);
+    return appendCallWithExceptionCheck(operation);
+}
+
 ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(V_JITOperation_ESsiJJI operation, StructureStubInfo* stubInfo, RegisterID regOp1, RegisterID regOp2, StringImpl* uid)
 {
     setupArgumentsWithExecState(TrustedImmPtr(stubInfo), regOp1, regOp2, TrustedImmPtr(uid));
@@ -420,17 +426,23 @@
     return appendCall(operation);
 }
 
-ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(F_JITOperation_EJJZ operation, GPRReg arg1Tag, GPRReg arg1Payload, GPRReg arg2Tag, GPRReg arg2Payload, int32_t arg3)
+ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(F_JITOperation_EJZ operation, GPRReg arg1Tag, GPRReg arg1Payload, int32_t arg2)
 {
 #if CPU(SH4)
     // We have to put arg3 in the 4th argument register (r7) as 64-bit value arg2 will be put on stack for sh4 architecure.
-    setupArgumentsWithExecState(arg1Payload, arg1Tag, TrustedImm32(arg3), arg2Payload, arg2Tag);
+    setupArgumentsWithExecState(arg1Payload, arg1Tag, TrustedImm32(arg2));
 #else
-    setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1Payload, arg1Tag, arg2Payload, arg2Tag, TrustedImm32(arg3));
+    setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1Payload, arg1Tag, TrustedImm32(arg2));
 #endif
     return appendCallWithExceptionCheck(operation);
 }
 
+ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(F_JITOperation_EFJJ operation, GPRReg arg1, GPRReg arg2Tag, GPRReg arg2Payload, GPRReg arg3Tag, GPRReg arg3Payload)
+{
+    setupArgumentsWithExecState(arg1, arg2Payload, arg2Tag, arg3Payload, arg3Tag);
+    return appendCallWithExceptionCheck(operation);
+}
+    
 ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(J_JITOperation_EAapJ operation, int dst, ArrayAllocationProfile* arg1, GPRReg arg2Tag, GPRReg arg2Payload)
 {
     setupArgumentsWithExecState(TrustedImmPtr(arg1), arg2Payload, arg2Tag);

Modified: branches/jsCStack/Source/_javascript_Core/jit/JITOperations.cpp (160252 => 160253)


--- branches/jsCStack/Source/_javascript_Core/jit/JITOperations.cpp	2013-12-06 22:54:02 UTC (rev 160252)
+++ branches/jsCStack/Source/_javascript_Core/jit/JITOperations.cpp	2013-12-06 22:54:41 UTC (rev 160253)
@@ -1526,14 +1526,23 @@
     return JSValue::encode(jsBoolean(result));
 }
 
-CallFrame* JIT_OPERATION operationLoadVarargs(ExecState* exec, EncodedJSValue encodedThis, EncodedJSValue encodedArguments, int32_t firstFreeRegister)
+CallFrame* JIT_OPERATION operationSizeAndAllocFrameForVarargs(ExecState* exec, EncodedJSValue encodedArguments, int32_t firstFreeRegister)
 {
     VM& vm = exec->vm();
     NativeCallFrameTracer tracer(&vm, exec);
     JSStack* stack = &exec->interpreter()->stack();
+    JSValue arguments = JSValue::decode(encodedArguments);
+    CallFrame* newCallFrame = sizeAndAllocFrameForVarargs(exec, stack, arguments, firstFreeRegister);
+    return newCallFrame;
+}
+
+CallFrame* JIT_OPERATION operationLoadVarargs(ExecState* exec, CallFrame* newCallFrame, EncodedJSValue encodedThis, EncodedJSValue encodedArguments)
+{
+    VM& vm = exec->vm();
+    NativeCallFrameTracer tracer(&vm, exec);
     JSValue thisValue = JSValue::decode(encodedThis);
     JSValue arguments = JSValue::decode(encodedArguments);
-    CallFrame* newCallFrame = loadVarargs(exec, stack, thisValue, arguments, firstFreeRegister);
+    loadVarargs(exec, newCallFrame, thisValue, arguments);
     return newCallFrame;
 }
 

Modified: branches/jsCStack/Source/_javascript_Core/jit/JITOperations.h (160252 => 160253)


--- branches/jsCStack/Source/_javascript_Core/jit/JITOperations.h	2013-12-06 22:54:02 UTC (rev 160252)
+++ branches/jsCStack/Source/_javascript_Core/jit/JITOperations.h	2013-12-06 22:54:41 UTC (rev 160253)
@@ -79,7 +79,9 @@
     Vws: VariableWatchpointSet*
     Z: int32_t
 */
-typedef CallFrame* JIT_OPERATION (*F_JITOperation_EJJZ)(ExecState*, EncodedJSValue, EncodedJSValue, int32_t);
+
+typedef CallFrame* JIT_OPERATION (*F_JITOperation_EFJJ)(ExecState*, CallFrame*, EncodedJSValue, EncodedJSValue);
+typedef CallFrame* JIT_OPERATION (*F_JITOperation_EJZ)(ExecState*, EncodedJSValue, int32_t);
 typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_E)(ExecState*);
 typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_EA)(ExecState*, JSArray*);
 typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_EAZ)(ExecState*, JSArray*, int32_t);
@@ -264,7 +266,8 @@
 EncodedJSValue JIT_OPERATION operationDeleteById(ExecState*, EncodedJSValue base, const Identifier*) WTF_INTERNAL;
 JSCell* JIT_OPERATION operationGetPNames(ExecState*, JSObject*) WTF_INTERNAL;
 EncodedJSValue JIT_OPERATION operationInstanceOf(ExecState*, EncodedJSValue, EncodedJSValue proto) WTF_INTERNAL;
-CallFrame* JIT_OPERATION operationLoadVarargs(ExecState*, EncodedJSValue thisValue, EncodedJSValue arguments, int32_t firstFreeRegister) WTF_INTERNAL;
+CallFrame* JIT_OPERATION operationSizeAndAllocFrameForVarargs(ExecState*, EncodedJSValue arguments, int32_t firstFreeRegister) WTF_INTERNAL;
+CallFrame* JIT_OPERATION operationLoadVarargs(ExecState*, CallFrame*, EncodedJSValue thisValue, EncodedJSValue arguments) WTF_INTERNAL;
 EncodedJSValue JIT_OPERATION operationToObject(ExecState*, EncodedJSValue) WTF_INTERNAL;
 
 char* JIT_OPERATION operationSwitchCharWithUnknownKeyType(ExecState*, EncodedJSValue key, size_t tableIndex) WTF_INTERNAL;

Modified: branches/jsCStack/Source/_javascript_Core/llint/LLIntSlowPaths.cpp (160252 => 160253)


--- branches/jsCStack/Source/_javascript_Core/llint/LLIntSlowPaths.cpp	2013-12-06 22:54:02 UTC (rev 160252)
+++ branches/jsCStack/Source/_javascript_Core/llint/LLIntSlowPaths.cpp	2013-12-06 22:54:41 UTC (rev 160253)
@@ -1105,19 +1105,33 @@
     return genericCall(exec, pc, CodeForConstruct);
 }
 
-LLINT_SLOW_PATH_DECL(slow_path_call_varargs)
+LLINT_SLOW_PATH_DECL(slow_path_size_and_alloc_frame_for_varargs)
 {
     LLINT_BEGIN();
     // This needs to:
     // - Set up a call frame while respecting the variable arguments.
+    
+    ExecState* execCallee = sizeAndAllocFrameForVarargs(exec, &vm.interpreter->stack(),
+        LLINT_OP_C(4).jsValue(), pc[5].u.operand);
+    LLINT_CALL_CHECK_EXCEPTION(exec);
+    
+    vm.newCallFrameReturnValue = execCallee;
+
+    LLINT_END();
+}
+
+LLINT_SLOW_PATH_DECL(slow_path_call_varargs)
+{
+    LLINT_BEGIN_NO_SET_PC();
+    // This needs to:
     // - Figure out what to call and compile it if necessary.
     // - Return a tuple of machine code address to call and the new call frame.
     
     JSValue calleeAsValue = LLINT_OP_C(2).jsValue();
     
-    ExecState* execCallee = loadVarargs(
-        exec, &vm.interpreter->stack(),
-        LLINT_OP_C(3).jsValue(), LLINT_OP_C(4).jsValue(), pc[5].u.operand);
+    ExecState* execCallee = vm.newCallFrameReturnValue;
+
+    loadVarargs(exec, execCallee, LLINT_OP_C(3).jsValue(), LLINT_OP_C(4).jsValue());
     LLINT_CALL_CHECK_EXCEPTION(exec);
     
     execCallee->uncheckedR(JSStack::Callee) = calleeAsValue;

Modified: branches/jsCStack/Source/_javascript_Core/llint/LLIntSlowPaths.h (160252 => 160253)


--- branches/jsCStack/Source/_javascript_Core/llint/LLIntSlowPaths.h	2013-12-06 22:54:02 UTC (rev 160252)
+++ branches/jsCStack/Source/_javascript_Core/llint/LLIntSlowPaths.h	2013-12-06 22:54:41 UTC (rev 160253)
@@ -100,6 +100,7 @@
 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_new_func_exp);
 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_call);
 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_construct);
+LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_size_and_alloc_frame_for_varargs);
 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_call_varargs);
 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_call_eval);
 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_tear_off_activation);

Modified: branches/jsCStack/Source/_javascript_Core/llint/LowLevelInterpreter.asm (160252 => 160253)


--- branches/jsCStack/Source/_javascript_Core/llint/LowLevelInterpreter.asm	2013-12-06 22:54:02 UTC (rev 160252)
+++ branches/jsCStack/Source/_javascript_Core/llint/LowLevelInterpreter.asm	2013-12-06 22:54:41 UTC (rev 160253)
@@ -723,6 +723,8 @@
 
 _llint_op_call_varargs:
     traceExecution()
+    callSlowPath(_llint_slow_path_size_and_alloc_frame_for_varargs)
+    branchIfException(_llint_throw_from_slow_path_trampoline)
     slowPathForCall(_llint_slow_path_call_varargs)
 
 

Modified: branches/jsCStack/Source/_javascript_Core/llint/LowLevelInterpreter32_64.asm (160252 => 160253)


--- branches/jsCStack/Source/_javascript_Core/llint/LowLevelInterpreter32_64.asm	2013-12-06 22:54:02 UTC (rev 160252)
+++ branches/jsCStack/Source/_javascript_Core/llint/LowLevelInterpreter32_64.asm	2013-12-06 22:54:41 UTC (rev 160253)
@@ -551,6 +551,14 @@
 end
 
 
+macro branchIfException(label)
+    loadp ScopeChain[cfr], t3
+    andp MarkedBlockMask, t3
+    loadp MarkedBlock::m_weakSet + WeakSet::m_vm[t3], t3
+    bineq VM::m_exception + TagOffset[t3], EmptyValueTag, label
+end
+
+
 # Instruction implementations
 
 _llint_op_enter:

Modified: branches/jsCStack/Source/_javascript_Core/llint/LowLevelInterpreter64.asm (160252 => 160253)


--- branches/jsCStack/Source/_javascript_Core/llint/LowLevelInterpreter64.asm	2013-12-06 22:54:02 UTC (rev 160252)
+++ branches/jsCStack/Source/_javascript_Core/llint/LowLevelInterpreter64.asm	2013-12-06 22:54:41 UTC (rev 160253)
@@ -389,6 +389,14 @@
 end
 
 
+macro branchIfException(label)
+    loadp ScopeChain[cfr], t3
+    andp MarkedBlockMask, t3
+    loadp MarkedBlock::m_weakSet + WeakSet::m_vm[t3], t3
+    btqnz VM::m_exception[t3], label
+end
+
+
 # Instruction implementations
 
 _llint_op_enter:

Modified: branches/jsCStack/Source/_javascript_Core/runtime/VM.h (160252 => 160253)


--- branches/jsCStack/Source/_javascript_Core/runtime/VM.h	2013-12-06 22:54:02 UTC (rev 160252)
+++ branches/jsCStack/Source/_javascript_Core/runtime/VM.h	2013-12-06 22:54:41 UTC (rev 160253)
@@ -383,6 +383,7 @@
 
         ReturnAddressPtr exceptionLocation;
         JSValue hostCallReturnValue;
+        ExecState* newCallFrameReturnValue;
         ExecState* callFrameForThrow;
         void* targetMachinePCForThrow;
         Instruction* targetInterpreterPCForThrow;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to