Changeset 100171 in webkit
- Timestamp:
- Nov 14, 2011, 11:44:32 AM (15 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 4 edited
-
ChangeLog (modified) (1 diff)
-
jit/JIT.cpp (modified) (1 diff)
-
jit/JIT.h (modified) (4 diffs)
-
jit/JITInlineMethods.h (modified) (22 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r100168 r100171 1 2011-11-14 Geoffrey Garen <ggaren@apple.com> 2 3 32-bit Build fix: declare virtual register indices to be int rather than 4 unsigned, since they can be positive or negative. 5 6 For better clarity, explicitly use ReturnPC instead of -1 as the "invalid" 7 state, since we'll never load and operate on the ReturnPC as a JS value. 8 9 * jit/JIT.cpp: 10 (JSC::JIT::JIT): 11 * jit/JIT.h: 12 * jit/JITInlineMethods.h: 13 (JSC::JIT::emitLoadTag): 14 (JSC::JIT::emitLoadPayload): 15 (JSC::JIT::emitLoad): 16 (JSC::JIT::emitLoad2): 17 (JSC::JIT::emitLoadDouble): 18 (JSC::JIT::emitLoadInt32ToDouble): 19 (JSC::JIT::emitStore): 20 (JSC::JIT::emitStoreInt32): 21 (JSC::JIT::emitStoreAndMapInt32): 22 (JSC::JIT::emitStoreCell): 23 (JSC::JIT::emitStoreBool): 24 (JSC::JIT::emitStoreDouble): 25 (JSC::JIT::map): 26 (JSC::JIT::unmap): 27 (JSC::JIT::isMapped): 28 (JSC::JIT::getMappedPayload): 29 (JSC::JIT::getMappedTag): 30 (JSC::JIT::emitJumpSlowCaseIfNotJSCell): 31 1 32 2011-11-14 Michael Saboff <msaboff@apple.com> 2 33 -
trunk/Source/JavaScriptCore/jit/JIT.cpp
r100165 r100171 79 79 , m_jumpTargetIndex(0) 80 80 , m_mappedBytecodeOffset((unsigned)-1) 81 , m_mappedVirtualRegisterIndex( (unsigned)-1)81 , m_mappedVirtualRegisterIndex(RegisterFile::ReturnPC) 82 82 , m_mappedTag((RegisterID)-1) 83 83 , m_mappedPayload((RegisterID)-1) -
trunk/Source/JavaScriptCore/jit/JIT.h
r100165 r100171 313 313 bool isOperandConstantImmediateDouble(unsigned src); 314 314 315 void emitLoadDouble( unsignedindex, FPRegisterID value);316 void emitLoadInt32ToDouble( unsignedindex, FPRegisterID value);315 void emitLoadDouble(int index, FPRegisterID value); 316 void emitLoadInt32ToDouble(int index, FPRegisterID value); 317 317 Jump emitJumpIfNotObject(RegisterID structureReg); 318 318 Jump emitJumpIfNotType(RegisterID baseReg, RegisterID scratchReg, JSType); … … 342 342 bool getOperandConstantImmediateInt(unsigned op1, unsigned op2, unsigned& op, int32_t& constant); 343 343 344 void emitLoadTag( unsignedindex, RegisterID tag);345 void emitLoadPayload( unsignedindex, RegisterID payload);344 void emitLoadTag(int index, RegisterID tag); 345 void emitLoadPayload(int index, RegisterID payload); 346 346 347 347 void emitLoad(const JSValue& v, RegisterID tag, RegisterID payload); 348 void emitLoad( unsignedindex, RegisterID tag, RegisterID payload, RegisterID base = callFrameRegister);349 void emitLoad2( unsigned index1, RegisterID tag1, RegisterID payload1, unsignedindex2, RegisterID tag2, RegisterID payload2);350 351 void emitStore( unsignedindex, RegisterID tag, RegisterID payload, RegisterID base = callFrameRegister);352 void emitStore( unsignedindex, const JSValue constant, RegisterID base = callFrameRegister);353 void emitStoreInt32( unsignedindex, RegisterID payload, bool indexIsInt32 = false);354 void emitStoreInt32( unsignedindex, TrustedImm32 payload, bool indexIsInt32 = false);355 void emitStoreAndMapInt32( unsignedindex, RegisterID tag, RegisterID payload, bool indexIsInt32, size_t opcodeLength);356 void emitStoreCell( unsignedindex, RegisterID payload, bool indexIsCell = false);357 void emitStoreBool( unsignedindex, RegisterID payload, bool indexIsBool = false);358 void emitStoreDouble( unsignedindex, FPRegisterID value);348 void emitLoad(int index, RegisterID tag, RegisterID payload, RegisterID base = callFrameRegister); 349 void emitLoad2(int index1, RegisterID tag1, RegisterID payload1, int index2, RegisterID tag2, RegisterID payload2); 350 351 void emitStore(int index, RegisterID tag, RegisterID payload, RegisterID base = callFrameRegister); 352 void emitStore(int index, const JSValue constant, RegisterID base = callFrameRegister); 353 void emitStoreInt32(int index, RegisterID payload, bool indexIsInt32 = false); 354 void emitStoreInt32(int index, TrustedImm32 payload, bool indexIsInt32 = false); 355 void emitStoreAndMapInt32(int index, RegisterID tag, RegisterID payload, bool indexIsInt32, size_t opcodeLength); 356 void emitStoreCell(int index, RegisterID payload, bool indexIsCell = false); 357 void emitStoreBool(int index, RegisterID payload, bool indexIsBool = false); 358 void emitStoreDouble(int index, FPRegisterID value); 359 359 360 360 bool isLabeled(unsigned bytecodeOffset); 361 void map(unsigned bytecodeOffset, unsignedvirtualRegisterIndex, RegisterID tag, RegisterID payload);361 void map(unsigned bytecodeOffset, int virtualRegisterIndex, RegisterID tag, RegisterID payload); 362 362 void unmap(RegisterID); 363 363 void unmap(); 364 bool isMapped(unsigned virtualRegisterIndex); 365 bool getMappedPayload(unsigned virtualRegisterIndex, RegisterID& payload); 366 bool getMappedTag(unsigned virtualRegisterIndex, RegisterID& tag); 367 368 void emitJumpSlowCaseIfNotJSCell(unsigned virtualRegisterIndex); 369 void emitJumpSlowCaseIfNotJSCell(unsigned virtualRegisterIndex, RegisterID tag); 370 void linkSlowCaseIfNotJSCell(Vector<SlowCaseEntry>::iterator&, unsigned virtualRegisterIndex); 364 bool isMapped(int virtualRegisterIndex); 365 bool getMappedPayload(int virtualRegisterIndex, RegisterID& payload); 366 bool getMappedTag(int virtualRegisterIndex, RegisterID& tag); 367 368 void emitJumpSlowCaseIfNotJSCell(int virtualRegisterIndex); 369 void emitJumpSlowCaseIfNotJSCell(int virtualRegisterIndex, RegisterID tag); 371 370 372 371 void compileGetByIdHotPath(); … … 985 984 ++iter; 986 985 } 987 void linkSlowCaseIfNotJSCell(Vector<SlowCaseEntry>::iterator&, int v Reg);986 void linkSlowCaseIfNotJSCell(Vector<SlowCaseEntry>::iterator&, int virtualRegisterIndex); 988 987 989 988 Jump checkStructure(RegisterID reg, Structure* structure); … … 1066 1065 unsigned m_jumpTargetIndex; 1067 1066 unsigned m_mappedBytecodeOffset; 1068 unsignedm_mappedVirtualRegisterIndex;1067 int m_mappedVirtualRegisterIndex; 1069 1068 RegisterID m_mappedTag; 1070 1069 RegisterID m_mappedPayload; -
trunk/Source/JavaScriptCore/jit/JITInlineMethods.h
r99888 r100171 500 500 #if USE(JSVALUE32_64) 501 501 502 inline void JIT::emitLoadTag( unsignedindex, RegisterID tag)502 inline void JIT::emitLoadTag(int index, RegisterID tag) 503 503 { 504 504 RegisterID mappedTag; … … 519 519 } 520 520 521 inline void JIT::emitLoadPayload( unsignedindex, RegisterID payload)521 inline void JIT::emitLoadPayload(int index, RegisterID payload) 522 522 { 523 523 RegisterID mappedPayload; … … 544 544 } 545 545 546 inline void JIT::emitLoad( unsignedindex, RegisterID tag, RegisterID payload, RegisterID base)546 inline void JIT::emitLoad(int index, RegisterID tag, RegisterID payload, RegisterID base) 547 547 { 548 548 ASSERT(tag != payload); … … 565 565 } 566 566 567 inline void JIT::emitLoad2( unsigned index1, RegisterID tag1, RegisterID payload1, unsignedindex2, RegisterID tag2, RegisterID payload2)567 inline void JIT::emitLoad2(int index1, RegisterID tag1, RegisterID payload1, int index2, RegisterID tag2, RegisterID payload2) 568 568 { 569 569 if (isMapped(index1)) { … … 576 576 } 577 577 578 inline void JIT::emitLoadDouble( unsignedindex, FPRegisterID value)578 inline void JIT::emitLoadDouble(int index, FPRegisterID value) 579 579 { 580 580 if (m_codeBlock->isConstantRegisterIndex(index)) { … … 585 585 } 586 586 587 inline void JIT::emitLoadInt32ToDouble( unsignedindex, FPRegisterID value)587 inline void JIT::emitLoadInt32ToDouble(int index, FPRegisterID value) 588 588 { 589 589 if (m_codeBlock->isConstantRegisterIndex(index)) { … … 595 595 } 596 596 597 inline void JIT::emitStore( unsignedindex, RegisterID tag, RegisterID payload, RegisterID base)597 inline void JIT::emitStore(int index, RegisterID tag, RegisterID payload, RegisterID base) 598 598 { 599 599 store32(payload, payloadFor(index, base)); … … 601 601 } 602 602 603 inline void JIT::emitStoreInt32( unsignedindex, RegisterID payload, bool indexIsInt32)603 inline void JIT::emitStoreInt32(int index, RegisterID payload, bool indexIsInt32) 604 604 { 605 605 store32(payload, payloadFor(index, callFrameRegister)); … … 608 608 } 609 609 610 inline void JIT::emitStoreAndMapInt32( unsignedindex, RegisterID tag, RegisterID payload, bool indexIsInt32, size_t opcodeLength)610 inline void JIT::emitStoreAndMapInt32(int index, RegisterID tag, RegisterID payload, bool indexIsInt32, size_t opcodeLength) 611 611 { 612 612 emitStoreInt32(index, payload, indexIsInt32); … … 614 614 } 615 615 616 inline void JIT::emitStoreInt32( unsignedindex, TrustedImm32 payload, bool indexIsInt32)616 inline void JIT::emitStoreInt32(int index, TrustedImm32 payload, bool indexIsInt32) 617 617 { 618 618 store32(payload, payloadFor(index, callFrameRegister)); … … 621 621 } 622 622 623 inline void JIT::emitStoreCell( unsignedindex, RegisterID payload, bool indexIsCell)623 inline void JIT::emitStoreCell(int index, RegisterID payload, bool indexIsCell) 624 624 { 625 625 store32(payload, payloadFor(index, callFrameRegister)); … … 628 628 } 629 629 630 inline void JIT::emitStoreBool( unsignedindex, RegisterID payload, bool indexIsBool)630 inline void JIT::emitStoreBool(int index, RegisterID payload, bool indexIsBool) 631 631 { 632 632 store32(payload, payloadFor(index, callFrameRegister)); … … 635 635 } 636 636 637 inline void JIT::emitStoreDouble( unsignedindex, FPRegisterID value)637 inline void JIT::emitStoreDouble(int index, FPRegisterID value) 638 638 { 639 639 storeDouble(value, addressFor(index)); 640 640 } 641 641 642 inline void JIT::emitStore( unsignedindex, const JSValue constant, RegisterID base)642 inline void JIT::emitStore(int index, const JSValue constant, RegisterID base) 643 643 { 644 644 store32(Imm32(constant.payload()), payloadFor(index, base)); … … 663 663 } 664 664 665 inline void JIT::map(unsigned bytecodeOffset, unsignedvirtualRegisterIndex, RegisterID tag, RegisterID payload)665 inline void JIT::map(unsigned bytecodeOffset, int virtualRegisterIndex, RegisterID tag, RegisterID payload) 666 666 { 667 667 if (isLabeled(bytecodeOffset)) … … 685 685 { 686 686 m_mappedBytecodeOffset = (unsigned)-1; 687 m_mappedVirtualRegisterIndex = (unsigned)-1;687 m_mappedVirtualRegisterIndex = RegisterFile::ReturnPC; 688 688 m_mappedTag = (RegisterID)-1; 689 689 m_mappedPayload = (RegisterID)-1; 690 690 } 691 691 692 inline bool JIT::isMapped( unsignedvirtualRegisterIndex)692 inline bool JIT::isMapped(int virtualRegisterIndex) 693 693 { 694 694 if (m_mappedBytecodeOffset != m_bytecodeOffset) … … 699 699 } 700 700 701 inline bool JIT::getMappedPayload( unsignedvirtualRegisterIndex, RegisterID& payload)701 inline bool JIT::getMappedPayload(int virtualRegisterIndex, RegisterID& payload) 702 702 { 703 703 if (m_mappedBytecodeOffset != m_bytecodeOffset) … … 711 711 } 712 712 713 inline bool JIT::getMappedTag( unsignedvirtualRegisterIndex, RegisterID& tag)713 inline bool JIT::getMappedTag(int virtualRegisterIndex, RegisterID& tag) 714 714 { 715 715 if (m_mappedBytecodeOffset != m_bytecodeOffset) … … 723 723 } 724 724 725 inline void JIT::emitJumpSlowCaseIfNotJSCell( unsignedvirtualRegisterIndex)725 inline void JIT::emitJumpSlowCaseIfNotJSCell(int virtualRegisterIndex) 726 726 { 727 727 if (!m_codeBlock->isKnownNotImmediate(virtualRegisterIndex)) { … … 733 733 } 734 734 735 inline void JIT::emitJumpSlowCaseIfNotJSCell( unsignedvirtualRegisterIndex, RegisterID tag)735 inline void JIT::emitJumpSlowCaseIfNotJSCell(int virtualRegisterIndex, RegisterID tag) 736 736 { 737 737 if (!m_codeBlock->isKnownNotImmediate(virtualRegisterIndex)) { … … 741 741 addSlowCase(branch32(NotEqual, tag, TrustedImm32(JSValue::CellTag))); 742 742 } 743 }744 745 inline void JIT::linkSlowCaseIfNotJSCell(Vector<SlowCaseEntry>::iterator& iter, unsigned virtualRegisterIndex)746 {747 if (!m_codeBlock->isKnownNotImmediate(virtualRegisterIndex))748 linkSlowCase(iter);749 743 } 750 744 … … 878 872 #if USE(JSVALUE64) 879 873 880 inline void JIT::emitLoadDouble( unsignedindex, FPRegisterID value)874 inline void JIT::emitLoadDouble(int index, FPRegisterID value) 881 875 { 882 876 if (m_codeBlock->isConstantRegisterIndex(index)) { … … 887 881 } 888 882 889 inline void JIT::emitLoadInt32ToDouble( unsignedindex, FPRegisterID value)883 inline void JIT::emitLoadInt32ToDouble(int index, FPRegisterID value) 890 884 { 891 885 if (m_codeBlock->isConstantRegisterIndex(index)) {
Note:
See TracChangeset
for help on using the changeset viewer.