Changeset 37422 in webkit for trunk/JavaScriptCore/VM/Machine.cpp


Ignore:
Timestamp:
Oct 8, 2008, 5:20:41 AM (17 years ago)
Author:
Simon Hausmann
Message:

2008-10-08 Prasanth Ullattil <[email protected]>

Reviewed by Oliver Hunt.

Avoid endless loops when compiling without the computed goto
optimization.

NEXT_OPCODE expands to "continue", which will not work inside
loops.

File:
1 edited

Legend:

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

    r37417 r37422  
    15041504    NEXT_OPCODE;
    15051505#else
    1506     #define NEXT_OPCODE MACHINE_SAMPLING_sample(this->codeBlock(r), vPC); continue
     1506    #define NEXT_OPCODE MACHINE_SAMPLING_sample(this->codeBlock(r), vPC); goto interpreterLoopStart
    15071507#if DUMP_OPCODE_STATS
    15081508    #define BEGIN_OPCODE(opcode) case opcode: OpcodeStats::recordInstruction(opcode);
     
    15101510    #define BEGIN_OPCODE(opcode) case opcode:
    15111511#endif
    1512     while (1) // iterator loop begins
     1512    while (1) { // iterator loop begins
     1513    interpreterLoopStart:;
    15131514    switch (vPC->u.opcode)
    15141515#endif
     
    39143915    }
    39153916    }
     3917#if !HAVE(COMPUTED_GOTO)
     3918    } // iterator loop ends
     3919#endif
    39163920    #undef NEXT_OPCODE
    39173921    #undef BEGIN_OPCODE
Note: See TracChangeset for help on using the changeset viewer.