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


Ignore:
Timestamp:
Dec 10, 2008, 8:35:13 PM (16 years ago)
Author:
[email protected]
Message:

2008-12-10 Gavin Barraclough <[email protected]>

Reviewed by Geoff Garen.

Port more of the JIT to use the MacroAssembler interface.


Everything in the main pass, bar a few corner cases (operations with required
registers, or calling convention code). Slightly refactors array creation,
moving the offset calculation into the callFrame into C code (reducing code
planted).

Overall this appears to be a 1% win on v8-tests, due to the smaller immediates
being planted (in jfalse in particular).

  • interpreter/Interpreter.cpp: (JSC::Interpreter::cti_op_new_array):
  • jit/JIT.cpp: (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompileSlowCases):
  • jit/JIT.h:
  • wrec/WRECGenerator.cpp: (JSC::WREC::Generator::generateEnter):
File:
1 edited

Legend:

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

    r39182 r39197  
    409409
    410410            // check if any are immediates
    411             __ orl_rr(X86::eax, X86::ecx);
    412             __ orl_rr(X86::edx, X86::ecx);
    413             emitJumpSlowCaseIfNotJSCell(X86::ecx, i);
     411            move(X86::eax, X86::ebx);
     412            or32(X86::ecx, X86::ebx);
     413            or32(X86::edx, X86::ebx);
     414            emitJumpSlowCaseIfNotJSCell(X86::ebx, i);
    414415
    415416            // check that all are object type - this is a bit of a bithack to avoid excess branching;
    416417            // we check that the sum of the three type codes from Structures is exactly 3 * ObjectType,
    417418            // this works because NumberType and StringType are smaller
    418             __ movl_i32r(3 * ObjectType, X86::ecx);
    419             __ movl_mr(FIELD_OFFSET(JSCell, m_structure), X86::eax, X86::eax);
    420             __ movl_mr(FIELD_OFFSET(JSCell, m_structure), X86::edx, X86::edx);
    421             __ subl_mr(FIELD_OFFSET(Structure, m_typeInfo.m_type), X86::eax, X86::ecx);
    422             __ subl_mr(FIELD_OFFSET(Structure, m_typeInfo.m_type), X86::edx, X86::ecx);
    423             emitGetVirtualRegister(instruction[i + 3].u.operand, X86::edx, i); // reload baseVal
    424             __ movl_mr(FIELD_OFFSET(JSCell, m_structure), X86::edx, X86::edx);
    425             __ cmpl_rm(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo.m_type), X86::edx);
    426 
    427             m_slowCases.append(SlowCaseEntry(__ jne(), i));
     419            move(Imm32(3 * ObjectType), X86::ebx);
     420            loadPtr(Address(X86::eax, FIELD_OFFSET(JSCell, m_structure)), X86::eax);
     421            loadPtr(Address(X86::ecx, FIELD_OFFSET(JSCell, m_structure)), X86::ecx);
     422            loadPtr(Address(X86::edx, FIELD_OFFSET(JSCell, m_structure)), X86::edx);
     423            sub32(Address(X86::eax, FIELD_OFFSET(Structure, m_typeInfo.m_type)), X86::ebx);
     424            sub32(Address(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo.m_type)), X86::ebx);
     425            m_slowCases.append(SlowCaseEntry(jne32(Address(X86::edx, FIELD_OFFSET(Structure, m_typeInfo.m_type)), X86::ebx), i));
    428426
    429427            // check that baseVal's flags include ImplementsHasInstance but not OverridesHasInstance
    430             __ movl_mr(FIELD_OFFSET(Structure, m_typeInfo.m_flags), X86::edx, X86::ecx);
    431             __ andl_i32r(ImplementsHasInstance | OverridesHasInstance, X86::ecx);
    432             __ cmpl_i32r(ImplementsHasInstance, X86::ecx);
    433 
    434             m_slowCases.append(SlowCaseEntry(__ jne(), i));
     428            load32(Address(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo.m_flags)), X86::ecx);
     429            and32(Imm32(ImplementsHasInstance | OverridesHasInstance), X86::ecx);
     430            m_slowCases.append(SlowCaseEntry(jne32(X86::ecx, Imm32(ImplementsHasInstance)), i));
    435431
    436432            emitGetVirtualRegister(instruction[i + 2].u.operand, X86::ecx, i); // reload value
     
    438434
    439435            // optimistically load true result
    440             __ movl_i32r(asInteger(jsBoolean(true)), X86::eax);
    441 
    442             JmpDst loop = __ label();
     436            move(Imm32(asInteger(jsBoolean(true))), X86::eax);
     437
     438            Label loop(this);
    443439
    444440            // load value's prototype
    445             __ movl_mr(FIELD_OFFSET(JSCell, m_structure), X86::ecx, X86::ecx);
    446             __ movl_mr(FIELD_OFFSET(Structure, m_prototype), X86::ecx, X86::ecx);
    447            
    448             __ cmpl_rr(X86::ecx, X86::edx);
    449             JmpSrc exit = __ je();
    450 
    451             __ cmpl_i32r(asInteger(jsNull()), X86::ecx);
    452             JmpSrc goToLoop = __ jne();
    453             __ link(goToLoop, loop);
    454 
    455             __ movl_i32r(asInteger(jsBoolean(false)), X86::eax);
    456 
    457             __ link(exit, __ label());
     441            loadPtr(Address(X86::ecx, FIELD_OFFSET(JSCell, m_structure)), X86::ecx);
     442            loadPtr(Address(X86::ecx, FIELD_OFFSET(Structure, m_prototype)), X86::ecx);
     443
     444            Jump exit = jePtr(X86::ecx, X86::edx);
     445
     446            jne32(X86::ecx, Imm32(asInteger(jsNull())), loop);
     447
     448            move(Imm32(asInteger(jsBoolean(false))), X86::eax);
     449
     450            exit.link(this);
    458451
    459452            emitPutVirtualRegister(instruction[i + 1].u.operand);
     
    590583        }
    591584        case op_new_array: {
    592             __ leal_mr(sizeof(Register) * instruction[i + 2].u.operand, X86::edi, X86::edx);
    593             emitPutCTIArg(X86::edx, 0);
     585            emitPutCTIArgConstant(instruction[i + 2].u.operand, 0);
    594586            emitPutCTIArgConstant(instruction[i + 3].u.operand, 4);
    595587            emitCTICall(i, Interpreter::cti_op_new_array);
     
    609601            emitGetVirtualRegister(instruction[i + 1].u.operand, X86::eax, i);
    610602
    611             JmpSrc isImmediate = emitJumpIfNotJSCell(X86::eax);
    612             __ movl_mr(FIELD_OFFSET(JSCell, m_structure), X86::eax, X86::ecx);
    613             __ cmpl_i32m(ObjectType, FIELD_OFFSET(Structure, m_typeInfo) + FIELD_OFFSET(TypeInfo, m_type), X86::ecx);
    614             JmpSrc isObject = __ je();
    615 
    616             __ link(isImmediate, __ label());
    617             emitGetVirtualRegister(instruction[i + 2].u.operand, X86::eax, i);
    618             emitPutVirtualRegister(instruction[i + 1].u.operand);
    619             __ link(isObject, __ label());
     603            emitJumpSlowCaseIfNotJSCell(X86::eax, i);
     604            loadPtr(Address(X86::eax, FIELD_OFFSET(JSCell, m_structure)), X86::ecx);
     605            m_slowCases.append(SlowCaseEntry(jne32(Address(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo) + FIELD_OFFSET(TypeInfo, m_type)), Imm32(ObjectType)), i));
    620606
    621607            i += OPCODE_LENGTH(op_construct_verify);
     
    627613            emitFastArithImmToInt(X86::edx);
    628614            emitJumpSlowCaseIfNotJSCell(X86::eax, i);
    629             __ cmpl_i32m(reinterpret_cast<unsigned>(m_interpreter->m_jsArrayVptr), X86::eax);
    630             m_slowCases.append(SlowCaseEntry(__ jne(), i));
     615            m_slowCases.append(SlowCaseEntry(jnePtr(Address(X86::eax), ImmPtr(m_interpreter->m_jsArrayVptr)), i));
    631616
    632617            // This is an array; get the m_storage pointer into ecx, then check if the index is below the fast cutoff
    633             __ movl_mr(FIELD_OFFSET(JSArray, m_storage), X86::eax, X86::ecx);
    634             __ cmpl_rm(X86::edx, FIELD_OFFSET(JSArray, m_fastAccessCutoff), X86::eax);
    635             m_slowCases.append(SlowCaseEntry(__ jbe(), i));
     618            loadPtr(Address(X86::eax, FIELD_OFFSET(JSArray, m_storage)), X86::ecx);
     619            m_slowCases.append(SlowCaseEntry(jae32(X86::edx, Address(X86::eax, FIELD_OFFSET(JSArray, m_fastAccessCutoff))), i));
    636620
    637621            // Get the value from the vector
    638             __ movl_mr(FIELD_OFFSET(ArrayStorage, m_vector[0]), X86::ecx, X86::edx, sizeof(JSValue*), X86::eax);
     622            loadPtr(BaseIndex(X86::ecx, X86::edx, ScalePtr, FIELD_OFFSET(ArrayStorage, m_vector[0])), X86::eax);
    639623            emitPutVirtualRegister(instruction[i + 1].u.operand);
    640624            i += OPCODE_LENGTH(op_get_by_val);
     
    660644            emitFastArithImmToInt(X86::edx);
    661645            emitJumpSlowCaseIfNotJSCell(X86::eax, i);
    662             __ cmpl_i32m(reinterpret_cast<unsigned>(m_interpreter->m_jsArrayVptr), X86::eax);
    663             m_slowCases.append(SlowCaseEntry(__ jne(), i));
     646            m_slowCases.append(SlowCaseEntry(jnePtr(Address(X86::eax), ImmPtr(m_interpreter->m_jsArrayVptr)), i));
    664647
    665648            // This is an array; get the m_storage pointer into ecx, then check if the index is below the fast cutoff
    666             __ movl_mr(FIELD_OFFSET(JSArray, m_storage), X86::eax, X86::ecx);
    667             __ cmpl_rm(X86::edx, FIELD_OFFSET(JSArray, m_fastAccessCutoff), X86::eax);
    668             JmpSrc inFastVector = __ ja();
     649            loadPtr(Address(X86::eax, FIELD_OFFSET(JSArray, m_storage)), X86::ecx);
     650            Jump inFastVector = jb32(X86::edx, Address(X86::eax, FIELD_OFFSET(JSArray, m_fastAccessCutoff)));
    669651            // No; oh well, check if the access if within the vector - if so, we may still be okay.
    670             __ cmpl_rm(X86::edx, FIELD_OFFSET(ArrayStorage, m_vectorLength), X86::ecx);
    671             m_slowCases.append(SlowCaseEntry(__ jbe(), i));
     652            m_slowCases.append(SlowCaseEntry(jae32(X86::edx, Address(X86::ecx, FIELD_OFFSET(ArrayStorage, m_vectorLength))), i));
    672653
    673654            // This is a write to the slow part of the vector; first, we have to check if this would be the first write to this location.
    674655            // FIXME: should be able to handle initial write to array; increment the the number of items in the array, and potentially update fast access cutoff.
    675             __ cmpl_i8m(0, FIELD_OFFSET(ArrayStorage, m_vector[0]), X86::ecx, X86::edx, sizeof(JSValue*));
    676             m_slowCases.append(SlowCaseEntry(__ je(), i));
     656            m_slowCases.append(SlowCaseEntry(jzPtr(BaseIndex(X86::ecx, X86::edx, ScalePtr, FIELD_OFFSET(ArrayStorage, m_vector[0]))), i));
    677657
    678658            // All good - put the value into the array.
    679             __ link(inFastVector, __ label());
     659            inFastVector.link(this);
    680660            emitGetVirtualRegister(instruction[i + 3].u.operand, X86::eax, i);
    681             __ movl_rm(X86::eax, FIELD_OFFSET(ArrayStorage, m_vector[0]), X86::ecx, X86::edx, sizeof(JSValue*));
     661            storePtr(X86::eax, BaseIndex(X86::ecx, X86::edx, ScalePtr, FIELD_OFFSET(ArrayStorage, m_vector[0])));
    682662            i += OPCODE_LENGTH(op_put_by_val);
    683663            break;
     
    690670            emitGetVirtualRegister(instruction[i + 1].u.operand, X86::eax, i);
    691671
    692             __ cmpl_i32r(asInteger(JSImmediate::zeroImmediate()), X86::eax);
    693             JmpSrc isZero = __ je();
    694             __ testl_i32r(JSImmediate::TagBitTypeInteger, X86::eax);
    695             m_jmpTable.append(JmpTable(__ jne(), i + 2 + target));
    696 
    697             __ cmpl_i32r(asInteger(JSImmediate::trueImmediate()), X86::eax);
    698             m_jmpTable.append(JmpTable(__ je(), i + 2 + target));
    699             __ cmpl_i32r(asInteger(JSImmediate::falseImmediate()), X86::eax);
    700             m_slowCases.append(SlowCaseEntry(__ jne(), i));
    701 
    702             __ link(isZero, __ label());
     672            Jump isZero = je32(X86::eax, Imm32(asInteger(JSImmediate::zeroImmediate())));
     673            m_jmpTable.append(JmpTable(jnz32(X86::eax, Imm32(JSImmediate::TagBitTypeInteger)), i + 2 + target));
     674
     675            m_jmpTable.append(JmpTable(je32(X86::eax, Imm32(asInteger(JSImmediate::trueImmediate()))), i + 2 + target));
     676            m_slowCases.append(SlowCaseEntry(jne32(X86::eax, Imm32(asInteger(JSImmediate::falseImmediate()))), i));
     677
     678            isZero.link(this);
    703679            i += OPCODE_LENGTH(op_loop_if_true);
    704680            break;
     
    730706        case op_resolve_global: {
    731707            // Fast case
    732             unsigned globalObject = asInteger(instruction[i + 2].u.jsCell);
     708            void* globalObject = instruction[i + 2].u.jsCell;
    733709            Identifier* ident = &(m_codeBlock->identifier(instruction[i + 3].u.operand));
    734710            void* structureAddress = reinterpret_cast<void*>(instruction + i + 4);
     
    736712
    737713            // Check Structure of global object
    738             __ movl_i32r(globalObject, X86::eax);
    739             __ movl_mr(structureAddress, X86::edx);
    740             __ cmpl_rm(X86::edx, FIELD_OFFSET(JSCell, m_structure), X86::eax);
    741             JmpSrc noMatch = __ jne(); // Structures don't match
     714            move(ImmPtr(globalObject), X86::eax);
     715            loadPtr(structureAddress, X86::edx);
     716            Jump noMatch = jnePtr(X86::edx, Address(X86::eax, FIELD_OFFSET(JSCell, m_structure))); // Structures don't match
    742717
    743718            // Load cached property
    744             __ movl_mr(FIELD_OFFSET(JSGlobalObject, m_propertyStorage), X86::eax, X86::eax);
    745             __ movl_mr(offsetAddr, X86::edx);
    746             __ movl_mr(0, X86::eax, X86::edx, sizeof(JSValue*), X86::eax);
    747             emitPutVirtualRegister(instruction[i + 1].u.operand);
    748             JmpSrc end = __ jmp();
     719            loadPtr(Address(X86::eax, FIELD_OFFSET(JSGlobalObject, m_propertyStorage)), X86::eax);
     720            load32(offsetAddr, X86::edx);
     721            loadPtr(BaseIndex(X86::eax, X86::edx, ScalePtr), X86::eax);
     722            emitPutVirtualRegister(instruction[i + 1].u.operand);
     723            Jump end = jump();
    749724
    750725            // Slow case
    751             __ link(noMatch, __ label());
     726            noMatch.link(this);
    752727            emitPutCTIArgConstant(globalObject, 0);
    753728            emitPutCTIArgConstant(reinterpret_cast<unsigned>(ident), 4);
     
    755730            emitCTICall(i, Interpreter::cti_op_resolve_global);
    756731            emitPutVirtualRegister(instruction[i + 1].u.operand);
    757             __ link(end, __ label());
     732            end.link(this);
    758733            i += OPCODE_LENGTH(op_resolve_global);
    759734            break;
     
    764739            emitGetVirtualRegister(srcDst, X86::eax, i);
    765740            emitJumpSlowCaseIfNotImmNum(X86::eax, i);
    766             __ subl_i8r(getDeTaggedConstantImmediate(JSImmediate::oneImmediate()), X86::eax);
    767             m_slowCases.append(SlowCaseEntry(__ jo(), i));
     741            m_slowCases.append(SlowCaseEntry(joSub32(Imm32(getDeTaggedConstantImmediate(JSImmediate::oneImmediate())), X86::eax), i));
    768742            emitPutVirtualRegister(srcDst);
    769743            i += OPCODE_LENGTH(op_pre_dec);
     
    776750                emitGetVirtualRegister(instruction[i + 1].u.operand, X86::edx, i);
    777751                emitJumpSlowCaseIfNotImmNum(X86::edx, i);
    778                 __ cmpl_i32r(asInteger(src2imm), X86::edx);
    779                 m_jmpTable.append(JmpTable(__ jge(), i + 3 + target));
     752                m_jmpTable.append(JmpTable(jge32(X86::edx, Imm32(asInteger(src2imm))), i + 3 + target));
    780753            } else {
    781754                emitGetVirtualRegisters(instruction[i + 1].u.operand, X86::eax, instruction[i + 2].u.operand, X86::edx, i);
    782755                emitJumpSlowCaseIfNotImmNum(X86::eax, i);
    783756                emitJumpSlowCaseIfNotImmNum(X86::edx, i);
    784                 __ cmpl_rr(X86::edx, X86::eax);
    785                 m_jmpTable.append(JmpTable(__ jge(), i + 3 + target));
     757                m_jmpTable.append(JmpTable(jge32(X86::eax, X86::edx), i + 3 + target));
    786758            }
    787759            i += OPCODE_LENGTH(op_jnless);
     
    790762        case op_not: {
    791763            emitGetVirtualRegister(instruction[i + 2].u.operand, X86::eax, i);
    792             __ xorl_i8r(JSImmediate::FullTagTypeBool, X86::eax);
    793             __ testl_i32r(JSImmediate::FullTagTypeMask, X86::eax); // i8?
    794             m_slowCases.append(SlowCaseEntry(__ jne(), i));
    795             __ xorl_i8r((JSImmediate::FullTagTypeBool | JSImmediate::ExtendedPayloadBitBoolValue), X86::eax);
     764            xor32(Imm32(JSImmediate::FullTagTypeBool), X86::eax);
     765            m_slowCases.append(SlowCaseEntry(jnz32(X86::eax, Imm32(JSImmediate::FullTagTypeMask)), i));
     766            xor32(Imm32(JSImmediate::FullTagTypeBool | JSImmediate::ExtendedPayloadBitBoolValue), X86::eax);
    796767            emitPutVirtualRegister(instruction[i + 1].u.operand);
    797768            i += OPCODE_LENGTH(op_not);
     
    802773            emitGetVirtualRegister(instruction[i + 1].u.operand, X86::eax, i);
    803774
    804             __ cmpl_i32r(asInteger(JSImmediate::zeroImmediate()), X86::eax);
    805             m_jmpTable.append(JmpTable(__ je(), i + 2 + target));
    806             __ testl_i32r(JSImmediate::TagBitTypeInteger, X86::eax);
    807             JmpSrc isNonZero = __ jne();
    808 
    809             __ cmpl_i32r(asInteger(JSImmediate::falseImmediate()), X86::eax);
    810             m_jmpTable.append(JmpTable(__ je(), i + 2 + target));
    811             __ cmpl_i32r(asInteger(JSImmediate::trueImmediate()), X86::eax);
    812             m_slowCases.append(SlowCaseEntry(__ jne(), i));
    813 
    814             __ link(isNonZero, __ label());
     775            m_jmpTable.append(JmpTable(je32(X86::eax, Imm32(asInteger(JSImmediate::zeroImmediate()))), i + 2 + target));
     776            Jump isNonZero = jnz32(X86::eax, Imm32(JSImmediate::TagBitTypeInteger));
     777
     778            m_jmpTable.append(JmpTable(je32(X86::eax, Imm32(asInteger(JSImmediate::falseImmediate()))), i + 2 + target));
     779            m_slowCases.append(SlowCaseEntry(jne32(X86::eax, Imm32(asInteger(JSImmediate::trueImmediate()))), i));
     780
     781            isNonZero.link(this);
    815782            i += OPCODE_LENGTH(op_jfalse);
    816783            break;
     
    855822
    856823            wasNotImmediate.link(this);
    857 
    858824            i += OPCODE_LENGTH(op_jneq_null);
    859825            break;
     
    862828            int srcDst = instruction[i + 2].u.operand;
    863829            emitGetVirtualRegister(srcDst, X86::eax, i);
    864             __ movl_rr(X86::eax, X86::edx);
     830            move(X86::eax, X86::edx);
    865831            emitJumpSlowCaseIfNotImmNum(X86::eax, i);
    866             __ addl_i8r(getDeTaggedConstantImmediate(JSImmediate::oneImmediate()), X86::edx);
    867             m_slowCases.append(SlowCaseEntry(__ jo(), i));
     832            m_slowCases.append(SlowCaseEntry(joAdd32(Imm32(getDeTaggedConstantImmediate(JSImmediate::oneImmediate())), X86::edx), i));
    868833            emitPutVirtualRegister(srcDst, X86::edx);
    869834            emitPutVirtualRegister(instruction[i + 1].u.operand);
     
    873838        case op_unexpected_load: {
    874839            JSValue* v = m_codeBlock->unexpectedConstant(instruction[i + 2].u.operand);
    875             __ movl_i32r(asInteger(v), X86::eax);
     840            move(ImmPtr(v), X86::eax);
    876841            emitPutVirtualRegister(instruction[i + 1].u.operand);
    877842            i += OPCODE_LENGTH(op_unexpected_load);
     
    897862            emitGetVirtualRegisters(instruction[i + 2].u.operand, X86::eax, instruction[i + 3].u.operand, X86::edx, i);
    898863            emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, X86::ecx, i);
    899             __ cmpl_rr(X86::edx, X86::eax);
    900             __ sete_r(X86::eax);
    901             __ movzbl_rr(X86::eax, X86::eax);
     864            sete32(X86::edx, X86::eax);
    902865            emitTagAsBoolImmediate(X86::eax);
    903866            emitPutVirtualRegister(instruction[i + 1].u.operand);
     
    924887                emitGetVirtualRegister(src2, X86::eax, i);
    925888                emitJumpSlowCaseIfNotImmNum(X86::eax, i);
    926                 __ andl_i32r(asInteger(value), X86::eax); // FIXME: make it more obvious this is relying on the format of JSImmediate
     889                and32(Imm32(asInteger(value)), X86::eax); // FIXME: make it more obvious this is relying on the format of JSImmediate
    927890                emitPutVirtualRegister(dst);
    928891            } else if (JSValue* value = getConstantImmediateNumericArg(src2)) {
    929892                emitGetVirtualRegister(src1, X86::eax, i);
    930893                emitJumpSlowCaseIfNotImmNum(X86::eax, i);
    931                 __ andl_i32r(asInteger(value), X86::eax);
     894                and32(Imm32(asInteger(value)), X86::eax);
    932895                emitPutVirtualRegister(dst);
    933896            } else {
    934897                emitGetVirtualRegisters(src1, X86::eax, src2, X86::edx, i);
    935                 __ andl_rr(X86::edx, X86::eax);
     898                and32(X86::edx, X86::eax);
    936899                emitJumpSlowCaseIfNotImmNum(X86::eax, i);
    937900                emitPutVirtualRegister(dst);
     
    947910                emitJumpSlowCaseIfNotImmNum(X86::eax, i);
    948911                // Mask with 0x1f as per ecma-262 11.7.2 step 7.
    949                 __ sarl_i8r(JSImmediate::getTruncatedUInt32(value) & 0x1f, X86::eax);
     912                rshift32(Imm32(JSImmediate::getTruncatedUInt32(value) & 0x1f), X86::eax);
    950913            } else {
    951914                emitGetVirtualRegisters(src1, X86::eax, src2, X86::ecx, i);
     
    963926            emitGetVirtualRegister(instruction[i + 2].u.operand, X86::eax, i);
    964927            emitJumpSlowCaseIfNotImmNum(X86::eax, i);
    965             __ xorl_i8r(~JSImmediate::TagBitTypeInteger, X86::eax);
     928            xor32(Imm32(~JSImmediate::TagBitTypeInteger), X86::eax);
    966929            emitPutVirtualRegister(instruction[i + 1].u.operand);
    967930            i += OPCODE_LENGTH(op_bitnot);
     
    994957            __ idivl_r(X86::ecx);
    995958            emitFastArithReTagImmediate(X86::edx);
    996             __ movl_rr(X86::edx, X86::eax);
     959            move(X86::edx, X86::eax);
    997960            emitPutVirtualRegister(instruction[i + 1].u.operand);
    998961            i += OPCODE_LENGTH(op_mod);
     
    1003966            emitGetVirtualRegister(instruction[i + 1].u.operand, X86::eax, i);
    1004967
    1005             __ cmpl_i32r(asInteger(JSImmediate::zeroImmediate()), X86::eax);
    1006             JmpSrc isZero = __ je();
    1007             __ testl_i32r(JSImmediate::TagBitTypeInteger, X86::eax);
    1008             m_jmpTable.append(JmpTable(__ jne(), i + 2 + target));
    1009 
    1010             __ cmpl_i32r(asInteger(JSImmediate::trueImmediate()), X86::eax);
    1011             m_jmpTable.append(JmpTable(__ je(), i + 2 + target));
    1012             __ cmpl_i32r(asInteger(JSImmediate::falseImmediate()), X86::eax);
    1013             m_slowCases.append(SlowCaseEntry(__ jne(), i));
    1014 
    1015             __ link(isZero, __ label());
     968            Jump isZero = je32(X86::eax, Imm32(asInteger(JSImmediate::zeroImmediate())));
     969            m_jmpTable.append(JmpTable(jnz32(X86::eax, Imm32(JSImmediate::TagBitTypeInteger)), i + 2 + target));
     970
     971            m_jmpTable.append(JmpTable(je32(X86::eax, Imm32(asInteger(JSImmediate::trueImmediate()))), i + 2 + target));
     972            m_slowCases.append(SlowCaseEntry(jne32(X86::eax, Imm32(asInteger(JSImmediate::falseImmediate()))), i));
     973
     974            isZero.link(this);
    1016975            i += OPCODE_LENGTH(op_jtrue);
    1017976            break;
     
    1021980            emitGetVirtualRegisters(instruction[i + 2].u.operand, X86::eax, instruction[i + 3].u.operand, X86::edx, i);
    1022981            emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, X86::ecx, i);
    1023             __ cmpl_rr(X86::eax, X86::edx);
    1024 
    1025             __ setne_r(X86::eax);
    1026             __ movzbl_rr(X86::eax, X86::eax);
     982            setne32(X86::edx, X86::eax);
    1027983            emitTagAsBoolImmediate(X86::eax);
    1028984
     
    1035991            int srcDst = instruction[i + 2].u.operand;
    1036992            emitGetVirtualRegister(srcDst, X86::eax, i);
    1037             __ movl_rr(X86::eax, X86::edx);
     993            move(X86::eax, X86::edx);
    1038994            emitJumpSlowCaseIfNotImmNum(X86::eax, i);
    1039             __ subl_i8r(getDeTaggedConstantImmediate(JSImmediate::oneImmediate()), X86::edx);
    1040             m_slowCases.append(SlowCaseEntry(__ jo(), i));
     995            m_slowCases.append(SlowCaseEntry(joSub32(Imm32(getDeTaggedConstantImmediate(JSImmediate::oneImmediate())), X86::edx), i));
    1041996            emitPutVirtualRegister(srcDst, X86::edx);
    1042997            emitPutVirtualRegister(instruction[i + 1].u.operand);
     
    10481003            emitGetVirtualRegisters(instruction[i + 2].u.operand, X86::eax, instruction[i + 3].u.operand, X86::edx, i);
    10491004            emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, X86::ecx, i);
    1050             __ xorl_rr(X86::edx, X86::eax);
     1005            xor32(X86::edx, X86::eax);
    10511006            emitFastArithReTagImmediate(X86::eax);
    10521007            emitPutVirtualRegister(instruction[i + 1].u.operand);
     
    10651020            emitGetVirtualRegisters(instruction[i + 2].u.operand, X86::eax, instruction[i + 3].u.operand, X86::edx, i);
    10661021            emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, X86::ecx, i);
    1067             __ orl_rr(X86::edx, X86::eax);
     1022            or32(X86::edx, X86::eax);
    10681023            emitPutVirtualRegister(instruction[i + 1].u.operand);
    10691024            i += OPCODE_LENGTH(op_bitor);
     
    10921047            unsigned target = instruction[i + 3].u.operand;
    10931048            emitCTICall(i, Interpreter::cti_op_next_pname);
    1094             __ testl_rr(X86::eax, X86::eax);
    1095             JmpSrc endOfIter = __ je();
    1096             emitPutVirtualRegister(instruction[i + 1].u.operand);
    1097             m_jmpTable.append(JmpTable(__ jmp(), i + 3 + target));
    1098             __ link(endOfIter, __ label());
     1049            Jump endOfIter = jzPtr(X86::eax);
     1050            emitPutVirtualRegister(instruction[i + 1].u.operand);
     1051            m_jmpTable.append(JmpTable(jump(), i + 3 + target));
     1052            endOfIter.link(this);
    10991053            i += OPCODE_LENGTH(op_next_pname);
    11001054            break;
     
    11321086            emitGetVirtualRegister(srcVReg, X86::eax, i);
    11331087           
    1134             __ testl_i32r(JSImmediate::TagBitTypeInteger, X86::eax);
    1135             JmpSrc wasImmediate = __ jnz();
     1088            Jump wasImmediate = jnz32(X86::eax, Imm32(JSImmediate::TagBitTypeInteger));
    11361089
    11371090            emitJumpSlowCaseIfNotJSCell(X86::eax, i, srcVReg);
    1138 
    1139             __ movl_mr(FIELD_OFFSET(JSCell, m_structure), X86::eax, X86::ecx);
    1140             __ cmpl_i32m(NumberType, FIELD_OFFSET(Structure, m_typeInfo.m_type), X86::ecx);
     1091            loadPtr(Address(X86::eax, FIELD_OFFSET(JSCell, m_structure)), X86::ecx);
     1092            m_slowCases.append(SlowCaseEntry(jne32(Address(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo.m_type)), Imm32(NumberType)), i));
    11411093           
    1142             m_slowCases.append(SlowCaseEntry(__ jne(), i));
    1143            
    1144             __ link(wasImmediate, __ label());
     1094            wasImmediate.link(this);
    11451095
    11461096            emitPutVirtualRegister(instruction[i + 1].u.operand);
     
    11761126            emitCTICall(i, Interpreter::cti_op_jmp_scopes);
    11771127            unsigned target = instruction[i + 2].u.operand;
    1178             m_jmpTable.append(JmpTable(__ jmp(), i + 2 + target));
     1128            m_jmpTable.append(JmpTable(jump(), i + 2 + target));
    11791129            i += OPCODE_LENGTH(op_jmp_scopes);
    11801130            break;
     
    12011151            emitPutCTIArgConstant(tableIndex, 4);
    12021152            emitCTICall(i, Interpreter::cti_op_switch_imm);
    1203             __ jmp_r(X86::eax);
     1153            jump(X86::eax);
    12041154            i += OPCODE_LENGTH(op_switch_imm);
    12051155            break;
     
    12181168            emitPutCTIArgConstant(tableIndex, 4);
    12191169            emitCTICall(i, Interpreter::cti_op_switch_char);
    1220             __ jmp_r(X86::eax);
     1170            jump(X86::eax);
    12211171            i += OPCODE_LENGTH(op_switch_char);
    12221172            break;
     
    12341184            emitPutCTIArgConstant(tableIndex, 4);
    12351185            emitCTICall(i, Interpreter::cti_op_switch_string);
    1236             __ jmp_r(X86::eax);
     1186            jump(X86::eax);
    12371187            i += OPCODE_LENGTH(op_switch_string);
    12381188            break;
     
    13661316
    13671317            emitJumpSlowCaseIfNotJSCell(X86::eax, i);
    1368             __ movl_mr(FIELD_OFFSET(JSCell, m_structure), X86::eax, X86::edx);
    1369             __ testl_i32m(NeedsThisConversion, FIELD_OFFSET(Structure, m_typeInfo.m_flags), X86::edx);
    1370             m_slowCases.append(SlowCaseEntry(__ jnz(), i));
     1318            loadPtr(Address(X86::eax, FIELD_OFFSET(JSCell, m_structure)), X86::edx);
     1319            m_slowCases.append(SlowCaseEntry(jnz32(Address(X86::edx, FIELD_OFFSET(Structure, m_typeInfo.m_flags)), Imm32(NeedsThisConversion)), i));
    13711320
    13721321            i += OPCODE_LENGTH(op_convert_this);
     
    14921441            break;
    14931442        }
     1443        case op_construct_verify: {
     1444            __ link(iter->from, __ label());
     1445            __ link((++iter)->from, __ label());
     1446            emitGetVirtualRegister(instruction[i + 2].u.operand, X86::eax, i);
     1447            emitPutVirtualRegister(instruction[i + 1].u.operand);
     1448
     1449            i += OPCODE_LENGTH(op_construct_verify);
     1450            break;
     1451        }
    14941452        case op_get_by_val: {
    14951453            // The slow case that handles accesses to arrays (below) may jump back up to here.
Note: See TracChangeset for help on using the changeset viewer.