Ignore:
Timestamp:
Jun 18, 2009, 7:32:29 PM (16 years ago)
Author:
[email protected]
Message:

2009-06-18 Gavin Barraclough <[email protected]>

Rubber Stamped by Mark Rowe (originally reviewed by Sam Weinig).

(Reintroducing patch added in r44492, and reverted in r44796.)

Change the implementation of op_throw so the stub function always modifies its
return address - if it doesn't find a 'catch' it will switch to a trampoline
to force a return from JIT execution. This saves memory, by avoiding the need
for a unique return for every op_throw.

  • jit/JITOpcodes.cpp: (JSC::JIT::emit_op_throw):

JITStubs::cti_op_throw now always changes its return address,
remove return code generated after the stub call (this is now
handled by ctiOpThrowNotCaught).

  • jit/JITStubs.cpp: (JSC::):

Add ctiOpThrowNotCaught definitions.

(JSC::JITStubs::DEFINE_STUB_FUNCTION):

Change cti_op_throw to always change its return address.

  • jit/JITStubs.h:

Add ctiOpThrowNotCaught declaration.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/jit/JITOpcodes.cpp

    r44796 r44838  
    623623    stubCall.call();
    624624    ASSERT(regT0 == returnValueRegister);
    625 #if PLATFORM(X86_64)
    626     addPtr(Imm32(0x48), X86::esp);
    627     pop(X86::ebx);
    628     pop(X86::r15);
    629     pop(X86::r14);
    630     pop(X86::r13);
    631     pop(X86::r12);
    632     pop(X86::ebp);
    633     ret();
    634 #else
    635     addPtr(Imm32(0x1c), X86::esp);
    636     pop(X86::ebx);
    637     pop(X86::edi);
    638     pop(X86::esi);
    639     pop(X86::ebp);
    640     ret();
     625#ifndef NDEBUG
     626    // cti_op_throw always changes it's return address,
     627    // this point in the code should never be reached.
     628    breakpoint();
    641629#endif
    642630}
Note: See TracChangeset for help on using the changeset viewer.