Ignore:
Timestamp:
Jun 24, 2008, 2:19:56 PM (17 years ago)
Author:
[email protected]
Message:

Groundwork for reimplementing the slow script dialog

Reviewed by Cameron.

Add special loop opcodes as groundwork for slow script
termination. Also added a few assertions to prevent us
from accidentally coalescing conditional jump operands
in a way that might bypass the slow script opcodes.

File:
1 edited

Legend:

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

    r34758 r34777  
    421421PassRefPtr<LabelID> CodeGenerator::emitJump(LabelID* target)
    422422{
     423    ASSERT(target->isForwardLabel());
    423424    emitOpcode(op_jmp);
    424425    instructions().append(target->offsetFrom(instructions().size()));
     
    437438        if (cond->index() == dstIndex) {
    438439            rewindBinaryOp();
    439             emitOpcode(op_jless);
     440            emitOpcode(target->isForwardLabel() ? op_jless : op_loop_if_less);
    440441            instructions().append(src1Index);
    441442            instructions().append(src2Index);
     
    450451PassRefPtr<LabelID> CodeGenerator::emitJumpIfTrue(RegisterID* cond, LabelID* target)
    451452{
    452     emitOpcode(op_jtrue);
     453    emitOpcode(target->isForwardLabel() ? op_jtrue : op_loop_if_true);
    453454    instructions().append(cond->index());
    454455    instructions().append(target->offsetFrom(instructions().size()));
     
    458459PassRefPtr<LabelID> CodeGenerator::emitJumpIfFalse(RegisterID* cond, LabelID* target)
    459460{
     461    ASSERT(target->isForwardLabel());
    460462    emitOpcode(op_jfalse);
    461463    instructions().append(cond->index());
     
    10321034{
    10331035    ASSERT(scopeDepth() - targetScopeDepth >= 0);
     1036    ASSERT(target->isForwardLabel());
    10341037
    10351038    size_t scopeDelta = scopeDepth() - targetScopeDepth;
Note: See TracChangeset for help on using the changeset viewer.