Changeset 37428 in webkit for trunk/JavaScriptCore/VM/CTI.cpp


Ignore:
Timestamp:
Oct 8, 2008, 10:50:42 AM (17 years ago)
Author:
[email protected]
Message:

Roll out r37427 because it causes an infinite recursion loading about:blank.

https://bugs.webkit.org/show_bug.cgi?id=21476

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/VM/CTI.cpp

    r37427 r37428  
    3535#include "wrec/WREC.h"
    3636#include "ResultType.h"
    37 
    3837#if PLATFORM(MAC)
    3938#include <sys/sysctl.h>
     
    4544
    4645#if PLATFORM(MAC)
    47 
    48 static inline bool isSSE2Present()
     46bool isSSE2Present()
    4947{
    5048    return true; // All X86 Macs are guaranteed to support at least SSE2
    5149}
    52 
    53 #else
    54 
    55 static bool isSSE2Present()
     50#else COMPILER(MSVC)
     51bool isSSE2Present()
    5652{
    5753    static const int SSE2FeatureBit = 1 << 26;
     
    7773    return check.present;
    7874}
    79 
    8075#endif
    81 
    82 COMPILE_ASSERT(CTI_ARGS_code == 0xC, CTI_ARGS_code_is_C);
    83 COMPILE_ASSERT(CTI_ARGS_callFrame == 0xE, CTI_ARGS_callFrame_is_E);
    8476
    8577#if COMPILER(GCC) && PLATFORM(X86)
     
    9284    "subl $0x24, %esp" "\n"
    9385    "movl $512, %esi" "\n"
    94     "movl 0x38(%esp), %edi" "\n" // Ox38 = 0x0E * 4, 0x0E = CTI_ARGS_callFrame (see assertion above)
    95     "call *0x30(%esp)" "\n" // Ox30 = 0x0C * 4, 0x0C = CTI_ARGS_code (see assertion above)
     86    "movl 0x38(%esp), %edi" "\n" // Ox38 = 0x0E * 4, 0x0E = CTI_ARGS_r
     87    "call *0x30(%esp)" "\n" // Ox30 = 0x0C * 4, 0x0C = CTI_ARGS_code
    9688    "addl $0x24, %esp" "\n"
    9789    "popl %edi" "\n"
     
    123115            mov ecx, esp;
    124116            mov edi, [esp + 0x38];
    125             call [esp + 0x30]; // Ox30 = 0x0C * 4, 0x0C = CTI_ARGS_code (see assertion above)
     117            call [esp + 0x30];
    126118            add esp, 0x24;
    127119            pop edi;
     
    147139#endif
    148140
     141
    149142ALWAYS_INLINE bool CTI::isConstant(int src)
    150143{
     
    152145}
    153146
    154 ALWAYS_INLINE JSValue* CTI::getConstant(CallFrame* callFrame, int src)
    155 {
    156     return m_codeBlock->constantRegisters[src - m_codeBlock->numVars].jsValue(callFrame);
     147ALWAYS_INLINE JSValue* CTI::getConstant(ExecState* exec, int src)
     148{
     149    return m_codeBlock->constantRegisters[src - m_codeBlock->numVars].jsValue(exec);
    157150}
    158151
     
    162155    // TODO: we want to reuse values that are already in registers if we can - add a register allocator!
    163156    if (isConstant(src)) {
    164         JSValue* js = getConstant(m_callFrame, src);
     157        JSValue* js = getConstant(m_exec, src);
    165158        m_jit.movl_i32r(reinterpret_cast<unsigned>(js), dst);
    166159    } else
     
    172165{
    173166    if (isConstant(src)) {
    174         JSValue* js = getConstant(m_callFrame, src);
     167        JSValue* js = getConstant(m_exec, src);
    175168        m_jit.movl_i32m(reinterpret_cast<unsigned>(js), offset + sizeof(void*), X86::esp);
    176169    } else {
     
    194187{
    195188    if (isConstant(src)) {
    196         JSValue* js = getConstant(m_callFrame, src);
     189        JSValue* js = getConstant(m_exec, src);
    197190        return JSImmediate::isNumber(js) ? js : 0;
    198191    }
     
    257250    char which1 = '*';
    258251    if (isConstant(src1)) {
    259         JSValue* js = getConstant(m_callFrame, src1);
     252        JSValue* js = getConstant(m_exec, src1);
    260253        which1 =
    261254            JSImmediate::isImmediate(js) ?
     
    271264    char which2 = '*';
    272265    if (isConstant(src2)) {
    273         JSValue* js = getConstant(m_callFrame, src2);
     266        JSValue* js = getConstant(m_exec, src2);
    274267        which2 =
    275268            JSImmediate::isImmediate(js) ?
     
    453446}
    454447
    455 CTI::CTI(Machine* machine, CallFrame* callFrame, CodeBlock* codeBlock)
     448CTI::CTI(Machine* machine, ExecState* exec, CodeBlock* codeBlock)
    456449    : m_jit(machine->jitCodeBuffer())
    457450    , m_machine(machine)
    458     , m_callFrame(callFrame)
     451    , m_exec(exec)
    459452    , m_codeBlock(codeBlock)
    460453    , m_labels(codeBlock ? codeBlock->instructions.size() : 0)
     
    495488    m_jit.movl_mr(OBJECT_OFFSET(JSFunction, m_scopeChain) + OBJECT_OFFSET(ScopeChain, m_node), X86::ecx, X86::ecx); // newScopeChain
    496489    m_jit.movl_i32m(argCount, RegisterFile::ArgumentCount * static_cast<int>(sizeof(Register)), X86::edx);
    497     m_jit.movl_rm(X86::edi, RegisterFile::CallerFrame * static_cast<int>(sizeof(Register)), X86::edx);
     490    m_jit.movl_rm(X86::edi, RegisterFile::CallerRegisters * static_cast<int>(sizeof(Register)), X86::edx);
    498491    m_jit.movl_rm(X86::ecx, RegisterFile::ScopeChain * static_cast<int>(sizeof(Register)), X86::edx);
    499492}
     
    523516        int thisVal = instruction[i + 3].u.operand;
    524517        if (thisVal == missingThisObjectMarker()) {
    525             // FIXME: should this be loaded dynamically off m_callFrame?
    526             m_jit.movl_i32m(reinterpret_cast<unsigned>(m_callFrame->globalThisValue()), firstArg * sizeof(Register), X86::edi);
     518            // FIXME: should this be loaded dynamically off m_exec?
     519            m_jit.movl_i32m(reinterpret_cast<unsigned>(m_exec->globalThisValue()), firstArg * sizeof(Register), X86::edi);
    527520        } else {
    528521            emitGetArg(thisVal, X86::ecx);
     
    567560    m_jit.movl_mr(OBJECT_OFFSET(CodeBlock, ctiCode), X86::eax, X86::eax);
    568561
    569     // Put the new value of 'callFrame' into edi and onto the stack, too.
    570     emitPutCTIParam(X86::edx, CTI_ARGS_callFrame);
     562    // Setup the new value of 'r' in edi, and on the stack, too.
     563    emitPutCTIParam(X86::edx, CTI_ARGS_r);
    571564    m_jit.movl_rr(X86::edx, X86::edi);
    572565
     
    693686void CTI::compileBinaryArithOp(OpcodeID opcodeID, unsigned dst, unsigned src1, unsigned src2, OperandTypes types, unsigned i)
    694687{
    695     StructureID* numberStructureID = m_callFrame->globalData().numberStructureID.get();
     688    StructureID* numberStructureID = m_exec->globalData().numberStructureID.get();
    696689    X86Assembler::JmpSrc wasJSNumberCell1, wasJSNumberCell1b, wasJSNumberCell2, wasJSNumberCell2b;
    697690
     
    886879            unsigned src = instruction[i + 2].u.operand;
    887880            if (isConstant(src))
    888                 m_jit.movl_i32r(reinterpret_cast<unsigned>(getConstant(m_callFrame, src)), X86::edx);
     881                m_jit.movl_i32r(reinterpret_cast<unsigned>(getConstant(m_exec, src)), X86::edx);
    889882            else
    890883                emitGetArg(src, X86::edx);
     
    12461239
    12471240            // Restore our caller's "r".
    1248             emitGetArg(RegisterFile::CallerFrame, X86::edi);
    1249             emitPutCTIParam(X86::edi, CTI_ARGS_callFrame);
     1241            emitGetArg(RegisterFile::CallerRegisters, X86::edi);
     1242            emitPutCTIParam(X86::edi, CTI_ARGS_r);
    12501243
    12511244            // Return.
     
    18111804        }
    18121805        case op_catch: {
    1813             emitGetCTIParam(CTI_ARGS_callFrame, X86::edi); // edi := r
     1806            emitGetCTIParam(CTI_ARGS_r, X86::edi); // edi := r
    18141807            emitPutResult(instruction[i + 1].u.operand);
    18151808            i += 2;
     
    26602653    // The prototype object definitely exists (if this stub exists the CodeBlock is referencing a StructureID that is
    26612654    // referencing the prototype object - let's speculatively load it's table nice and early!)
    2662     JSObject* protoObject = static_cast<JSObject*>(structureID->prototypeForLookup(m_callFrame));
     2655    JSObject* protoObject = static_cast<JSObject*>(structureID->prototypeForLookup(m_exec));
    26632656    PropertyStorage* protoPropertyStorage = &protoObject->m_propertyStorage;
    26642657    m_jit.movl_mr(static_cast<void*>(protoPropertyStorage), X86::edx);
     
    27032696    // The prototype object definitely exists (if this stub exists the CodeBlock is referencing a StructureID that is
    27042697    // referencing the prototype object - let's speculatively load it's table nice and early!)
    2705     JSObject* protoObject = static_cast<JSObject*>(structureID->prototypeForLookup(m_callFrame));
     2698    JSObject* protoObject = static_cast<JSObject*>(structureID->prototypeForLookup(m_exec));
    27062699    PropertyStorage* protoPropertyStorage = &protoObject->m_propertyStorage;
    27072700    m_jit.movl_mr(static_cast<void*>(protoPropertyStorage), X86::edx);
     
    27522745    JSObject* protoObject = 0;
    27532746    for (unsigned i = 0; i<count; ++i) {
    2754         protoObject = static_cast<JSObject*>(currStructureID->prototypeForLookup(m_callFrame));
     2747        protoObject = static_cast<JSObject*>(currStructureID->prototypeForLookup(m_exec));
    27552748        currStructureID = chainEntries[i].get();
    27562749
     
    30523045#if ENABLE(WREC)
    30533046
    3054 void* CTI::compileRegExp(Machine* machine, const UString& pattern, unsigned* numSubpatterns_ptr, const char** error_ptr, bool ignoreCase, bool multiline)
     3047void* CTI::compileRegExp(ExecState* exec, const UString& pattern, unsigned* numSubpatterns_ptr, const char** error_ptr, bool ignoreCase, bool multiline)
    30553048{
    30563049    // TODO: better error messages
     
    30603053    }
    30613054
    3062     X86Assembler jit(machine->jitCodeBuffer());
     3055    X86Assembler jit(exec->machine()->jitCodeBuffer());
    30633056    WRECParser parser(pattern, ignoreCase, multiline, jit);
    30643057   
Note: See TracChangeset for help on using the changeset viewer.