Changeset 39351 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Dec 16, 2008, 6:34:59 PM (16 years ago)
Author:
[email protected]
Message:

2008-12-16 Sam Weinig <[email protected]>

Reviewed by Gavin Barraclough.

Fix for https://bugs.webkit.org/show_bug.cgi?id=22837
Remove dependency on the bytecode Instruction buffer in Interpreter::cti_op_call_NotJSFunction
Part of <rdar://problem/6428342>

  • interpreter/CallFrame.h: Added comment regarding returnPC storing a void*.
  • interpreter/Interpreter.cpp: (JSC::bytecodeOffsetForPC): We no longer have any cases of the PC being in the instruction stream for JIT, so we can remove the check. (JSC::Interpreter::cti_op_call_NotJSFunction): Use the CTI_RETURN_ADDRESS as the call frame returnPC as it is only necessary for looking up when throwing an exception.
  • interpreter/RegisterFile.h: (JSC::RegisterFile::): Added comment regarding returnPC storing a void*.
  • jit/JIT.h: Remove ARG_instr4.
  • jit/JITCall.cpp: (JSC::JIT::compileOpCallSetupArgs): Don't pass the instruction pointer.
Location:
trunk/JavaScriptCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r39350 r39351  
     12008-12-16  Sam Weinig  <[email protected]>
     2
     3        Reviewed by Gavin Barraclough.
     4
     5        Fix for https://bugs.webkit.org/show_bug.cgi?id=22837
     6        Remove dependency on the bytecode Instruction buffer in Interpreter::cti_op_call_NotJSFunction
     7        Part of <rdar://problem/6428342>
     8
     9        * interpreter/CallFrame.h: Added comment regarding returnPC storing a void*.
     10        * interpreter/Interpreter.cpp:
     11        (JSC::bytecodeOffsetForPC): We no longer have any cases of the PC
     12        being in the instruction stream for JIT, so we can remove the check.
     13        (JSC::Interpreter::cti_op_call_NotJSFunction): Use the CTI_RETURN_ADDRESS
     14        as the call frame returnPC as it is only necessary for looking up when
     15        throwing an exception.
     16        * interpreter/RegisterFile.h:
     17        (JSC::RegisterFile::): Added comment regarding returnPC storing a void*.
     18        * jit/JIT.h: Remove ARG_instr4.
     19        * jit/JITCall.cpp:
     20        (JSC::JIT::compileOpCallSetupArgs): Don't pass the instruction pointer.
     21
    1222008-12-16  Darin Adler  <[email protected]>
    223
  • trunk/JavaScriptCore/interpreter/CallFrame.h

    r38528 r39351  
    125125            setScopeChain(scopeChain);
    126126            setCallerFrame(callerFrame);
    127             this[RegisterFile::ReturnPC] = vPC;
     127            this[RegisterFile::ReturnPC] = vPC; // This is either an Instruction* or a pointer into JIT generated code stored as an Instruction*.
    128128            this[RegisterFile::ReturnValueRegister] = returnValueRegister;
    129129            setArgumentCount(argc); // original argument count (for the sake of the "arguments" object)
  • trunk/JavaScriptCore/interpreter/Interpreter.cpp

    r39342 r39351  
    9292{
    9393#if ENABLE(JIT)
    94     if (pc >= codeBlock->instructions().begin() && pc < codeBlock->instructions().end())
    95         return static_cast<Instruction*>(pc) - codeBlock->instructions().begin();
    9694    return codeBlock->getBytecodeIndex(pc);
    9795#else
     
    49164914        CallFrame* callFrame = CallFrame::create(previousCallFrame->registers() + registerOffset);
    49174915
    4918         callFrame->init(0, ARG_instr4 + 1, previousCallFrame->scopeChain(), previousCallFrame, 0, argCount, 0);
     4916        callFrame->init(0, static_cast<Instruction*>(CTI_RETURN_ADDRESS), previousCallFrame->scopeChain(), previousCallFrame, 0, argCount, 0);
    49194917        ARG_setCallFrame(callFrame);
    49204918
  • trunk/JavaScriptCore/interpreter/RegisterFile.h

    r39303 r39351  
    100100            ScopeChain = -7,
    101101            CallerFrame = -6,
    102             ReturnPC = -5,
     102            ReturnPC = -5, // This is either an Instruction* or a pointer into JIT generated code stored as an Instruction*.
    103103            ReturnValueRegister = -4,
    104104            ArgumentCount = -3,
  • trunk/JavaScriptCore/jit/JIT.h

    r39325 r39351  
    7575#define ARG_regexp1 static_cast<RegExp*>(ARGS[1])
    7676#define ARG_pni1 static_cast<JSPropertyNameIterator*>(ARGS[1])
    77 #define ARG_instr4 static_cast<Instruction*>(ARGS[4])
    7877#define ARG_returnAddress2 static_cast<void*>(ARGS[2])
    7978#define ARG_codeBlock4 static_cast<CodeBlock*>(ARGS[4])
  • trunk/JavaScriptCore/jit/JITCall.cpp

    r39342 r39351  
    9292    emitPutJITStubArgConstant(registerOffset, 2);
    9393    emitPutJITStubArgConstant(argCount, 3);
    94     emitPutJITStubArgConstant(instruction, 4);
    9594}
    9695
Note: See TracChangeset for help on using the changeset viewer.