Show
Ignore:
Timestamp:
08/18/08 11:14:49 (5 months ago)
Author:
odole
Message:

merge with webkit revision 35814

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/JavaScriptCore/VM/Machine.cpp

    r434 r440  
    8383 
    8484// Returns the depth of the scope chain within a given call frame. 
    85 static int depth(ScopeChain& sc) 
    86 
     85static int depth(CodeBlock* codeBlock, ScopeChain& sc) 
     86
     87    if (!codeBlock->needsFullScopeChain) 
     88        return 0; 
    8789    int scopeDepth = 0; 
    8890    ScopeChainIterator iter = sc.begin(); 
     
    646648 
    647649    if (Debugger* debugger = exec->dynamicGlobalObject()->debugger()) { 
    648         DebuggerCallFrame debuggerCallFrame(exec->dynamicGlobalObject(), codeBlock, scopeChain, r, exceptionValue); 
     650        DebuggerCallFrame debuggerCallFrame(exec, exec->dynamicGlobalObject(), codeBlock, scopeChain, r, exceptionValue); 
    649651        if (callFrame[RegisterFile::Callee].jsValue(exec)) 
    650652            debugger->returnEvent(debuggerCallFrame, codeBlock->ownerNode->sourceId(), codeBlock->ownerNode->lastLine()); 
     
    724726 
    725727    if (Debugger* debugger = exec->dynamicGlobalObject()->debugger()) { 
    726         DebuggerCallFrame debuggerCallFrame(exec->dynamicGlobalObject(), codeBlock, scopeChain, r, exceptionValue); 
     728        DebuggerCallFrame debuggerCallFrame(exec, exec->dynamicGlobalObject(), codeBlock, scopeChain, r, exceptionValue); 
    727729        debugger->exception(debuggerCallFrame, codeBlock->ownerNode->sourceId(), codeBlock->lineNumberForVPC(vPC)); 
    728730    } 
     
    741743 
    742744    ScopeChain sc(scopeChain); 
    743     int scopeDelta = depth(sc) - scopeDepth; 
     745    int scopeDelta = depth(codeBlock, sc) - scopeDepth; 
    744746    ASSERT(scopeDelta >= 0); 
    745747    while (scopeDelta--) 
     
    956958        return; 
    957959 
    958     DebuggerCallFrame debuggerCallFrame(exec->dynamicGlobalObject(), codeBlock, scopeChain, r, 0); 
     960    DebuggerCallFrame debuggerCallFrame(exec, exec->dynamicGlobalObject(), codeBlock, scopeChain, r, 0); 
    959961 
    960962    switch((DebugHookID)debugHookID) { 
     
    22152217        NEXT_OPCODE; 
    22162218    } 
    2217     BEGIN_OPCODE(op_jless) { 
    2218         /* jless src1(r) src2(r) target(offset) 
    2219  
    2220            Checks whether register src1 is less than register src2, as 
    2221            with the ECMAScript '<' operator, and then jumps to offset 
    2222            target from the current instruction, if and only if the  
    2223            result of the comparison is true. 
    2224         */ 
    2225         JSValue* src1 = r[(++vPC)->u.operand].jsValue(exec); 
    2226         JSValue* src2 = r[(++vPC)->u.operand].jsValue(exec); 
    2227         int target = (++vPC)->u.operand; 
    2228  
    2229         bool result = jsLess(exec, src1, src2); 
    2230         VM_CHECK_EXCEPTION(); 
    2231          
    2232         if (result) { 
    2233             vPC += target; 
    2234             NEXT_OPCODE; 
    2235         } 
    2236  
    2237         ++vPC; 
    2238         NEXT_OPCODE; 
    2239     } 
    22402219    BEGIN_OPCODE(op_jnless) { 
    22412220        /* jnless src1(r) src2(r) target(offset)