Changeset 34781 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Jun 24, 2008, 4:03:11 PM (17 years ago)
Author:
[email protected]
Message:

2008-06-24 Cameron Zwarich <[email protected]>

Rubber stamped by Oliver.

Roll out r34777 due to multiple assertion failures on tests.

  • ChangeLog:
  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::emitJump): (KJS::CodeGenerator::emitJumpIfTrueMayCombine): (KJS::CodeGenerator::emitJumpIfTrue): (KJS::CodeGenerator::emitJumpIfFalse): (KJS::CodeGenerator::emitJumpScopes):
  • VM/LabelID.h:
  • VM/Machine.cpp: (KJS::Machine::privateExecute):
  • VM/Machine.h:
  • VM/Opcode.h:
Location:
trunk/JavaScriptCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r34778 r34781  
    2323        (KJS::ProfileNode::removeChild): Should reset the sibling pointers since
    2424        one of them has been removed.
    25 
    26 2008-06-24  Oliver Hunt  <[email protected]>
    27 
    28         Reviewed by Cameron.
    29 
    30         Add special loop opcodes as groundwork for slow script
    31         termination.  Also added a few assertions to prevent us
    32         from accidentally coalescing conditional jump operands
    33         in a way that might bypass the slow script opcodes.
    34 
    35         * JavaScriptCore.xcodeproj/project.pbxproj:
    36         * VM/CodeGenerator.cpp:
    37         (KJS::CodeGenerator::emitJumpIfTrueMayCombine):
    38         (KJS::CodeGenerator::emitJumpScopes):
    39         * VM/LabelID.h:
    40         * VM/Machine.cpp:
    41         (KJS::Machine::privateExecute):
    42         * VM/Machine.h:
    43         * VM/Opcode.h:
    4425
    45262008-06-24  Darin Adler  <[email protected]>
  • trunk/JavaScriptCore/VM/CodeGenerator.cpp

    r34777 r34781  
    421421PassRefPtr<LabelID> CodeGenerator::emitJump(LabelID* target)
    422422{
    423     ASSERT(target->isForwardLabel());
    424423    emitOpcode(op_jmp);
    425424    instructions().append(target->offsetFrom(instructions().size()));
     
    438437        if (cond->index() == dstIndex) {
    439438            rewindBinaryOp();
    440             emitOpcode(target->isForwardLabel() ? op_jless : op_loop_if_less);
     439            emitOpcode(op_jless);
    441440            instructions().append(src1Index);
    442441            instructions().append(src2Index);
     
    451450PassRefPtr<LabelID> CodeGenerator::emitJumpIfTrue(RegisterID* cond, LabelID* target)
    452451{
    453     emitOpcode(target->isForwardLabel() ? op_jtrue : op_loop_if_true);
     452    emitOpcode(op_jtrue);
    454453    instructions().append(cond->index());
    455454    instructions().append(target->offsetFrom(instructions().size()));
     
    459458PassRefPtr<LabelID> CodeGenerator::emitJumpIfFalse(RegisterID* cond, LabelID* target)
    460459{
    461     ASSERT(target->isForwardLabel());
    462460    emitOpcode(op_jfalse);
    463461    instructions().append(cond->index());
     
    10341032{
    10351033    ASSERT(scopeDepth() - targetScopeDepth >= 0);
    1036     ASSERT(target->isForwardLabel());
    10371034
    10381035    size_t scopeDelta = scopeDepth() - targetScopeDepth;
  • trunk/JavaScriptCore/VM/LabelID.h

    r34777 r34781  
    9999        }
    100100
    101         bool isForwardLabel() { return m_location == invalidLocation; }
    102101    private:
    103102        typedef Vector<int, 8> JumpVector;
  • trunk/JavaScriptCore/VM/Machine.cpp

    r34777 r34781  
    896896    JSValue** k = codeBlock->jsValues.data();
    897897    Profiler** enabledProfilerReference = Profiler::enabledProfilerReference();
    898    
     898
    899899    registerFile->setSafeForReentry(false);
    900900#define VM_CHECK_EXCEPTION() \
     
    909909    OpcodeStats::resetLastInstruction();
    910910#endif
    911    
    912 #define CHECK_FOR_TIMEOUT()
    913    
     911
    914912#if HAVE(COMPUTED_GOTO)
    915913    #define NEXT_OPCODE goto *vPC->u.opcode
     
    18901888        NEXT_OPCODE;
    18911889    }
    1892     BEGIN_OPCODE(op_loop_if_true) {
    1893         /* loop_if_true cond(r) target(offset)
    1894          
    1895            Jumps to offset target from the current instruction, if and
    1896            only if register cond converts to boolean as true.
    1897 
    1898            Additionally this loop instruction may terminate JS execution is
    1899            the JS timeout is reached.
    1900          */
    1901         int cond = (++vPC)->u.operand;
    1902         int target = (++vPC)->u.operand;
    1903         if (r[cond].u.jsValue->toBoolean(exec)) {
    1904             vPC += target;
    1905             CHECK_FOR_TIMEOUT();
    1906             NEXT_OPCODE;
    1907         }
    1908        
    1909         ++vPC;
    1910         NEXT_OPCODE;
    1911     }
    19121890    BEGIN_OPCODE(op_jtrue) {
    19131891        /* jtrue cond(r) target(offset)
     
    19391917        }
    19401918
    1941         ++vPC;
    1942         NEXT_OPCODE;
    1943     }
    1944     BEGIN_OPCODE(op_loop_if_less) {
    1945         /* loop_if_less src1(r) src2(r) target(offset)
    1946 
    1947            Checks whether register src1 is less than register src2, as
    1948            with the ECMAScript '<' operator, and then jumps to offset
    1949            target from the current instruction, if and only if the
    1950            result of the comparison is true.
    1951 
    1952            Additionally this loop instruction may terminate JS execution is
    1953            the JS timeout is reached.
    1954          */
    1955         JSValue* src1 = r[(++vPC)->u.operand].u.jsValue;
    1956         JSValue* src2 = r[(++vPC)->u.operand].u.jsValue;
    1957         int target = (++vPC)->u.operand;
    1958        
    1959         bool result = jsLess(exec, src1, src2);
    1960         VM_CHECK_EXCEPTION();
    1961        
    1962         if (result) {
    1963             vPC += target;
    1964             CHECK_FOR_TIMEOUT();
    1965             NEXT_OPCODE;
    1966         }
    1967        
    19681919        ++vPC;
    19691920        NEXT_OPCODE;
  • trunk/JavaScriptCore/VM/Machine.h

    r34777 r34781  
    128128
    129129        int m_reentryDepth;
    130 
    131130#if HAVE(COMPUTED_GOTO)
    132131        Opcode m_opcodeTable[numOpcodeIDs]; // Maps OpcodeID => Opcode for compiling
  • trunk/JavaScriptCore/VM/Opcode.h

    r34777 r34781  
    9898        macro(op_jless) \
    9999        macro(op_jmp_scopes) \
    100         macro(op_loop_if_true) \
    101         macro(op_loop_if_less) \
    102100        \
    103101        macro(op_new_func) \
Note: See TracChangeset for help on using the changeset viewer.