Changeset 39851 in webkit for trunk/JavaScriptCore/jit
- Timestamp:
- Jan 12, 2009, 8:51:16 PM (16 years ago)
- Location:
- trunk/JavaScriptCore/jit
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/jit/JIT.cpp
r39752 r39851 236 236 firstNotImmediate.link(this); 237 237 emitJumpSlowCaseIfJSCell(X86::edx); 238 addSlowCase(jePtr(X86::edx, ImmPtr(JSValuePtr::encode( JSImmediate::zeroImmediate()))));238 addSlowCase(jePtr(X86::edx, ImmPtr(JSValuePtr::encode(js0())))); 239 239 Jump firstWasNotImmediate = jump(); 240 240 … … 242 242 // If eax is 0 jump to a slow case, otherwise these values are not equal. 243 243 secondNotImmediate.link(this); 244 addSlowCase(jePtr(X86::eax, ImmPtr(JSValuePtr::encode( JSImmediate::zeroImmediate()))));244 addSlowCase(jePtr(X86::eax, ImmPtr(JSValuePtr::encode(js0())))); 245 245 246 246 // We get here if the two values are different immediates, or one is 0 and the other is a JSCell. … … 350 350 emitJumpSlowCaseIfNotImmNum(X86::eax); 351 351 #if USE(ALTERNATE_JSIMMEDIATE) 352 int32_t op2imm = JSImmediate::intValue(getConstantOperand(op2));352 int32_t op2imm = getConstantOperandImmediateInt(op2); 353 353 #else 354 354 int32_t op2imm = static_cast<int32_t>(JSImmediate::rawValue(getConstantOperand(op2))); … … 373 373 emitJumpSlowCaseIfNotImmNum(X86::eax); 374 374 #if USE(ALTERNATE_JSIMMEDIATE) 375 int32_t op2imm = JSImmediate::intValue(getConstantOperand(op2));375 int32_t op2imm = getConstantOperandImmediateInt(op2); 376 376 #else 377 377 int32_t op2imm = static_cast<int32_t>(JSImmediate::rawValue(getConstantOperand(op2))); … … 644 644 emitGetVirtualRegister(currentInstruction[1].u.operand, X86::eax); 645 645 646 Jump isZero = jePtr(X86::eax, ImmPtr(JSValuePtr::encode( JSImmediate::zeroImmediate())));646 Jump isZero = jePtr(X86::eax, ImmPtr(JSValuePtr::encode(js0()))); 647 647 addJump(emitJumpIfImmNum(X86::eax), target + 2); 648 648 … … 718 718 emitJumpSlowCaseIfNotImmNum(X86::eax); 719 719 #if USE(ALTERNATE_JSIMMEDIATE) 720 int32_t op2imm = JSImmediate::intValue(getConstantOperand(op2));720 int32_t op2imm = getConstantOperandImmediateInt(op2); 721 721 #else 722 722 int32_t op2imm = static_cast<int32_t>(JSImmediate::rawValue(getConstantOperand(op2))); … … 743 743 emitGetVirtualRegister(currentInstruction[1].u.operand, X86::eax); 744 744 745 addJump(jePtr(X86::eax, ImmPtr(JSValuePtr::encode( JSImmediate::zeroImmediate()))), target + 2);745 addJump(jePtr(X86::eax, ImmPtr(JSValuePtr::encode(js0()))), target + 2); 746 746 Jump isNonZero = emitJumpIfImmNum(X86::eax); 747 747 … … 869 869 emitGetVirtualRegister(currentInstruction[1].u.operand, X86::eax); 870 870 871 Jump isZero = jePtr(X86::eax, ImmPtr(JSValuePtr::encode( JSImmediate::zeroImmediate())));871 Jump isZero = jePtr(X86::eax, ImmPtr(JSValuePtr::encode(js0()))); 872 872 addJump(emitJumpIfImmNum(X86::eax), target + 2); 873 873 -
trunk/JavaScriptCore/jit/JIT.h
r39738 r39851 352 352 } 353 353 354 static bool isStrictEqCaseHandledInJITCode(JSValuePtr src1, JSValuePtr src2) 355 { 356 return JSImmediate::areBothImmediate(src1, src2) || (JSImmediate::isEitherImmediate(src1, src2) & (src1 != js0()) & (src2 != js0())); 357 } 358 354 359 private: 355 360 JIT(JSGlobalData*, CodeBlock* = 0); -
trunk/JavaScriptCore/jit/JITArithmetic.cpp
r39738 r39851 97 97 // Mask with 0x1f as per ecma-262 11.7.2 step 7. 98 98 #if USE(ALTERNATE_JSIMMEDIATE) 99 rshift32(Imm32( JSImmediate::getTruncatedUInt32(getConstantOperand(op2)) & 0x1f), X86::eax);100 #else 101 rshiftPtr(Imm32( JSImmediate::getTruncatedUInt32(getConstantOperand(op2)) & 0x1f), X86::eax);99 rshift32(Imm32(getConstantOperandImmediateInt(op2) & 0x1f), X86::eax); 100 #else 101 rshiftPtr(Imm32(getConstantOperandImmediateInt(op2) & 0x1f), X86::eax); 102 102 #endif 103 103 } else { … … 145 145 emitJumpSlowCaseIfNotImmNum(X86::eax); 146 146 #if USE(ALTERNATE_JSIMMEDIATE) 147 int32_t imm = JSImmediate::intValue(getConstantOperand(op1));147 int32_t imm = getConstantOperandImmediateInt(op1); 148 148 andPtr(Imm32(imm), X86::eax); 149 149 if (imm >= 0) … … 156 156 emitJumpSlowCaseIfNotImmNum(X86::eax); 157 157 #if USE(ALTERNATE_JSIMMEDIATE) 158 int32_t imm = JSImmediate::intValue(getConstantOperand(op2));158 int32_t imm = getConstantOperandImmediateInt(op2); 159 159 andPtr(Imm32(imm), X86::eax); 160 160 if (imm >= 0) … … 193 193 emitJumpSlowCaseIfNotImmNum(X86::ecx); 194 194 #if USE(ALTERNATE_JSIMMEDIATE) 195 addSlowCase(jePtr(X86::ecx, ImmPtr(JSValuePtr::encode( JSImmediate::zeroImmediate()))));195 addSlowCase(jePtr(X86::ecx, ImmPtr(JSValuePtr::encode(js0())))); 196 196 mod32(X86::ecx, X86::eax, X86::edx); 197 197 #else -
trunk/JavaScriptCore/jit/JITCall.cpp
r39738 r39851 50 50 // (and, if a new JSFunction happened to be constructed at the same location, we could get a false positive 51 51 // match). Reset the check so it no longer matches. 52 DataLabelPtr::patch(callLinkInfo->hotPathBegin, JSValuePtr::encode( JSImmediate::impossibleValue()));52 DataLabelPtr::patch(callLinkInfo->hotPathBegin, JSValuePtr::encode(jsImpossibleValue())); 53 53 } 54 54 … … 134 134 135 135 emitCTICall(Interpreter::cti_op_call_eval); 136 wasEval = jnePtr(X86::eax, ImmPtr( JSImmediate::impossibleValue()));136 wasEval = jnePtr(X86::eax, ImmPtr(jsImpossibleValue())); 137 137 } 138 138 … … 212 212 213 213 emitCTICall(Interpreter::cti_op_call_eval); 214 wasEval = jnePtr(X86::eax, ImmPtr(JSValuePtr::encode( JSImmediate::impossibleValue())));214 wasEval = jnePtr(X86::eax, ImmPtr(JSValuePtr::encode(jsImpossibleValue()))); 215 215 } 216 216 … … 219 219 emitGetVirtualRegister(callee, X86::ecx); 220 220 DataLabelPtr addressOfLinkedFunctionCheck; 221 Jump jumpToSlow = jnePtrWithPatch(X86::ecx, addressOfLinkedFunctionCheck, ImmPtr(JSValuePtr::encode( JSImmediate::impossibleValue())));221 Jump jumpToSlow = jnePtrWithPatch(X86::ecx, addressOfLinkedFunctionCheck, ImmPtr(JSValuePtr::encode(jsImpossibleValue()))); 222 222 addSlowCase(jumpToSlow); 223 223 ASSERT(differenceBetween(addressOfLinkedFunctionCheck, jumpToSlow) == patchOffsetOpCallCompareToJump); -
trunk/JavaScriptCore/jit/JITInlineMethods.h
r39738 r39851 121 121 ALWAYS_INLINE int32_t JIT::getConstantOperandImmediateInt(unsigned src) 122 122 { 123 return static_cast<int32_t>(JSImmediate::intValue(getConstantOperand(src)));123 return getConstantOperand(src)->getInt32Fast(); 124 124 } 125 125 126 126 ALWAYS_INLINE bool JIT::isOperandConstantImmediateInt(unsigned src) 127 127 { 128 return m_codeBlock->isConstantRegisterIndex(src) && JSImmediate::isNumber(getConstantOperand(src));128 return m_codeBlock->isConstantRegisterIndex(src) && getConstantOperand(src)->isInt32Fast(); 129 129 } 130 130
Note:
See TracChangeset
for help on using the changeset viewer.