OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 // Store the value in register src in the safepoint register stack | 329 // Store the value in register src in the safepoint register stack |
330 // slot for register dst. | 330 // slot for register dst. |
331 void StoreToSafepointRegisterSlot(Register dst, const Immediate& imm); | 331 void StoreToSafepointRegisterSlot(Register dst, const Immediate& imm); |
332 void StoreToSafepointRegisterSlot(Register dst, Register src); | 332 void StoreToSafepointRegisterSlot(Register dst, Register src); |
333 void LoadFromSafepointRegisterSlot(Register dst, Register src); | 333 void LoadFromSafepointRegisterSlot(Register dst, Register src); |
334 | 334 |
335 void InitializeRootRegister() { | 335 void InitializeRootRegister() { |
336 ExternalReference roots_array_start = | 336 ExternalReference roots_array_start = |
337 ExternalReference::roots_array_start(isolate()); | 337 ExternalReference::roots_array_start(isolate()); |
338 Move(kRootRegister, roots_array_start); | 338 Move(kRootRegister, roots_array_start); |
339 addq(kRootRegister, Immediate(kRootRegisterBias)); | 339 addp(kRootRegister, Immediate(kRootRegisterBias)); |
340 } | 340 } |
341 | 341 |
342 // --------------------------------------------------------------------------- | 342 // --------------------------------------------------------------------------- |
343 // JavaScript invokes | 343 // JavaScript invokes |
344 | 344 |
345 // Invoke the JavaScript function code by either calling or jumping. | 345 // Invoke the JavaScript function code by either calling or jumping. |
346 void InvokeCode(Register code, | 346 void InvokeCode(Register code, |
347 const ParameterCount& expected, | 347 const ParameterCount& expected, |
348 const ParameterCount& actual, | 348 const ParameterCount& actual, |
349 InvokeFlag flag, | 349 InvokeFlag flag, |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 void Call(Label* target) { call(target); } | 839 void Call(Label* target) { call(target); } |
840 void Push(Register src); | 840 void Push(Register src); |
841 void Push(const Operand& src); | 841 void Push(const Operand& src); |
842 void Push(Immediate value); | 842 void Push(Immediate value); |
843 void PushImm32(int32_t imm32); | 843 void PushImm32(int32_t imm32); |
844 void Pop(Register dst); | 844 void Pop(Register dst); |
845 void Pop(const Operand& dst); | 845 void Pop(const Operand& dst); |
846 void PushReturnAddressFrom(Register src) { pushq(src); } | 846 void PushReturnAddressFrom(Register src) { pushq(src); } |
847 void PopReturnAddressTo(Register dst) { popq(dst); } | 847 void PopReturnAddressTo(Register dst) { popq(dst); } |
848 void Move(Register dst, ExternalReference ext) { | 848 void Move(Register dst, ExternalReference ext) { |
849 movp(dst, reinterpret_cast<Address>(ext.address()), | 849 movp(dst, reinterpret_cast<void*>(ext.address()), |
850 RelocInfo::EXTERNAL_REFERENCE); | 850 RelocInfo::EXTERNAL_REFERENCE); |
851 } | 851 } |
852 | 852 |
853 // Loads a pointer into a register with a relocation mode. | 853 // Loads a pointer into a register with a relocation mode. |
854 void Move(Register dst, void* ptr, RelocInfo::Mode rmode) { | 854 void Move(Register dst, void* ptr, RelocInfo::Mode rmode) { |
855 // This method must not be used with heap object references. The stored | 855 // This method must not be used with heap object references. The stored |
856 // address is not GC safe. Use the handle version instead. | 856 // address is not GC safe. Use the handle version instead. |
857 ASSERT(rmode > RelocInfo::LAST_GCED_ENUM); | 857 ASSERT(rmode > RelocInfo::LAST_GCED_ENUM); |
858 movp(dst, ptr, rmode); | 858 movp(dst, ptr, rmode); |
859 } | 859 } |
860 | 860 |
861 void Move(Register dst, Handle<Object> value, RelocInfo::Mode rmode) { | 861 void Move(Register dst, Handle<Object> value, RelocInfo::Mode rmode) { |
862 AllowDeferredHandleDereference using_raw_address; | 862 AllowDeferredHandleDereference using_raw_address; |
863 ASSERT(!RelocInfo::IsNone(rmode)); | 863 ASSERT(!RelocInfo::IsNone(rmode)); |
864 ASSERT(value->IsHeapObject()); | 864 ASSERT(value->IsHeapObject()); |
865 ASSERT(!isolate()->heap()->InNewSpace(*value)); | 865 ASSERT(!isolate()->heap()->InNewSpace(*value)); |
866 movp(dst, value.location(), rmode); | 866 movp(dst, reinterpret_cast<void*>(value.location()), rmode); |
867 } | 867 } |
868 | 868 |
869 // Control Flow | 869 // Control Flow |
870 void Jump(Address destination, RelocInfo::Mode rmode); | 870 void Jump(Address destination, RelocInfo::Mode rmode); |
871 void Jump(ExternalReference ext); | 871 void Jump(ExternalReference ext); |
872 void Jump(const Operand& op); | 872 void Jump(const Operand& op); |
873 void Jump(Handle<Code> code_object, RelocInfo::Mode rmode); | 873 void Jump(Handle<Code> code_object, RelocInfo::Mode rmode); |
874 | 874 |
875 void Call(Address destination, RelocInfo::Mode rmode); | 875 void Call(Address destination, RelocInfo::Mode rmode); |
876 void Call(ExternalReference ext); | 876 void Call(ExternalReference ext); |
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1619 masm->popfq(); \ | 1619 masm->popfq(); \ |
1620 } \ | 1620 } \ |
1621 masm-> | 1621 masm-> |
1622 #else | 1622 #else |
1623 #define ACCESS_MASM(masm) masm-> | 1623 #define ACCESS_MASM(masm) masm-> |
1624 #endif | 1624 #endif |
1625 | 1625 |
1626 } } // namespace v8::internal | 1626 } } // namespace v8::internal |
1627 | 1627 |
1628 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ | 1628 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ |
OLD | NEW |