Changeset 155497 in webkit for trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
- Timestamp:
- Sep 10, 2013, 8:24:09 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
r155482 r155497 2426 2426 2427 2427 JITCompiler::JumpList failureCases; 2428 bool negZeroCheck = ! nodeCanIgnoreNegativeZero(node->arithNodeFlags());2428 bool negZeroCheck = !bytecodeCanIgnoreNegativeZero(node->arithNodeFlags()); 2429 2429 m_jit.branchConvertDoubleToInt32(valueFPR, resultGPR, failureCases, scratchFPR, negZeroCheck); 2430 2430 forwardSpeculationCheck(Overflow, JSValueRegs(), 0, failureCases, ValueRecovery::inFPR(valueFPR)); … … 2930 2930 GPRTemporary result(this); 2931 2931 2932 if ( nodeCanTruncateInteger(node->arithNodeFlags())) {2932 if (bytecodeCanTruncateInteger(node->arithNodeFlags())) { 2933 2933 m_jit.move(op2.gpr(), result.gpr()); 2934 2934 m_jit.add32(Imm32(imm1), result.gpr()); … … 2945 2945 GPRTemporary result(this); 2946 2946 2947 if ( nodeCanTruncateInteger(node->arithNodeFlags())) {2947 if (bytecodeCanTruncateInteger(node->arithNodeFlags())) { 2948 2948 m_jit.move(op1.gpr(), result.gpr()); 2949 2949 m_jit.add32(Imm32(imm2), result.gpr()); … … 2963 2963 GPRReg gprResult = result.gpr(); 2964 2964 2965 if ( nodeCanTruncateInteger(node->arithNodeFlags())) {2965 if (bytecodeCanTruncateInteger(node->arithNodeFlags())) { 2966 2966 if (gpr1 == gprResult) 2967 2967 m_jit.add32(gpr2, gprResult); … … 3084 3084 GPRTemporary result(this); 3085 3085 3086 if ( nodeCanTruncateInteger(node->arithNodeFlags())) {3086 if (bytecodeCanTruncateInteger(node->arithNodeFlags())) { 3087 3087 m_jit.move(op1.gpr(), result.gpr()); 3088 3088 m_jit.sub32(Imm32(imm2), result.gpr()); … … 3106 3106 3107 3107 m_jit.move(Imm32(imm1), result.gpr()); 3108 if ( nodeCanTruncateInteger(node->arithNodeFlags()))3108 if (bytecodeCanTruncateInteger(node->arithNodeFlags())) 3109 3109 m_jit.sub32(op2.gpr(), result.gpr()); 3110 3110 else … … 3119 3119 GPRTemporary result(this); 3120 3120 3121 if ( nodeCanTruncateInteger(node->arithNodeFlags())) {3121 if (bytecodeCanTruncateInteger(node->arithNodeFlags())) { 3122 3122 m_jit.move(op1.gpr(), result.gpr()); 3123 3123 m_jit.sub32(op2.gpr(), result.gpr()); … … 3157 3157 m_jit.move(op1.gpr(), result.gpr()); 3158 3158 3159 if ( nodeCanTruncateInteger(node->arithNodeFlags()))3159 if (bytecodeCanTruncateInteger(node->arithNodeFlags())) 3160 3160 m_jit.neg32(result.gpr()); 3161 3161 else { 3162 3162 speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branchNeg32(MacroAssembler::Overflow, result.gpr())); 3163 if (! nodeCanIgnoreNegativeZero(node->arithNodeFlags()))3163 if (!bytecodeCanIgnoreNegativeZero(node->arithNodeFlags())) 3164 3164 speculationCheck(NegativeZero, JSValueRegs(), 0, m_jit.branchTest32(MacroAssembler::Zero, result.gpr())); 3165 3165 } … … 3213 3213 // fixup phase could not prove that it would be safe, it would have turned us into 3214 3214 // a double multiplication. 3215 if ( nodeCanTruncateInteger(node->arithNodeFlags())) {3215 if (bytecodeCanTruncateInteger(node->arithNodeFlags())) { 3216 3216 m_jit.move(reg1, result.gpr()); 3217 3217 m_jit.mul32(reg2, result.gpr()); … … 3223 3223 3224 3224 // Check for negative zero, if the users of this node care about such things. 3225 if (! nodeCanIgnoreNegativeZero(node->arithNodeFlags())) {3225 if (!bytecodeCanIgnoreNegativeZero(node->arithNodeFlags())) { 3226 3226 MacroAssembler::Jump resultNonZero = m_jit.branchTest32(MacroAssembler::NonZero, result.gpr()); 3227 3227 speculationCheck(NegativeZero, JSValueRegs(), 0, m_jit.branch32(MacroAssembler::LessThan, reg1, TrustedImm32(0))); … … 3287 3287 3288 3288 JITCompiler::JumpList done; 3289 if ( nodeUsedAsNumber(node->arithNodeFlags())) {3289 if (bytecodeUsesAsNumber(node->arithNodeFlags())) { 3290 3290 speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branchTest32(JITCompiler::Zero, op2GPR)); 3291 3291 speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branch32(JITCompiler::Equal, op1GPR, TrustedImm32(-2147483647-1))); … … 3315 3315 // If the user cares about negative zero, then speculate that we're not about 3316 3316 // to produce negative zero. 3317 if (! nodeCanIgnoreNegativeZero(node->arithNodeFlags())) {3317 if (!bytecodeCanIgnoreNegativeZero(node->arithNodeFlags())) { 3318 3318 MacroAssembler::Jump numeratorNonZero = m_jit.branchTest32(MacroAssembler::NonZero, op1GPR); 3319 3319 speculationCheck(NegativeZero, JSValueRegs(), 0, m_jit.branch32(MacroAssembler::LessThan, op2GPR, TrustedImm32(0))); … … 3335 3335 // Check that there was no remainder. If there had been, then we'd be obligated to 3336 3336 // produce a double result instead. 3337 if ( nodeUsedAsNumber(node->arithNodeFlags()))3337 if (bytecodeUsesAsNumber(node->arithNodeFlags())) 3338 3338 speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branchTest32(JITCompiler::NonZero, edx.gpr())); 3339 3339 … … 3350 3350 // If the user cares about negative zero, then speculate that we're not about 3351 3351 // to produce negative zero. 3352 if (! nodeCanIgnoreNegativeZero(node->arithNodeFlags())) {3352 if (!bytecodeCanIgnoreNegativeZero(node->arithNodeFlags())) { 3353 3353 MacroAssembler::Jump numeratorNonZero = m_jit.branchTest32(MacroAssembler::NonZero, op1GPR); 3354 3354 speculationCheck(NegativeZero, JSValueRegs(), 0, m_jit.branch32(MacroAssembler::LessThan, op2GPR, TrustedImm32(0))); … … 3360 3360 // Check that there was no remainder. If there had been, then we'd be obligated to 3361 3361 // produce a double result instead. 3362 if ( nodeUsedAsNumber(node->arithNodeFlags())) {3362 if (bytecodeUsesAsNumber(node->arithNodeFlags())) { 3363 3363 speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branchMul32(JITCompiler::Overflow, quotient.gpr(), op2GPR, multiplyAnswer.gpr())); 3364 3364 speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branch32(JITCompiler::NotEqual, multiplyAnswer.gpr(), op1GPR)); … … 3449 3449 m_jit.add32(dividendGPR, resultGPR); 3450 3450 3451 if (! nodeCanIgnoreNegativeZero(node->arithNodeFlags())) {3451 if (!bytecodeCanIgnoreNegativeZero(node->arithNodeFlags())) { 3452 3452 // Check that we're not about to create negative zero. 3453 3453 JITCompiler::Jump numeratorPositive = m_jit.branch32(JITCompiler::GreaterThanOrEqual, dividendGPR, TrustedImm32(0)); … … 3486 3486 m_jit.assembler().cdq(); 3487 3487 m_jit.assembler().idivl_r(scratchGPR); 3488 if (! nodeCanIgnoreNegativeZero(node->arithNodeFlags())) {3488 if (!bytecodeCanIgnoreNegativeZero(node->arithNodeFlags())) { 3489 3489 JITCompiler::Jump numeratorPositive = m_jit.branch32(JITCompiler::GreaterThanOrEqual, op1SaveGPR, TrustedImm32(0)); 3490 3490 speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branchTest32(JITCompiler::Zero, edx.gpr())); … … 3543 3543 // FIXME: -2^31 / -1 will actually yield negative zero, so we could have a 3544 3544 // separate case for that. But it probably doesn't matter so much. 3545 if ( nodeUsedAsNumber(node->arithNodeFlags())) {3545 if (bytecodeUsesAsNumber(node->arithNodeFlags())) { 3546 3546 speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branchTest32(JITCompiler::Zero, op2GPR)); 3547 3547 speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branch32(JITCompiler::Equal, op1GPR, TrustedImm32(-2147483647-1))); … … 3582 3582 3583 3583 // Check that we're not about to create negative zero. 3584 if (! nodeCanIgnoreNegativeZero(node->arithNodeFlags())) {3584 if (!bytecodeCanIgnoreNegativeZero(node->arithNodeFlags())) { 3585 3585 JITCompiler::Jump numeratorPositive = m_jit.branch32(JITCompiler::GreaterThanOrEqual, op1SaveGPR, TrustedImm32(0)); 3586 3586 speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branchTest32(JITCompiler::Zero, edx.gpr())); … … 3609 3609 // If the user cares about negative zero, then speculate that we're not about 3610 3610 // to produce negative zero. 3611 if (! nodeCanIgnoreNegativeZero(node->arithNodeFlags())) {3611 if (!bytecodeCanIgnoreNegativeZero(node->arithNodeFlags())) { 3612 3612 // Check that we're not about to create negative zero. 3613 3613 JITCompiler::Jump numeratorPositive = m_jit.branch32(JITCompiler::GreaterThanOrEqual, dividendGPR, TrustedImm32(0));
Note:
See TracChangeset
for help on using the changeset viewer.