Changeset 95201 in webkit
- Timestamp:
- Sep 15, 2011 10:58:27 AM (13 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r95194 r95201 1 2011-09-15 Geoffrey Garen <ggaren@apple.com> 2 3 Value chaining for JSValue32_64 bitops. 4 5 Reviewed by Sam Weinig. 6 7 SunSpider says 2.3% faster, v8 ~1% faster (mostly due to crypto). 8 9 * jit/JIT.h: 10 * jit/JITInlineMethods.h: 11 (JSC::JIT::emitStoreAndMapInt32): New int32 helper function for stores 12 that can chain their results, which is the common case. 13 14 * jit/JITArithmetic32_64.cpp: 15 (JSC::JIT::emit_op_lshift): 16 (JSC::JIT::emitRightShift): 17 (JSC::JIT::emit_op_bitand): 18 (JSC::JIT::emit_op_bitor): 19 (JSC::JIT::emit_op_bitxor): 20 (JSC::JIT::emit_op_bitnot): 21 (JSC::JIT::emit_op_pre_inc): 22 (JSC::JIT::emit_op_pre_dec): Deployed new function. 23 (JSC::JIT::emit_op_post_inc): 24 (JSC::JIT::emit_op_post_dec): Had to reorder these functions so they 25 computed their result values last, to make them elligible for chaining. 26 1 27 2011-09-15 Adam Roben <aroben@apple.com> 2 28 -
trunk/Source/JavaScriptCore/jit/JIT.h
r95016 r95201 334 334 void emitStoreInt32(unsigned index, RegisterID payload, bool indexIsInt32 = false); 335 335 void emitStoreInt32(unsigned index, TrustedImm32 payload, bool indexIsInt32 = false); 336 void emitStoreAndMapInt32(unsigned index, RegisterID tag, RegisterID payload, bool indexIsInt32, size_t opcodeLength); 336 337 void emitStoreCell(unsigned index, RegisterID payload, bool indexIsCell = false); 337 338 void emitStoreBool(unsigned index, RegisterID payload, bool indexIsBool = false); -
trunk/Source/JavaScriptCore/jit/JITArithmetic32_64.cpp
r90371 r95201 176 176 addSlowCase(branch32(NotEqual, regT1, TrustedImm32(JSValue::Int32Tag))); 177 177 lshift32(Imm32(getConstantOperand(op2).asInt32()), regT0); 178 emitStore Int32(dst, regT0, dst == op1);178 emitStoreAndMapInt32(dst, regT1, regT0, dst == op1, OPCODE_LENGTH(op_lshift)); 179 179 return; 180 180 } … … 185 185 addSlowCase(branch32(NotEqual, regT3, TrustedImm32(JSValue::Int32Tag))); 186 186 lshift32(regT2, regT0); 187 emitStore Int32(dst, regT0, dst == op1 || dst == op2);187 emitStoreAndMapInt32(dst, regT1, regT0, dst == op1 || dst == op2, OPCODE_LENGTH(op_lshift)); 188 188 } 189 189 … … 229 229 rshift32(Imm32(shift & 0x1f), regT0); 230 230 } 231 emitStore Int32(dst, regT0, dst == op1);231 emitStoreAndMapInt32(dst, regT1, regT0, dst == op1, OPCODE_LENGTH(op_rshift)); 232 232 return; 233 233 } … … 242 242 } else 243 243 rshift32(regT2, regT0); 244 emitStore Int32(dst, regT0, dst == op1 || dst == op2);244 emitStoreAndMapInt32(dst, regT1, regT0, dst == op1, OPCODE_LENGTH(op_rshift)); 245 245 } 246 246 … … 343 343 addSlowCase(branch32(NotEqual, regT1, TrustedImm32(JSValue::Int32Tag))); 344 344 and32(Imm32(constant), regT0); 345 emitStore Int32(dst, regT0, (op == dst));345 emitStoreAndMapInt32(dst, regT1, regT0, dst == op, OPCODE_LENGTH(op_bitand)); 346 346 return; 347 347 } … … 351 351 addSlowCase(branch32(NotEqual, regT3, TrustedImm32(JSValue::Int32Tag))); 352 352 and32(regT2, regT0); 353 emitStore Int32(dst, regT0, (op1 == dst || op2 == dst));353 emitStoreAndMapInt32(dst, regT1, regT0, (op1 == dst || op2 == dst), OPCODE_LENGTH(op_bitand)); 354 354 } 355 355 … … 384 384 addSlowCase(branch32(NotEqual, regT1, TrustedImm32(JSValue::Int32Tag))); 385 385 or32(Imm32(constant), regT0); 386 emitStore Int32(dst, regT0, (op == dst));386 emitStoreAndMapInt32(dst, regT1, regT0, op == dst, OPCODE_LENGTH(op_bitor)); 387 387 return; 388 388 } … … 392 392 addSlowCase(branch32(NotEqual, regT3, TrustedImm32(JSValue::Int32Tag))); 393 393 or32(regT2, regT0); 394 emitStore Int32(dst, regT0, (op1 == dst || op2 == dst));394 emitStoreAndMapInt32(dst, regT1, regT0, (op1 == dst || op2 == dst), OPCODE_LENGTH(op_bitor)); 395 395 } 396 396 … … 425 425 addSlowCase(branch32(NotEqual, regT1, TrustedImm32(JSValue::Int32Tag))); 426 426 xor32(Imm32(constant), regT0); 427 emitStore Int32(dst, regT0, (op == dst));427 emitStoreAndMapInt32(dst, regT1, regT0, op == dst, OPCODE_LENGTH(op_bitxor)); 428 428 return; 429 429 } … … 433 433 addSlowCase(branch32(NotEqual, regT3, TrustedImm32(JSValue::Int32Tag))); 434 434 xor32(regT2, regT0); 435 emitStore Int32(dst, regT0, (op1 == dst || op2 == dst));435 emitStoreAndMapInt32(dst, regT1, regT0, (op1 == dst || op2 == dst), OPCODE_LENGTH(op_bitxor)); 436 436 } 437 437 … … 463 463 464 464 not32(regT0); 465 emitStore Int32(dst, regT0, (dst == src));465 emitStoreAndMapInt32(dst, regT1, regT0, dst == src, OPCODE_LENGTH(op_bitnot)); 466 466 } 467 467 … … 490 490 return; 491 491 492 emitStoreInt32(dst, regT0); 493 494 addSlowCase(branchAdd32(Overflow, TrustedImm32(1), regT0)); 495 emitStoreInt32(srcDst, regT0, true); 492 move(regT0, regT2); 493 addSlowCase(branchAdd32(Overflow, TrustedImm32(1), regT2)); 494 emitStoreInt32(srcDst, regT2, true); 495 496 emitStoreAndMapInt32(dst, regT1, regT0, false, OPCODE_LENGTH(op_post_inc)); 496 497 } 497 498 … … 524 525 return; 525 526 526 emitStoreInt32(dst, regT0); 527 528 addSlowCase(branchSub32(Overflow, TrustedImm32(1), regT0)); 529 emitStoreInt32(srcDst, regT0, true); 527 move(regT0, regT2); 528 addSlowCase(branchSub32(Overflow, TrustedImm32(1), regT2)); 529 emitStoreInt32(srcDst, regT2, true); 530 531 emitStoreAndMapInt32(dst, regT1, regT0, false, OPCODE_LENGTH(op_post_dec)); 530 532 } 531 533 … … 555 557 addSlowCase(branch32(NotEqual, regT1, TrustedImm32(JSValue::Int32Tag))); 556 558 addSlowCase(branchAdd32(Overflow, TrustedImm32(1), regT0)); 557 emitStore Int32(srcDst, regT0, true);559 emitStoreAndMapInt32(srcDst, regT1, regT0, true, OPCODE_LENGTH(op_pre_inc)); 558 560 } 559 561 … … 580 582 addSlowCase(branch32(NotEqual, regT1, TrustedImm32(JSValue::Int32Tag))); 581 583 addSlowCase(branchSub32(Overflow, TrustedImm32(1), regT0)); 582 emitStore Int32(srcDst, regT0, true);584 emitStoreAndMapInt32(srcDst, regT1, regT0, true, OPCODE_LENGTH(op_pre_dec)); 583 585 } 584 586 -
trunk/Source/JavaScriptCore/jit/JITInlineMethods.h
r95134 r95201 572 572 } 573 573 574 inline void JIT::emitStoreAndMapInt32(unsigned index, RegisterID tag, RegisterID payload, bool indexIsInt32, size_t opcodeLength) 575 { 576 emitStoreInt32(index, payload, indexIsInt32); 577 map(m_bytecodeOffset + opcodeLength, index, tag, payload); 578 } 579 574 580 inline void JIT::emitStoreInt32(unsigned index, TrustedImm32 payload, bool indexIsInt32) 575 581 {
Note: See TracChangeset
for help on using the changeset viewer.