Changeset 190230 in webkit
- Timestamp:
- Sep 24, 2015 5:17:16 PM (9 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r190220 r190230 1 2015-09-24 Mark Lam <mark.lam@apple.com> 2 3 Remove the use of "Immediate" in JIT function names. 4 https://bugs.webkit.org/show_bug.cgi?id=149542 5 6 Reviewed by Geoffrey Garen. 7 8 We will rename the following: 9 isOperandConstantImmediateDouble => isOperandConstantDouble 10 isOperandConstantImmediateInt => isOperandConstantInt 11 isOperandConstantImmediateChar => isOperandConstantChar 12 13 getOperandConstantImmediateInt => getOperandConstantInt 14 getConstantOperandImmediateInt => getOperandConstantInt 15 16 emitJumpIfImmediateInteger => emitJumpIfInt 17 emitJumpIfNotImmediateInteger => emitJumpIfNotInt 18 emitJumpIfNotImmediateIntegers => emitJumpIfNotInt 19 emitPatchableJumpIfNotImmediateInteger => emitPatchableJumpIfNotInt 20 emitJumpSlowCaseIfNotImmediateInteger => emitJumpSlowCaseIfNotInt 21 emitJumpSlowCaseIfNotImmediateNumber => emitJumpSlowCaseIfNotNumber 22 emitJumpSlowCaseIfNotImmediateIntegers => emitJumpSlowCaseIfNotInt 23 emitFastArithReTagImmediate => emitTagInt 24 emitTagAsBoolImmediate => emitTagBool 25 emitJumpIfImmediateNumber => emitJumpIfNumber 26 emitJumpIfNotImmediateNumber => emitJumpIfNotNumber 27 emitFastArithImmToInt - Deleted because this is an empty function. 28 emitFastArithIntToImmNoCheck => emitTagInt 29 emitPutImmediateToCallFrameHeader => emitPutToCallFrameHeader 30 31 This is purely a refactoring patch to do the renaming. There is no behavior 32 change. 33 34 * dfg/DFGJITCompiler.cpp: 35 (JSC::DFG::JITCompiler::compileEntry): 36 (JSC::DFG::JITCompiler::compileSetupRegistersForEntry): 37 * jit/AssemblyHelpers.h: 38 (JSC::AssemblyHelpers::emitPutToCallFrameHeader): 39 (JSC::AssemblyHelpers::emitPutImmediateToCallFrameHeader): Deleted. 40 * jit/JIT.cpp: 41 (JSC::JIT::privateCompile): 42 * jit/JIT.h: 43 (JSC::JIT::emitStoreCell): 44 (JSC::JIT::getSlowCase): 45 * jit/JITArithmetic.cpp: 46 (JSC::JIT::emit_op_negate): 47 (JSC::JIT::emit_op_lshift): 48 (JSC::JIT::emit_op_rshift): 49 (JSC::JIT::emitSlow_op_rshift): 50 (JSC::JIT::emit_op_urshift): 51 (JSC::JIT::emitSlow_op_urshift): 52 (JSC::JIT::emit_op_unsigned): 53 (JSC::JIT::emit_compareAndJump): 54 (JSC::JIT::emit_compareAndJumpSlow): 55 (JSC::JIT::emit_op_bitand): 56 (JSC::JIT::emit_op_inc): 57 (JSC::JIT::emit_op_dec): 58 (JSC::JIT::emit_op_mod): 59 (JSC::JIT::compileBinaryArithOp): 60 (JSC::JIT::compileBinaryArithOpSlowCase): 61 (JSC::JIT::emit_op_add): 62 (JSC::JIT::emitSlow_op_add): 63 (JSC::JIT::emit_op_mul): 64 (JSC::JIT::emitSlow_op_mul): 65 (JSC::JIT::emit_op_div): 66 (JSC::JIT::emitSlow_op_div): 67 * jit/JITArithmetic32_64.cpp: 68 (JSC::JIT::emit_compareAndJump): 69 (JSC::JIT::emit_compareAndJumpSlow): 70 (JSC::JIT::emit_op_lshift): 71 (JSC::JIT::emitSlow_op_lshift): 72 (JSC::JIT::emitRightShift): 73 (JSC::JIT::emitRightShiftSlowCase): 74 (JSC::JIT::emit_op_bitand): 75 (JSC::JIT::emitSlow_op_bitand): 76 (JSC::JIT::emit_op_bitor): 77 (JSC::JIT::emitSlow_op_bitor): 78 (JSC::JIT::emit_op_bitxor): 79 (JSC::JIT::emitSlow_op_bitxor): 80 (JSC::JIT::emit_op_add): 81 (JSC::JIT::emitSlow_op_add): 82 (JSC::JIT::emit_op_sub): 83 (JSC::JIT::emitSlow_op_sub): 84 * jit/JITInlines.h: 85 (JSC::JIT::emitArrayStorageGetByVal): 86 (JSC::JIT::isOperandConstantDouble): 87 (JSC::JIT::isOperandConstantChar): 88 (JSC::JIT::emitJumpSlowCaseIfNotJSCell): 89 (JSC::JIT::isOperandConstantInt): 90 (JSC::JIT::getOperandConstantInt): 91 (JSC::JIT::emitGetVirtualRegisters): 92 (JSC::JIT::emitLoadInt32ToDouble): 93 (JSC::JIT::emitJumpIfInt): 94 (JSC::JIT::emitJumpIfNotInt): 95 (JSC::JIT::emitPatchableJumpIfNotInt): 96 (JSC::JIT::emitJumpSlowCaseIfNotInt): 97 (JSC::JIT::emitJumpSlowCaseIfNotNumber): 98 (JSC::JIT::emitTagBool): 99 (JSC::JIT::isOperandConstantImmediateDouble): Deleted. 100 (JSC::JIT::isOperandConstantImmediateChar): Deleted. 101 (JSC::JIT::isOperandConstantImmediateInt): Deleted. 102 (JSC::JIT::getOperandConstantImmediateInt): Deleted. 103 (JSC::JIT::getConstantOperandImmediateInt): Deleted. 104 (JSC::JIT::emitJumpIfImmediateInteger): Deleted. 105 (JSC::JIT::emitJumpIfNotImmediateInteger): Deleted. 106 (JSC::JIT::emitPatchableJumpIfNotImmediateInteger): Deleted. 107 (JSC::JIT::emitJumpIfNotImmediateIntegers): Deleted. 108 (JSC::JIT::emitJumpSlowCaseIfNotImmediateInteger): Deleted. 109 (JSC::JIT::emitJumpSlowCaseIfNotImmediateIntegers): Deleted. 110 (JSC::JIT::emitJumpSlowCaseIfNotImmediateNumber): Deleted. 111 (JSC::JIT::emitFastArithReTagImmediate): Deleted. 112 (JSC::JIT::emitTagAsBoolImmediate): Deleted. 113 * jit/JITOpcodes.cpp: 114 (JSC::JIT::emit_op_is_undefined): 115 (JSC::JIT::emit_op_is_boolean): 116 (JSC::JIT::emit_op_is_number): 117 (JSC::JIT::emit_op_is_string): 118 (JSC::JIT::emit_op_is_object): 119 (JSC::JIT::emit_op_jfalse): 120 (JSC::JIT::emit_op_eq): 121 (JSC::JIT::emit_op_jtrue): 122 (JSC::JIT::emit_op_neq): 123 (JSC::JIT::emit_op_bitxor): 124 (JSC::JIT::emit_op_bitor): 125 (JSC::JIT::compileOpStrictEq): 126 (JSC::JIT::emit_op_to_number): 127 (JSC::JIT::emit_op_eq_null): 128 (JSC::JIT::emit_op_neq_null): 129 (JSC::JIT::emitSlow_op_eq): 130 (JSC::JIT::emitSlow_op_neq): 131 (JSC::JIT::emit_op_profile_type): 132 * jit/JITOpcodes32_64.cpp: 133 (JSC::JIT::privateCompileCTINativeCall): 134 * jit/JITPropertyAccess.cpp: 135 (JSC::JIT::emit_op_get_by_val): 136 (JSC::JIT::emit_op_put_by_val): 137 (JSC::JIT::emitGenericContiguousPutByVal): 138 (JSC::JIT::emit_op_put_by_id): 139 (JSC::JIT::emitIntTypedArrayPutByVal): 140 (JSC::JIT::emitFloatTypedArrayPutByVal): 141 * jit/JSInterfaceJIT.h: 142 (JSC::JSInterfaceJIT::emitJumpIfNotJSCell): 143 (JSC::JSInterfaceJIT::emitJumpIfNumber): 144 (JSC::JSInterfaceJIT::emitJumpIfNotNumber): 145 (JSC::JSInterfaceJIT::emitLoadDouble): 146 (JSC::JSInterfaceJIT::emitTagInt): 147 (JSC::JSInterfaceJIT::emitPutToCallFrameHeader): 148 (JSC::JSInterfaceJIT::emitJumpIfImmediateNumber): Deleted. 149 (JSC::JSInterfaceJIT::emitJumpIfNotImmediateNumber): Deleted. 150 (JSC::JSInterfaceJIT::emitFastArithImmToInt): Deleted. 151 (JSC::JSInterfaceJIT::emitFastArithIntToImmNoCheck): Deleted. 152 (JSC::JSInterfaceJIT::emitPutImmediateToCallFrameHeader): Deleted. 153 * jit/ThunkGenerators.cpp: 154 (JSC::nativeForGenerator): 155 * wasm/WASMFunctionCompiler.h: 156 (JSC::WASMFunctionCompiler::startFunction): 157 (JSC::WASMFunctionCompiler::endFunction): 158 1 159 2015-09-24 Michael Saboff <msaboff@apple.com> 2 160 -
trunk/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp
r190220 r190230 110 110 // both normal return code and when jumping to an exception handler). 111 111 emitFunctionPrologue(); 112 emitPut ImmediateToCallFrameHeader(m_codeBlock, JSStack::CodeBlock);112 emitPutToCallFrameHeader(m_codeBlock, JSStack::CodeBlock); 113 113 } 114 114 -
trunk/Source/JavaScriptCore/jit/AssemblyHelpers.h
r190076 r190230 480 480 } 481 481 482 void emitPut ImmediateToCallFrameHeader(void* value, JSStack::CallFrameHeaderEntry entry)482 void emitPutToCallFrameHeader(void* value, JSStack::CallFrameHeaderEntry entry) 483 483 { 484 484 storePtr(TrustedImmPtr(value), Address(GPRInfo::callFrameRegister, entry * sizeof(Register))); -
trunk/Source/JavaScriptCore/jit/JIT.cpp
r189884 r190230 511 511 512 512 emitFunctionPrologue(); 513 emitPut ImmediateToCallFrameHeader(m_codeBlock, JSStack::CodeBlock);513 emitPutToCallFrameHeader(m_codeBlock, JSStack::CodeBlock); 514 514 515 515 Label beginLabel(this); … … 567 567 store8(TrustedImm32(0), &m_codeBlock->m_shouldAlwaysBeInlined); 568 568 emitFunctionPrologue(); 569 emitPut ImmediateToCallFrameHeader(m_codeBlock, JSStack::CodeBlock);569 emitPutToCallFrameHeader(m_codeBlock, JSStack::CodeBlock); 570 570 571 571 load32(payloadFor(JSStack::ArgumentCount), regT1); -
trunk/Source/JavaScriptCore/jit/JIT.h
r190063 r190230 324 324 enum CompileOpStrictEqType { OpStrictEq, OpNStrictEq }; 325 325 void compileOpStrictEq(Instruction* instruction, CompileOpStrictEqType type); 326 bool isOperandConstant ImmediateDouble(int src);326 bool isOperandConstantDouble(int src); 327 327 328 328 void emitLoadDouble(int index, FPRegisterID value); … … 402 402 403 403 #if USE(JSVALUE32_64) 404 bool getOperandConstantI mmediateInt(int op1, int op2, int& op, int32_t& constant);404 bool getOperandConstantInt(int op1, int op2, int& op, int32_t& constant); 405 405 406 406 void emitLoadTag(int index, RegisterID tag); … … 449 449 } 450 450 451 int32_t get ConstantOperandImmediateInt(int src);451 int32_t getOperandConstantInt(int src); 452 452 453 453 Jump emitJumpIfJSCell(RegisterID); … … 456 456 void emitJumpSlowCaseIfNotJSCell(RegisterID); 457 457 void emitJumpSlowCaseIfNotJSCell(RegisterID, int VReg); 458 Jump emitJumpIfImmediateInteger(RegisterID); 459 Jump emitJumpIfNotImmediateInteger(RegisterID); 460 Jump emitJumpIfNotImmediateIntegers(RegisterID, RegisterID, RegisterID); 461 PatchableJump emitPatchableJumpIfNotImmediateInteger(RegisterID); 462 void emitJumpSlowCaseIfNotImmediateInteger(RegisterID); 463 void emitJumpSlowCaseIfNotImmediateNumber(RegisterID); 464 void emitJumpSlowCaseIfNotImmediateIntegers(RegisterID, RegisterID, RegisterID); 465 466 void emitFastArithReTagImmediate(RegisterID src, RegisterID dest); 467 468 void emitTagAsBoolImmediate(RegisterID reg); 458 Jump emitJumpIfInt(RegisterID); 459 Jump emitJumpIfNotInt(RegisterID); 460 Jump emitJumpIfNotInt(RegisterID, RegisterID, RegisterID scratch); 461 PatchableJump emitPatchableJumpIfNotInt(RegisterID); 462 void emitJumpSlowCaseIfNotInt(RegisterID); 463 void emitJumpSlowCaseIfNotNumber(RegisterID); 464 void emitJumpSlowCaseIfNotInt(RegisterID, RegisterID, RegisterID scratch); 465 466 void emitTagBool(RegisterID); 469 467 void compileBinaryArithOp(OpcodeID, int dst, int src1, int src2, OperandTypes opi); 470 468 void compileBinaryArithOpSlowCase(Instruction*, OpcodeID, Vector<SlowCaseEntry>::iterator&, int dst, int src1, int src2, OperandTypes, bool op1HasImmediateIntFastCase, bool op2HasImmediateIntFastCase); … … 693 691 694 692 JSValue getConstantOperand(int src); 695 bool isOperandConstantI mmediateInt(int src);696 bool isOperandConstant ImmediateChar(int src);693 bool isOperandConstantInt(int src); 694 bool isOperandConstantChar(int src); 697 695 698 696 Jump getSlowCase(Vector<SlowCaseEntry>::iterator& iter) -
trunk/Source/JavaScriptCore/jit/JITArithmetic.cpp
r190213 r190230 197 197 emitGetVirtualRegister(src, regT0); 198 198 199 Jump srcNotInt = emitJumpIfNotI mmediateInteger(regT0);199 Jump srcNotInt = emitJumpIfNotInt(regT0); 200 200 addSlowCase(branchTest32(Zero, regT0, TrustedImm32(0x7fffffff))); 201 201 neg32(regT0); 202 emit FastArithReTagImmediate(regT0, regT0);202 emitTagInt(regT0, regT0); 203 203 204 204 Jump end = jump(); 205 205 206 206 srcNotInt.link(this); 207 emitJumpSlowCaseIfNot ImmediateNumber(regT0);207 emitJumpSlowCaseIfNotNumber(regT0); 208 208 209 209 move(TrustedImm64((int64_t)0x8000000000000000ull), regT1); … … 230 230 231 231 emitGetVirtualRegisters(op1, regT0, op2, regT2); 232 // FIXME: would we be better using 'emitJumpSlowCaseIfNotImmediateIntegers'? - we *probably* ought to be consistent. 233 emitJumpSlowCaseIfNotImmediateInteger(regT0); 234 emitJumpSlowCaseIfNotImmediateInteger(regT2); 235 emitFastArithImmToInt(regT0); 236 emitFastArithImmToInt(regT2); 232 // FIXME: would we be better using a 'emitJumpSlowCaseIfNotInt' that tests both values at once? - we *probably* ought to be consistent. 233 emitJumpSlowCaseIfNotInt(regT0); 234 emitJumpSlowCaseIfNotInt(regT2); 237 235 lshift32(regT2, regT0); 238 emit FastArithReTagImmediate(regT0, regT0);236 emitTagInt(regT0, regT0); 239 237 emitPutVirtualRegister(result); 240 238 } … … 254 252 int op2 = currentInstruction[3].u.operand; 255 253 256 if (isOperandConstantI mmediateInt(op2)) {257 // isOperandConstantI mmediateInt(op2) => 1 SlowCase254 if (isOperandConstantInt(op2)) { 255 // isOperandConstantInt(op2) => 1 SlowCase 258 256 emitGetVirtualRegister(op1, regT0); 259 emitJumpSlowCaseIfNotI mmediateInteger(regT0);257 emitJumpSlowCaseIfNotInt(regT0); 260 258 // Mask with 0x1f as per ecma-262 11.7.2 step 7. 261 rshift32(Imm32(get ConstantOperandImmediateInt(op2) & 0x1f), regT0);259 rshift32(Imm32(getOperandConstantInt(op2) & 0x1f), regT0); 262 260 } else { 263 261 emitGetVirtualRegisters(op1, regT0, op2, regT2); 264 262 if (supportsFloatingPointTruncate()) { 265 Jump lhsIsInt = emitJumpIfI mmediateInteger(regT0);263 Jump lhsIsInt = emitJumpIfInt(regT0); 266 264 // supportsFloatingPoint() && USE(JSVALUE64) => 3 SlowCases 267 addSlowCase(emitJumpIfNot ImmediateNumber(regT0));265 addSlowCase(emitJumpIfNotNumber(regT0)); 268 266 add64(tagTypeNumberRegister, regT0); 269 267 move64ToDouble(regT0, fpRegT0); 270 268 addSlowCase(branchTruncateDoubleToInt32(fpRegT0, regT0)); 271 269 lhsIsInt.link(this); 272 emitJumpSlowCaseIfNotI mmediateInteger(regT2);270 emitJumpSlowCaseIfNotInt(regT2); 273 271 } else { 274 272 // !supportsFloatingPoint() => 2 SlowCases 275 emitJumpSlowCaseIfNotI mmediateInteger(regT0);276 emitJumpSlowCaseIfNotI mmediateInteger(regT2);273 emitJumpSlowCaseIfNotInt(regT0); 274 emitJumpSlowCaseIfNotInt(regT2); 277 275 } 278 emitFastArithImmToInt(regT2);279 276 rshift32(regT2, regT0); 280 277 } 281 emit FastArithIntToImmNoCheck(regT0, regT0);278 emitTagInt(regT0, regT0); 282 279 emitPutVirtualRegister(result); 283 280 } … … 287 284 int op2 = currentInstruction[3].u.operand; 288 285 289 if (isOperandConstantI mmediateInt(op2))286 if (isOperandConstantInt(op2)) 290 287 linkSlowCase(iter); 291 288 … … 311 308 int op2 = currentInstruction[3].u.operand; 312 309 313 if (isOperandConstantI mmediateInt(op2)) {314 // isOperandConstantI mmediateInt(op2) => 1 SlowCase310 if (isOperandConstantInt(op2)) { 311 // isOperandConstantInt(op2) => 1 SlowCase 315 312 emitGetVirtualRegister(op1, regT0); 316 emitJumpSlowCaseIfNotI mmediateInteger(regT0);313 emitJumpSlowCaseIfNotInt(regT0); 317 314 // Mask with 0x1f as per ecma-262 11.7.2 step 7. 318 urshift32(Imm32(get ConstantOperandImmediateInt(op2) & 0x1f), regT0);315 urshift32(Imm32(getOperandConstantInt(op2) & 0x1f), regT0); 319 316 } else { 320 317 emitGetVirtualRegisters(op1, regT0, op2, regT2); 321 318 if (supportsFloatingPointTruncate()) { 322 Jump lhsIsInt = emitJumpIfI mmediateInteger(regT0);319 Jump lhsIsInt = emitJumpIfInt(regT0); 323 320 // supportsFloatingPoint() && USE(JSVALUE64) => 3 SlowCases 324 addSlowCase(emitJumpIfNot ImmediateNumber(regT0));321 addSlowCase(emitJumpIfNotNumber(regT0)); 325 322 add64(tagTypeNumberRegister, regT0); 326 323 move64ToDouble(regT0, fpRegT0); 327 324 addSlowCase(branchTruncateDoubleToInt32(fpRegT0, regT0)); 328 325 lhsIsInt.link(this); 329 emitJumpSlowCaseIfNotI mmediateInteger(regT2);326 emitJumpSlowCaseIfNotInt(regT2); 330 327 } else { 331 328 // !supportsFloatingPoint() => 2 SlowCases 332 emitJumpSlowCaseIfNotI mmediateInteger(regT0);333 emitJumpSlowCaseIfNotI mmediateInteger(regT2);329 emitJumpSlowCaseIfNotInt(regT0); 330 emitJumpSlowCaseIfNotInt(regT2); 334 331 } 335 emitFastArithImmToInt(regT2);336 332 urshift32(regT2, regT0); 337 333 } 338 emit FastArithIntToImmNoCheck(regT0, regT0);334 emitTagInt(regT0, regT0); 339 335 emitPutVirtualRegister(result); 340 336 } … … 344 340 int op2 = currentInstruction[3].u.operand; 345 341 346 if (isOperandConstantI mmediateInt(op2))342 if (isOperandConstantInt(op2)) 347 343 linkSlowCase(iter); 348 344 … … 368 364 369 365 emitGetVirtualRegister(op1, regT0); 370 emitJumpSlowCaseIfNotI mmediateInteger(regT0);366 emitJumpSlowCaseIfNotInt(regT0); 371 367 addSlowCase(branch32(LessThan, regT0, TrustedImm32(0))); 372 emit FastArithReTagImmediate(regT0, regT0);368 emitTagInt(regT0, regT0); 373 369 emitPutVirtualRegister(result, regT0); 374 370 } … … 390 386 // - int immediate to int immediate 391 387 392 if (isOperandConstant ImmediateChar(op1)) {388 if (isOperandConstantChar(op1)) { 393 389 emitGetVirtualRegister(op2, regT0); 394 390 addSlowCase(emitJumpIfNotJSCell(regT0)); … … 399 395 return; 400 396 } 401 if (isOperandConstant ImmediateChar(op2)) {397 if (isOperandConstantChar(op2)) { 402 398 emitGetVirtualRegister(op1, regT0); 403 399 addSlowCase(emitJumpIfNotJSCell(regT0)); … … 408 404 return; 409 405 } 410 if (isOperandConstantI mmediateInt(op2)) {406 if (isOperandConstantInt(op2)) { 411 407 emitGetVirtualRegister(op1, regT0); 412 emitJumpSlowCaseIfNotI mmediateInteger(regT0);413 int32_t op2imm = get ConstantOperandImmediateInt(op2);408 emitJumpSlowCaseIfNotInt(regT0); 409 int32_t op2imm = getOperandConstantInt(op2); 414 410 addJump(branch32(condition, regT0, Imm32(op2imm)), target); 415 } else if (isOperandConstantI mmediateInt(op1)) {411 } else if (isOperandConstantInt(op1)) { 416 412 emitGetVirtualRegister(op2, regT1); 417 emitJumpSlowCaseIfNotI mmediateInteger(regT1);418 int32_t op1imm = get ConstantOperandImmediateInt(op1);413 emitJumpSlowCaseIfNotInt(regT1); 414 int32_t op1imm = getOperandConstantInt(op1); 419 415 addJump(branch32(commute(condition), regT1, Imm32(op1imm)), target); 420 416 } else { 421 417 emitGetVirtualRegisters(op1, regT0, op2, regT1); 422 emitJumpSlowCaseIfNotI mmediateInteger(regT0);423 emitJumpSlowCaseIfNotI mmediateInteger(regT1);418 emitJumpSlowCaseIfNotInt(regT0); 419 emitJumpSlowCaseIfNotInt(regT1); 424 420 425 421 addJump(branch32(condition, regT0, regT1), target); … … 441 437 // - constant int immediate to floating-point number 442 438 // - floating-point number to floating-point number. 443 if (isOperandConstant ImmediateChar(op1) || isOperandConstantImmediateChar(op2)) {439 if (isOperandConstantChar(op1) || isOperandConstantChar(op2)) { 444 440 linkSlowCase(iter); 445 441 linkSlowCase(iter); … … 454 450 } 455 451 456 if (isOperandConstantI mmediateInt(op2)) {452 if (isOperandConstantInt(op2)) { 457 453 linkSlowCase(iter); 458 454 459 455 if (supportsFloatingPoint()) { 460 Jump fail1 = emitJumpIfNot ImmediateNumber(regT0);456 Jump fail1 = emitJumpIfNotNumber(regT0); 461 457 add64(tagTypeNumberRegister, regT0); 462 458 move64ToDouble(regT0, fpRegT0); … … 477 473 callOperation(operation, regT0, regT1); 478 474 emitJumpSlowToHot(branchTest32(invert ? Zero : NonZero, returnValueGPR), target); 479 } else if (isOperandConstantI mmediateInt(op1)) {475 } else if (isOperandConstantInt(op1)) { 480 476 linkSlowCase(iter); 481 477 482 478 if (supportsFloatingPoint()) { 483 Jump fail1 = emitJumpIfNot ImmediateNumber(regT1);479 Jump fail1 = emitJumpIfNotNumber(regT1); 484 480 add64(tagTypeNumberRegister, regT1); 485 481 move64ToDouble(regT1, fpRegT1); … … 504 500 505 501 if (supportsFloatingPoint()) { 506 Jump fail1 = emitJumpIfNot ImmediateNumber(regT0);507 Jump fail2 = emitJumpIfNot ImmediateNumber(regT1);508 Jump fail3 = emitJumpIfI mmediateInteger(regT1);502 Jump fail1 = emitJumpIfNotNumber(regT0); 503 Jump fail2 = emitJumpIfNotNumber(regT1); 504 Jump fail3 = emitJumpIfInt(regT1); 509 505 add64(tagTypeNumberRegister, regT0); 510 506 add64(tagTypeNumberRegister, regT1); … … 533 529 int op2 = currentInstruction[3].u.operand; 534 530 535 if (isOperandConstantI mmediateInt(op1)) {531 if (isOperandConstantInt(op1)) { 536 532 emitGetVirtualRegister(op2, regT0); 537 emitJumpSlowCaseIfNotI mmediateInteger(regT0);538 int32_t imm = get ConstantOperandImmediateInt(op1);533 emitJumpSlowCaseIfNotInt(regT0); 534 int32_t imm = getOperandConstantInt(op1); 539 535 and64(Imm32(imm), regT0); 540 536 if (imm >= 0) 541 emit FastArithIntToImmNoCheck(regT0, regT0);542 } else if (isOperandConstantI mmediateInt(op2)) {537 emitTagInt(regT0, regT0); 538 } else if (isOperandConstantInt(op2)) { 543 539 emitGetVirtualRegister(op1, regT0); 544 emitJumpSlowCaseIfNotI mmediateInteger(regT0);545 int32_t imm = get ConstantOperandImmediateInt(op2);540 emitJumpSlowCaseIfNotInt(regT0); 541 int32_t imm = getOperandConstantInt(op2); 546 542 and64(Imm32(imm), regT0); 547 543 if (imm >= 0) 548 emit FastArithIntToImmNoCheck(regT0, regT0);544 emitTagInt(regT0, regT0); 549 545 } else { 550 546 emitGetVirtualRegisters(op1, regT0, op2, regT1); 551 547 and64(regT1, regT0); 552 emitJumpSlowCaseIfNotI mmediateInteger(regT0);548 emitJumpSlowCaseIfNotInt(regT0); 553 549 } 554 550 emitPutVirtualRegister(result); … … 568 564 569 565 emitGetVirtualRegister(srcDst, regT0); 570 emitJumpSlowCaseIfNotI mmediateInteger(regT0);566 emitJumpSlowCaseIfNotInt(regT0); 571 567 addSlowCase(branchAdd32(Overflow, TrustedImm32(1), regT0)); 572 emit FastArithIntToImmNoCheck(regT0, regT0);568 emitTagInt(regT0, regT0); 573 569 emitPutVirtualRegister(srcDst); 574 570 } … … 587 583 588 584 emitGetVirtualRegister(srcDst, regT0); 589 emitJumpSlowCaseIfNotI mmediateInteger(regT0);585 emitJumpSlowCaseIfNotInt(regT0); 590 586 addSlowCase(branchSub32(Overflow, TrustedImm32(1), regT0)); 591 emit FastArithIntToImmNoCheck(regT0, regT0);587 emitTagInt(regT0, regT0); 592 588 emitPutVirtualRegister(srcDst); 593 589 } … … 619 615 620 616 emitGetVirtualRegisters(op1, regT4, op2, ecx); 621 emitJumpSlowCaseIfNotI mmediateInteger(regT4);622 emitJumpSlowCaseIfNotI mmediateInteger(ecx);617 emitJumpSlowCaseIfNotInt(regT4); 618 emitJumpSlowCaseIfNotInt(ecx); 623 619 624 620 move(regT4, regT0); … … 632 628 addSlowCase(branchTest32(Zero, edx)); 633 629 numeratorPositive.link(this); 634 emit FastArithReTagImmediate(edx, regT0);630 emitTagInt(edx, regT0); 635 631 emitPutVirtualRegister(result); 636 632 } … … 669 665 { 670 666 emitGetVirtualRegisters(op1, regT0, op2, regT1); 671 emitJumpSlowCaseIfNotI mmediateInteger(regT0);672 emitJumpSlowCaseIfNotI mmediateInteger(regT1);667 emitJumpSlowCaseIfNotInt(regT0); 668 emitJumpSlowCaseIfNotInt(regT1); 673 669 RareCaseProfile* profile = m_codeBlock->addSpecialFastCaseProfile(m_bytecodeOffset); 674 670 if (opcodeID == op_add) … … 702 698 } 703 699 } 704 emit FastArithIntToImmNoCheck(regT0, regT0);700 emitTagInt(regT0, regT0); 705 701 } 706 702 … … 734 730 notImm2.link(this); 735 731 if (!types.second().definitelyIsNumber()) 736 emitJumpIfNot ImmediateNumber(regT0).linkTo(stubFunctionCall, this);732 emitJumpIfNotNumber(regT0).linkTo(stubFunctionCall, this); 737 733 emitGetVirtualRegister(op1, regT1); 738 734 convertInt32ToDouble(regT1, fpRegT1); … … 742 738 notImm1.link(this); 743 739 if (!types.first().definitelyIsNumber()) 744 emitJumpIfNot ImmediateNumber(regT0).linkTo(stubFunctionCall, this);740 emitJumpIfNotNumber(regT0).linkTo(stubFunctionCall, this); 745 741 emitGetVirtualRegister(op2, regT1); 746 742 convertInt32ToDouble(regT1, fpRegT1); … … 751 747 notImm1.link(this); 752 748 if (!types.first().definitelyIsNumber()) 753 emitJumpIfNot ImmediateNumber(regT0).linkTo(stubFunctionCall, this);749 emitJumpIfNotNumber(regT0).linkTo(stubFunctionCall, this); 754 750 if (!types.second().definitelyIsNumber()) 755 emitJumpIfNot ImmediateNumber(regT1).linkTo(stubFunctionCall, this);751 emitJumpIfNotNumber(regT1).linkTo(stubFunctionCall, this); 756 752 add64(tagTypeNumberRegister, regT0); 757 753 move64ToDouble(regT0, fpRegT1); 758 Jump op2isDouble = emitJumpIfNotI mmediateInteger(regT1);754 Jump op2isDouble = emitJumpIfNotInt(regT1); 759 755 convertInt32ToDouble(regT1, fpRegT2); 760 756 Jump op2wasInteger = jump(); … … 763 759 notImm2.link(this); 764 760 if (!types.second().definitelyIsNumber()) 765 emitJumpIfNot ImmediateNumber(regT1).linkTo(stubFunctionCall, this);761 emitJumpIfNotNumber(regT1).linkTo(stubFunctionCall, this); 766 762 convertInt32ToDouble(regT0, fpRegT1); 767 763 op2isDouble.link(this); … … 801 797 } 802 798 803 if (isOperandConstantI mmediateInt(op1)) {799 if (isOperandConstantInt(op1)) { 804 800 emitGetVirtualRegister(op2, regT0); 805 emitJumpSlowCaseIfNotI mmediateInteger(regT0);806 addSlowCase(branchAdd32(Overflow, regT0, Imm32(get ConstantOperandImmediateInt(op1)), regT1));807 emit FastArithIntToImmNoCheck(regT1, regT0);808 } else if (isOperandConstantI mmediateInt(op2)) {801 emitJumpSlowCaseIfNotInt(regT0); 802 addSlowCase(branchAdd32(Overflow, regT0, Imm32(getOperandConstantInt(op1)), regT1)); 803 emitTagInt(regT1, regT0); 804 } else if (isOperandConstantInt(op2)) { 809 805 emitGetVirtualRegister(op1, regT0); 810 emitJumpSlowCaseIfNotI mmediateInteger(regT0);811 addSlowCase(branchAdd32(Overflow, regT0, Imm32(get ConstantOperandImmediateInt(op2)), regT1));812 emit FastArithIntToImmNoCheck(regT1, regT0);806 emitJumpSlowCaseIfNotInt(regT0); 807 addSlowCase(branchAdd32(Overflow, regT0, Imm32(getOperandConstantInt(op2)), regT1)); 808 emitTagInt(regT1, regT0); 813 809 } else 814 810 compileBinaryArithOp(op_add, result, op1, op2, types); … … 826 822 RELEASE_ASSERT(types.first().mightBeNumber() && types.second().mightBeNumber()); 827 823 828 bool op1HasImmediateIntFastCase = isOperandConstantI mmediateInt(op1);829 bool op2HasImmediateIntFastCase = !op1HasImmediateIntFastCase && isOperandConstantI mmediateInt(op2);824 bool op1HasImmediateIntFastCase = isOperandConstantInt(op1); 825 bool op2HasImmediateIntFastCase = !op1HasImmediateIntFastCase && isOperandConstantInt(op2); 830 826 compileBinaryArithOpSlowCase(currentInstruction, op_add, iter, result, op1, op2, types, op1HasImmediateIntFastCase, op2HasImmediateIntFastCase); 831 827 } … … 840 836 // For now, only plant a fast int case if the constant operand is greater than zero. 841 837 int32_t value; 842 if (isOperandConstantI mmediateInt(op1) && ((value = getConstantOperandImmediateInt(op1)) > 0)) {838 if (isOperandConstantInt(op1) && ((value = getOperandConstantInt(op1)) > 0)) { 843 839 // Add a special fast case profile because the DFG JIT will expect one. 844 840 m_codeBlock->addSpecialFastCaseProfile(m_bytecodeOffset); 845 841 emitGetVirtualRegister(op2, regT0); 846 emitJumpSlowCaseIfNotI mmediateInteger(regT0);842 emitJumpSlowCaseIfNotInt(regT0); 847 843 addSlowCase(branchMul32(Overflow, Imm32(value), regT0, regT1)); 848 emit FastArithReTagImmediate(regT1, regT0);849 } else if (isOperandConstantI mmediateInt(op2) && ((value = getConstantOperandImmediateInt(op2)) > 0)) {844 emitTagInt(regT1, regT0); 845 } else if (isOperandConstantInt(op2) && ((value = getOperandConstantInt(op2)) > 0)) { 850 846 // Add a special fast case profile because the DFG JIT will expect one. 851 847 m_codeBlock->addSpecialFastCaseProfile(m_bytecodeOffset); 852 848 emitGetVirtualRegister(op1, regT0); 853 emitJumpSlowCaseIfNotI mmediateInteger(regT0);849 emitJumpSlowCaseIfNotInt(regT0); 854 850 addSlowCase(branchMul32(Overflow, Imm32(value), regT0, regT1)); 855 emit FastArithReTagImmediate(regT1, regT0);851 emitTagInt(regT1, regT0); 856 852 } else 857 853 compileBinaryArithOp(op_mul, result, op1, op2, types); … … 867 863 OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); 868 864 869 bool op1HasImmediateIntFastCase = isOperandConstantI mmediateInt(op1) && getConstantOperandImmediateInt(op1) > 0;870 bool op2HasImmediateIntFastCase = !op1HasImmediateIntFastCase && isOperandConstantI mmediateInt(op2) && getConstantOperandImmediateInt(op2) > 0;865 bool op1HasImmediateIntFastCase = isOperandConstantInt(op1) && getOperandConstantInt(op1) > 0; 866 bool op2HasImmediateIntFastCase = !op1HasImmediateIntFastCase && isOperandConstantInt(op2) && getOperandConstantInt(op2) > 0; 871 867 compileBinaryArithOpSlowCase(currentInstruction, op_mul, iter, result, op1, op2, types, op1HasImmediateIntFastCase, op2HasImmediateIntFastCase); 872 868 } … … 879 875 OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); 880 876 881 if (isOperandConstant ImmediateDouble(op1)) {877 if (isOperandConstantDouble(op1)) { 882 878 emitGetVirtualRegister(op1, regT0); 883 879 add64(tagTypeNumberRegister, regT0); 884 880 move64ToDouble(regT0, fpRegT0); 885 } else if (isOperandConstantI mmediateInt(op1)) {881 } else if (isOperandConstantInt(op1)) { 886 882 emitLoadInt32ToDouble(op1, fpRegT0); 887 883 } else { 888 884 emitGetVirtualRegister(op1, regT0); 889 885 if (!types.first().definitelyIsNumber()) 890 emitJumpSlowCaseIfNot ImmediateNumber(regT0);891 Jump notInt = emitJumpIfNotI mmediateInteger(regT0);886 emitJumpSlowCaseIfNotNumber(regT0); 887 Jump notInt = emitJumpIfNotInt(regT0); 892 888 convertInt32ToDouble(regT0, fpRegT0); 893 889 Jump skipDoubleLoad = jump(); … … 898 894 } 899 895 900 if (isOperandConstant ImmediateDouble(op2)) {896 if (isOperandConstantDouble(op2)) { 901 897 emitGetVirtualRegister(op2, regT1); 902 898 add64(tagTypeNumberRegister, regT1); 903 899 move64ToDouble(regT1, fpRegT1); 904 } else if (isOperandConstantI mmediateInt(op2)) {900 } else if (isOperandConstantInt(op2)) { 905 901 emitLoadInt32ToDouble(op2, fpRegT1); 906 902 } else { 907 903 emitGetVirtualRegister(op2, regT1); 908 904 if (!types.second().definitelyIsNumber()) 909 emitJumpSlowCaseIfNot ImmediateNumber(regT1);910 Jump notInt = emitJumpIfNotI mmediateInteger(regT1);905 emitJumpSlowCaseIfNotNumber(regT1); 906 Jump notInt = emitJumpIfNotInt(regT1); 911 907 convertInt32ToDouble(regT1, fpRegT1); 912 908 Jump skipDoubleLoad = jump(); … … 932 928 branchConvertDoubleToInt32(fpRegT0, regT0, notInteger, fpRegT1); 933 929 // If we've got an integer, we might as well make that the result of the division. 934 emit FastArithReTagImmediate(regT0, regT0);930 emitTagInt(regT0, regT0); 935 931 Jump isInteger = jump(); 936 932 notInteger.link(this); … … 958 954 return; 959 955 } 960 if (!isOperandConstant ImmediateDouble(op1) && !isOperandConstantImmediateInt(op1)) {956 if (!isOperandConstantDouble(op1) && !isOperandConstantInt(op1)) { 961 957 if (!types.first().definitelyIsNumber()) 962 958 linkSlowCase(iter); 963 959 } 964 if (!isOperandConstant ImmediateDouble(op2) && !isOperandConstantImmediateInt(op2)) {960 if (!isOperandConstantDouble(op2) && !isOperandConstantInt(op2)) { 965 961 if (!types.second().definitelyIsNumber()) 966 962 linkSlowCase(iter); -
trunk/Source/JavaScriptCore/jit/JITArithmetic32_64.cpp
r190213 r190230 84 84 85 85 // Character less. 86 if (isOperandConstant ImmediateChar(op1)) {86 if (isOperandConstantChar(op1)) { 87 87 emitLoad(op2, regT1, regT0); 88 88 addSlowCase(branch32(NotEqual, regT1, TrustedImm32(JSValue::CellTag))); … … 93 93 return; 94 94 } 95 if (isOperandConstant ImmediateChar(op2)) {95 if (isOperandConstantChar(op2)) { 96 96 emitLoad(op1, regT1, regT0); 97 97 addSlowCase(branch32(NotEqual, regT1, TrustedImm32(JSValue::CellTag))); … … 102 102 return; 103 103 } 104 if (isOperandConstantI mmediateInt(op1)) {104 if (isOperandConstantInt(op1)) { 105 105 emitLoad(op2, regT3, regT2); 106 106 notInt32Op2.append(branch32(NotEqual, regT3, TrustedImm32(JSValue::Int32Tag))); 107 107 addJump(branch32(commute(condition), regT2, Imm32(getConstantOperand(op1).asInt32())), target); 108 } else if (isOperandConstantI mmediateInt(op2)) {108 } else if (isOperandConstantInt(op2)) { 109 109 emitLoad(op1, regT1, regT0); 110 110 notInt32Op1.append(branch32(NotEqual, regT1, TrustedImm32(JSValue::Int32Tag))); … … 125 125 126 126 // Double less. 127 emitBinaryDoubleOp(opcode, target, op1, op2, OperandTypes(), notInt32Op1, notInt32Op2, !isOperandConstantI mmediateInt(op1), isOperandConstantImmediateInt(op1) || !isOperandConstantImmediateInt(op2));127 emitBinaryDoubleOp(opcode, target, op1, op2, OperandTypes(), notInt32Op1, notInt32Op2, !isOperandConstantInt(op1), isOperandConstantInt(op1) || !isOperandConstantInt(op2)); 128 128 end.link(this); 129 129 } … … 131 131 void JIT::emit_compareAndJumpSlow(int op1, int op2, unsigned target, DoubleCondition, size_t (JIT_OPERATION *operation)(ExecState*, EncodedJSValue, EncodedJSValue), bool invert, Vector<SlowCaseEntry>::iterator& iter) 132 132 { 133 if (isOperandConstant ImmediateChar(op1) || isOperandConstantImmediateChar(op2)) {133 if (isOperandConstantChar(op1) || isOperandConstantChar(op2)) { 134 134 linkSlowCase(iter); 135 135 linkSlowCase(iter); … … 138 138 } else { 139 139 if (!supportsFloatingPoint()) { 140 if (!isOperandConstantI mmediateInt(op1) && !isOperandConstantImmediateInt(op2))140 if (!isOperandConstantInt(op1) && !isOperandConstantInt(op2)) 141 141 linkSlowCase(iter); // int32 check 142 142 linkSlowCase(iter); // int32 check 143 143 } else { 144 if (!isOperandConstantI mmediateInt(op1)) {144 if (!isOperandConstantInt(op1)) { 145 145 linkSlowCase(iter); // double check 146 146 linkSlowCase(iter); // int32 check 147 147 } 148 if (isOperandConstantI mmediateInt(op1) || !isOperandConstantImmediateInt(op2))148 if (isOperandConstantInt(op1) || !isOperandConstantInt(op2)) 149 149 linkSlowCase(iter); // double check 150 150 } … … 164 164 int op2 = currentInstruction[3].u.operand; 165 165 166 if (isOperandConstantI mmediateInt(op2)) {166 if (isOperandConstantInt(op2)) { 167 167 emitLoad(op1, regT1, regT0); 168 168 addSlowCase(branch32(NotEqual, regT1, TrustedImm32(JSValue::Int32Tag))); … … 173 173 174 174 emitLoad2(op1, regT1, regT0, op2, regT3, regT2); 175 if (!isOperandConstantI mmediateInt(op1))175 if (!isOperandConstantInt(op1)) 176 176 addSlowCase(branch32(NotEqual, regT1, TrustedImm32(JSValue::Int32Tag))); 177 177 addSlowCase(branch32(NotEqual, regT3, TrustedImm32(JSValue::Int32Tag))); … … 185 185 int op2 = currentInstruction[3].u.operand; 186 186 187 if (!isOperandConstantI mmediateInt(op1) && !isOperandConstantImmediateInt(op2))187 if (!isOperandConstantInt(op1) && !isOperandConstantInt(op2)) 188 188 linkSlowCase(iter); // int32 check 189 189 linkSlowCase(iter); // int32 check … … 203 203 // Slow case of rshift makes assumptions about what registers hold the 204 204 // shift arguments, so any changes must be updated there as well. 205 if (isOperandConstantI mmediateInt(op2)) {205 if (isOperandConstantInt(op2)) { 206 206 emitLoad(op1, regT1, regT0); 207 207 addSlowCase(branch32(NotEqual, regT1, TrustedImm32(JSValue::Int32Tag))); … … 216 216 } else { 217 217 emitLoad2(op1, regT1, regT0, op2, regT3, regT2); 218 if (!isOperandConstantI mmediateInt(op1))218 if (!isOperandConstantInt(op1)) 219 219 addSlowCase(branch32(NotEqual, regT1, TrustedImm32(JSValue::Int32Tag))); 220 220 addSlowCase(branch32(NotEqual, regT3, TrustedImm32(JSValue::Int32Tag))); … … 232 232 int op1 = currentInstruction[2].u.operand; 233 233 int op2 = currentInstruction[3].u.operand; 234 if (isOperandConstantI mmediateInt(op2)) {234 if (isOperandConstantInt(op2)) { 235 235 int shift = getConstantOperand(op2).asInt32() & 0x1f; 236 236 // op1 = regT1:regT0 … … 255 255 // op1 = regT1:regT0 256 256 // op2 = regT3:regT2 257 if (!isOperandConstantI mmediateInt(op1)) {257 if (!isOperandConstantInt(op1)) { 258 258 linkSlowCase(iter); // int32 check -- op1 is not an int 259 259 if (supportsFloatingPointTruncate()) { … … 336 336 int op; 337 337 int32_t constant; 338 if (getOperandConstantI mmediateInt(op1, op2, op, constant)) {338 if (getOperandConstantInt(op1, op2, op, constant)) { 339 339 emitLoad(op, regT1, regT0); 340 340 addSlowCase(branch32(NotEqual, regT1, TrustedImm32(JSValue::Int32Tag))); … … 356 356 int op2 = currentInstruction[3].u.operand; 357 357 358 if (!isOperandConstantI mmediateInt(op1) && !isOperandConstantImmediateInt(op2))358 if (!isOperandConstantInt(op1) && !isOperandConstantInt(op2)) 359 359 linkSlowCase(iter); // int32 check 360 360 linkSlowCase(iter); // int32 check … … 374 374 int op; 375 375 int32_t constant; 376 if (getOperandConstantI mmediateInt(op1, op2, op, constant)) {376 if (getOperandConstantInt(op1, op2, op, constant)) { 377 377 emitLoad(op, regT1, regT0); 378 378 addSlowCase(branch32(NotEqual, regT1, TrustedImm32(JSValue::Int32Tag))); … … 394 394 int op2 = currentInstruction[3].u.operand; 395 395 396 if (!isOperandConstantI mmediateInt(op1) && !isOperandConstantImmediateInt(op2))396 if (!isOperandConstantInt(op1) && !isOperandConstantInt(op2)) 397 397 linkSlowCase(iter); // int32 check 398 398 linkSlowCase(iter); // int32 check … … 412 412 int op; 413 413 int32_t constant; 414 if (getOperandConstantI mmediateInt(op1, op2, op, constant)) {414 if (getOperandConstantInt(op1, op2, op, constant)) { 415 415 emitLoad(op, regT1, regT0); 416 416 addSlowCase(branch32(NotEqual, regT1, TrustedImm32(JSValue::Int32Tag))); … … 432 432 int op2 = currentInstruction[3].u.operand; 433 433 434 if (!isOperandConstantI mmediateInt(op1) && !isOperandConstantImmediateInt(op2))434 if (!isOperandConstantInt(op1) && !isOperandConstantInt(op2)) 435 435 linkSlowCase(iter); // int32 check 436 436 linkSlowCase(iter); // int32 check … … 500 500 int op; 501 501 int32_t constant; 502 if (getOperandConstantI mmediateInt(op1, op2, op, constant)) {502 if (getOperandConstantInt(op1, op2, op, constant)) { 503 503 emitAdd32Constant(dst, op, constant, op == op1 ? types.first() : types.second()); 504 504 return; … … 562 562 int op; 563 563 int32_t constant; 564 if (getOperandConstantI mmediateInt(op1, op2, op, constant)) {564 if (getOperandConstantInt(op1, op2, op, constant)) { 565 565 linkSlowCase(iter); // overflow check 566 566 … … 605 605 JumpList notInt32Op2; 606 606 607 if (isOperandConstantI mmediateInt(op2)) {607 if (isOperandConstantInt(op2)) { 608 608 emitSub32Constant(dst, op1, getConstantOperand(op2).asInt32(), types.first()); 609 609 return; … … 662 662 OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); 663 663 664 if (isOperandConstantI mmediateInt(op2)) {664 if (isOperandConstantInt(op2)) { 665 665 linkSlowCase(iter); // overflow check 666 666 -
trunk/Source/JavaScriptCore/jit/JITInlines.h
r190063 r190230 78 78 } 79 79 80 ALWAYS_INLINE bool JIT::isOperandConstant ImmediateDouble(int src)80 ALWAYS_INLINE bool JIT::isOperandConstantDouble(int src) 81 81 { 82 82 return m_codeBlock->isConstantRegisterIndex(src) && getConstantOperand(src).isDouble(); … … 872 872 #endif 873 873 874 ALWAYS_INLINE bool JIT::isOperandConstant ImmediateChar(int src)874 ALWAYS_INLINE bool JIT::isOperandConstantChar(int src) 875 875 { 876 876 return m_codeBlock->isConstantRegisterIndex(src) && getConstantOperand(src).isString() && asString(getConstantOperand(src).asCell())->length() == 1; … … 1115 1115 } 1116 1116 1117 ALWAYS_INLINE bool JIT::isOperandConstantI mmediateInt(int src)1117 ALWAYS_INLINE bool JIT::isOperandConstantInt(int src) 1118 1118 { 1119 1119 return m_codeBlock->isConstantRegisterIndex(src) && getConstantOperand(src).isInt32(); 1120 1120 } 1121 1121 1122 ALWAYS_INLINE bool JIT::getOperandConstantI mmediateInt(int op1, int op2, int& op, int32_t& constant)1123 { 1124 if (isOperandConstantI mmediateInt(op1)) {1122 ALWAYS_INLINE bool JIT::getOperandConstantInt(int op1, int op2, int& op, int32_t& constant) 1123 { 1124 if (isOperandConstantInt(op1)) { 1125 1125 constant = getConstantOperand(op1).asInt32(); 1126 1126 op = op2; … … 1128 1128 } 1129 1129 1130 if (isOperandConstantI mmediateInt(op2)) {1130 if (isOperandConstantInt(op2)) { 1131 1131 constant = getConstantOperand(op2).asInt32(); 1132 1132 op = op1; … … 1173 1173 } 1174 1174 1175 ALWAYS_INLINE int32_t JIT::get ConstantOperandImmediateInt(int src)1175 ALWAYS_INLINE int32_t JIT::getOperandConstantInt(int src) 1176 1176 { 1177 1177 return getConstantOperand(src).asInt32(); 1178 1178 } 1179 1179 1180 ALWAYS_INLINE bool JIT::isOperandConstantI mmediateInt(int src)1180 ALWAYS_INLINE bool JIT::isOperandConstantInt(int src) 1181 1181 { 1182 1182 return m_codeBlock->isConstantRegisterIndex(src) && getConstantOperand(src).isInt32(); … … 1238 1238 { 1239 1239 if (m_codeBlock->isConstantRegisterIndex(index)) { 1240 ASSERT(isOperandConstantI mmediateInt(index));1240 ASSERT(isOperandConstantInt(index)); 1241 1241 convertInt32ToDouble(Imm32(getConstantOperand(index).asInt32()), value); 1242 1242 } else … … 1244 1244 } 1245 1245 1246 ALWAYS_INLINE JIT::Jump JIT::emitJumpIfI mmediateInteger(RegisterID reg)1246 ALWAYS_INLINE JIT::Jump JIT::emitJumpIfInt(RegisterID reg) 1247 1247 { 1248 1248 return branch64(AboveOrEqual, reg, tagTypeNumberRegister); 1249 1249 } 1250 1250 1251 ALWAYS_INLINE JIT::Jump JIT::emitJumpIfNotI mmediateInteger(RegisterID reg)1251 ALWAYS_INLINE JIT::Jump JIT::emitJumpIfNotInt(RegisterID reg) 1252 1252 { 1253 1253 return branch64(Below, reg, tagTypeNumberRegister); 1254 1254 } 1255 1255 1256 ALWAYS_INLINE JIT::PatchableJump JIT::emitPatchableJumpIfNotI mmediateInteger(RegisterID reg)1256 ALWAYS_INLINE JIT::PatchableJump JIT::emitPatchableJumpIfNotInt(RegisterID reg) 1257 1257 { 1258 1258 return patchableBranch64(Below, reg, tagTypeNumberRegister); 1259 1259 } 1260 1260 1261 ALWAYS_INLINE JIT::Jump JIT::emitJumpIfNotI mmediateIntegers(RegisterID reg1, RegisterID reg2, RegisterID scratch)1261 ALWAYS_INLINE JIT::Jump JIT::emitJumpIfNotInt(RegisterID reg1, RegisterID reg2, RegisterID scratch) 1262 1262 { 1263 1263 move(reg1, scratch); 1264 1264 and64(reg2, scratch); 1265 return emitJumpIfNotImmediateInteger(scratch); 1266 } 1267 1268 ALWAYS_INLINE void JIT::emitJumpSlowCaseIfNotImmediateInteger(RegisterID reg) 1269 { 1270 addSlowCase(emitJumpIfNotImmediateInteger(reg)); 1271 } 1272 1273 ALWAYS_INLINE void JIT::emitJumpSlowCaseIfNotImmediateIntegers(RegisterID reg1, RegisterID reg2, RegisterID scratch) 1274 { 1275 addSlowCase(emitJumpIfNotImmediateIntegers(reg1, reg2, scratch)); 1276 } 1277 1278 ALWAYS_INLINE void JIT::emitJumpSlowCaseIfNotImmediateNumber(RegisterID reg) 1279 { 1280 addSlowCase(emitJumpIfNotImmediateNumber(reg)); 1281 } 1282 1283 ALWAYS_INLINE void JIT::emitFastArithReTagImmediate(RegisterID src, RegisterID dest) 1284 { 1285 emitFastArithIntToImmNoCheck(src, dest); 1286 } 1287 1288 ALWAYS_INLINE void JIT::emitTagAsBoolImmediate(RegisterID reg) 1265 return emitJumpIfNotInt(scratch); 1266 } 1267 1268 ALWAYS_INLINE void JIT::emitJumpSlowCaseIfNotInt(RegisterID reg) 1269 { 1270 addSlowCase(emitJumpIfNotInt(reg)); 1271 } 1272 1273 ALWAYS_INLINE void JIT::emitJumpSlowCaseIfNotInt(RegisterID reg1, RegisterID reg2, RegisterID scratch) 1274 { 1275 addSlowCase(emitJumpIfNotInt(reg1, reg2, scratch)); 1276 } 1277 1278 ALWAYS_INLINE void JIT::emitJumpSlowCaseIfNotNumber(RegisterID reg) 1279 { 1280 addSlowCase(emitJumpIfNotNumber(reg)); 1281 } 1282 1283 ALWAYS_INLINE void JIT::emitTagBool(RegisterID reg) 1289 1284 { 1290 1285 or32(TrustedImm32(static_cast<int32_t>(ValueFalse)), reg); -
trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp
r190063 r190230 182 182 notMasqueradesAsUndefined.link(this); 183 183 done.link(this); 184 emitTag AsBoolImmediate(regT0);184 emitTagBool(regT0); 185 185 emitPutVirtualRegister(dst); 186 186 } … … 194 194 xor64(TrustedImm32(static_cast<int32_t>(ValueFalse)), regT0); 195 195 test64(Zero, regT0, TrustedImm32(static_cast<int32_t>(~1)), regT0); 196 emitTag AsBoolImmediate(regT0);196 emitTagBool(regT0); 197 197 emitPutVirtualRegister(dst); 198 198 } … … 205 205 emitGetVirtualRegister(value, regT0); 206 206 test64(NonZero, regT0, tagTypeNumberRegister, regT0); 207 emitTag AsBoolImmediate(regT0);207 emitTagBool(regT0); 208 208 emitPutVirtualRegister(dst); 209 209 } … … 218 218 219 219 compare8(Equal, Address(regT0, JSCell::typeInfoTypeOffset()), TrustedImm32(StringType), regT0); 220 emitTag AsBoolImmediate(regT0);220 emitTagBool(regT0); 221 221 Jump done = jump(); 222 222 … … 237 237 238 238 compare8(AboveOrEqual, Address(regT0, JSCell::typeInfoTypeOffset()), TrustedImm32(ObjectType), regT0); 239 emitTag AsBoolImmediate(regT0);239 emitTagBool(regT0); 240 240 Jump done = jump(); 241 241 … … 304 304 305 305 addJump(branch64(Equal, regT0, TrustedImm64(JSValue::encode(jsNumber(0)))), target); 306 Jump isNonZero = emitJumpIfI mmediateInteger(regT0);306 Jump isNonZero = emitJumpIfInt(regT0); 307 307 308 308 addJump(branch64(Equal, regT0, TrustedImm64(JSValue::encode(jsBoolean(false)))), target); … … 371 371 { 372 372 emitGetVirtualRegisters(currentInstruction[2].u.operand, regT0, currentInstruction[3].u.operand, regT1); 373 emitJumpSlowCaseIfNotI mmediateIntegers(regT0, regT1, regT2);373 emitJumpSlowCaseIfNotInt(regT0, regT1, regT2); 374 374 compare32(Equal, regT1, regT0, regT0); 375 emitTag AsBoolImmediate(regT0);375 emitTagBool(regT0); 376 376 emitPutVirtualRegister(currentInstruction[1].u.operand); 377 377 } … … 383 383 384 384 Jump isZero = branch64(Equal, regT0, TrustedImm64(JSValue::encode(jsNumber(0)))); 385 addJump(emitJumpIfI mmediateInteger(regT0), target);385 addJump(emitJumpIfInt(regT0), target); 386 386 387 387 addJump(branch64(Equal, regT0, TrustedImm64(JSValue::encode(jsBoolean(true)))), target); … … 394 394 { 395 395 emitGetVirtualRegisters(currentInstruction[2].u.operand, regT0, currentInstruction[3].u.operand, regT1); 396 emitJumpSlowCaseIfNotI mmediateIntegers(regT0, regT1, regT2);396 emitJumpSlowCaseIfNotInt(regT0, regT1, regT2); 397 397 compare32(NotEqual, regT1, regT0, regT0); 398 emitTag AsBoolImmediate(regT0);398 emitTagBool(regT0); 399 399 400 400 emitPutVirtualRegister(currentInstruction[1].u.operand); … … 405 405 { 406 406 emitGetVirtualRegisters(currentInstruction[2].u.operand, regT0, currentInstruction[3].u.operand, regT1); 407 emitJumpSlowCaseIfNotI mmediateIntegers(regT0, regT1, regT2);407 emitJumpSlowCaseIfNotInt(regT0, regT1, regT2); 408 408 xor64(regT1, regT0); 409 emit FastArithReTagImmediate(regT0, regT0);409 emitTagInt(regT0, regT0); 410 410 emitPutVirtualRegister(currentInstruction[1].u.operand); 411 411 } … … 414 414 { 415 415 emitGetVirtualRegisters(currentInstruction[2].u.operand, regT0, currentInstruction[3].u.operand, regT1); 416 emitJumpSlowCaseIfNotI mmediateIntegers(regT0, regT1, regT2);416 emitJumpSlowCaseIfNotInt(regT0, regT1, regT2); 417 417 or64(regT1, regT0); 418 418 emitPutVirtualRegister(currentInstruction[1].u.operand); … … 449 449 // Jump slow if either is a double. First test if it's an integer, which is fine, and then test 450 450 // if it's a double. 451 Jump leftOK = emitJumpIfI mmediateInteger(regT0);452 addSlowCase(emitJumpIf ImmediateNumber(regT0));451 Jump leftOK = emitJumpIfInt(regT0); 452 addSlowCase(emitJumpIfNumber(regT0)); 453 453 leftOK.link(this); 454 Jump rightOK = emitJumpIfI mmediateInteger(regT1);455 addSlowCase(emitJumpIf ImmediateNumber(regT1));454 Jump rightOK = emitJumpIfInt(regT1); 455 addSlowCase(emitJumpIfNumber(regT1)); 456 456 rightOK.link(this); 457 457 … … 460 460 else 461 461 compare64(NotEqual, regT1, regT0, regT0); 462 emitTag AsBoolImmediate(regT0);462 emitTagBool(regT0); 463 463 464 464 emitPutVirtualRegister(dst); … … 480 480 emitGetVirtualRegister(srcVReg, regT0); 481 481 482 addSlowCase(emitJumpIfNot ImmediateNumber(regT0));482 addSlowCase(emitJumpIfNotNumber(regT0)); 483 483 484 484 emitPutVirtualRegister(currentInstruction[1].u.operand); … … 622 622 wasNotMasqueradesAsUndefined.link(this); 623 623 624 emitTag AsBoolImmediate(regT0);624 emitTagBool(regT0); 625 625 emitPutVirtualRegister(dst); 626 626 … … 654 654 wasNotMasqueradesAsUndefined.link(this); 655 655 656 emitTag AsBoolImmediate(regT0);656 emitTagBool(regT0); 657 657 emitPutVirtualRegister(dst); 658 658 } … … 832 832 linkSlowCase(iter); 833 833 callOperation(operationCompareEq, regT0, regT1); 834 emitTag AsBoolImmediate(returnValueGPR);834 emitTagBool(returnValueGPR); 835 835 emitPutVirtualRegister(currentInstruction[1].u.operand, returnValueGPR); 836 836 } … … 841 841 callOperation(operationCompareEq, regT0, regT1); 842 842 xor32(TrustedImm32(0x1), regT0); 843 emitTag AsBoolImmediate(returnValueGPR);843 emitTagBool(returnValueGPR); 844 844 emitPutVirtualRegister(currentInstruction[1].u.operand, returnValueGPR); 845 845 } … … 1286 1286 jumpToEnd.append(branch64(Equal, regT1, TrustedImm64(ValueFalse))); 1287 1287 } else if (cachedTypeLocation->m_lastSeenType == TypeMachineInt) 1288 jumpToEnd.append(emitJumpIfI mmediateInteger(regT0));1288 jumpToEnd.append(emitJumpIfInt(regT0)); 1289 1289 else if (cachedTypeLocation->m_lastSeenType == TypeNumber) 1290 jumpToEnd.append(emitJumpIf ImmediateNumber(regT0));1290 jumpToEnd.append(emitJumpIfNumber(regT0)); 1291 1291 else if (cachedTypeLocation->m_lastSeenType == TypeString) { 1292 1292 Jump isNotCell = emitJumpIfNotJSCell(regT0); -
trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
r189995 r190230 54 54 55 55 emitFunctionPrologue(); 56 emitPut ImmediateToCallFrameHeader(0, JSStack::CodeBlock);56 emitPutToCallFrameHeader(0, JSStack::CodeBlock); 57 57 storePtr(callFrameRegister, &m_vm->topCallFrame); 58 58 -
trunk/Source/JavaScriptCore/jit/JITPropertyAccess.cpp
r190129 r190230 105 105 emitJumpSlowCaseIfNotJSCell(regT0, base); 106 106 107 PatchableJump notIndex = emitPatchableJumpIfNotI mmediateInteger(regT1);107 PatchableJump notIndex = emitPatchableJumpIfNotInt(regT1); 108 108 addSlowCase(notIndex); 109 109 … … 302 302 emitGetVirtualRegisters(base, regT0, property, regT1); 303 303 emitJumpSlowCaseIfNotJSCell(regT0, base); 304 PatchableJump notIndex = emitPatchableJumpIfNotI mmediateInteger(regT1);304 PatchableJump notIndex = emitPatchableJumpIfNotInt(regT1); 305 305 addSlowCase(notIndex); 306 306 // See comment in op_get_by_val. … … 355 355 switch (indexingShape) { 356 356 case Int32Shape: 357 slowCases.append(emitJumpIfNotI mmediateInteger(regT3));357 slowCases.append(emitJumpIfNotInt(regT3)); 358 358 store64(regT3, BaseIndex(regT2, regT1, TimesEight)); 359 359 break; 360 360 case DoubleShape: { 361 Jump notInt = emitJumpIfNotI mmediateInteger(regT3);361 Jump notInt = emitJumpIfNotInt(regT3); 362 362 convertInt32ToDouble(regT3, fpRegT0); 363 363 Jump ready = jump(); … … 618 618 emitGetVirtualRegisters(baseVReg, regT0, valueVReg, regT1); 619 619 620 // Jump to a slow case if either the base object is an immediate, or if the Structure does not match.621 620 emitJumpSlowCaseIfNotJSCell(regT0, baseVReg); 622 621 … … 1631 1630 #if USE(JSVALUE64) 1632 1631 emitGetVirtualRegister(value, earlyScratch); 1633 slowCases.append(emitJumpIfNotI mmediateInteger(earlyScratch));1632 slowCases.append(emitJumpIfNotInt(earlyScratch)); 1634 1633 #else 1635 1634 emitLoad(value, lateScratch, earlyScratch); … … 1703 1702 #if USE(JSVALUE64) 1704 1703 emitGetVirtualRegister(value, earlyScratch); 1705 Jump doubleCase = emitJumpIfNotI mmediateInteger(earlyScratch);1704 Jump doubleCase = emitJumpIfNotInt(earlyScratch); 1706 1705 convertInt32ToDouble(earlyScratch, fpRegT0); 1707 1706 Jump ready = jump(); 1708 1707 doubleCase.link(this); 1709 slowCases.append(emitJumpIfNot ImmediateNumber(earlyScratch));1708 slowCases.append(emitJumpIfNotNumber(earlyScratch)); 1710 1709 add64(tagTypeNumberRegister, earlyScratch); 1711 1710 move64ToDouble(earlyScratch, fpRegT0); -
trunk/Source/JavaScriptCore/jit/JSInterfaceJIT.h
r182151 r190230 66 66 #if USE(JSVALUE64) 67 67 Jump emitJumpIfNotJSCell(RegisterID); 68 Jump emitJumpIfImmediateNumber(RegisterID reg); 69 Jump emitJumpIfNotImmediateNumber(RegisterID reg); 70 void emitFastArithImmToInt(RegisterID reg); 71 void emitFastArithIntToImmNoCheck(RegisterID src, RegisterID dest); 68 Jump emitJumpIfNumber(RegisterID); 69 Jump emitJumpIfNotNumber(RegisterID); 70 void emitTagInt(RegisterID src, RegisterID dest); 72 71 #endif 73 72 … … 76 75 void emitGetFromCallFrameHeaderPtr(JSStack::CallFrameHeaderEntry, RegisterID to, RegisterID from = callFrameRegister); 77 76 void emitPutToCallFrameHeader(RegisterID from, JSStack::CallFrameHeaderEntry); 78 void emitPut ImmediateToCallFrameHeader(void* value, JSStack::CallFrameHeaderEntry);77 void emitPutToCallFrameHeader(void* value, JSStack::CallFrameHeaderEntry); 79 78 void emitPutCellToCallFrameHeader(RegisterID from, JSStack::CallFrameHeaderEntry); 80 79 … … 155 154 } 156 155 157 ALWAYS_INLINE JSInterfaceJIT::Jump JSInterfaceJIT::emitJumpIf ImmediateNumber(RegisterID reg)156 ALWAYS_INLINE JSInterfaceJIT::Jump JSInterfaceJIT::emitJumpIfNumber(RegisterID reg) 158 157 { 159 158 return branchTest64(NonZero, reg, tagTypeNumberRegister); 160 159 } 161 ALWAYS_INLINE JSInterfaceJIT::Jump JSInterfaceJIT::emitJumpIfNot ImmediateNumber(RegisterID reg)160 ALWAYS_INLINE JSInterfaceJIT::Jump JSInterfaceJIT::emitJumpIfNotNumber(RegisterID reg) 162 161 { 163 162 return branchTest64(Zero, reg, tagTypeNumberRegister); … … 180 179 { 181 180 load64(addressFor(virtualRegisterIndex), scratch); 182 Jump notNumber = emitJumpIfNot ImmediateNumber(scratch);181 Jump notNumber = emitJumpIfNotNumber(scratch); 183 182 Jump notInt = branch64(Below, scratch, tagTypeNumberRegister); 184 183 convertInt32ToDouble(scratch, dst); … … 191 190 } 192 191 193 ALWAYS_INLINE void JSInterfaceJIT::emitFastArithImmToInt(RegisterID)194 {195 }196 197 192 // operand is int32_t, must have been zero-extended if register is 64-bit. 198 ALWAYS_INLINE void JSInterfaceJIT::emit FastArithIntToImmNoCheck(RegisterID src, RegisterID dest)193 ALWAYS_INLINE void JSInterfaceJIT::emitTagInt(RegisterID src, RegisterID dest) 199 194 { 200 195 if (src != dest) … … 242 237 } 243 238 244 ALWAYS_INLINE void JSInterfaceJIT::emitPut ImmediateToCallFrameHeader(void* value, JSStack::CallFrameHeaderEntry entry)239 ALWAYS_INLINE void JSInterfaceJIT::emitPutToCallFrameHeader(void* value, JSStack::CallFrameHeaderEntry entry) 245 240 { 246 241 storePtr(TrustedImmPtr(value), Address(callFrameRegister, entry * sizeof(Register))); -
trunk/Source/JavaScriptCore/jit/ThunkGenerators.cpp
r189999 r190230 258 258 #endif 259 259 260 jit.emitPut ImmediateToCallFrameHeader(0, JSStack::CodeBlock);260 jit.emitPutToCallFrameHeader(0, JSStack::CodeBlock); 261 261 jit.storePtr(JSInterfaceJIT::callFrameRegister, &vm->topCallFrame); 262 262 -
trunk/Source/JavaScriptCore/wasm/WASMFunctionCompiler.h
r190130 r190230 129 129 130 130 emitFunctionPrologue(); 131 emitPut ImmediateToCallFrameHeader(m_codeBlock, JSStack::CodeBlock);131 emitPutToCallFrameHeader(m_codeBlock, JSStack::CodeBlock); 132 132 133 133 m_beginLabel = label(); … … 216 216 Label arityCheck = label(); 217 217 emitFunctionPrologue(); 218 emitPut ImmediateToCallFrameHeader(m_codeBlock, JSStack::CodeBlock);218 emitPutToCallFrameHeader(m_codeBlock, JSStack::CodeBlock); 219 219 jump(m_beginLabel); 220 220
Note: See TracChangeset
for help on using the changeset viewer.