Changeset 43432 in webkit for trunk/JavaScriptCore/assembler
- Timestamp:
- May 9, 2009, 1:35:57 AM (16 years ago)
- Location:
- trunk/JavaScriptCore/assembler
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/assembler/AbstractMacroAssembler.h
r41544 r43432 38 38 class Jump; 39 39 class PatchBuffer; 40 class CodeLocationInstruction; 40 41 class CodeLocationLabel; 41 42 class CodeLocationJump; … … 407 408 // methods may be used to recover a handle that has nopw been 408 409 // retained, based on a known fixed relative offset from one that has. 410 CodeLocationInstruction instructionAtOffset(int offset); 409 411 CodeLocationLabel labelAtOffset(int offset); 410 412 CodeLocationJump jumpAtOffset(int offset); … … 423 425 424 426 void* m_location; 427 }; 428 429 // CodeLocationInstruction: 430 // 431 // An arbitrary instruction in the JIT code. 432 class CodeLocationInstruction : public CodeLocationCommon { 433 friend class CodeLocationCommon; 434 public: 435 CodeLocationInstruction() 436 { 437 } 438 439 void patchLoadToLEA() { 440 AssemblerType::patchLoadToLEA(reinterpret_cast<intptr_t>(this->m_location)); 441 } 442 443 private: 444 explicit CodeLocationInstruction(void* location) 445 : CodeLocationCommon(location) 446 { 447 } 425 448 }; 426 449 … … 805 828 806 829 template <class AssemblerType> 830 typename AbstractMacroAssembler<AssemblerType>::CodeLocationInstruction AbstractMacroAssembler<AssemblerType>::CodeLocationCommon::instructionAtOffset(int offset) 831 { 832 return typename AbstractMacroAssembler::CodeLocationInstruction(reinterpret_cast<char*>(m_location) + offset); 833 } 834 835 template <class AssemblerType> 807 836 typename AbstractMacroAssembler<AssemblerType>::CodeLocationLabel AbstractMacroAssembler<AssemblerType>::CodeLocationCommon::labelAtOffset(int offset) 808 837 { -
trunk/JavaScriptCore/assembler/MacroAssembler.h
r41103 r43432 243 243 } 244 244 245 void storePtr(RegisterID src, void* address) 246 { 247 store32(src, address); 248 } 249 245 250 void storePtr(ImmPtr imm, ImplicitAddress address) 246 251 { -
trunk/JavaScriptCore/assembler/MacroAssemblerX86.h
r41089 r43432 71 71 } 72 72 73 void store32(RegisterID src, void* address) 74 { 75 m_assembler.movl_rm(src, address); 76 } 77 73 78 Jump branch32(Condition cond, AbsoluteAddress left, RegisterID right) 74 79 { -
trunk/JavaScriptCore/assembler/MacroAssemblerX86_64.h
r43220 r43432 242 242 m_assembler.movq_rm(src, address.offset, address.base, address.index, address.scale); 243 243 } 244 245 void storePtr(RegisterID src, void* address) 246 { 247 if (src == X86::eax) 248 m_assembler.movq_EAXm(address); 249 else { 250 swap(X86::eax, src); 251 m_assembler.movq_EAXm(address); 252 swap(X86::eax, src); 253 } 254 } 244 255 245 256 void storePtr(ImmPtr imm, ImplicitAddress address) -
trunk/JavaScriptCore/assembler/X86Assembler.h
r43220 r43432 938 938 } 939 939 940 void movq_EAXm(void* addr) 941 { 942 m_formatter.oneByteOp64(OP_MOV_OvEAX); 943 m_formatter.immediate64(reinterpret_cast<int64_t>(addr)); 944 } 945 940 946 void movq_mr(int offset, RegisterID base, RegisterID dst) 941 947 { … … 972 978 973 979 #else 980 void movl_rm(RegisterID src, void* addr) 981 { 982 if (src == X86::eax) 983 movl_EAXm(addr); 984 else 985 m_formatter.oneByteOp(OP_MOV_EvGv, src, addr); 986 } 987 974 988 void movl_mr(void* addr, RegisterID dst) 975 989 { … … 1287 1301 ASSERT(linkOffset == static_cast<int>(linkOffset)); 1288 1302 reinterpret_cast<int*>(reinterpret_cast<ptrdiff_t>(code) + from.m_offset)[-1] = linkOffset; 1303 } 1304 1305 static void patchLoadToLEA(intptr_t where) 1306 { 1307 char* ptr = reinterpret_cast<char*>(where); 1308 ptr[0] = OP_LEA; 1289 1309 } 1290 1310
Note:
See TracChangeset
for help on using the changeset viewer.