Ignore:
Timestamp:
Oct 9, 2009, 5:30:49 PM (16 years ago)
Author:
[email protected]
Message:

Eliminated some legacy bytecode weirdness.

Patch by Geoffrey Garen <[email protected]> on 2009-10-09
Reviewed by Oliver Hunt.

Use vPC[x] subscripting instead of ++vPC to access instruction operands.
This is simpler, and often more efficient.

To support this, and to remove use of hard-coded offsets in bytecode and
JIT code generation and dumping, calculate jump offsets from the beginning
of an instruction, rather than the middle or end.

Also, use OPCODE_LENGTH instead of hard-coded constants for the sizes of
opcodes.

SunSpider reports no change in JIT mode, and a 1.01x speedup in Interpreter
mode.

  • bytecode/CodeBlock.cpp:

(JSC::printConditionalJump):
(JSC::CodeBlock::dump):

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::emitJump):
(JSC::BytecodeGenerator::emitJumpIfTrue):
(JSC::BytecodeGenerator::emitJumpIfFalse):
(JSC::BytecodeGenerator::emitJumpIfNotFunctionCall):
(JSC::BytecodeGenerator::emitJumpIfNotFunctionApply):
(JSC::BytecodeGenerator::emitComplexJumpScopes):
(JSC::BytecodeGenerator::emitJumpScopes):
(JSC::BytecodeGenerator::emitNextPropertyName):
(JSC::BytecodeGenerator::emitCatch):
(JSC::BytecodeGenerator::emitJumpSubroutine):
(JSC::prepareJumpTableForImmediateSwitch):
(JSC::prepareJumpTableForCharacterSwitch):
(JSC::prepareJumpTableForStringSwitch):
(JSC::BytecodeGenerator::endSwitch):

  • bytecompiler/Label.h:

(JSC::Label::setLocation):
(JSC::Label::bind):

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::resolve):
(JSC::Interpreter::resolveSkip):
(JSC::Interpreter::resolveGlobal):
(JSC::Interpreter::resolveBase):
(JSC::Interpreter::resolveBaseAndProperty):
(JSC::Interpreter::createExceptionScope):
(JSC::Interpreter::privateExecute):

  • interpreter/Interpreter.h:
  • jit/JIT.cpp:

(JSC::JIT::privateCompile):

  • jit/JITArithmetic.cpp:

(JSC::JIT::emit_op_jnless):
(JSC::JIT::emitSlow_op_jnless):
(JSC::JIT::emit_op_jnlesseq):
(JSC::JIT::emitSlow_op_jnlesseq):
(JSC::JIT::emitBinaryDoubleOp):

  • jit/JITOpcodes.cpp:

(JSC::JIT::emit_op_jmp):
(JSC::JIT::emit_op_loop):
(JSC::JIT::emit_op_loop_if_less):
(JSC::JIT::emitSlow_op_loop_if_less):
(JSC::JIT::emit_op_loop_if_lesseq):
(JSC::JIT::emitSlow_op_loop_if_lesseq):
(JSC::JIT::emit_op_loop_if_true):
(JSC::JIT::emitSlow_op_loop_if_true):
(JSC::JIT::emit_op_jfalse):
(JSC::JIT::emitSlow_op_jfalse):
(JSC::JIT::emit_op_jtrue):
(JSC::JIT::emitSlow_op_jtrue):
(JSC::JIT::emit_op_jeq_null):
(JSC::JIT::emit_op_jneq_null):
(JSC::JIT::emit_op_jneq_ptr):
(JSC::JIT::emit_op_jsr):
(JSC::JIT::emit_op_next_pname):
(JSC::JIT::emit_op_jmp_scopes):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/interpreter/Interpreter.cpp

    r48905 r49409  
    9292NEVER_INLINE bool Interpreter::resolve(CallFrame* callFrame, Instruction* vPC, JSValue& exceptionValue)
    9393{
    94     int dst = (vPC + 1)->u.operand;
    95     int property = (vPC + 2)->u.operand;
     94    int dst = vPC[1].u.operand;
     95    int property = vPC[2].u.operand;
    9696
    9797    ScopeChainNode* scopeChain = callFrame->scopeChain();
     
    122122    CodeBlock* codeBlock = callFrame->codeBlock();
    123123
    124     int dst = (vPC + 1)->u.operand;
    125     int property = (vPC + 2)->u.operand;
    126     int skip = (vPC + 3)->u.operand + codeBlock->needsFullScopeChain();
     124    int dst = vPC[1].u.operand;
     125    int property = vPC[2].u.operand;
     126    int skip = vPC[3].u.operand + codeBlock->needsFullScopeChain();
    127127
    128128    ScopeChainNode* scopeChain = callFrame->scopeChain();
     
    153153NEVER_INLINE bool Interpreter::resolveGlobal(CallFrame* callFrame, Instruction* vPC, JSValue& exceptionValue)
    154154{
    155     int dst = (vPC + 1)->u.operand;
    156     JSGlobalObject* globalObject = static_cast<JSGlobalObject*>((vPC + 2)->u.jsCell);
     155    int dst = vPC[1].u.operand;
     156    JSGlobalObject* globalObject = static_cast<JSGlobalObject*>(vPC[2].u.jsCell);
    157157    ASSERT(globalObject->isGlobalObject());
    158     int property = (vPC + 3)->u.operand;
    159     Structure* structure = (vPC + 4)->u.structure;
    160     int offset = (vPC + 5)->u.operand;
     158    int property = vPC[3].u.operand;
     159    Structure* structure = vPC[4].u.structure;
     160    int offset = vPC[5].u.operand;
    161161
    162162    if (structure == globalObject->structure()) {
     
    193193NEVER_INLINE void Interpreter::resolveBase(CallFrame* callFrame, Instruction* vPC)
    194194{
    195     int dst = (vPC + 1)->u.operand;
    196     int property = (vPC + 2)->u.operand;
     195    int dst = vPC[1].u.operand;
     196    int property = vPC[2].u.operand;
    197197    callFrame->r(dst) = JSValue(JSC::resolveBase(callFrame, callFrame->codeBlock()->identifier(property), callFrame->scopeChain()));
    198198}
     
    200200NEVER_INLINE bool Interpreter::resolveBaseAndProperty(CallFrame* callFrame, Instruction* vPC, JSValue& exceptionValue)
    201201{
    202     int baseDst = (vPC + 1)->u.operand;
    203     int propDst = (vPC + 2)->u.operand;
    204     int property = (vPC + 3)->u.operand;
     202    int baseDst = vPC[1].u.operand;
     203    int propDst = vPC[2].u.operand;
     204    int property = vPC[3].u.operand;
    205205
    206206    ScopeChainNode* scopeChain = callFrame->scopeChain();
     
    225225            callFrame->r(propDst) = JSValue(result);
    226226            callFrame->r(baseDst) = JSValue(base);
    227             return true;
    228         }
    229         ++iter;
    230     } while (iter != end);
    231 
    232     exceptionValue = createUndefinedVariableError(callFrame, ident, vPC - codeBlock->instructions().begin(), codeBlock);
    233     return false;
    234 }
    235 
    236 NEVER_INLINE bool Interpreter::resolveBaseAndFunc(CallFrame* callFrame, Instruction* vPC, JSValue& exceptionValue)
    237 {
    238     int baseDst = (vPC + 1)->u.operand;
    239     int funcDst = (vPC + 2)->u.operand;
    240     int property = (vPC + 3)->u.operand;
    241 
    242     ScopeChainNode* scopeChain = callFrame->scopeChain();
    243     ScopeChainIterator iter = scopeChain->begin();
    244     ScopeChainIterator end = scopeChain->end();
    245 
    246     // FIXME: add scopeDepthIsZero optimization
    247 
    248     ASSERT(iter != end);
    249 
    250     CodeBlock* codeBlock = callFrame->codeBlock();
    251     Identifier& ident = codeBlock->identifier(property);
    252     JSObject* base;
    253     do {
    254         base = *iter;
    255         PropertySlot slot(base);
    256         if (base->getPropertySlot(callFrame, ident, slot)) {           
    257             // ECMA 11.2.3 says that if we hit an activation the this value should be null.
    258             // However, section 10.2.3 says that in the case where the value provided
    259             // by the caller is null, the global object should be used. It also says
    260             // that the section does not apply to internal functions, but for simplicity
    261             // of implementation we use the global object anyway here. This guarantees
    262             // that in host objects you always get a valid object for this.
    263             // We also handle wrapper substitution for the global object at the same time.
    264             JSObject* thisObj = base->toThisObject(callFrame);
    265             JSValue result = slot.getValue(callFrame, ident);
    266             exceptionValue = callFrame->globalData().exception;
    267             if (exceptionValue)
    268                 return false;
    269 
    270             callFrame->r(baseDst) = JSValue(thisObj);
    271             callFrame->r(funcDst) = JSValue(result);
    272227            return true;
    273228        }
     
    929884NEVER_INLINE ScopeChainNode* Interpreter::createExceptionScope(CallFrame* callFrame, const Instruction* vPC)
    930885{
    931     int dst = (++vPC)->u.operand;
     886    int dst = vPC[1].u.operand;
    932887    CodeBlock* codeBlock = callFrame->codeBlock();
    933     Identifier& property = codeBlock->identifier((++vPC)->u.operand);
    934     JSValue value = callFrame->r((++vPC)->u.operand).jsValue();
     888    Identifier& property = codeBlock->identifier(vPC[2].u.operand);
     889    JSValue value = callFrame->r(vPC[3].u.operand).jsValue();
    935890    JSObject* scope = new (callFrame) JSStaticScopeObject(callFrame, property, value, DontDelete);
    936891    callFrame->r(dst) = JSValue(scope);
     
    12141169           constructor, and puts the result in register dst.
    12151170        */
    1216         int dst = (++vPC)->u.operand;
     1171        int dst = vPC[1].u.operand;
    12171172        callFrame->r(dst) = JSValue(constructEmptyObject(callFrame));
    12181173
    1219         ++vPC;
     1174        vPC += OPCODE_LENGTH(op_new_object);
    12201175        NEXT_INSTRUCTION();
    12211176    }
     
    12281183           taken from registers starting at register firstArg.
    12291184        */
    1230         int dst = (++vPC)->u.operand;
    1231         int firstArg = (++vPC)->u.operand;
    1232         int argCount = (++vPC)->u.operand;
     1185        int dst = vPC[1].u.operand;
     1186        int firstArg = vPC[2].u.operand;
     1187        int argCount = vPC[3].u.operand;
    12331188        ArgList args(callFrame->registers() + firstArg, argCount);
    12341189        callFrame->r(dst) = JSValue(constructArray(callFrame, args));
    12351190
    1236         ++vPC;
     1191        vPC += OPCODE_LENGTH(op_new_array);
    12371192        NEXT_INSTRUCTION();
    12381193    }
     
    12441199           register dst.
    12451200        */
    1246         int dst = (++vPC)->u.operand;
    1247         int regExp = (++vPC)->u.operand;
     1201        int dst = vPC[1].u.operand;
     1202        int regExp = vPC[2].u.operand;
    12481203        callFrame->r(dst) = JSValue(new (globalData) RegExpObject(callFrame->scopeChain()->globalObject->regExpStructure(), callFrame->codeBlock()->regexp(regExp)));
    12491204
    1250         ++vPC;
     1205        vPC += OPCODE_LENGTH(op_new_regexp);
    12511206        NEXT_INSTRUCTION();
    12521207    }
     
    12561211           Copies register src to register dst.
    12571212        */
    1258         int dst = (++vPC)->u.operand;
    1259         int src = (++vPC)->u.operand;
     1213        int dst = vPC[1].u.operand;
     1214        int src = vPC[2].u.operand;
    12601215        callFrame->r(dst) = callFrame->r(src);
    12611216
    1262         ++vPC;
     1217        vPC += OPCODE_LENGTH(op_mov);
    12631218        NEXT_INSTRUCTION();
    12641219    }
     
    12701225           as a boolean in register dst.
    12711226        */
    1272         int dst = (++vPC)->u.operand;
    1273         JSValue src1 = callFrame->r((++vPC)->u.operand).jsValue();
    1274         JSValue src2 = callFrame->r((++vPC)->u.operand).jsValue();
     1227        int dst = vPC[1].u.operand;
     1228        JSValue src1 = callFrame->r(vPC[2].u.operand).jsValue();
     1229        JSValue src2 = callFrame->r(vPC[3].u.operand).jsValue();
    12751230        if (src1.isInt32() && src2.isInt32())
    12761231            callFrame->r(dst) = jsBoolean(src1.asInt32() == src2.asInt32());
     
    12811236        }
    12821237
    1283         ++vPC;
     1238        vPC += OPCODE_LENGTH(op_eq);
    12841239        NEXT_INSTRUCTION();
    12851240    }
     
    12901245           operator, and puts the result as a boolean in register dst.
    12911246        */
    1292         int dst = (++vPC)->u.operand;
    1293         JSValue src = callFrame->r((++vPC)->u.operand).jsValue();
     1247        int dst = vPC[1].u.operand;
     1248        JSValue src = callFrame->r(vPC[2].u.operand).jsValue();
    12941249
    12951250        if (src.isUndefinedOrNull()) {
    12961251            callFrame->r(dst) = jsBoolean(true);
    1297             ++vPC;
     1252            vPC += OPCODE_LENGTH(op_eq_null);
    12981253            NEXT_INSTRUCTION();
    12991254        }
    13001255       
    13011256        callFrame->r(dst) = jsBoolean(src.isCell() && src.asCell()->structure()->typeInfo().masqueradesAsUndefined());
    1302         ++vPC;
     1257        vPC += OPCODE_LENGTH(op_eq_null);
    13031258        NEXT_INSTRUCTION();
    13041259    }
     
    13101265           result as a boolean in register dst.
    13111266        */
    1312         int dst = (++vPC)->u.operand;
    1313         JSValue src1 = callFrame->r((++vPC)->u.operand).jsValue();
    1314         JSValue src2 = callFrame->r((++vPC)->u.operand).jsValue();
     1267        int dst = vPC[1].u.operand;
     1268        JSValue src1 = callFrame->r(vPC[2].u.operand).jsValue();
     1269        JSValue src2 = callFrame->r(vPC[3].u.operand).jsValue();
    13151270        if (src1.isInt32() && src2.isInt32())
    13161271            callFrame->r(dst) = jsBoolean(src1.asInt32() != src2.asInt32());
     
    13211276        }
    13221277
    1323         ++vPC;
     1278        vPC += OPCODE_LENGTH(op_neq);
    13241279        NEXT_INSTRUCTION();
    13251280    }
     
    13301285           operator, and puts the result as a boolean in register dst.
    13311286        */
    1332         int dst = (++vPC)->u.operand;
    1333         JSValue src = callFrame->r((++vPC)->u.operand).jsValue();
     1287        int dst = vPC[1].u.operand;
     1288        JSValue src = callFrame->r(vPC[2].u.operand).jsValue();
    13341289
    13351290        if (src.isUndefinedOrNull()) {
    13361291            callFrame->r(dst) = jsBoolean(false);
    1337             ++vPC;
     1292            vPC += OPCODE_LENGTH(op_neq_null);
    13381293            NEXT_INSTRUCTION();
    13391294        }
    13401295       
    13411296        callFrame->r(dst) = jsBoolean(!src.isCell() || !asCell(src)->structure()->typeInfo().masqueradesAsUndefined());
    1342         ++vPC;
     1297        vPC += OPCODE_LENGTH(op_neq_null);
    13431298        NEXT_INSTRUCTION();
    13441299    }
     
    13501305           result as a boolean in register dst.
    13511306        */
    1352         int dst = (++vPC)->u.operand;
    1353         JSValue src1 = callFrame->r((++vPC)->u.operand).jsValue();
    1354         JSValue src2 = callFrame->r((++vPC)->u.operand).jsValue();
     1307        int dst = vPC[1].u.operand;
     1308        JSValue src1 = callFrame->r(vPC[2].u.operand).jsValue();
     1309        JSValue src2 = callFrame->r(vPC[3].u.operand).jsValue();
    13551310        callFrame->r(dst) = jsBoolean(JSValue::strictEqual(src1, src2));
    13561311
    1357         ++vPC;
     1312        vPC += OPCODE_LENGTH(op_stricteq);
    13581313        NEXT_INSTRUCTION();
    13591314    }
     
    13651320           puts the result as a boolean in register dst.
    13661321        */
    1367         int dst = (++vPC)->u.operand;
    1368         JSValue src1 = callFrame->r((++vPC)->u.operand).jsValue();
    1369         JSValue src2 = callFrame->r((++vPC)->u.operand).jsValue();
     1322        int dst = vPC[1].u.operand;
     1323        JSValue src1 = callFrame->r(vPC[2].u.operand).jsValue();
     1324        JSValue src2 = callFrame->r(vPC[3].u.operand).jsValue();
    13701325        callFrame->r(dst) = jsBoolean(!JSValue::strictEqual(src1, src2));
    13711326
    1372         ++vPC;
     1327        vPC += OPCODE_LENGTH(op_nstricteq);
    13731328        NEXT_INSTRUCTION();
    13741329    }
     
    13801335           a boolean in register dst.
    13811336        */
    1382         int dst = (++vPC)->u.operand;
    1383         JSValue src1 = callFrame->r((++vPC)->u.operand).jsValue();
    1384         JSValue src2 = callFrame->r((++vPC)->u.operand).jsValue();
     1337        int dst = vPC[1].u.operand;
     1338        JSValue src1 = callFrame->r(vPC[2].u.operand).jsValue();
     1339        JSValue src2 = callFrame->r(vPC[3].u.operand).jsValue();
    13851340        JSValue result = jsBoolean(jsLess(callFrame, src1, src2));
    13861341        CHECK_FOR_EXCEPTION();
    13871342        callFrame->r(dst) = result;
    13881343
    1389         ++vPC;
     1344        vPC += OPCODE_LENGTH(op_less);
    13901345        NEXT_INSTRUCTION();
    13911346    }
     
    13971352           puts the result as a boolean in register dst.
    13981353        */
    1399         int dst = (++vPC)->u.operand;
    1400         JSValue src1 = callFrame->r((++vPC)->u.operand).jsValue();
    1401         JSValue src2 = callFrame->r((++vPC)->u.operand).jsValue();
     1354        int dst = vPC[1].u.operand;
     1355        JSValue src1 = callFrame->r(vPC[2].u.operand).jsValue();
     1356        JSValue src2 = callFrame->r(vPC[3].u.operand).jsValue();
    14021357        JSValue result = jsBoolean(jsLessEq(callFrame, src1, src2));
    14031358        CHECK_FOR_EXCEPTION();
    14041359        callFrame->r(dst) = result;
    14051360
    1406         ++vPC;
     1361        vPC += OPCODE_LENGTH(op_lesseq);
    14071362        NEXT_INSTRUCTION();
    14081363    }
     
    14131368           back in register srcDst.
    14141369        */
    1415         int srcDst = (++vPC)->u.operand;
     1370        int srcDst = vPC[1].u.operand;
    14161371        JSValue v = callFrame->r(srcDst).jsValue();
    14171372        if (v.isInt32() && v.asInt32() < INT_MAX)
     
    14231378        }
    14241379
    1425         ++vPC;
     1380        vPC += OPCODE_LENGTH(op_pre_inc);
    14261381        NEXT_INSTRUCTION();
    14271382    }
     
    14321387           back in register srcDst.
    14331388        */
    1434         int srcDst = (++vPC)->u.operand;
     1389        int srcDst = vPC[1].u.operand;
    14351390        JSValue v = callFrame->r(srcDst).jsValue();
    14361391        if (v.isInt32() && v.asInt32() > INT_MIN)
     
    14421397        }
    14431398
    1444         ++vPC;
     1399        vPC += OPCODE_LENGTH(op_pre_dec);
    14451400        NEXT_INSTRUCTION();
    14461401    }
     
    14521407           back to register srcDst.
    14531408        */
    1454         int dst = (++vPC)->u.operand;
    1455         int srcDst = (++vPC)->u.operand;
     1409        int dst = vPC[1].u.operand;
     1410        int srcDst = vPC[2].u.operand;
    14561411        JSValue v = callFrame->r(srcDst).jsValue();
    14571412        if (v.isInt32() && v.asInt32() < INT_MAX) {
     
    14651420        }
    14661421
    1467         ++vPC;
     1422        vPC += OPCODE_LENGTH(op_post_inc);
    14681423        NEXT_INSTRUCTION();
    14691424    }
     
    14751430           back to register srcDst.
    14761431        */
    1477         int dst = (++vPC)->u.operand;
    1478         int srcDst = (++vPC)->u.operand;
     1432        int dst = vPC[1].u.operand;
     1433        int srcDst = vPC[2].u.operand;
    14791434        JSValue v = callFrame->r(srcDst).jsValue();
    14801435        if (v.isInt32() && v.asInt32() > INT_MIN) {
     
    14881443        }
    14891444
    1490         ++vPC;
     1445        vPC += OPCODE_LENGTH(op_post_dec);
    14911446        NEXT_INSTRUCTION();
    14921447    }
     
    14971452           in register dst.
    14981453        */
    1499         int dst = (++vPC)->u.operand;
    1500         int src = (++vPC)->u.operand;
     1454        int dst = vPC[1].u.operand;
     1455        int src = vPC[2].u.operand;
    15011456
    15021457        JSValue srcVal = callFrame->r(src).jsValue();
     
    15101465        }
    15111466
    1512         ++vPC;
     1467        vPC += OPCODE_LENGTH(op_to_jsnumber);
    15131468        NEXT_INSTRUCTION();
    15141469    }
     
    15191474           result in register dst.
    15201475        */
    1521         int dst = (++vPC)->u.operand;
    1522         JSValue src = callFrame->r((++vPC)->u.operand).jsValue();
     1476        int dst = vPC[1].u.operand;
     1477        JSValue src = callFrame->r(vPC[2].u.operand).jsValue();
    15231478        if (src.isInt32() && src.asInt32())
    15241479            callFrame->r(dst) = jsNumber(callFrame, -src.asInt32());
     
    15291484        }
    15301485
    1531         ++vPC;
     1486        vPC += OPCODE_LENGTH(op_negate);
    15321487        NEXT_INSTRUCTION();
    15331488    }
     
    15391494           numeric add, depending on the types of the operands.)
    15401495        */
    1541         int dst = (++vPC)->u.operand;
    1542         JSValue src1 = callFrame->r((++vPC)->u.operand).jsValue();
    1543         JSValue src2 = callFrame->r((++vPC)->u.operand).jsValue();
     1496        int dst = vPC[1].u.operand;
     1497        JSValue src1 = callFrame->r(vPC[2].u.operand).jsValue();
     1498        JSValue src2 = callFrame->r(vPC[3].u.operand).jsValue();
    15441499        if (src1.isInt32() && src2.isInt32() && !(src1.asInt32() | src2.asInt32() & 0xc0000000)) // no overflow
    15451500            callFrame->r(dst) = jsNumber(callFrame, src1.asInt32() + src2.asInt32());
     
    15491504            callFrame->r(dst) = result;
    15501505        }
    1551         vPC += 2;
     1506        vPC += OPCODE_LENGTH(op_add);
    15521507        NEXT_INSTRUCTION();
    15531508    }
     
    15581513           numbers), and puts the product in register dst.
    15591514        */
    1560         int dst = (++vPC)->u.operand;
    1561         JSValue src1 = callFrame->r((++vPC)->u.operand).jsValue();
    1562         JSValue src2 = callFrame->r((++vPC)->u.operand).jsValue();
     1515        int dst = vPC[1].u.operand;
     1516        JSValue src1 = callFrame->r(vPC[2].u.operand).jsValue();
     1517        JSValue src2 = callFrame->r(vPC[3].u.operand).jsValue();
    15631518        if (src1.isInt32() && src2.isInt32() && !(src1.asInt32() | src2.asInt32() >> 15)) // no overflow
    15641519                callFrame->r(dst) = jsNumber(callFrame, src1.asInt32() * src2.asInt32());
     
    15691524        }
    15701525
    1571         vPC += 2;
     1526        vPC += OPCODE_LENGTH(op_mul);
    15721527        NEXT_INSTRUCTION();
    15731528    }
     
    15791534           quotient in register dst.
    15801535        */
    1581         int dst = (++vPC)->u.operand;
    1582         JSValue dividend = callFrame->r((++vPC)->u.operand).jsValue();
    1583         JSValue divisor = callFrame->r((++vPC)->u.operand).jsValue();
     1536        int dst = vPC[1].u.operand;
     1537        JSValue dividend = callFrame->r(vPC[2].u.operand).jsValue();
     1538        JSValue divisor = callFrame->r(vPC[3].u.operand).jsValue();
    15841539
    15851540        JSValue result = jsNumber(callFrame, dividend.toNumber(callFrame) / divisor.toNumber(callFrame));
     
    15871542        callFrame->r(dst) = result;
    15881543
    1589         vPC += 2;
     1544        vPC += OPCODE_LENGTH(op_div);
    15901545        NEXT_INSTRUCTION();
    15911546    }
     
    15971552           remainder in register dst.
    15981553        */
    1599         int dst = (++vPC)->u.operand;
    1600         JSValue dividend = callFrame->r((++vPC)->u.operand).jsValue();
    1601         JSValue divisor = callFrame->r((++vPC)->u.operand).jsValue();
     1554        int dst = vPC[1].u.operand;
     1555        JSValue dividend = callFrame->r(vPC[2].u.operand).jsValue();
     1556        JSValue divisor = callFrame->r(vPC[3].u.operand).jsValue();
    16021557
    16031558        if (dividend.isInt32() && divisor.isInt32() && divisor.asInt32() != 0) {
     
    16051560            ASSERT(result);
    16061561            callFrame->r(dst) = result;
    1607             ++vPC;
     1562            vPC += OPCODE_LENGTH(op_mod);
    16081563            NEXT_INSTRUCTION();
    16091564        }
     
    16161571        CHECK_FOR_EXCEPTION();
    16171572        callFrame->r(dst) = result;
    1618         ++vPC;
     1573        vPC += OPCODE_LENGTH(op_mod);
    16191574        NEXT_INSTRUCTION();
    16201575    }
     
    16261581           register dst.
    16271582        */
    1628         int dst = (++vPC)->u.operand;
    1629         JSValue src1 = callFrame->r((++vPC)->u.operand).jsValue();
    1630         JSValue src2 = callFrame->r((++vPC)->u.operand).jsValue();
     1583        int dst = vPC[1].u.operand;
     1584        JSValue src1 = callFrame->r(vPC[2].u.operand).jsValue();
     1585        JSValue src2 = callFrame->r(vPC[3].u.operand).jsValue();
    16311586        if (src1.isInt32() && src2.isInt32() && !(src1.asInt32() | src2.asInt32() & 0xc0000000)) // no overflow
    16321587            callFrame->r(dst) = jsNumber(callFrame, src1.asInt32() - src2.asInt32());
     
    16361591            callFrame->r(dst) = result;
    16371592        }
    1638         vPC += 2;
     1593        vPC += OPCODE_LENGTH(op_sub);
    16391594        NEXT_INSTRUCTION();
    16401595    }
     
    16461601           in register dst.
    16471602        */
    1648         int dst = (++vPC)->u.operand;
    1649         JSValue val = callFrame->r((++vPC)->u.operand).jsValue();
    1650         JSValue shift = callFrame->r((++vPC)->u.operand).jsValue();
     1603        int dst = vPC[1].u.operand;
     1604        JSValue val = callFrame->r(vPC[2].u.operand).jsValue();
     1605        JSValue shift = callFrame->r(vPC[3].u.operand).jsValue();
    16511606
    16521607        if (val.isInt32() && shift.isInt32())
     
    16581613        }
    16591614
    1660         ++vPC;
     1615        vPC += OPCODE_LENGTH(op_lshift);
    16611616        NEXT_INSTRUCTION();
    16621617    }
     
    16681623           uint32), and puts the result in register dst.
    16691624        */
    1670         int dst = (++vPC)->u.operand;
    1671         JSValue val = callFrame->r((++vPC)->u.operand).jsValue();
    1672         JSValue shift = callFrame->r((++vPC)->u.operand).jsValue();
     1625        int dst = vPC[1].u.operand;
     1626        JSValue val = callFrame->r(vPC[2].u.operand).jsValue();
     1627        JSValue shift = callFrame->r(vPC[3].u.operand).jsValue();
    16731628
    16741629        if (val.isInt32() && shift.isInt32())
     
    16801635        }
    16811636
    1682         ++vPC;
     1637        vPC += OPCODE_LENGTH(op_rshift);
    16831638        NEXT_INSTRUCTION();
    16841639    }
     
    16901645           uint32), and puts the result in register dst.
    16911646        */
    1692         int dst = (++vPC)->u.operand;
    1693         JSValue val = callFrame->r((++vPC)->u.operand).jsValue();
    1694         JSValue shift = callFrame->r((++vPC)->u.operand).jsValue();
     1647        int dst = vPC[1].u.operand;
     1648        JSValue val = callFrame->r(vPC[2].u.operand).jsValue();
     1649        JSValue shift = callFrame->r(vPC[3].u.operand).jsValue();
    16951650        if (val.isUInt32() && shift.isInt32())
    16961651            callFrame->r(dst) = jsNumber(callFrame, val.asInt32() >> (shift.asInt32() & 0x1f));
     
    17011656        }
    17021657
    1703         ++vPC;
     1658        vPC += OPCODE_LENGTH(op_urshift);
    17041659        NEXT_INSTRUCTION();
    17051660    }
     
    17111666           in register dst.
    17121667        */
    1713         int dst = (++vPC)->u.operand;
    1714         JSValue src1 = callFrame->r((++vPC)->u.operand).jsValue();
    1715         JSValue src2 = callFrame->r((++vPC)->u.operand).jsValue();
     1668        int dst = vPC[1].u.operand;
     1669        JSValue src1 = callFrame->r(vPC[2].u.operand).jsValue();
     1670        JSValue src2 = callFrame->r(vPC[3].u.operand).jsValue();
    17161671        if (src1.isInt32() && src2.isInt32())
    17171672            callFrame->r(dst) = jsNumber(callFrame, src1.asInt32() & src2.asInt32());
     
    17221677        }
    17231678
    1724         vPC += 2;
     1679        vPC += OPCODE_LENGTH(op_bitand);
    17251680        NEXT_INSTRUCTION();
    17261681    }
     
    17321687           in register dst.
    17331688        */
    1734         int dst = (++vPC)->u.operand;
    1735         JSValue src1 = callFrame->r((++vPC)->u.operand).jsValue();
    1736         JSValue src2 = callFrame->r((++vPC)->u.operand).jsValue();
     1689        int dst = vPC[1].u.operand;
     1690        JSValue src1 = callFrame->r(vPC[2].u.operand).jsValue();
     1691        JSValue src2 = callFrame->r(vPC[3].u.operand).jsValue();
    17371692        if (src1.isInt32() && src2.isInt32())
    17381693            callFrame->r(dst) = jsNumber(callFrame, src1.asInt32() ^ src2.asInt32());
     
    17431698        }
    17441699
    1745         vPC += 2;
     1700        vPC += OPCODE_LENGTH(op_bitxor);
    17461701        NEXT_INSTRUCTION();
    17471702    }
     
    17531708           result in register dst.
    17541709        */
    1755         int dst = (++vPC)->u.operand;
    1756         JSValue src1 = callFrame->r((++vPC)->u.operand).jsValue();
    1757         JSValue src2 = callFrame->r((++vPC)->u.operand).jsValue();
     1710        int dst = vPC[1].u.operand;
     1711        JSValue src1 = callFrame->r(vPC[2].u.operand).jsValue();
     1712        JSValue src2 = callFrame->r(vPC[3].u.operand).jsValue();
    17581713        if (src1.isInt32() && src2.isInt32())
    17591714            callFrame->r(dst) = jsNumber(callFrame, src1.asInt32() | src2.asInt32());
     
    17641719        }
    17651720
    1766         vPC += 2;
     1721        vPC += OPCODE_LENGTH(op_bitor);
    17671722        NEXT_INSTRUCTION();
    17681723    }
     
    17731728           and puts the result in register dst.
    17741729        */
    1775         int dst = (++vPC)->u.operand;
    1776         JSValue src = callFrame->r((++vPC)->u.operand).jsValue();
     1730        int dst = vPC[1].u.operand;
     1731        JSValue src = callFrame->r(vPC[2].u.operand).jsValue();
    17771732        if (src.isInt32())
    17781733            callFrame->r(dst) = jsNumber(callFrame, ~src.asInt32());
     
    17821737            callFrame->r(dst) = result;
    17831738        }
    1784         ++vPC;
     1739        vPC += OPCODE_LENGTH(op_bitnot);
    17851740        NEXT_INSTRUCTION();
    17861741    }
     
    17911746           boolean), and puts the result in register dst.
    17921747        */
    1793         int dst = (++vPC)->u.operand;
    1794         int src = (++vPC)->u.operand;
     1748        int dst = vPC[1].u.operand;
     1749        int src = vPC[2].u.operand;
    17951750        JSValue result = jsBoolean(!callFrame->r(src).jsValue().toBoolean(callFrame));
    17961751        CHECK_FOR_EXCEPTION();
    17971752        callFrame->r(dst) = result;
    17981753
    1799         ++vPC;
     1754        vPC += OPCODE_LENGTH(op_not);
    18001755        NEXT_INSTRUCTION();
    18011756    }
     
    18271782        callFrame->r(dst) = jsBoolean(result);
    18281783
    1829         vPC += 5;
     1784        vPC += OPCODE_LENGTH(op_instanceof);
    18301785        NEXT_INSTRUCTION();
    18311786    }
     
    18361791           rules, and puts the result in register dst.
    18371792        */
    1838         int dst = (++vPC)->u.operand;
    1839         int src = (++vPC)->u.operand;
     1793        int dst = vPC[1].u.operand;
     1794        int src = vPC[2].u.operand;
    18401795        callFrame->r(dst) = JSValue(jsTypeStringForValue(callFrame, callFrame->r(src).jsValue()));
    18411796
    1842         ++vPC;
     1797        vPC += OPCODE_LENGTH(op_typeof);
    18431798        NEXT_INSTRUCTION();
    18441799    }
     
    18501805           in register dst.
    18511806        */
    1852         int dst = (++vPC)->u.operand;
    1853         int src = (++vPC)->u.operand;
     1807        int dst = vPC[1].u.operand;
     1808        int src = vPC[2].u.operand;
    18541809        JSValue v = callFrame->r(src).jsValue();
    18551810        callFrame->r(dst) = jsBoolean(v.isCell() ? v.asCell()->structure()->typeInfo().masqueradesAsUndefined() : v.isUndefined());
    18561811
    1857         ++vPC;
     1812        vPC += OPCODE_LENGTH(op_is_undefined);
    18581813        NEXT_INSTRUCTION();
    18591814    }
     
    18651820           in register dst.
    18661821        */
    1867         int dst = (++vPC)->u.operand;
    1868         int src = (++vPC)->u.operand;
     1822        int dst = vPC[1].u.operand;
     1823        int src = vPC[2].u.operand;
    18691824        callFrame->r(dst) = jsBoolean(callFrame->r(src).jsValue().isBoolean());
    18701825
    1871         ++vPC;
     1826        vPC += OPCODE_LENGTH(op_is_boolean);
    18721827        NEXT_INSTRUCTION();
    18731828    }
     
    18791834           in register dst.
    18801835        */
    1881         int dst = (++vPC)->u.operand;
    1882         int src = (++vPC)->u.operand;
     1836        int dst = vPC[1].u.operand;
     1837        int src = vPC[2].u.operand;
    18831838        callFrame->r(dst) = jsBoolean(callFrame->r(src).jsValue().isNumber());
    18841839
    1885         ++vPC;
     1840        vPC += OPCODE_LENGTH(op_is_number);
    18861841        NEXT_INSTRUCTION();
    18871842    }
     
    18931848           in register dst.
    18941849        */
    1895         int dst = (++vPC)->u.operand;
    1896         int src = (++vPC)->u.operand;
     1850        int dst = vPC[1].u.operand;
     1851        int src = vPC[2].u.operand;
    18971852        callFrame->r(dst) = jsBoolean(callFrame->r(src).jsValue().isString());
    18981853
    1899         ++vPC;
     1854        vPC += OPCODE_LENGTH(op_is_string);
    19001855        NEXT_INSTRUCTION();
    19011856    }
     
    19071862           in register dst.
    19081863        */
    1909         int dst = (++vPC)->u.operand;
    1910         int src = (++vPC)->u.operand;
     1864        int dst = vPC[1].u.operand;
     1865        int src = vPC[2].u.operand;
    19111866        callFrame->r(dst) = jsBoolean(jsIsObjectType(callFrame->r(src).jsValue()));
    19121867
    1913         ++vPC;
     1868        vPC += OPCODE_LENGTH(op_is_object);
    19141869        NEXT_INSTRUCTION();
    19151870    }
     
    19211876           in register dst.
    19221877        */
    1923         int dst = (++vPC)->u.operand;
    1924         int src = (++vPC)->u.operand;
     1878        int dst = vPC[1].u.operand;
     1879        int src = vPC[2].u.operand;
    19251880        callFrame->r(dst) = jsBoolean(jsIsFunctionType(callFrame->r(src).jsValue()));
    19261881
    1927         ++vPC;
     1882        vPC += OPCODE_LENGTH(op_is_function);
    19281883        NEXT_INSTRUCTION();
    19291884    }
     
    19371892           object.
    19381893        */
    1939         int dst = (++vPC)->u.operand;
    1940         int property = (++vPC)->u.operand;
    1941         int base = (++vPC)->u.operand;
     1894        int dst = vPC[1].u.operand;
     1895        int property = vPC[2].u.operand;
     1896        int base = vPC[3].u.operand;
    19421897
    19431898        JSValue baseVal = callFrame->r(base).jsValue();
     
    19581913        }
    19591914
    1960         ++vPC;
     1915        vPC += OPCODE_LENGTH(op_in);
    19611916        NEXT_INSTRUCTION();
    19621917    }
     
    19711926            goto vm_throw;
    19721927
    1973         vPC += 3;
     1928        vPC += OPCODE_LENGTH(op_resolve);
    19741929        NEXT_INSTRUCTION();
    19751930    }
     
    19841939            goto vm_throw;
    19851940
    1986         vPC += 4;
     1941        vPC += OPCODE_LENGTH(op_resolve_skip);
    19871942
    19881943        NEXT_INSTRUCTION();
     
    19991954            goto vm_throw;
    20001955       
    2001         vPC += 6;
     1956        vPC += OPCODE_LENGTH(op_resolve_global);
    20021957       
    20031958        NEXT_INSTRUCTION();
     
    20081963           Gets the global var at global slot index and places it in register dst.
    20091964         */
    2010         int dst = (++vPC)->u.operand;
    2011         JSGlobalObject* scope = static_cast<JSGlobalObject*>((++vPC)->u.jsCell);
     1965        int dst = vPC[1].u.operand;
     1966        JSGlobalObject* scope = static_cast<JSGlobalObject*>(vPC[2].u.jsCell);
    20121967        ASSERT(scope->isGlobalObject());
    2013         int index = (++vPC)->u.operand;
     1968        int index = vPC[3].u.operand;
    20141969
    20151970        callFrame->r(dst) = scope->registerAt(index);
    2016         ++vPC;
     1971        vPC += OPCODE_LENGTH(op_get_global_var);
    20171972        NEXT_INSTRUCTION();
    20181973    }
     
    20221977           Puts value into global slot index.
    20231978         */
    2024         JSGlobalObject* scope = static_cast<JSGlobalObject*>((++vPC)->u.jsCell);
     1979        JSGlobalObject* scope = static_cast<JSGlobalObject*>(vPC[1].u.jsCell);
    20251980        ASSERT(scope->isGlobalObject());
    2026         int index = (++vPC)->u.operand;
    2027         int value = (++vPC)->u.operand;
     1981        int index = vPC[2].u.operand;
     1982        int value = vPC[3].u.operand;
    20281983       
    20291984        scope->registerAt(index) = JSValue(callFrame->r(value).jsValue());
    2030         ++vPC;
     1985        vPC += OPCODE_LENGTH(op_put_global_var);
    20311986        NEXT_INSTRUCTION();
    20321987    }           
     
    20371992         the top of the scope chain, and places it in register dst
    20381993         */
    2039         int dst = (++vPC)->u.operand;
    2040         int index = (++vPC)->u.operand;
    2041         int skip = (++vPC)->u.operand + callFrame->codeBlock()->needsFullScopeChain();
     1994        int dst = vPC[1].u.operand;
     1995        int index = vPC[2].u.operand;
     1996        int skip = vPC[3].u.operand + callFrame->codeBlock()->needsFullScopeChain();
    20421997
    20431998        ScopeChainNode* scopeChain = callFrame->scopeChain();
     
    20532008        JSVariableObject* scope = static_cast<JSVariableObject*>(*iter);
    20542009        callFrame->r(dst) = scope->registerAt(index);
    2055         ++vPC;
     2010        vPC += OPCODE_LENGTH(op_get_scoped_var);
    20562011        NEXT_INSTRUCTION();
    20572012    }
     
    20602015
    20612016         */
    2062         int index = (++vPC)->u.operand;
    2063         int skip = (++vPC)->u.operand + callFrame->codeBlock()->needsFullScopeChain();
    2064         int value = (++vPC)->u.operand;
     2017        int index = vPC[1].u.operand;
     2018        int skip = vPC[2].u.operand + callFrame->codeBlock()->needsFullScopeChain();
     2019        int value = vPC[3].u.operand;
    20652020
    20662021        ScopeChainNode* scopeChain = callFrame->scopeChain();
     
    20762031        JSVariableObject* scope = static_cast<JSVariableObject*>(*iter);
    20772032        scope->registerAt(index) = JSValue(callFrame->r(value).jsValue());
    2078         ++vPC;
     2033        vPC += OPCODE_LENGTH(op_put_scoped_var);
    20792034        NEXT_INSTRUCTION();
    20802035    }
     
    20892044        resolveBase(callFrame, vPC);
    20902045
    2091         vPC += 3;
     2046        vPC += OPCODE_LENGTH(op_resolve_base);
    20922047        NEXT_INSTRUCTION();
    20932048    }
     
    21072062            goto vm_throw;
    21082063
    2109         vPC += 4;
     2064        vPC += OPCODE_LENGTH(op_resolve_with_base);
    21102065        NEXT_INSTRUCTION();
    21112066    }
     
    21302085
    21312086        callFrame->r(dst) = result;
    2132         vPC += 8;
     2087        vPC += OPCODE_LENGTH(op_get_by_id);
    21332088        NEXT_INSTRUCTION();
    21342089    }
     
    21562111                callFrame->r(dst) = JSValue(baseObject->getDirectOffset(offset));
    21572112
    2158                 vPC += 8;
     2113                vPC += OPCODE_LENGTH(op_get_by_id_self);
    21592114                NEXT_INSTRUCTION();
    21602115            }
     
    21902145                    callFrame->r(dst) = JSValue(protoObject->getDirectOffset(offset));
    21912146
    2192                     vPC += 8;
     2147                    vPC += OPCODE_LENGTH(op_get_by_id_proto);
    21932148                    NEXT_INSTRUCTION();
    21942149                }
     
    22032158        ASSERT_NOT_REACHED();
    22042159        // This case of the switch must not be empty, else (op_get_by_id_self_list == op_get_by_id_chain)!
    2205         vPC += 8;
     2160        vPC += OPCODE_LENGTH(op_get_by_id_self_list);
    22062161        NEXT_INSTRUCTION();
    22072162    }
     
    22102165        ASSERT_NOT_REACHED();
    22112166        // This case of the switch must not be empty, else (op_get_by_id_proto_list == op_get_by_id_chain)!
    2212         vPC += 8;
     2167        vPC += OPCODE_LENGTH(op_get_by_id_proto_list);
    22132168        NEXT_INSTRUCTION();
    22142169    }
     
    22452200                        callFrame->r(dst) = JSValue(baseObject->getDirectOffset(offset));
    22462201
    2247                         vPC += 8;
     2202                        vPC += OPCODE_LENGTH(op_get_by_id_chain);
    22482203                        NEXT_INSTRUCTION();
    22492204                    }
     
    22752230
    22762231        callFrame->r(dst) = result;
    2277         vPC += 8;
     2232        vPC += OPCODE_LENGTH(op_get_by_id_generic);
    22782233        NEXT_INSTRUCTION();
    22792234    }
     
    22912246            int dst = vPC[1].u.operand;
    22922247            callFrame->r(dst) = jsNumber(callFrame, asArray(baseValue)->length());
    2293             vPC += 8;
     2248            vPC += OPCODE_LENGTH(op_get_array_length);
    22942249            NEXT_INSTRUCTION();
    22952250        }
     
    23112266            int dst = vPC[1].u.operand;
    23122267            callFrame->r(dst) = jsNumber(callFrame, asString(baseValue)->value().size());
    2313             vPC += 8;
     2268            vPC += OPCODE_LENGTH(op_get_string_length);
    23142269            NEXT_INSTRUCTION();
    23152270        }
     
    23412296        tryCachePutByID(callFrame, codeBlock, vPC, baseValue, slot);
    23422297
    2343         vPC += 8;
     2298        vPC += OPCODE_LENGTH(op_put_by_id);
    23442299        NEXT_INSTRUCTION();
    23452300    }
     
    23862341                baseObject->putDirectOffset(offset, callFrame->r(value).jsValue());
    23872342
    2388                 vPC += 8;
     2343                vPC += OPCODE_LENGTH(op_put_by_id_transition);
    23892344                NEXT_INSTRUCTION();
    23902345            }
     
    24212376                baseObject->putDirectOffset(offset, callFrame->r(value).jsValue());
    24222377
    2423                 vPC += 8;
     2378                vPC += OPCODE_LENGTH(op_put_by_id_replace);
    24242379                NEXT_INSTRUCTION();
    24252380            }
     
    24482403        CHECK_FOR_EXCEPTION();
    24492404
    2450         vPC += 8;
     2405        vPC += OPCODE_LENGTH(op_put_by_id_generic);
    24512406        NEXT_INSTRUCTION();
    24522407    }
     
    24592414           to register dst.
    24602415        */
    2461         int dst = (++vPC)->u.operand;
    2462         int base = (++vPC)->u.operand;
    2463         int property = (++vPC)->u.operand;
     2416        int dst = vPC[1].u.operand;
     2417        int base = vPC[2].u.operand;
     2418        int property = vPC[3].u.operand;
    24642419
    24652420        JSObject* baseObj = callFrame->r(base).jsValue().toObject(callFrame);
     
    24682423        CHECK_FOR_EXCEPTION();
    24692424        callFrame->r(dst) = result;
    2470         ++vPC;
     2425        vPC += OPCODE_LENGTH(op_del_by_id);
    24712426        NEXT_INSTRUCTION();
    24722427    }
     
    24792434           but numbers are treated more efficiently.
    24802435        */
    2481         int dst = (++vPC)->u.operand;
    2482         int base = (++vPC)->u.operand;
    2483         int property = (++vPC)->u.operand;
     2436        int dst = vPC[1].u.operand;
     2437        int base = vPC[2].u.operand;
     2438        int property = vPC[3].u.operand;
    24842439       
    24852440        JSValue baseValue = callFrame->r(base).jsValue();
     
    25092464        CHECK_FOR_EXCEPTION();
    25102465        callFrame->r(dst) = result;
    2511         ++vPC;
     2466        vPC += OPCODE_LENGTH(op_get_by_val);
    25122467        NEXT_INSTRUCTION();
    25132468    }
     
    25232478           the register file.
    25242479        */
    2525         int base = (++vPC)->u.operand;
    2526         int property = (++vPC)->u.operand;
    2527         int value = (++vPC)->u.operand;
     2480        int base = vPC[1].u.operand;
     2481        int property = vPC[2].u.operand;
     2482        int value = vPC[3].u.operand;
    25282483
    25292484        JSValue baseValue = callFrame->r(base).jsValue();
     
    25592514
    25602515        CHECK_FOR_EXCEPTION();
    2561         ++vPC;
     2516        vPC += OPCODE_LENGTH(op_put_by_val);
    25622517        NEXT_INSTRUCTION();
    25632518    }
     
    25702525           to register dst.
    25712526        */
    2572         int dst = (++vPC)->u.operand;
    2573         int base = (++vPC)->u.operand;
    2574         int property = (++vPC)->u.operand;
     2527        int dst = vPC[1].u.operand;
     2528        int base = vPC[2].u.operand;
     2529        int property = vPC[3].u.operand;
    25752530
    25762531        JSObject* baseObj = callFrame->r(base).jsValue().toObject(callFrame); // may throw
     
    25902545        CHECK_FOR_EXCEPTION();
    25912546        callFrame->r(dst) = result;
    2592         ++vPC;
     2547        vPC += OPCODE_LENGTH(op_del_by_val);
    25932548        NEXT_INSTRUCTION();
    25942549    }
     
    26052560           This opcode is mainly used to initialize array literals.
    26062561        */
    2607         int base = (++vPC)->u.operand;
    2608         unsigned property = (++vPC)->u.operand;
    2609         int value = (++vPC)->u.operand;
     2562        int base = vPC[1].u.operand;
     2563        unsigned property = vPC[2].u.operand;
     2564        int value = vPC[3].u.operand;
    26102565
    26112566        callFrame->r(base).jsValue().put(callFrame, property, callFrame->r(value).jsValue());
    26122567
    2613         ++vPC;
     2568        vPC += OPCODE_LENGTH(op_put_by_index);
    26142569        NEXT_INSTRUCTION();
    26152570    }
     
    26262581        OpcodeStats::resetLastInstruction();
    26272582#endif
    2628         int target = (++vPC)->u.operand;
     2583        int target = vPC[1].u.operand;
    26292584        CHECK_FOR_TIMEOUT();
    26302585        vPC += target;
     
    26402595        OpcodeStats::resetLastInstruction();
    26412596#endif
    2642         int target = (++vPC)->u.operand;
     2597        int target = vPC[1].u.operand;
    26432598
    26442599        vPC += target;
     
    26542609           the JS timeout is reached.
    26552610         */
    2656         int cond = (++vPC)->u.operand;
    2657         int target = (++vPC)->u.operand;
     2611        int cond = vPC[1].u.operand;
     2612        int target = vPC[2].u.operand;
    26582613        if (callFrame->r(cond).jsValue().toBoolean(callFrame)) {
    26592614            vPC += target;
     
    26622617        }
    26632618       
    2664         ++vPC;
     2619        vPC += OPCODE_LENGTH(op_loop_if_true);
    26652620        NEXT_INSTRUCTION();
    26662621    }
     
    26712626           only if register cond converts to boolean as true.
    26722627        */
    2673         int cond = (++vPC)->u.operand;
    2674         int target = (++vPC)->u.operand;
     2628        int cond = vPC[1].u.operand;
     2629        int target = vPC[2].u.operand;
    26752630        if (callFrame->r(cond).jsValue().toBoolean(callFrame)) {
    26762631            vPC += target;
     
    26782633        }
    26792634
    2680         ++vPC;
     2635        vPC += OPCODE_LENGTH(op_jtrue);
    26812636        NEXT_INSTRUCTION();
    26822637    }
     
    26872642           only if register cond converts to boolean as false.
    26882643        */
    2689         int cond = (++vPC)->u.operand;
    2690         int target = (++vPC)->u.operand;
     2644        int cond = vPC[1].u.operand;
     2645        int target = vPC[2].u.operand;
    26912646        if (!callFrame->r(cond).jsValue().toBoolean(callFrame)) {
    26922647            vPC += target;
     
    26942649        }
    26952650
    2696         ++vPC;
     2651        vPC += OPCODE_LENGTH(op_jfalse);
    26972652        NEXT_INSTRUCTION();
    26982653    }
     
    27032658           only if register src is null.
    27042659        */
    2705         int src = (++vPC)->u.operand;
    2706         int target = (++vPC)->u.operand;
     2660        int src = vPC[1].u.operand;
     2661        int target = vPC[2].u.operand;
    27072662        JSValue srcValue = callFrame->r(src).jsValue();
    27082663
     
    27122667        }
    27132668
    2714         ++vPC;
     2669        vPC += OPCODE_LENGTH(op_jeq_null);
    27152670        NEXT_INSTRUCTION();
    27162671    }
     
    27212676           only if register src is not null.
    27222677        */
    2723         int src = (++vPC)->u.operand;
    2724         int target = (++vPC)->u.operand;
     2678        int src = vPC[1].u.operand;
     2679        int target = vPC[2].u.operand;
    27252680        JSValue srcValue = callFrame->r(src).jsValue();
    27262681
     
    27302685        }
    27312686
    2732         ++vPC;
     2687        vPC += OPCODE_LENGTH(op_jneq_null);
    27332688        NEXT_INSTRUCTION();
    27342689    }
     
    27392694           to ptr, using pointer equality.
    27402695         */
    2741         int src = (++vPC)->u.operand;
    2742         JSValue ptr = JSValue((++vPC)->u.jsCell);
    2743         int target = (++vPC)->u.operand;
     2696        int src = vPC[1].u.operand;
     2697        JSValue ptr = JSValue(vPC[2].u.jsCell);
     2698        int target = vPC[3].u.operand;
    27442699        JSValue srcValue = callFrame->r(src).jsValue();
    27452700        if (srcValue != ptr) {
     
    27482703        }
    27492704
    2750         ++vPC;
     2705        vPC += OPCODE_LENGTH(op_jneq_ptr);
    27512706        NEXT_INSTRUCTION();
    27522707    }
     
    27622717           the JS timeout is reached.
    27632718         */
    2764         JSValue src1 = callFrame->r((++vPC)->u.operand).jsValue();
    2765         JSValue src2 = callFrame->r((++vPC)->u.operand).jsValue();
    2766         int target = (++vPC)->u.operand;
     2719        JSValue src1 = callFrame->r(vPC[1].u.operand).jsValue();
     2720        JSValue src2 = callFrame->r(vPC[2].u.operand).jsValue();
     2721        int target = vPC[3].u.operand;
    27672722       
    27682723        bool result = jsLess(callFrame, src1, src2);
     
    27752730        }
    27762731       
    2777         ++vPC;
     2732        vPC += OPCODE_LENGTH(op_loop_if_less);
    27782733        NEXT_INSTRUCTION();
    27792734    }
     
    27892744           the JS timeout is reached.
    27902745        */
    2791         JSValue src1 = callFrame->r((++vPC)->u.operand).jsValue();
    2792         JSValue src2 = callFrame->r((++vPC)->u.operand).jsValue();
    2793         int target = (++vPC)->u.operand;
     2746        JSValue src1 = callFrame->r(vPC[1].u.operand).jsValue();
     2747        JSValue src2 = callFrame->r(vPC[2].u.operand).jsValue();
     2748        int target = vPC[3].u.operand;
    27942749       
    27952750        bool result = jsLessEq(callFrame, src1, src2);
     
    28022757        }
    28032758       
    2804         ++vPC;
     2759        vPC += OPCODE_LENGTH(op_loop_if_lesseq);
    28052760        NEXT_INSTRUCTION();
    28062761    }
     
    28132768           result of the comparison is false.
    28142769        */
    2815         JSValue src1 = callFrame->r((++vPC)->u.operand).jsValue();
    2816         JSValue src2 = callFrame->r((++vPC)->u.operand).jsValue();
    2817         int target = (++vPC)->u.operand;
     2770        JSValue src1 = callFrame->r(vPC[1].u.operand).jsValue();
     2771        JSValue src2 = callFrame->r(vPC[2].u.operand).jsValue();
     2772        int target = vPC[3].u.operand;
    28182773
    28192774        bool result = jsLess(callFrame, src1, src2);
     
    28252780        }
    28262781
    2827         ++vPC;
     2782        vPC += OPCODE_LENGTH(op_jnless);
    28282783        NEXT_INSTRUCTION();
    28292784    }
     
    28362791           if and only if theresult of the comparison is false.
    28372792        */
    2838         JSValue src1 = callFrame->r((++vPC)->u.operand).jsValue();
    2839         JSValue src2 = callFrame->r((++vPC)->u.operand).jsValue();
    2840         int target = (++vPC)->u.operand;
     2793        JSValue src1 = callFrame->r(vPC[1].u.operand).jsValue();
     2794        JSValue src2 = callFrame->r(vPC[2].u.operand).jsValue();
     2795        int target = vPC[3].u.operand;
    28412796
    28422797        bool result = jsLessEq(callFrame, src1, src2);
     
    28482803        }
    28492804
    2850         ++vPC;
     2805        vPC += OPCODE_LENGTH(op_jnlesseq);
    28512806        NEXT_INSTRUCTION();
    28522807    }
     
    28602815           that value is used as the jump offset, otherwise defaultOffset is used.
    28612816         */
    2862         int tableIndex = (++vPC)->u.operand;
    2863         int defaultOffset = (++vPC)->u.operand;
    2864         JSValue scrutinee = callFrame->r((++vPC)->u.operand).jsValue();
     2817        int tableIndex = vPC[1].u.operand;
     2818        int defaultOffset = vPC[2].u.operand;
     2819        JSValue scrutinee = callFrame->r(vPC[3].u.operand).jsValue();
    28652820        if (scrutinee.isInt32())
    28662821            vPC += callFrame->codeBlock()->immediateSwitchJumpTable(tableIndex).offsetForValue(scrutinee.asInt32(), defaultOffset);
     
    28842839           that value is used as the jump offset, otherwise defaultOffset is used.
    28852840         */
    2886         int tableIndex = (++vPC)->u.operand;
    2887         int defaultOffset = (++vPC)->u.operand;
    2888         JSValue scrutinee = callFrame->r((++vPC)->u.operand).jsValue();
     2841        int tableIndex = vPC[1].u.operand;
     2842        int defaultOffset = vPC[2].u.operand;
     2843        JSValue scrutinee = callFrame->r(vPC[3].u.operand).jsValue();
    28892844        if (!scrutinee.isString())
    28902845            vPC += defaultOffset;
     
    29072862           jump offset, otherwise defaultOffset is used.
    29082863         */
    2909         int tableIndex = (++vPC)->u.operand;
    2910         int defaultOffset = (++vPC)->u.operand;
    2911         JSValue scrutinee = callFrame->r((++vPC)->u.operand).jsValue();
     2864        int tableIndex = vPC[1].u.operand;
     2865        int defaultOffset = vPC[2].u.operand;
     2866        JSValue scrutinee = callFrame->r(vPC[3].u.operand).jsValue();
    29122867        if (!scrutinee.isString())
    29132868            vPC += defaultOffset;
     
    29242879           puts the result in register dst.
    29252880        */
    2926         int dst = (++vPC)->u.operand;
    2927         int func = (++vPC)->u.operand;
     2881        int dst = vPC[1].u.operand;
     2882        int func = vPC[2].u.operand;
    29282883
    29292884        callFrame->r(dst) = JSValue(callFrame->codeBlock()->functionDecl(func)->make(callFrame, callFrame->scopeChain()));
    29302885
    2931         ++vPC;
     2886        vPC += OPCODE_LENGTH(op_new_func);
    29322887        NEXT_INSTRUCTION();
    29332888    }
     
    29402895           puts the result in register dst.
    29412896        */
    2942         int dst = (++vPC)->u.operand;
    2943         int funcIndex = (++vPC)->u.operand;
     2897        int dst = vPC[1].u.operand;
     2898        int funcIndex = vPC[2].u.operand;
    29442899
    29452900        FunctionExecutable* function = callFrame->codeBlock()->functionExpr(funcIndex);
     
    29602915        callFrame->r(dst) = JSValue(func);
    29612916
    2962         ++vPC;
     2917        vPC += OPCODE_LENGTH(op_new_func_exp);
    29632918        NEXT_INSTRUCTION();
    29642919    }
     
    29932948            callFrame->r(dst) = result;
    29942949
    2995             vPC += 5;
     2950            vPC += OPCODE_LENGTH(op_call_eval);
    29962951            NEXT_INSTRUCTION();
    29972952        }
     
    30673022            callFrame->r(dst) = returnValue;
    30683023
    3069             vPC += 5;
     3024            vPC += OPCODE_LENGTH(op_call);
    30703025            NEXT_INSTRUCTION();
    30713026        }
     
    30773032    }
    30783033    DEFINE_OPCODE(op_load_varargs) {
    3079         int argCountDst = (++vPC)->u.operand;
    3080         int argsOffset = (++vPC)->u.operand;
     3034        int argCountDst = vPC[1].u.operand;
     3035        int argsOffset = vPC[2].u.operand;
    30813036       
    30823037        JSValue arguments = callFrame->r(argsOffset).jsValue();
     
    31503105        CHECK_FOR_EXCEPTION();
    31513106        callFrame->r(argCountDst) = Register::withInt(argCount + 1);
    3152         ++vPC;
     3107        vPC += OPCODE_LENGTH(op_load_varargs);
    31533108        NEXT_INSTRUCTION();
    31543109    }
     
    32213176            callFrame->r(dst) = returnValue;
    32223177           
    3223             vPC += 5;
     3178            vPC += OPCODE_LENGTH(op_call_varargs);
    32243179            NEXT_INSTRUCTION();
    32253180        }
     
    32433198        */
    32443199
    3245         int src = (++vPC)->u.operand;
     3200        int src = vPC[1].u.operand;
    32463201        ASSERT(callFrame->codeBlock()->needsFullScopeChain());
    32473202
    32483203        asActivation(callFrame->r(src).jsValue())->copyRegisters(callFrame->optionalCalleeArguments());
    32493204
    3250         ++vPC;
     3205        vPC += OPCODE_LENGTH(op_tear_off_activation);
    32513206        NEXT_INSTRUCTION();
    32523207    }
     
    32693224            callFrame->optionalCalleeArguments()->copyRegisters();
    32703225
    3271         ++vPC;
     3226        vPC += OPCODE_LENGTH(op_tear_off_arguments);
    32723227        NEXT_INSTRUCTION();
    32733228    }
     
    32823237        */
    32833238
    3284         int result = (++vPC)->u.operand;
     3239        int result = vPC[1].u.operand;
    32853240
    32863241        if (callFrame->codeBlock()->needsFullScopeChain())
     
    33173272            callFrame->r(i) = jsUndefined();
    33183273
    3319         ++vPC;
     3274        vPC += OPCODE_LENGTH(op_enter);
    33203275        NEXT_INSTRUCTION();
    33213276    }
     
    33393294            callFrame->r(i) = jsUndefined();
    33403295
    3341         int dst = (++vPC)->u.operand;
     3296        int dst = vPC[1].u.operand;
    33423297        JSActivation* activation = new (globalData) JSActivation(callFrame, static_cast<FunctionExecutable*>(codeBlock->ownerExecutable()));
    33433298        callFrame->r(dst) = JSValue(activation);
    33443299        callFrame->setScopeChain(callFrame->scopeChain()->copy()->push(activation));
    33453300
    3346         ++vPC;
     3301        vPC += OPCODE_LENGTH(op_enter_with_activation);
    33473302        NEXT_INSTRUCTION();
    33483303    }
     
    33593314        */
    33603315
    3361         int thisRegister = (++vPC)->u.operand;
     3316        int thisRegister = vPC[1].u.operand;
    33623317        JSValue thisVal = callFrame->r(thisRegister).jsValue();
    33633318        if (thisVal.needsThisConversion())
    33643319            callFrame->r(thisRegister) = JSValue(thisVal.toThisObject(callFrame));
    33653320
    3366         ++vPC;
     3321        vPC += OPCODE_LENGTH(op_convert_this);
    33673322        NEXT_INSTRUCTION();
    33683323    }
     
    33783333         */
    33793334        callFrame->r(RegisterFile::ArgumentsRegister) = JSValue();
    3380         ++vPC;
     3335        vPC += OPCODE_LENGTH(op_init_arguments);
    33813336        NEXT_INSTRUCTION();
    33823337    }
     
    33943349             callFrame->r(RegisterFile::ArgumentsRegister) = JSValue(arguments);
    33953350         }
    3396         ++vPC;
     3351        vPC += OPCODE_LENGTH(op_create_arguments);
    33973352        NEXT_INSTRUCTION();
    33983353    }
     
    34723427            callFrame->r(dst) = JSValue(returnValue);
    34733428
    3474             vPC += 7;
     3429            vPC += OPCODE_LENGTH(op_construct);
    34753430            NEXT_INSTRUCTION();
    34763431        }
     
    34903445        int dst = vPC[1].u.operand;
    34913446        if (LIKELY(callFrame->r(dst).jsValue().isObject())) {
    3492             vPC += 3;
     3447            vPC += OPCODE_LENGTH(op_construct_verify);
    34933448            NEXT_INSTRUCTION();
    34943449        }
     
    34973452        callFrame->r(dst) = callFrame->r(override);
    34983453
    3499         vPC += 3;
     3454        vPC += OPCODE_LENGTH(op_construct_verify);
    35003455        NEXT_INSTRUCTION();
    35013456    }
    35023457    DEFINE_OPCODE(op_strcat) {
    3503         int dst = (++vPC)->u.operand;
    3504         int src = (++vPC)->u.operand;
    3505         int count = (++vPC)->u.operand;
     3458        int dst = vPC[1].u.operand;
     3459        int src = vPC[2].u.operand;
     3460        int count = vPC[3].u.operand;
    35063461
    35073462        callFrame->r(dst) = concatenateStrings(callFrame, &callFrame->registers()[src], count);
    3508         ++vPC;
     3463        vPC += OPCODE_LENGTH(op_strcat);
    35093464
    35103465        NEXT_INSTRUCTION();
    35113466    }
    35123467    DEFINE_OPCODE(op_to_primitive) {
    3513         int dst = (++vPC)->u.operand;
    3514         int src = (++vPC)->u.operand;
     3468        int dst = vPC[1].u.operand;
     3469        int src = vPC[2].u.operand;
    35153470
    35163471        callFrame->r(dst) = callFrame->r(src).jsValue().toPrimitive(callFrame);
    3517         ++vPC;
     3472        vPC += OPCODE_LENGTH(op_to_primitive);
    35183473
    35193474        NEXT_INSTRUCTION();
     
    35263481           are replaced by the result of toObject conversion of the scope.
    35273482        */
    3528         int scope = (++vPC)->u.operand;
     3483        int scope = vPC[1].u.operand;
    35293484        JSValue v = callFrame->r(scope).jsValue();
    35303485        JSObject* o = v.toObject(callFrame);
     
    35343489        callFrame->setScopeChain(callFrame->scopeChain()->push(o));
    35353490
    3536         ++vPC;
     3491        vPC += OPCODE_LENGTH(op_push_scope);
    35373492        NEXT_INSTRUCTION();
    35383493    }
     
    35443499        callFrame->setScopeChain(callFrame->scopeChain()->pop());
    35453500
    3546         ++vPC;
     3501        vPC += OPCODE_LENGTH(op_pop_scope);
    35473502        NEXT_INSTRUCTION();
    35483503    }
     
    35553510           register.
    35563511        */
    3557         int dst = (++vPC)->u.operand;
    3558         int base = (++vPC)->u.operand;
     3512        int dst = vPC[1].u.operand;
     3513        int base = vPC[2].u.operand;
    35593514
    35603515        callFrame->r(dst) = JSPropertyNameIterator::create(callFrame, callFrame->r(base).jsValue());
    3561         ++vPC;
     3516        vPC += OPCODE_LENGTH(op_get_pnames);
    35623517        NEXT_INSTRUCTION();
    35633518    }
     
    35713526           instruction.
    35723527        */
    3573         int dst = (++vPC)->u.operand;
    3574         int iter = (++vPC)->u.operand;
    3575         int target = (++vPC)->u.operand;
     3528        int dst = vPC[1].u.operand;
     3529        int iter = vPC[2].u.operand;
     3530        int target = vPC[3].u.operand;
    35763531
    35773532        JSPropertyNameIterator* it = callFrame->r(iter).propertyNameIterator();
     
    35843539        it->invalidate();
    35853540
    3586         ++vPC;
     3541        vPC += OPCODE_LENGTH(op_next_pname);
    35873542        NEXT_INSTRUCTION();
    35883543    }
     
    35943549           target.
    35953550        */
    3596         int count = (++vPC)->u.operand;
    3597         int target = (++vPC)->u.operand;
     3551        int count = vPC[1].u.operand;
     3552        int target = vPC[2].u.operand;
    35983553
    35993554        ScopeChainNode* tmp = callFrame->scopeChain();
     
    36183573        callFrame->setScopeChain(createExceptionScope(callFrame, vPC));
    36193574
    3620         vPC += 4;
     3575        vPC += OPCODE_LENGTH(op_push_new_scope);
    36213576        NEXT_INSTRUCTION();
    36223577    }
     
    36333588        ASSERT(exceptionValue);
    36343589        ASSERT(!globalData->exception);
    3635         int ex = (++vPC)->u.operand;
     3590        int ex = vPC[1].u.operand;
    36363591        callFrame->r(ex) = exceptionValue;
    36373592        exceptionValue = JSValue();
    36383593
    3639         ++vPC;
     3594        vPC += OPCODE_LENGTH(op_catch);
    36403595        NEXT_INSTRUCTION();
    36413596    }
     
    36513606        */
    36523607
    3653         int ex = (++vPC)->u.operand;
     3608        int ex = vPC[1].u.operand;
    36543609        exceptionValue = callFrame->r(ex).jsValue();
    36553610
     
    36713626           written to register dst.
    36723627        */
    3673         int dst = (++vPC)->u.operand;
    3674         int type = (++vPC)->u.operand;
    3675         int message = (++vPC)->u.operand;
     3628        int dst = vPC[1].u.operand;
     3629        int type = vPC[2].u.operand;
     3630        int message = vPC[3].u.operand;
    36763631
    36773632        CodeBlock* codeBlock = callFrame->codeBlock();
    36783633        callFrame->r(dst) = JSValue(Error::create(callFrame, (ErrorType)type, callFrame->r(message).jsValue().toString(callFrame), codeBlock->lineNumberForBytecodeOffset(callFrame, vPC - codeBlock->instructions().begin()), codeBlock->ownerExecutable()->sourceID(), codeBlock->ownerExecutable()->sourceURL()));
    36793634
    3680         ++vPC;
     3635        vPC += OPCODE_LENGTH(op_new_error);
    36813636        NEXT_INSTRUCTION();
    36823637    }
     
    36933648            scopeChain->deref();
    36943649        }
    3695         int result = (++vPC)->u.operand;
     3650        int result = vPC[1].u.operand;
    36963651        return callFrame->r(result).jsValue();
    36973652    }
     
    37073662           the register file.
    37083663        */
    3709         int base = (++vPC)->u.operand;
    3710         int property = (++vPC)->u.operand;
    3711         int function = (++vPC)->u.operand;
     3664        int base = vPC[1].u.operand;
     3665        int property = vPC[2].u.operand;
     3666        int function = vPC[3].u.operand;
    37123667
    37133668        ASSERT(callFrame->r(base).jsValue().isObject());
     
    37173672        baseObj->defineGetter(callFrame, ident, asObject(callFrame->r(function).jsValue()));
    37183673
    3719         ++vPC;
     3674        vPC += OPCODE_LENGTH(op_put_getter);
    37203675        NEXT_INSTRUCTION();
    37213676    }
     
    37313686           the register file.
    37323687        */
    3733         int base = (++vPC)->u.operand;
    3734         int property = (++vPC)->u.operand;
    3735         int function = (++vPC)->u.operand;
     3688        int base = vPC[1].u.operand;
     3689        int property = vPC[2].u.operand;
     3690        int function = vPC[3].u.operand;
    37363691
    37373692        ASSERT(callFrame->r(base).jsValue().isObject());
     
    37413696        baseObj->defineSetter(callFrame, ident, asObject(callFrame->r(function).jsValue()), 0);
    37423697
    3743         ++vPC;
     3698        vPC += OPCODE_LENGTH(op_put_setter);
    37443699        NEXT_INSTRUCTION();
    37453700    }
     
    37543709           register and jumps to offset target from the current instruction.
    37553710        */
    3756         int retAddrDst = (++vPC)->u.operand;
    3757         int target = (++vPC)->u.operand;
    3758         callFrame->r(retAddrDst) = vPC + 1;
     3711        int retAddrDst = vPC[1].u.operand;
     3712        int target = vPC[2].u.operand;
     3713        callFrame->r(retAddrDst) = vPC + OPCODE_LENGTH(op_jsr);
    37593714
    37603715        vPC += target;
     
    37683723         register, not as an immediate.
    37693724        */
    3770         int retAddrSrc = (++vPC)->u.operand;
     3725        int retAddrSrc = vPC[1].u.operand;
    37713726        vPC = callFrame->r(retAddrSrc).vPC();
    37723727        NEXT_INSTRUCTION();
     
    37783733         is only generated while the debugger is attached.
    37793734        */
    3780         int debugHookID = (++vPC)->u.operand;
    3781         int firstLine = (++vPC)->u.operand;
    3782         int lastLine = (++vPC)->u.operand;
     3735        int debugHookID = vPC[1].u.operand;
     3736        int firstLine = vPC[2].u.operand;
     3737        int lastLine = vPC[3].u.operand;
    37833738
    37843739        debug(callFrame, static_cast<DebugHookID>(debugHookID), firstLine, lastLine);
    37853740
    3786         ++vPC;
     3741        vPC += OPCODE_LENGTH(op_debug);
    37873742        NEXT_INSTRUCTION();
    37883743    }
     
    37983753            (*enabledProfilerReference)->willExecute(callFrame, callFrame->r(function).jsValue());
    37993754
    3800         vPC += 2;
     3755        vPC += OPCODE_LENGTH(op_profile_will_call);
    38013756        NEXT_INSTRUCTION();
    38023757    }
     
    38123767            (*enabledProfilerReference)->didExecute(callFrame, callFrame->r(function).jsValue());
    38133768
    3814         vPC += 2;
     3769        vPC += OPCODE_LENGTH(op_profile_did_call);
    38153770        NEXT_INSTRUCTION();
    38163771    }
Note: See TracChangeset for help on using the changeset viewer.