Changeset 39141 in webkit for trunk/JavaScriptCore/jit/JIT.cpp


Ignore:
Timestamp:
Dec 9, 2008, 11:19:04 AM (16 years ago)
Author:
[email protected]
Message:

2008-12-08 Judit Jasz <[email protected]>

Reviewed and tweaked by Cameron Zwarich.

Bug 22352: Annotate opcodes with their length
<https://bugs.webkit.org/show_bug.cgi?id=22352>

  • bytecode/Opcode.cpp:
  • bytecode/Opcode.h:
  • interpreter/Interpreter.cpp: (JSC::Interpreter::privateExecute):
  • jit/JIT.cpp: (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompileSlowCases):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/jit/JIT.cpp

    r39122 r39141  
    286286            emitGetVirtualRegister(instruction[i + 2].u.operand, X86::eax, i);
    287287            emitPutVirtualRegister(instruction[i + 1].u.operand);
    288             i += 3;
     288            i += OPCODE_LENGTH(op_mov);
    289289            break;
    290290        }
     
    316316            }
    317317
    318             i += 5;
     318            i += OPCODE_LENGTH(op_add);
    319319            break;
    320320        }
     
    325325            __ pushl_m(RegisterFile::ReturnPC * static_cast<int>(sizeof(Register)), X86::edi);
    326326            __ ret();
    327             i += 2;
     327            i += OPCODE_LENGTH(op_end);
    328328            break;
    329329        }
     
    331331            unsigned target = instruction[i + 1].u.operand;
    332332            m_jmpTable.append(JmpTable(jump(), i + 1 + target));
    333             i += 2;
     333            i += OPCODE_LENGTH(op_jmp);
    334334            break;
    335335        }
     
    340340            m_slowCases.append(SlowCaseEntry(joAdd32(Imm32(getDeTaggedConstantImmediate(JSImmediate::oneImmediate())), X86::eax), i));
    341341            emitPutVirtualRegister(srcDst);
    342             i += 2;
     342            i += OPCODE_LENGTH(op_pre_inc);
    343343            break;
    344344        }
     
    348348            unsigned target = instruction[i + 1].u.operand;
    349349            m_jmpTable.append(JmpTable(jump(), i + 1 + target));
    350             i += 2;
     350            i += OPCODE_LENGTH(op_end);
    351351            break;
    352352        }
     
    366366                m_jmpTable.append(JmpTable(jl32(X86::eax, X86::edx), i + 3 + target));
    367367            }
    368             i += 4;
     368            i += OPCODE_LENGTH(op_loop_if_less);
    369369            break;
    370370        }
     
    384384                m_jmpTable.append(JmpTable(jle32(X86::eax, X86::edx), i + 3 + target));
    385385            }
    386             i += 4;
     386            i += OPCODE_LENGTH(op_loop_if_lesseq);
    387387            break;
    388388        }
     
    390390            emitCTICall(i, Interpreter::cti_op_new_object);
    391391            emitPutVirtualRegister(instruction[i + 1].u.operand);
    392             i += 2;
     392            i += OPCODE_LENGTH(op_new_object);
    393393            break;
    394394        }
    395395        case op_put_by_id: {
    396396            compilePutByIdHotPath(instruction[i + 1].u.operand, &(m_codeBlock->identifier(instruction[i + 2].u.operand)), instruction[i + 3].u.operand, i, propertyAccessInstructionIndex++);
    397             i += 8;
     397            i += OPCODE_LENGTH(op_put_by_id);
    398398            break;
    399399        }
    400400        case op_get_by_id: {
    401401            compileGetByIdHotPath(instruction[i + 1].u.operand, instruction[i + 2].u.operand, &(m_codeBlock->identifier(instruction[i + 3].u.operand)), i, propertyAccessInstructionIndex++);
    402             i += 8;
     402            i += OPCODE_LENGTH(op_get_by_id);
    403403            break;
    404404        }
     
    459459            emitPutVirtualRegister(instruction[i + 1].u.operand);
    460460
    461             i += 5;
     461            i += OPCODE_LENGTH(op_instanceof);
    462462            break;
    463463        }
     
    468468            emitCTICall(i, Interpreter::cti_op_del_by_id);
    469469            emitPutVirtualRegister(instruction[i + 1].u.operand);
    470             i += 4;
     470            i += OPCODE_LENGTH(op_del_by_id);
    471471            break;
    472472        }
     
    497497                compileBinaryArithOp(op_mul, instruction[i + 1].u.operand, instruction[i + 2].u.operand, instruction[i + 3].u.operand, OperandTypes::fromInt(instruction[i + 4].u.operand), i);
    498498
    499             i += 5;
     499            i += OPCODE_LENGTH(op_mul);
    500500            break;
    501501        }
     
    505505            emitCTICall(i, Interpreter::cti_op_new_func);
    506506            emitPutVirtualRegister(instruction[i + 1].u.operand);
    507             i += 3;
     507            i += OPCODE_LENGTH(op_new_func);
    508508            break;
    509509        }
     
    512512        case op_construct: {
    513513            compileOpCall(opcodeID, instruction + i, i, callLinkInfoIndex++);
    514             i += (opcodeID == op_construct ? 7 : 5);
     514            i += (opcodeID == op_construct ? OPCODE_LENGTH(op_construct) : OPCODE_LENGTH(op_call));
    515515            break;
    516516        }
     
    520520            emitGetVariableObjectRegister(X86::eax, instruction[i + 3].u.operand, X86::eax);
    521521            emitPutVirtualRegister(instruction[i + 1].u.operand);
    522             i += 4;
     522            i += OPCODE_LENGTH(op_get_global_var);
    523523            break;
    524524        }
     
    528528            move(ImmPtr(globalObject), X86::eax);
    529529            emitPutVariableObjectRegister(X86::edx, X86::eax, instruction[i + 2].u.operand);
    530             i += 4;
     530            i += OPCODE_LENGTH(op_put_global_var);
    531531            break;
    532532        }
     
    541541            emitGetVariableObjectRegister(X86::eax, instruction[i + 2].u.operand, X86::eax);
    542542            emitPutVirtualRegister(instruction[i + 1].u.operand);
    543             i += 4;
     543            i += OPCODE_LENGTH(op_get_scoped_var);
    544544            break;
    545545        }
     
    554554            loadPtr(Address(X86::edx, FIELD_OFFSET(ScopeChainNode, object)), X86::edx);
    555555            emitPutVariableObjectRegister(X86::eax, X86::edx, instruction[i + 1].u.operand);
    556             i += 4;
     556            i += OPCODE_LENGTH(op_put_scoped_var);
    557557            break;
    558558        }
     
    560560            emitPutCTIArgFromVirtualRegister(instruction[i + 1].u.operand, 0, X86::ecx);
    561561            emitCTICall(i, Interpreter::cti_op_tear_off_activation);
    562             i += 2;
     562            i += OPCODE_LENGTH(op_tear_off_activation);
    563563            break;
    564564        }
    565565        case op_tear_off_arguments: {
    566566            emitCTICall(i, Interpreter::cti_op_tear_off_arguments);
    567             i += 1;
     567            i += OPCODE_LENGTH(op_tear_off_arguments);
    568568            break;
    569569        }
     
    586586            __ ret();
    587587
    588             i += 2;
     588            i += OPCODE_LENGTH(op_ret);
    589589            break;
    590590        }
     
    595595            emitCTICall(i, Interpreter::cti_op_new_array);
    596596            emitPutVirtualRegister(instruction[i + 1].u.operand);
    597             i += 4;
     597            i += OPCODE_LENGTH(op_new_array);
    598598            break;
    599599        }
     
    603603            emitCTICall(i, Interpreter::cti_op_resolve);
    604604            emitPutVirtualRegister(instruction[i + 1].u.operand);
    605             i += 3;
     605            i += OPCODE_LENGTH(op_resolve);
    606606            break;
    607607        }
     
    619619            __ link(isObject, __ label());
    620620
    621             i += 3;
     621            i += OPCODE_LENGTH(op_construct_verify);
    622622            break;
    623623        }
     
    638638            __ movl_mr(FIELD_OFFSET(ArrayStorage, m_vector[0]), X86::ecx, X86::edx, sizeof(JSValue*), X86::eax);
    639639            emitPutVirtualRegister(instruction[i + 1].u.operand);
    640             i += 4;
     640            i += OPCODE_LENGTH(op_get_by_val);
    641641            break;
    642642        }
     
    647647            emitPutVirtualRegister(instruction[i + 2].u.operand, X86::edx);
    648648            emitPutVirtualRegister(instruction[i + 1].u.operand);
    649             i += 4;
     649            i += OPCODE_LENGTH(op_resolve_func);
    650650            break;
    651651        }
    652652        case op_sub: {
    653653            compileBinaryArithOp(op_sub, instruction[i + 1].u.operand, instruction[i + 2].u.operand, instruction[i + 3].u.operand, OperandTypes::fromInt(instruction[i + 4].u.operand), i);
    654             i += 5;
     654            i += OPCODE_LENGTH(op_sub);
    655655            break;
    656656        }
     
    680680            emitGetVirtualRegister(instruction[i + 3].u.operand, X86::eax, i);
    681681            __ movl_rm(X86::eax, FIELD_OFFSET(ArrayStorage, m_vector[0]), X86::ecx, X86::edx, sizeof(JSValue*));
    682             i += 4;
     682            i += OPCODE_LENGTH(op_put_by_val);
    683683            break;
    684684        }
     
    701701
    702702            __ link(isZero, __ label());
    703             i += 3;
     703            i += OPCODE_LENGTH(op_loop_if_true);
    704704            break;
    705705        };
     
    709709            emitCTICall(i, Interpreter::cti_op_resolve_base);
    710710            emitPutVirtualRegister(instruction[i + 1].u.operand);
    711             i += 3;
     711            i += OPCODE_LENGTH(op_resolve_base);
    712712            break;
    713713        }
     
    716716            emitCTICall(i, Interpreter::cti_op_negate);
    717717            emitPutVirtualRegister(instruction[i + 1].u.operand);
    718             i += 3;
     718            i += OPCODE_LENGTH(op_negate);
    719719            break;
    720720        }
     
    725725            emitCTICall(i, Interpreter::cti_op_resolve_skip);
    726726            emitPutVirtualRegister(instruction[i + 1].u.operand);
    727             i += 4;
     727            i += OPCODE_LENGTH(op_resolve_skip);
    728728            break;
    729729        }
     
    756756            emitPutVirtualRegister(instruction[i + 1].u.operand);
    757757            __ link(end, __ label());
    758             i += 6;
     758            i += OPCODE_LENGTH(op_resolve_global);
    759759            break;
    760760        }
     
    767767            m_slowCases.append(SlowCaseEntry(__ jo(), i));
    768768            emitPutVirtualRegister(srcDst);
    769             i += 2;
     769            i += OPCODE_LENGTH(op_pre_dec);
    770770            break;
    771771        }
     
    785785                m_jmpTable.append(JmpTable(__ jge(), i + 3 + target));
    786786            }
    787             i += 4;
     787            i += OPCODE_LENGTH(op_jnless);
    788788            break;
    789789        }
     
    795795            __ xorl_i8r((JSImmediate::FullTagTypeBool | JSImmediate::ExtendedPayloadBitBoolValue), X86::eax);
    796796            emitPutVirtualRegister(instruction[i + 1].u.operand);
    797             i += 3;
     797            i += OPCODE_LENGTH(op_not);
    798798            break;
    799799        }
     
    813813
    814814            __ link(isNonZero, __ label());
    815             i += 3;
     815            i += OPCODE_LENGTH(op_jfalse);
    816816            break;
    817817        };
     
    834834
    835835            wasNotImmediate.link(this);
    836             i += 3;
     836            i += OPCODE_LENGTH(op_jeq_null);
    837837            break;
    838838        };
     
    856856            wasNotImmediate.link(this);
    857857
    858             i += 3;
     858            i += OPCODE_LENGTH(op_jneq_null);
    859859            break;
    860860        }
     
    868868            emitPutVirtualRegister(srcDst, X86::edx);
    869869            emitPutVirtualRegister(instruction[i + 1].u.operand);
    870             i += 3;
     870            i += OPCODE_LENGTH(op_post_inc);
    871871            break;
    872872        }
     
    875875            __ movl_i32r(asInteger(v), X86::eax);
    876876            emitPutVirtualRegister(instruction[i + 1].u.operand);
    877             i += 3;
     877            i += OPCODE_LENGTH(op_unexpected_load);
    878878            break;
    879879        }
     
    886886            JmpDst sretTarget = __ label();
    887887            m_jsrSites.append(JSRInfo(addrPosition, sretTarget));
    888             i += 3;
     888            i += OPCODE_LENGTH(op_jsr);
    889889            break;
    890890        }
    891891        case op_sret: {
    892892            __ jmp_m(sizeof(Register) * instruction[i + 1].u.operand, X86::edi);
    893             i += 2;
     893            i += OPCODE_LENGTH(op_sret);
    894894            break;
    895895        }
     
    902902            emitTagAsBoolImmediate(X86::eax);
    903903            emitPutVirtualRegister(instruction[i + 1].u.operand);
    904             i += 4;
     904            i += OPCODE_LENGTH(op_eq);
    905905            break;
    906906        }
     
    914914            emitFastArithIntToImmOrSlowCase(X86::eax, i);
    915915            emitPutVirtualRegister(instruction[i + 1].u.operand);
    916             i += 4;
     916            i += OPCODE_LENGTH(op_lshift);
    917917            break;
    918918        }
     
    937937                emitPutVirtualRegister(dst);
    938938            }
    939             i += 5;
     939            i += OPCODE_LENGTH(op_bitand);
    940940            break;
    941941        }
     
    957957            emitFastArithPotentiallyReTagImmediate(X86::eax);
    958958            emitPutVirtualRegister(instruction[i + 1].u.operand);
    959             i += 4;
     959            i += OPCODE_LENGTH(op_rshift);
    960960            break;
    961961        }
     
    965965            __ xorl_i8r(~JSImmediate::TagBitTypeInteger, X86::eax);
    966966            emitPutVirtualRegister(instruction[i + 1].u.operand);
    967             i += 3;
     967            i += OPCODE_LENGTH(op_bitnot);
    968968            break;
    969969        }
     
    974974            emitPutVirtualRegister(instruction[i + 2].u.operand, X86::edx);
    975975            emitPutVirtualRegister(instruction[i + 1].u.operand);
    976             i += 4;
     976            i += OPCODE_LENGTH(op_resolve_with_base);
    977977            break;
    978978        }
     
    982982            emitCTICall(i, Interpreter::cti_op_new_func_exp);
    983983            emitPutVirtualRegister(instruction[i + 1].u.operand);
    984             i += 3;
     984            i += OPCODE_LENGTH(op_new_func_exp);
    985985            break;
    986986        }
     
    996996            __ movl_rr(X86::edx, X86::eax);
    997997            emitPutVirtualRegister(instruction[i + 1].u.operand);
    998             i += 4;
     998            i += OPCODE_LENGTH(op_mod);
    999999            break;
    10001000        }
     
    10141014
    10151015            __ link(isZero, __ label());
    1016             i += 3;
     1016            i += OPCODE_LENGTH(op_jtrue);
    10171017            break;
    10181018        }
     
    10291029            emitPutVirtualRegister(instruction[i + 1].u.operand);
    10301030
    1031             i += 4;
     1031            i += OPCODE_LENGTH(op_neq);
    10321032            break;
    10331033        }
     
    10411041            emitPutVirtualRegister(srcDst, X86::edx);
    10421042            emitPutVirtualRegister(instruction[i + 1].u.operand);
    1043             i += 3;
     1043            i += OPCODE_LENGTH(op_post_dec);
    10441044            break;
    10451045        }
     
    10511051            emitFastArithReTagImmediate(X86::eax);
    10521052            emitPutVirtualRegister(instruction[i + 1].u.operand);
    1053             i += 5;
     1053            i += OPCODE_LENGTH(op_bitxor);
    10541054            break;
    10551055        }
     
    10591059            emitCTICall(i, Interpreter::cti_op_new_regexp);
    10601060            emitPutVirtualRegister(instruction[i + 1].u.operand);
    1061             i += 3;
     1061            i += OPCODE_LENGTH(op_new_regexp);
    10621062            break;
    10631063        }
     
    10671067            __ orl_rr(X86::edx, X86::eax);
    10681068            emitPutVirtualRegister(instruction[i + 1].u.operand);
    1069             i += 5;
     1069            i += OPCODE_LENGTH(op_bitor);
    10701070            break;
    10711071        }
     
    10781078            __ popl_r(X86::esi);
    10791079            __ ret();
    1080             i += 2;
     1080            i += OPCODE_LENGTH(op_throw);
    10811081            break;
    10821082        }
     
    10851085            emitCTICall(i, Interpreter::cti_op_get_pnames);
    10861086            emitPutVirtualRegister(instruction[i + 1].u.operand);
    1087             i += 3;
     1087            i += OPCODE_LENGTH(op_get_pnames);
    10881088            break;
    10891089        }
     
    10971097            m_jmpTable.append(JmpTable(__ jmp(), i + 3 + target));
    10981098            __ link(endOfIter, __ label());
    1099             i += 4;
     1099            i += OPCODE_LENGTH(op_next_pname);
    11001100            break;
    11011101        }
     
    11031103            emitPutCTIArgFromVirtualRegister(instruction[i + 1].u.operand, 0, X86::ecx);
    11041104            emitCTICall(i, Interpreter::cti_op_push_scope);
    1105             i += 2;
     1105            i += OPCODE_LENGTH(op_push_scope);
    11061106            break;
    11071107        }
    11081108        case op_pop_scope: {
    11091109            emitCTICall(i, Interpreter::cti_op_pop_scope);
    1110             i += 1;
     1110            i += OPCODE_LENGTH(op_pop_scope);
    11111111            break;
    11121112        }
     
    11201120        case op_stricteq: {
    11211121            compileOpStrictEq(instruction + i, i, OpStrictEq);
    1122             i += 4;
     1122            i += OPCODE_LENGTH(op_stricteq);
    11231123            break;
    11241124        }
    11251125        case op_nstricteq: {
    11261126            compileOpStrictEq(instruction + i, i, OpNStrictEq);
    1127             i += 4;
     1127            i += OPCODE_LENGTH(op_nstricteq);
    11281128            break;
    11291129        }
     
    11451145
    11461146            emitPutVirtualRegister(instruction[i + 1].u.operand);
    1147             i += 3;
     1147            i += OPCODE_LENGTH(op_to_jsnumber);
    11481148            break;
    11491149        }
     
    11531153            emitCTICall(i, Interpreter::cti_op_in);
    11541154            emitPutVirtualRegister(instruction[i + 1].u.operand);
    1155             i += 4;
     1155            i += OPCODE_LENGTH(op_in);
    11561156            break;
    11571157        }
     
    11621162            emitCTICall(i, Interpreter::cti_op_push_new_scope);
    11631163            emitPutVirtualRegister(instruction[i + 1].u.operand);
    1164             i += 4;
     1164            i += OPCODE_LENGTH(op_push_new_scope);
    11651165            break;
    11661166        }
     
    11681168            emitGetCTIParam(CTI_ARGS_callFrame, X86::edi); // edi := r
    11691169            emitPutVirtualRegister(instruction[i + 1].u.operand);
    1170             i += 2;
     1170            i += OPCODE_LENGTH(op_catch);
    11711171            break;
    11721172        }
     
    11771177            unsigned target = instruction[i + 2].u.operand;
    11781178            m_jmpTable.append(JmpTable(__ jmp(), i + 2 + target));
    1179             i += 3;
     1179            i += OPCODE_LENGTH(op_jmp_scopes);
    11801180            break;
    11811181        }
     
    11851185            emitPutCTIArgFromVirtualRegister(instruction[i + 3].u.operand, 8, X86::ecx);
    11861186            emitCTICall(i, Interpreter::cti_op_put_by_index);
    1187             i += 4;
     1187            i += OPCODE_LENGTH(op_put_by_index);
    11881188            break;
    11891189        }
     
    12021202            emitCTICall(i, Interpreter::cti_op_switch_imm);
    12031203            __ jmp_r(X86::eax);
    1204             i += 4;
     1204            i += OPCODE_LENGTH(op_switch_imm);
    12051205            break;
    12061206        }
     
    12191219            emitCTICall(i, Interpreter::cti_op_switch_char);
    12201220            __ jmp_r(X86::eax);
    1221             i += 4;
     1221            i += OPCODE_LENGTH(op_switch_char);
    12221222            break;
    12231223        }
     
    12351235            emitCTICall(i, Interpreter::cti_op_switch_string);
    12361236            __ jmp_r(X86::eax);
    1237             i += 4;
     1237            i += OPCODE_LENGTH(op_switch_string);
    12381238            break;
    12391239        }
     
    12431243            emitCTICall(i, Interpreter::cti_op_del_by_val);
    12441244            emitPutVirtualRegister(instruction[i + 1].u.operand);
    1245             i += 4;
     1245            i += OPCODE_LENGTH(op_del_by_val);
    12461246            break;
    12471247        }
     
    12521252            emitPutCTIArgFromVirtualRegister(instruction[i + 3].u.operand, 8, X86::ecx);
    12531253            emitCTICall(i, Interpreter::cti_op_put_getter);
    1254             i += 4;
     1254            i += OPCODE_LENGTH(op_put_getter);
    12551255            break;
    12561256        }
     
    12611261            emitPutCTIArgFromVirtualRegister(instruction[i + 3].u.operand, 8, X86::ecx);
    12621262            emitCTICall(i, Interpreter::cti_op_put_setter);
    1263             i += 4;
     1263            i += OPCODE_LENGTH(op_put_setter);
    12641264            break;
    12651265        }
     
    12711271            emitCTICall(i, Interpreter::cti_op_new_error);
    12721272            emitPutVirtualRegister(instruction[i + 1].u.operand);
    1273             i += 4;
     1273            i += OPCODE_LENGTH(op_new_error);
    12741274            break;
    12751275        }
     
    12791279            emitPutCTIArgConstant(instruction[i + 3].u.operand, 8);
    12801280            emitCTICall(i, Interpreter::cti_op_debug);
    1281             i += 4;
     1281            i += OPCODE_LENGTH(op_debug);
    12821282            break;
    12831283        }
     
    13041304            emitPutVirtualRegister(dst);
    13051305
    1306             i += 3;
     1306            i += OPCODE_LENGTH(op_eq_null);
    13071307            break;
    13081308        }
     
    13291329            emitPutVirtualRegister(dst);
    13301330
    1331             i += 3;
     1331            i += OPCODE_LENGTH(op_neq_null);
    13321332            break;
    13331333        }
     
    13401340                emitInitRegister(j);
    13411341
    1342             i+= 1;
     1342            i += OPCODE_LENGTH(op_enter);
    13431343            break;
    13441344        }
     
    13541354            emitPutVirtualRegister(instruction[i + 1].u.operand);
    13551355
    1356             i+= 2;
     1356            i += OPCODE_LENGTH(op_enter_with_activation);
    13571357            break;
    13581358        }
    13591359        case op_create_arguments: {
    13601360            emitCTICall(i, (m_codeBlock->m_numParameters == 1) ? Interpreter::cti_op_create_arguments_no_params : Interpreter::cti_op_create_arguments);
    1361             i += 1;
     1361            i += OPCODE_LENGTH(op_create_arguments);
    13621362            break;
    13631363        }
     
    13701370            m_slowCases.append(SlowCaseEntry(__ jnz(), i));
    13711371
    1372             i += 2;
     1372            i += OPCODE_LENGTH(op_convert_this);
    13731373            break;
    13741374        }
     
    13811381            __ link(noProfiler, __ label());
    13821382
    1383             i += 2;
     1383            i += OPCODE_LENGTH(op_profile_will_call);
    13841384            break;
    13851385        }
     
    13921392            __ link(noProfiler, __ label());
    13931393
    1394             i += 2;
     1394            i += OPCODE_LENGTH(op_profile_did_call);
    13951395            break;
    13961396        }
     
    14561456            emitCTICall(i, Interpreter::cti_op_convert_this);
    14571457            emitPutVirtualRegister(instruction[i + 1].u.operand);
    1458             i += 2;
     1458            i += OPCODE_LENGTH(op_convert_this);
    14591459            break;
    14601460        }
     
    14891489            }
    14901490
    1491             i += 5;
     1491            i += OPCODE_LENGTH(op_add);
    14921492            break;
    14931493        }
     
    15211521            emitPutVirtualRegister(instruction[i + 1].u.operand, X86::eax);
    15221522
    1523             i += 4;
     1523            i += OPCODE_LENGTH(op_get_by_val);
    15241524            break;
    15251525        }
    15261526        case op_sub: {
    15271527            compileBinaryArithOpSlowCase(op_sub, iter, instruction[i + 1].u.operand, instruction[i + 2].u.operand, instruction[i + 3].u.operand, OperandTypes::fromInt(instruction[i + 4].u.operand), i);
    1528             i += 5;
     1528            i += OPCODE_LENGTH(op_sub);
    15291529            break;
    15301530        }
     
    15421542            emitCTICall(i, Interpreter::cti_op_rshift);
    15431543            emitPutVirtualRegister(instruction[i + 1].u.operand);
    1544             i += 4;
     1544            i += OPCODE_LENGTH(op_rshift);
    15451545            break;
    15461546        }
     
    15561556            emitCTICall(i, Interpreter::cti_op_lshift);
    15571557            emitPutVirtualRegister(instruction[i + 1].u.operand);
    1558             i += 4;
     1558            i += OPCODE_LENGTH(op_lshift);
    15591559            break;
    15601560        }
     
    15781578                __ link(__ jne(), m_labels[i + 3 + target]);
    15791579            }
    1580             i += 4;
     1580            i += OPCODE_LENGTH(op_loop_if_less);
    15811581            break;
    15821582        }
    15831583        case op_put_by_id: {
    15841584            compilePutByIdSlowCase(instruction[i + 1].u.operand, &(m_codeBlock->identifier(instruction[i + 2].u.operand)), instruction[i + 3].u.operand, i, iter, propertyAccessInstructionIndex++);
    1585             i += 8;
     1585            i += OPCODE_LENGTH(op_put_by_id);
    15861586            break;
    15871587        }
    15881588        case op_get_by_id: {
    15891589            compileGetByIdSlowCase(instruction[i + 1].u.operand, instruction[i + 2].u.operand, &(m_codeBlock->identifier(instruction[i + 3].u.operand)), i, iter, propertyAccessInstructionIndex++);
    1590             i += 8;
     1590            i += OPCODE_LENGTH(op_get_by_id);
    15911591            break;
    15921592        }
     
    16101610                __ link(__ jne(), m_labels[i + 3 + target]);
    16111611            }
    1612             i += 4;
     1612            i += OPCODE_LENGTH(op_loop_if_lesseq);
    16131613            break;
    16141614        }
     
    16221622            emitCTICall(i, Interpreter::cti_op_pre_inc);
    16231623            emitPutVirtualRegister(srcDst);
    1624             i += 2;
     1624            i += OPCODE_LENGTH(op_pre_inc);
    16251625            break;
    16261626        }
     
    16481648            emitCTICall(i, Interpreter::cti_op_put_by_val_array);
    16491649
    1650             i += 4;
     1650            i += OPCODE_LENGTH(op_put_by_val);
    16511651            break;
    16521652        }
     
    16581658            unsigned target = instruction[i + 2].u.operand;
    16591659            __ link(__ jne(), m_labels[i + 2 + target]);
    1660             i += 3;
     1660            i += OPCODE_LENGTH(op_loop_if_true);
    16611661            break;
    16621662        }
     
    16701670            emitCTICall(i, Interpreter::cti_op_pre_dec);
    16711671            emitPutVirtualRegister(srcDst);
    1672             i += 2;
     1672            i += OPCODE_LENGTH(op_pre_dec);
    16731673            break;
    16741674        }
     
    16921692                __ link(__ je(), m_labels[i + 3 + target]);
    16931693            }
    1694             i += 4;
     1694            i += OPCODE_LENGTH(op_jnless);
    16951695            break;
    16961696        }
     
    17011701            emitCTICall(i, Interpreter::cti_op_not);
    17021702            emitPutVirtualRegister(instruction[i + 1].u.operand);
    1703             i += 3;
     1703            i += OPCODE_LENGTH(op_not);
    17041704            break;
    17051705        }
     
    17111711            unsigned target = instruction[i + 2].u.operand;
    17121712            __ link(__ je(), m_labels[i + 2 + target]); // inverted!
    1713             i += 3;
     1713            i += OPCODE_LENGTH(op_jfalse);
    17141714            break;
    17151715        }
     
    17221722            emitPutVirtualRegister(srcDst, X86::edx);
    17231723            emitPutVirtualRegister(instruction[i + 1].u.operand);
    1724             i += 3;
     1724            i += OPCODE_LENGTH(op_post_inc);
    17251725            break;
    17261726        }
     
    17301730            emitCTICall(i, Interpreter::cti_op_bitnot);
    17311731            emitPutVirtualRegister(instruction[i + 1].u.operand);
    1732             i += 3;
     1732            i += OPCODE_LENGTH(op_bitnot);
    17331733            break;
    17341734        }
     
    17561756                emitPutVirtualRegister(dst);
    17571757            }
    1758             i += 5;
     1758            i += OPCODE_LENGTH(op_bitand);
    17591759            break;
    17601760        }
     
    17661766            unsigned target = instruction[i + 2].u.operand;
    17671767            __ link(__ jne(), m_labels[i + 2 + target]);
    1768             i += 3;
     1768            i += OPCODE_LENGTH(op_jtrue);
    17691769            break;
    17701770        }
     
    17771777            emitPutVirtualRegister(srcDst, X86::edx);
    17781778            emitPutVirtualRegister(instruction[i + 1].u.operand);
    1779             i += 3;
     1779            i += OPCODE_LENGTH(op_post_dec);
    17801780            break;
    17811781        }
     
    17861786            emitCTICall(i, Interpreter::cti_op_bitxor);
    17871787            emitPutVirtualRegister(instruction[i + 1].u.operand);
    1788             i += 5;
     1788            i += OPCODE_LENGTH(op_bitxor);
    17891789            break;
    17901790        }
     
    17951795            emitCTICall(i, Interpreter::cti_op_bitor);
    17961796            emitPutVirtualRegister(instruction[i + 1].u.operand);
    1797             i += 5;
     1797            i += OPCODE_LENGTH(op_bitor);
    17981798            break;
    17991799        }
     
    18041804            emitCTICall(i, Interpreter::cti_op_eq);
    18051805            emitPutVirtualRegister(instruction[i + 1].u.operand);
    1806             i += 4;
     1806            i += OPCODE_LENGTH(op_eq);
    18071807            break;
    18081808        }
     
    18131813            emitCTICall(i, Interpreter::cti_op_neq);
    18141814            emitPutVirtualRegister(instruction[i + 1].u.operand);
    1815             i += 4;
     1815            i += OPCODE_LENGTH(op_neq);
    18161816            break;
    18171817        }
     
    18241824            emitCTICall(i, Interpreter::cti_op_stricteq);
    18251825            emitPutVirtualRegister(instruction[i + 1].u.operand);
    1826             i += 4;
     1826            i += OPCODE_LENGTH(op_stricteq);
    18271827            break;
    18281828        }
     
    18351835            emitCTICall(i, Interpreter::cti_op_nstricteq);
    18361836            emitPutVirtualRegister(instruction[i + 1].u.operand);
    1837             i += 4;
     1837            i += OPCODE_LENGTH(op_nstricteq);
    18381838            break;
    18391839        }
     
    18471847            emitCTICall(i, Interpreter::cti_op_instanceof);
    18481848            emitPutVirtualRegister(instruction[i + 1].u.operand);
    1849             i += 5;
     1849            i += OPCODE_LENGTH(op_instanceof);
    18501850            break;
    18511851        }
     
    18621862            emitCTICall(i, Interpreter::cti_op_mod);
    18631863            emitPutVirtualRegister(instruction[i + 1].u.operand);
    1864             i += 4;
     1864            i += OPCODE_LENGTH(op_mod);
    18651865            break;
    18661866        }
     
    18901890            } else
    18911891                compileBinaryArithOpSlowCase(op_mul, iter, dst, src1, src2, OperandTypes::fromInt(instruction[i + 4].u.operand), i);
    1892             i += 5;
     1892            i += OPCODE_LENGTH(op_mul);
    18931893            break;
    18941894        }
     
    18981898        case op_construct: {
    18991899            compileOpCallSlowCase(instruction + i, i, iter, callLinkInfoIndex++, opcodeID);
    1900             i += (opcodeID == op_construct ? 7 : 5);
     1900            i += (opcodeID == op_construct ? OPCODE_LENGTH(op_construct) : OPCODE_LENGTH(op_call));
    19011901            break;
    19021902        }
     
    19101910
    19111911            emitPutVirtualRegister(instruction[i + 1].u.operand);
    1912             i += 3;
     1912            i += OPCODE_LENGTH(op_to_jsnumber);
    19131913            break;
    19141914        }
Note: See TracChangeset for help on using the changeset viewer.