Title: [157581] trunk/Source/_javascript_Core
Revision
157581
Author
msab...@apple.com
Date
2013-10-17 11:12:28 -0700 (Thu, 17 Oct 2013)

Log Message

Transition cti_op_throw and cti_vm_throw to a JIT operation
https://bugs.webkit.org/show_bug.cgi?id=122931

Reviewed by Filip Pizlo.

Moved cti_op_throw to operationThrow.  Made the caller responsible for jumping to the
catch handler.  Eliminated cti_op_throw_static_error, cti_vm_throw, ctiVMThrowTrampoline()
and their callers as it is now dead code.  There is some work needed on the Microsoft X86
callOperation to handle the need to provide space for structure return value.

* jit/JIT.h:
* jit/JITInlines.h:
(JSC::JIT::callOperation):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_throw):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_throw):
(JSC::JIT::emit_op_catch):
* jit/JITOperations.cpp:
* jit/JITOperations.h:
* jit/JITStubs.cpp:
* jit/JITStubs.h:
* jit/JITStubsARM.h:
* jit/JITStubsARM64.h:
* jit/JITStubsARMv7.h:
* jit/JITStubsMIPS.h:
* jit/JITStubsMSVC64.asm:
* jit/JITStubsSH4.h:
* jit/JITStubsX86.h:
* jit/JITStubsX86_64.h:
* jit/JSInterfaceJIT.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (157580 => 157581)


--- trunk/Source/_javascript_Core/ChangeLog	2013-10-17 18:00:07 UTC (rev 157580)
+++ trunk/Source/_javascript_Core/ChangeLog	2013-10-17 18:12:28 UTC (rev 157581)
@@ -1,3 +1,37 @@
+2013-10-17  Michael Saboff  <msab...@apple.com>
+
+        Transition cti_op_throw and cti_vm_throw to a JIT operation
+        https://bugs.webkit.org/show_bug.cgi?id=122931
+
+        Reviewed by Filip Pizlo.
+
+        Moved cti_op_throw to operationThrow.  Made the caller responsible for jumping to the
+        catch handler.  Eliminated cti_op_throw_static_error, cti_vm_throw, ctiVMThrowTrampoline()
+        and their callers as it is now dead code.  There is some work needed on the Microsoft X86
+        callOperation to handle the need to provide space for structure return value.
+
+        * jit/JIT.h:
+        * jit/JITInlines.h:
+        (JSC::JIT::callOperation):
+        * jit/JITOpcodes.cpp:
+        (JSC::JIT::emit_op_throw):
+        * jit/JITOpcodes32_64.cpp:
+        (JSC::JIT::emit_op_throw):
+        (JSC::JIT::emit_op_catch):
+        * jit/JITOperations.cpp:
+        * jit/JITOperations.h:
+        * jit/JITStubs.cpp:
+        * jit/JITStubs.h:
+        * jit/JITStubsARM.h:
+        * jit/JITStubsARM64.h:
+        * jit/JITStubsARMv7.h:
+        * jit/JITStubsMIPS.h:
+        * jit/JITStubsMSVC64.asm:
+        * jit/JITStubsSH4.h:
+        * jit/JITStubsX86.h:
+        * jit/JITStubsX86_64.h:
+        * jit/JSInterfaceJIT.h:
+
 2013-10-17  Mark Lam  <mark....@apple.com>
 
         Remove JITStackFrame references in the C Loop LLINT.

Modified: trunk/Source/_javascript_Core/jit/JIT.h (157580 => 157581)


--- trunk/Source/_javascript_Core/jit/JIT.h	2013-10-17 18:00:07 UTC (rev 157580)
+++ trunk/Source/_javascript_Core/jit/JIT.h	2013-10-17 18:12:28 UTC (rev 157581)
@@ -795,6 +795,11 @@
         MacroAssembler::Call callOperation(J_JITOperation_EP, int, void*);
         MacroAssembler::Call callOperation(WithProfileTag, J_JITOperation_EPc, int, Instruction*);
         MacroAssembler::Call callOperation(J_JITOperation_EZ, int, int32_t);
+#if USE(JSVALUE64)
+        MacroAssembler::Call callOperation(Jhe_JITOperation_EJ, RegisterID);
+#else
+        MacroAssembler::Call callOperation(Jhe_JITOperation_EJ, RegisterID, RegisterID);
+#endif
         MacroAssembler::Call callOperation(P_JITOperation_EJS, GPRReg, size_t);
         MacroAssembler::Call callOperation(P_JITOperation_EZ, int32_t);
         MacroAssembler::Call callOperation(S_JITOperation_ECC, RegisterID, RegisterID);

Modified: trunk/Source/_javascript_Core/jit/JITInlines.h (157580 => 157581)


--- trunk/Source/_javascript_Core/jit/JITInlines.h	2013-10-17 18:00:07 UTC (rev 157580)
+++ trunk/Source/_javascript_Core/jit/JITInlines.h	2013-10-17 18:12:28 UTC (rev 157581)
@@ -291,6 +291,34 @@
     return appendCallWithExceptionCheckSetJSValueResult(operation, dst);
 }
 
+#if USE(JSVALUE64)
+ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(Jhe_JITOperation_EJ operation, GPRReg arg1)
+{
+#if COMPILER(MSVC) && CPU(X86)
+    // Need to make space on stack for return value, use that address as first arg (in register),
+    // move callFrameRegister to second argument register and push the passed arg1.
+    updateTopCallFrame();
+    MacroAssembler::Call call = appendCall(operation);
+    // These may not be pops:
+    // pop(regT0); // Restore arg1 slot
+    // pop(regT0); // Get handler's call frame
+    // pop(regT1); // Get handler's address
+    return call;
+#else
+    setupArgumentsWithExecState(arg1);
+    updateTopCallFrame();
+    return appendCall(operation);
+#endif
+}
+#else
+ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(Jhe_JITOperation_EJ operation, GPRReg arg1Tag, GPRReg arg1Payload)
+{
+    setupArgumentsWithExecState(arg1Payload, arg1Tag);
+    updateTopCallFrame();
+    return appendCall(operation);
+}
+#endif
+
 ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(P_JITOperation_EZ operation, int32_t op)
 {
     setupArgumentsWithExecState(TrustedImm32(op));

Modified: trunk/Source/_javascript_Core/jit/JITOpcodes.cpp (157580 => 157581)


--- trunk/Source/_javascript_Core/jit/JITOpcodes.cpp	2013-10-17 18:00:07 UTC (rev 157580)
+++ trunk/Source/_javascript_Core/jit/JITOpcodes.cpp	2013-10-17 18:12:28 UTC (rev 157581)
@@ -483,15 +483,12 @@
 
 void JIT::emit_op_throw(Instruction* currentInstruction)
 {
-    JITStubCall stubCall(this, cti_op_throw);
-    stubCall.addArgument(currentInstruction[1].u.operand, regT2);
-    stubCall.call();
     ASSERT(regT0 == returnValueRegister);
-#ifndef NDEBUG
-    // cti_op_throw always changes it's return address,
-    // this point in the code should never be reached.
-    breakpoint();
-#endif
+    emitGetVirtualRegister(currentInstruction[1].u.operand, regT0);
+    callOperation(operationThrow, regT0);
+    // After operationThrow returns, returnValueRegister (regT0) has the handler's callFrame and
+    // returnValue2Register has the handler's entry address.
+    jump(returnValue2Register);
 }
 
 void JIT::emit_op_get_pnames(Instruction* currentInstruction)

Modified: trunk/Source/_javascript_Core/jit/JITOpcodes32_64.cpp (157580 => 157581)


--- trunk/Source/_javascript_Core/jit/JITOpcodes32_64.cpp	2013-10-17 18:00:07 UTC (rev 157580)
+++ trunk/Source/_javascript_Core/jit/JITOpcodes32_64.cpp	2013-10-17 18:12:28 UTC (rev 157581)
@@ -812,16 +812,12 @@
 
 void JIT::emit_op_throw(Instruction* currentInstruction)
 {
-    unsigned exception = currentInstruction[1].u.operand;
-    JITStubCall stubCall(this, cti_op_throw);
-    stubCall.addArgument(exception);
-    stubCall.call();
-
-#ifndef NDEBUG
-    // cti_op_throw always changes it's return address,
-    // this point in the code should never be reached.
-    breakpoint();
-#endif
+    ASSERT(regT0 == returnValueRegister);
+    emitLoad(currentInstruction[1].u.operand, regT1, regT0);
+    callOperation(operationThrow, regT1, regT0);
+    // After operationThrow returns, returnValueRegister (regT0) has the handler's callFrame and
+    // returnValue2Register has the handler's entry address.
+    jump(returnValue2Register);
 }
 
 void JIT::emit_op_get_pnames(Instruction* currentInstruction)
@@ -971,10 +967,10 @@
 
 void JIT::emit_op_catch(Instruction* currentInstruction)
 {
-    // cti_op_throw returns the callFrame for the handler.
+    // operationThrow returns the callFrame for the handler.
     move(regT0, callFrameRegister);
 
-    // Now store the exception returned by cti_op_throw.
+    // Now store the exception returned by operationThrow.
     loadPtr(Address(stackPointerRegister, OBJECT_OFFSETOF(struct JITStackFrame, vm)), regT3);
     load32(Address(regT3, VM::exceptionOffset() + OBJECT_OFFSETOF(JSValue, u.asBits.payload)), regT0);
     load32(Address(regT3, VM::exceptionOffset() + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), regT1);

Modified: trunk/Source/_javascript_Core/jit/JITOperations.cpp (157580 => 157581)


--- trunk/Source/_javascript_Core/jit/JITOperations.cpp	2013-10-17 18:00:07 UTC (rev 157580)
+++ trunk/Source/_javascript_Core/jit/JITOperations.cpp	2013-10-17 18:12:28 UTC (rev 157581)
@@ -1615,6 +1615,17 @@
     }
 }
 
+JITHandlerEncoded JIT_OPERATION operationThrow(ExecState* exec, EncodedJSValue encodedExceptionValue)
+{
+    VM* vm = &exec->vm();
+    NativeCallFrameTracer tracer(vm, exec);
+
+    JSValue exceptionValue = JSValue::decode(encodedExceptionValue);
+    vm->throwException(exec, exceptionValue);
+    ExceptionHandler handler = genericUnwind(vm, exec, exceptionValue);
+    return dfgHandlerEncoded(handler.callFrame, handler.catchRoutine);
+}
+
 JITHandlerEncoded JIT_OPERATION lookupExceptionHandler(ExecState* exec)
 {
     VM* vm = &exec->vm();

Modified: trunk/Source/_javascript_Core/jit/JITOperations.h (157580 => 157581)


--- trunk/Source/_javascript_Core/jit/JITOperations.h	2013-10-17 18:00:07 UTC (rev 157580)
+++ trunk/Source/_javascript_Core/jit/JITOperations.h	2013-10-17 18:12:28 UTC (rev 157581)
@@ -27,6 +27,7 @@
 #define JITOperations_h
 
 #include "CallFrame.h"
+#include "JITExceptions.h"
 #include "JSArray.h"
 #include "JSCJSValue.h"
 #include "MacroAssembler.h"
@@ -44,6 +45,47 @@
 #define JIT_OPERATION
 #endif
 
+extern "C" {
+
+// This method is used to lookup an exception hander, keyed by faultLocation, which is
+// the return location from one of the calls out to one of the helper operations above.
+
+// According to C++ rules, a type used for the return signature of function with C linkage (i.e.
+// 'extern "C"') needs to be POD; hence putting any constructors into it could cause either compiler
+// warnings, or worse, a change in the ABI used to return these types.
+struct JITHandler {
+    union Union {
+        struct Struct {
+            ExecState* exec;
+            void* handler;
+        } s;
+        uint64_t encoded;
+    } u;
+};
+
+inline JITHandler createJITHandler(ExecState* exec, void* handler)
+{
+    JITHandler result;
+    result.u.s.exec = exec;
+    result.u.s.handler = handler;
+    return result;
+}
+
+#if CPU(X86_64)
+typedef JITHandler JITHandlerEncoded;
+inline JITHandlerEncoded dfgHandlerEncoded(ExecState* exec, void* handler)
+{
+    return createJITHandler(exec, handler);
+}
+#else
+typedef uint64_t JITHandlerEncoded;
+inline JITHandlerEncoded dfgHandlerEncoded(ExecState* exec, void* handler)
+{
+    COMPILE_ASSERT(sizeof(JITHandler::Union) == sizeof(uint64_t), JITHandler_Union_is_64bit);
+    return createJITHandler(exec, handler).u.encoded;
+}
+#endif
+
 // These typedefs provide typechecking when generating calls out to helper routines;
 // this helps prevent calling a helper routine with the wrong arguments!
 /*
@@ -60,6 +102,7 @@
     Idc: const Identifier*
     J: EncodedJSValue
     Jcp: const JSValue*
+    Jhe: JITHandlerEncoded
     Jsa: JSActivation*
     Jss: JSString*
     O: JSObject*
@@ -99,6 +142,7 @@
 typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_EZ)(ExecState*, int32_t);
 typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_EZIcfZ)(ExecState*, int32_t, InlineCallFrame*, int32_t);
 typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_EZZ)(ExecState*, int32_t, int32_t);
+typedef JITHandlerEncoded JIT_OPERATION (*Jhe_JITOperation_EJ)(ExecState*, EncodedJSValue);
 typedef JSCell* JIT_OPERATION (*C_JITOperation_E)(ExecState*);
 typedef JSCell* JIT_OPERATION (*C_JITOperation_EZ)(ExecState*, int32_t);
 typedef JSCell* JIT_OPERATION (*C_JITOperation_EC)(ExecState*, JSCell*);
@@ -166,46 +210,6 @@
 typedef StringImpl* JIT_OPERATION (*I_JITOperation_EJss)(ExecState*, JSString*);
 typedef JSString* JIT_OPERATION (*Jss_JITOperation_EZ)(ExecState*, int32_t);
 
-extern "C" {
-
-// This method is used to lookup an exception hander, keyed by faultLocation, which is
-// the return location from one of the calls out to one of the helper operations above.
-
-// According to C++ rules, a type used for the return signature of function with C linkage (i.e.
-// 'extern "C"') needs to be POD; hence putting any constructors into it could cause either compiler
-// warnings, or worse, a change in the ABI used to return these types.
-struct JITHandler {
-    union Union {
-        struct Struct {
-            ExecState* exec;
-            void* handler;
-        } s;
-        uint64_t encoded;
-    } u;
-};
-
-inline JITHandler createJITHandler(ExecState* exec, void* handler)
-{
-    JITHandler result;
-    result.u.s.exec = exec;
-    result.u.s.handler = handler;
-    return result;
-}
-
-#if CPU(X86_64)
-typedef JITHandler JITHandlerEncoded;
-inline JITHandlerEncoded dfgHandlerEncoded(ExecState* exec, void* handler)
-{
-    return createJITHandler(exec, handler);
-}
-#else
-typedef uint64_t JITHandlerEncoded;
-inline JITHandlerEncoded dfgHandlerEncoded(ExecState* exec, void* handler)
-{
-    COMPILE_ASSERT(sizeof(JITHandler::Union) == sizeof(uint64_t), JITHandler_Union_is_64bit);
-    return createJITHandler(exec, handler).u.encoded;
-}
-#endif
 JITHandlerEncoded JIT_OPERATION lookupExceptionHandler(ExecState*) WTF_INTERNAL;
 
 void JIT_OPERATION operationStackCheck(ExecState*, CodeBlock*) WTF_INTERNAL;
@@ -260,6 +264,7 @@
 EncodedJSValue JIT_OPERATION operationNewRegexp(ExecState*, void*) WTF_INTERNAL;
 void JIT_OPERATION operationHandleWatchdogTimer(ExecState*) WTF_INTERNAL;
 void JIT_OPERATION operationThrowStaticError(ExecState*, EncodedJSValue, int32_t) WTF_INTERNAL;
+JITHandlerEncoded JIT_OPERATION operationThrow(ExecState*, EncodedJSValue) WTF_INTERNAL;
 void JIT_OPERATION operationDebug(ExecState*, int32_t) WTF_INTERNAL;
 #if ENABLE(DFG_JIT)
 char* JIT_OPERATION operationOptimize(ExecState*, int32_t) WTF_INTERNAL;

Modified: trunk/Source/_javascript_Core/jit/JITStubs.cpp (157580 => 157581)


--- trunk/Source/_javascript_Core/jit/JITStubs.cpp	2013-10-17 18:00:07 UTC (rev 157580)
+++ trunk/Source/_javascript_Core/jit/JITStubs.cpp	2013-10-17 18:12:28 UTC (rev 157581)
@@ -127,182 +127,6 @@
 #endif
 }
 
-#if !defined(NDEBUG)
-
-extern "C" {
-
-static void jscGeneratedNativeCode() 
-{
-    // When executing a JIT stub function (which might do an allocation), we hack the return address
-    // to pretend to be executing this function, to keep stack logging tools from blowing out
-    // memory.
-}
-
-}
-
-struct StackHack {
-    ALWAYS_INLINE StackHack(JITStackFrame& stackFrame) 
-        : stackFrame(stackFrame)
-        , savedReturnAddress(*stackFrame.returnAddressSlot())
-    {
-        if (!CodeProfiling::enabled())
-            *stackFrame.returnAddressSlot() = ReturnAddressPtr(FunctionPtr(jscGeneratedNativeCode));
-    }
-
-    ALWAYS_INLINE ~StackHack() 
-    { 
-        *stackFrame.returnAddressSlot() = savedReturnAddress;
-    }
-
-    JITStackFrame& stackFrame;
-    ReturnAddressPtr savedReturnAddress;
-};
-
-#define STUB_INIT_STACK_FRAME(stackFrame) JITStackFrame& stackFrame = *reinterpret_cast_ptr<JITStackFrame*>(STUB_ARGS); StackHack stackHack(stackFrame)
-#define STUB_SET_RETURN_ADDRESS(returnAddress) stackHack.savedReturnAddress = ReturnAddressPtr(returnAddress)
-#define STUB_RETURN_ADDRESS stackHack.savedReturnAddress
-
-#else
-
-#define STUB_INIT_STACK_FRAME(stackFrame) JITStackFrame& stackFrame = *reinterpret_cast_ptr<JITStackFrame*>(STUB_ARGS)
-#define STUB_SET_RETURN_ADDRESS(returnAddress) *stackFrame.returnAddressSlot() = ReturnAddressPtr(returnAddress)
-#define STUB_RETURN_ADDRESS *stackFrame.returnAddressSlot()
-
-#endif
-
-// The reason this is not inlined is to avoid having to do a PIC branch
-// to get the address of the ctiVMThrowTrampoline function. It's also
-// good to keep the code size down by leaving as much of the exception
-// handling code out of line as possible.
-static NEVER_INLINE void returnToThrowTrampoline(VM* vm, ReturnAddressPtr exceptionLocation, ReturnAddressPtr& returnAddressSlot)
-{
-    RELEASE_ASSERT(vm->exception());
-    vm->exceptionLocation = exceptionLocation;
-    returnAddressSlot = ReturnAddressPtr(FunctionPtr(ctiVMThrowTrampoline));
-}
-
-#define VM_THROW_EXCEPTION() \
-    do { \
-        VM_THROW_EXCEPTION_AT_END(); \
-        return 0; \
-    } while (0)
-#define VM_THROW_EXCEPTION_AT_END() \
-    do {\
-        returnToThrowTrampoline(stackFrame.vm, STUB_RETURN_ADDRESS, STUB_RETURN_ADDRESS);\
-    } while (0)
-
-#define CHECK_FOR_EXCEPTION() \
-    do { \
-        if (UNLIKELY(stackFrame.vm->exception())) \
-            VM_THROW_EXCEPTION(); \
-    } while (0)
-#define CHECK_FOR_EXCEPTION_AT_END() \
-    do { \
-        if (UNLIKELY(stackFrame.vm->exception())) \
-            VM_THROW_EXCEPTION_AT_END(); \
-    } while (0)
-#define CHECK_FOR_EXCEPTION_VOID() \
-    do { \
-        if (UNLIKELY(stackFrame.vm->exception())) { \
-            VM_THROW_EXCEPTION_AT_END(); \
-            return; \
-        } \
-    } while (0)
-
-class ErrorFunctor {
-public:
-    virtual ~ErrorFunctor() { }
-    virtual JSValue operator()(ExecState*) = 0;
-};
-
-class ErrorWithExecFunctor : public ErrorFunctor {
-public:
-    typedef JSObject* (*Factory)(ExecState* exec);
-    
-    ErrorWithExecFunctor(Factory factory)
-        : m_factory(factory)
-    {
-    }
-
-    virtual JSValue operator()(ExecState* exec) OVERRIDE
-    {
-        return m_factory(exec);
-    }
-
-private:
-    Factory m_factory;
-};
-
-class ErrorWithExecAndCalleeFunctor : public ErrorFunctor {
-public:
-    typedef JSObject* (*Factory)(ExecState* exec, JSValue callee);
-
-    ErrorWithExecAndCalleeFunctor(Factory factory, JSValue callee)
-        : m_factory(factory), m_callee(callee)
-    {
-    }
-
-    virtual JSValue operator()(ExecState* exec) OVERRIDE
-    {
-        return m_factory(exec, m_callee);
-    }
-private:
-    Factory m_factory;
-    JSValue m_callee;
-};
-
-// Helper function for JIT stubs that may throw an exception in the middle of
-// processing a function call. This function rolls back the stack to
-// our caller, so exception processing can proceed from a valid state.
-template<typename T> static T throwExceptionFromOpCall(JITStackFrame& jitStackFrame, CallFrame* newCallFrame, ReturnAddressPtr& returnAddressSlot, ErrorFunctor* createError = 0)
-{
-    CallFrame* callFrame = newCallFrame->callerFrame()->removeHostCallFrameFlag();
-    jitStackFrame.callFrame = callFrame;
-    ASSERT(callFrame);
-    callFrame->vm().topCallFrame = callFrame;
-    if (createError)
-        callFrame->vm().throwException(callFrame, (*createError)(callFrame));
-    ASSERT(callFrame->vm().exception());
-    returnToThrowTrampoline(&callFrame->vm(), ReturnAddressPtr(newCallFrame->returnPC()), returnAddressSlot);
-    return T();
-}
-
-// If the CPU specific header does not provide an implementation, use the default one here.
-#ifndef DEFINE_STUB_FUNCTION
-#define DEFINE_STUB_FUNCTION(rtype, op) rtype JIT_STUB cti_##op(STUB_ARGS_DECLARATION)
-#endif
-
-DEFINE_STUB_FUNCTION(void*, op_throw)
-{
-    STUB_INIT_STACK_FRAME(stackFrame);
-    stackFrame.vm->throwException(stackFrame.callFrame, stackFrame.args[0].jsValue()); 
-    ExceptionHandler handler = genericUnwind(stackFrame.vm, stackFrame.callFrame, stackFrame.args[0].jsValue());
-    STUB_SET_RETURN_ADDRESS(handler.catchRoutine);
-    return handler.callFrame;
-}
-
-DEFINE_STUB_FUNCTION(void, op_throw_static_error)
-{
-    STUB_INIT_STACK_FRAME(stackFrame);
-
-    CallFrame* callFrame = stackFrame.callFrame;
-    String message = errorDescriptionForValue(callFrame, stackFrame.args[0].jsValue())->value(callFrame);
-    if (stackFrame.args[1].asInt32)
-        stackFrame.vm->throwException(callFrame, createReferenceError(callFrame, message));
-    else
-        stackFrame.vm->throwException(callFrame, createTypeError(callFrame, message));
-    VM_THROW_EXCEPTION_AT_END();
-}
-
-DEFINE_STUB_FUNCTION(void*, vm_throw)
-{
-    STUB_INIT_STACK_FRAME(stackFrame);
-    VM* vm = stackFrame.vm;
-    ExceptionHandler handler = genericUnwind(vm, stackFrame.callFrame, vm->exception());
-    STUB_SET_RETURN_ADDRESS(handler.catchRoutine);
-    return handler.callFrame;
-}
-
 #if USE(JSVALUE32_64)
 EncodedExceptionHandler JIT_STUB cti_vm_handle_exception(CallFrame* callFrame)
 {

Modified: trunk/Source/_javascript_Core/jit/JITStubs.h (157580 => 157581)


--- trunk/Source/_javascript_Core/jit/JITStubs.h	2013-10-17 18:00:07 UTC (rev 157580)
+++ trunk/Source/_javascript_Core/jit/JITStubs.h	2013-10-17 18:12:28 UTC (rev 157581)
@@ -334,7 +334,6 @@
 #define JIT_STUB
 #endif
 
-extern "C" void ctiVMThrowTrampoline();
 extern "C" void ctiVMHandleException();
 extern "C" void ctiOpThrowNotCaught();
 extern "C" EncodedJSValue ctiTrampoline(void* code, JSStack*, CallFrame*, void* /*unused1*/, void* /*unused2*/, VM*);
@@ -355,9 +354,6 @@
 void performPlatformSpecificJITAssertions(VM*);
 
 extern "C" {
-void JIT_STUB cti_op_throw_static_error(STUB_ARGS_DECLARATION) WTF_INTERNAL;
-void* JIT_STUB cti_op_throw(STUB_ARGS_DECLARATION) WTF_INTERNAL;
-void* JIT_STUB cti_vm_throw(STUB_ARGS_DECLARATION) REFERENCED_FROM_ASM WTF_INTERNAL;
 
 #if USE(JSVALUE32_64)
 EncodedExceptionHandler JIT_STUB cti_vm_handle_exception(CallFrame*) REFERENCED_FROM_ASM WTF_INTERNAL;

Modified: trunk/Source/_javascript_Core/jit/JITStubsARM.h (157580 => 157581)


--- trunk/Source/_javascript_Core/jit/JITStubsARM.h	2013-10-17 18:00:07 UTC (rev 157580)
+++ trunk/Source/_javascript_Core/jit/JITStubsARM.h	2013-10-17 18:12:28 UTC (rev 157581)
@@ -174,14 +174,6 @@
 );
 
 asm (
-".text" "\n"
-".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
-HIDE_SYMBOL(ctiVMThrowTrampoline) "\n"
-INLINE_ARM_FUNCTION(ctiVMThrowTrampoline)
-SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
-    "mov r0, sp" "\n"
-    "bl " SYMBOL_STRING(cti_vm_throw) "\n"
-
 // Both has the same return sequence
 ".text" "\n"
 ".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n"
@@ -393,18 +385,6 @@
 {
 }
 
-__asm void ctiVMThrowTrampoline()
-{
-    ARM
-    PRESERVE8
-    mov r0, sp
-    bl cti_vm_throw
-    add sp, sp, # PRESERVEDR4_OFFSET
-    ldmia sp!, {r4-r6, r8-r11, lr}
-    add sp, sp, #12
-    bx lr
-}
-
 __asm void ctiOpThrowNotCaught()
 {
     ARM
@@ -454,7 +434,6 @@
 MSVC_BEGIN()
 MSVC_BEGIN(    EXPORT ctiTrampoline)
 MSVC_BEGIN(    EXPORT ctiTrampolineEnd)
-MSVC_BEGIN(    EXPORT ctiVMThrowTrampoline)
 MSVC_BEGIN(    EXPORT ctiOpThrowNotCaught)
 MSVC_BEGIN(    EXPORT ctiVMHandleException)
 MSVC_BEGIN(    IMPORT cti_vm_handle_exception)
@@ -475,16 +454,6 @@
 MSVC_BEGIN(ctiTrampolineEnd)
 MSVC_BEGIN(ctiTrampoline ENDP)
 MSVC_BEGIN()
-MSVC_BEGIN(ctiVMThrowTrampoline PROC)
-MSVC_BEGIN(    mov r0, sp)
-MSVC_BEGIN(    bl cti_vm_throw)
-MSVC_BEGIN(ctiOpThrowNotCaught)
-MSVC_BEGIN(    add sp, sp, #68 ; sync with PRESERVEDR4_OFFSET)
-MSVC_BEGIN(    ldmia sp!, {r4-r6, r8-r11, lr})
-MSVC_BEGIN(    add sp, sp, #12)
-MSVC_BEGIN(    bx lr)
-MSVC_BEGIN(ctiVMThrowTrampoline ENDP)
-MSVC_BEGIN()
 MSVC_BEGIN(ctiVMHandleException PROC)
 MSVC_BEGIN(    mov r0, r5)
 MSVC_BEGIN(    bl cti_vm_handle_exception)

Modified: trunk/Source/_javascript_Core/jit/JITStubsARM64.h (157580 => 157581)


--- trunk/Source/_javascript_Core/jit/JITStubsARM64.h	2013-10-17 18:00:07 UTC (rev 157580)
+++ trunk/Source/_javascript_Core/jit/JITStubsARM64.h	2013-10-17 18:12:28 UTC (rev 157581)
@@ -104,7 +104,7 @@
 SYMBOL_STRING(ctiVMHandleException) ":" "\n"
     "mov x0, x25" "\n"
     "bl " LOCAL_REFERENCE(cti_vm_handle_exception) "\n"
-    // When cti_vm_throw_slowpath returns, x0 has callFrame and x1 has handler address
+    // When cti_vm_handle_exception returns, x0 has callFrame and x1 has handler address
     "mov x25, x0" "\n"
     "br x1" "\n"
 
@@ -129,17 +129,6 @@
 SYMBOL_STRING(ctiTrampolineEnd) ":" "\n"
 );
 
-asm (
-".section __TEXT,__text,regular,pure_instructions" "\n"
-".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
-".align 2" "\n"
-HIDE_SYMBOL(ctiVMThrowTrampoline) "\n"
-SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
-    "mov x0, sp" "\n"
-    "bl " LOCAL_REFERENCE(cti_vm_throw) "\n"
-    "hlt 0xdead" "\n" // Should not be reached!
-);
-
 #define DEFINE_STUB_FUNCTION(rtype, op) \
     extern "C" { \
         rtype JITStubThunked_##op(STUB_ARGS_DECLARATION); \

Modified: trunk/Source/_javascript_Core/jit/JITStubsARMv7.h (157580 => 157581)


--- trunk/Source/_javascript_Core/jit/JITStubsARMv7.h	2013-10-17 18:00:07 UTC (rev 157580)
+++ trunk/Source/_javascript_Core/jit/JITStubsARMv7.h	2013-10-17 18:12:28 UTC (rev 157581)
@@ -245,29 +245,6 @@
 asm (
 ".text" "\n"
 ".align 2" "\n"
-".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
-HIDE_SYMBOL(ctiVMThrowTrampoline) "\n"
-".thumb" "\n"
-".thumb_func " THUMB_FUNC_PARAM(ctiVMThrowTrampoline) "\n"
-SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
-    "mov r0, sp" "\n"
-    "bl " LOCAL_REFERENCE(cti_vm_throw) "\n"
-    "ldr r11, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R11_OFFSET) "]" "\n"
-    "ldr r10, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R10_OFFSET) "]" "\n"
-    "ldr r9, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R9_OFFSET) "]" "\n"
-    "ldr r8, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R8_OFFSET) "]" "\n"
-    "ldr r7, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R7_OFFSET) "]" "\n"
-    "ldr r6, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R6_OFFSET) "]" "\n"
-    "ldr r5, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R5_OFFSET) "]" "\n"
-    "ldr r4, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R4_OFFSET) "]" "\n"
-    "ldr lr, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_RETURN_ADDRESS_OFFSET) "]" "\n"
-    "add sp, sp, #" STRINGIZE_VALUE_OF(FIRST_STACK_ARGUMENT) "\n"
-    "bx lr" "\n"
-);
-
-asm (
-".text" "\n"
-".align 2" "\n"
 ".globl " SYMBOL_STRING(ctiVMHandleException) "\n"
 HIDE_SYMBOL(ctiVMHandleException) "\n"
 ".thumb" "\n"
@@ -515,24 +492,6 @@
     bx lr
 }
 
-__asm void ctiVMThrowTrampoline()
-{
-    PRESERVE8
-    mov r0, sp
-    bl cti_vm_throw
-    ldr r11, [sp, # PRESERVED_R11_OFFSET ]
-    ldr r10, [sp, # PRESERVED_R10_OFFSET ]
-    ldr r9, [sp, # PRESERVED_R9_OFFSET ]
-    ldr r8, [sp, # PRESERVED_R8_OFFSET ]
-    ldr r7, [sp, # PRESERVED_R7_OFFSET ]
-    ldr r6, [sp, # PRESERVED_R6_OFFSET ]
-    ldr r5, [sp, # PRESERVED_R5_OFFSET ]
-    ldr r4, [sp, # PRESERVED_R4_OFFSET ]
-    ldr lr, [sp, # PRESERVED_RETURN_ADDRESS_OFFSET ]
-    add sp, sp, # FIRST_STACK_ARGUMENT
-    bx lr
-}
-
 __asm void ctiOpThrowNotCaught()
 {
     PRESERVE8

Modified: trunk/Source/_javascript_Core/jit/JITStubsMIPS.h (157580 => 157581)


--- trunk/Source/_javascript_Core/jit/JITStubsMIPS.h	2013-10-17 18:00:07 UTC (rev 157580)
+++ trunk/Source/_javascript_Core/jit/JITStubsMIPS.h	2013-10-17 18:12:28 UTC (rev 157581)
@@ -101,39 +101,6 @@
 ".set noreorder" "\n"
 ".set nomacro" "\n"
 ".set nomips16" "\n"
-".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
-".ent " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
-SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
-#if WTF_MIPS_PIC
-".set macro" "\n"
-".cpload $31" "\n"
-    "la    $25," SYMBOL_STRING(cti_vm_throw) "\n"
-".set nomacro" "\n"
-    "bal " SYMBOL_STRING(cti_vm_throw) "\n"
-    "move  $4,$29" "\n"
-#else
-    "jal " SYMBOL_STRING(cti_vm_throw) "\n"
-    "move  $4,$29" "\n"
-#endif
-    "lw    $16," STRINGIZE_VALUE_OF(PRESERVED_S0_OFFSET) "($29)" "\n"
-    "lw    $17," STRINGIZE_VALUE_OF(PRESERVED_S1_OFFSET) "($29)" "\n"
-    "lw    $18," STRINGIZE_VALUE_OF(PRESERVED_S2_OFFSET) "($29)" "\n"
-    "lw    $19," STRINGIZE_VALUE_OF(PRESERVED_S3_OFFSET) "($29)" "\n"
-    "lw    $20," STRINGIZE_VALUE_OF(PRESERVED_S4_OFFSET) "($29)" "\n"
-    "lw    $31," STRINGIZE_VALUE_OF(PRESERVED_RETURN_ADDRESS_OFFSET) "($29)" "\n"
-    "jr    $31" "\n"
-    "addiu $29,$29," STRINGIZE_VALUE_OF(STACK_LENGTH) "\n"
-".set reorder" "\n"
-".set macro" "\n"
-".end " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
-);
-
-asm (
-".text" "\n"
-".align 2" "\n"
-".set noreorder" "\n"
-".set nomacro" "\n"
-".set nomips16" "\n"
 ".globl " SYMBOL_STRING(ctiVMHandleException) "\n"
 ".ent " SYMBOL_STRING(ctiVMHandleException) "\n"
 SYMBOL_STRING(ctiVMHandleException) ":" "\n"

Modified: trunk/Source/_javascript_Core/jit/JITStubsMSVC64.asm (157580 => 157581)


--- trunk/Source/_javascript_Core/jit/JITStubsMSVC64.asm	2013-10-17 18:00:07 UTC (rev 157580)
+++ trunk/Source/_javascript_Core/jit/JITStubsMSVC64.asm	2013-10-17 18:12:28 UTC (rev 157581)
@@ -28,7 +28,6 @@
 EXTERN getHostCallReturnValueWithExecState : near
 
 PUBLIC ctiTrampoline
-PUBLIC ctiVMThrowTrampoline
 PUBLIC ctiOpThrowNotCaught
 PUBLIC getHostCallReturnValue
 
@@ -66,12 +65,6 @@
     ret
 ctiTrampoline ENDP
 
-ctiVMThrowTrampoline PROC
-    mov rcx, rsp
-    call cti_vm_throw
-    int 3
-ctiVMThrowTrampoline ENDP
-
 ctiVMHandleException PROC
 	sub rsp, 16
     mov rcx, rsp
@@ -103,4 +96,4 @@
 
 _TEXT   ENDS
 
-END
\ No newline at end of file
+END

Modified: trunk/Source/_javascript_Core/jit/JITStubsSH4.h (157580 => 157581)


--- trunk/Source/_javascript_Core/jit/JITStubsSH4.h	2013-10-17 18:00:07 UTC (rev 157580)
+++ trunk/Source/_javascript_Core/jit/JITStubsSH4.h	2013-10-17 18:12:28 UTC (rev 157581)
@@ -83,30 +83,6 @@
 );
 
 asm volatile (
-".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
-HIDE_SYMBOL(ctiVMThrowTrampoline) "\n"
-SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
-    "mov.l .L2" SYMBOL_STRING(cti_vm_throw) ",r0" "\n"
-    "mov r15, r4" "\n"
-    "mov.l @(r0,r12),r11" "\n"
-    "jsr @r11" "\n"
-    "nop" "\n"
-    "add #" STRINGIZE_VALUE_OF(SAVED_R8_OFFSET) ", r15" "\n"
-    "mov.l @r15+,r8" "\n"
-    "mov.l @r15+,r9" "\n"
-    "mov.l @r15+,r10" "\n"
-    "mov.l @r15+,r11" "\n"
-    "mov.l @r15+,r13" "\n"
-    "lds.l @r15+,pr" "\n"
-    "mov.l @r15+,r14" "\n"
-    "add #12, r15" "\n"
-    "rts" "\n"
-    "nop" "\n"
-    ".align 2" "\n"
-    ".L2" SYMBOL_STRING(cti_vm_throw) ":.long " SYMBOL_STRING(cti_vm_throw) "@GOT \n"
-);
-
-asm volatile (
 ".globl " SYMBOL_STRING(ctiVMHandleException) "\n"
 HIDE_SYMBOL(ctiVMHandleException) "\n"
 SYMBOL_STRING(ctiVMHandleException) ":" "\n"

Modified: trunk/Source/_javascript_Core/jit/JITStubsX86.h (157580 => 157581)


--- trunk/Source/_javascript_Core/jit/JITStubsX86.h	2013-10-17 18:00:07 UTC (rev 157580)
+++ trunk/Source/_javascript_Core/jit/JITStubsX86.h	2013-10-17 18:12:28 UTC (rev 157581)
@@ -77,15 +77,6 @@
 );
 
 asm (
-".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
-HIDE_SYMBOL(ctiVMThrowTrampoline) "\n"
-SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
-    "movl %esp, %ecx" "\n"
-    "call " LOCAL_REFERENCE(cti_vm_throw) "\n"
-    "int3" "\n"
-);
-
-asm (
 ".globl " SYMBOL_STRING(ctiVMHandleException) "\n"
 HIDE_SYMBOL(ctiVMHandleException) "\n"
 SYMBOL_STRING(ctiVMHandleException) ":" "\n"
@@ -294,15 +285,6 @@
         }
     }
 
-    __declspec(naked) void ctiVMThrowTrampoline()
-    {
-        __asm {
-            mov ecx, esp;
-            call cti_vm_throw;
-            int 3;
-        }
-    }
-
     __declspec(naked) void ctiVMHandleException()
     {
         __asm {

Modified: trunk/Source/_javascript_Core/jit/JITStubsX86_64.h (157580 => 157581)


--- trunk/Source/_javascript_Core/jit/JITStubsX86_64.h	2013-10-17 18:00:07 UTC (rev 157580)
+++ trunk/Source/_javascript_Core/jit/JITStubsX86_64.h	2013-10-17 18:12:28 UTC (rev 157581)
@@ -90,15 +90,6 @@
 );
 
 asm (
-".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
-HIDE_SYMBOL(ctiVMThrowTrampoline) "\n"
-SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
-    "movq %rsp, %rdi" "\n"
-    "call " LOCAL_REFERENCE(cti_vm_throw) "\n"
-    "int3" "\n"
-);
-
-asm (
 ".globl " SYMBOL_STRING(ctiVMHandleException) "\n"
 HIDE_SYMBOL(ctiVMHandleException) "\n"
 SYMBOL_STRING(ctiVMHandleException) ":" "\n"

Modified: trunk/Source/_javascript_Core/jit/JSInterfaceJIT.h (157580 => 157581)


--- trunk/Source/_javascript_Core/jit/JSInterfaceJIT.h	2013-10-17 18:00:07 UTC (rev 157580)
+++ trunk/Source/_javascript_Core/jit/JSInterfaceJIT.h	2013-10-17 18:12:28 UTC (rev 157581)
@@ -62,6 +62,7 @@
         // however the code will still function correctly.
 #if CPU(X86_64)
         static const RegisterID returnValueRegister = X86Registers::eax;
+        static const RegisterID returnValue2Register = X86Registers::edx;
         static const RegisterID cachedResultRegister = X86Registers::eax;
 #if !OS(WINDOWS)
         static const RegisterID firstArgumentRegister = X86Registers::edi;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to