Ignore:
Timestamp:
Sep 21, 2013, 10:00:45 PM (12 years ago)
Author:
[email protected]
Message:

Interpreter::unwind() has no need for the bytecodeOffset
https://bugs.webkit.org/show_bug.cgi?id=121755

Reviewed by Oliver Hunt.

It was only using the bytecodeOffset for some debugger stuff, but the debugger could
just get the bytecodeOffset the same way the rest of the machinery does: by using the
CallFrame's location.

It turns out that a lot of really ugly code was in place just to supply this
bytecodeOffset. This patch kills most of that code, and allows us to kill even more
code in a future patch - though most likely that killage will involve further
refactorings as well, see https://bugs.webkit.org/show_bug.cgi?id=121734.

  • dfg/DFGOperations.cpp:
  • interpreter/CallFrame.cpp:

(JSC::CallFrame::bytecodeOffset):
(JSC::CallFrame::codeOrigin):

  • interpreter/CallFrame.h:
  • interpreter/Interpreter.cpp:

(JSC::Interpreter::unwind):

  • interpreter/Interpreter.h:
  • jit/JITExceptions.cpp:

(JSC::genericUnwind):

  • jit/JITExceptions.h:
  • jit/JITStubs.cpp:

(JSC::DEFINE_STUB_FUNCTION):
(JSC::cti_vm_handle_exception):

  • llint/LLIntExceptions.cpp:

(JSC::LLInt::doThrow):
(JSC::LLInt::returnToThrow):
(JSC::LLInt::callToThrow):

  • llint/LLIntExceptions.h:
  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::LLINT_SLOW_PATH_DECL):

  • runtime/CommonSlowPaths.cpp:

(JSC::SLOW_PATH_DECL):

  • runtime/CommonSlowPathsExceptions.cpp:

(JSC::CommonSlowPaths::interpreterThrowInCaller):

  • runtime/CommonSlowPathsExceptions.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jit/JITExceptions.cpp

    r154817 r156242  
    3939namespace JSC {
    4040
    41 static unsigned getExceptionLocation(VM* vm, CallFrame* callFrame)
    42 {
    43     UNUSED_PARAM(vm);
    44     ASSERT(!callFrame->hasHostCallFrameFlag());
    45 
    46 #if ENABLE(DFG_JIT)
    47     if (callFrame->hasLocationAsCodeOriginIndex())
    48         return callFrame->bytecodeOffsetFromCodeOriginIndex();
    49 #endif
    50 
    51     return callFrame->locationAsBytecodeOffset();
    52 }
    53 
    5441#if USE(JSVALUE32_64)
    5542EncodedExceptionHandler encode(ExceptionHandler handler)
     
    6855}
    6956
    70 ExceptionHandler genericUnwind(VM* vm, ExecState* callFrame, JSValue exceptionValue, unsigned vPCIndex)
     57ExceptionHandler genericUnwind(VM* vm, ExecState* callFrame, JSValue exceptionValue)
    7158{
    7259    RELEASE_ASSERT(exceptionValue);
    73     HandlerInfo* handler = vm->interpreter->unwind(callFrame, exceptionValue, vPCIndex); // This may update callFrame.
     60    HandlerInfo* handler = vm->interpreter->unwind(callFrame, exceptionValue); // This may update callFrame.
    7461
    7562    void* catchRoutine;
     
    9077}
    9178
    92 ExceptionHandler jitThrowNew(VM* vm, ExecState* callFrame, JSValue exceptionValue)
    93 {
    94     unsigned bytecodeOffset = getExceptionLocation(vm, callFrame);
    95    
    96     return genericUnwind(vm, callFrame, exceptionValue, bytecodeOffset);
    97 }
    98 
    99 ExceptionHandler jitThrow(VM* vm, ExecState* callFrame, JSValue exceptionValue, ReturnAddressPtr faultLocation)
    100 {
    101     return genericUnwind(vm, callFrame, exceptionValue, callFrame->codeBlock()->bytecodeOffset(callFrame, faultLocation));
    102 }
    103 
    10479}
    10580
Note: See TracChangeset for help on using the changeset viewer.