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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 | 400 |
401 // --------------------------------------------------------------------------- | 401 // --------------------------------------------------------------------------- |
402 // Smi tagging, untagging and operations on tagged smis. | 402 // Smi tagging, untagging and operations on tagged smis. |
403 | 403 |
404 // Support for constant splitting. | 404 // Support for constant splitting. |
405 bool IsUnsafeInt(const int32_t x); | 405 bool IsUnsafeInt(const int32_t x); |
406 void SafeMove(Register dst, Smi* src); | 406 void SafeMove(Register dst, Smi* src); |
407 void SafePush(Smi* src); | 407 void SafePush(Smi* src); |
408 | 408 |
409 void InitializeSmiConstantRegister() { | 409 void InitializeSmiConstantRegister() { |
410 movq(kSmiConstantRegister, Smi::FromInt(kSmiConstantRegisterValue), | 410 Move(kSmiConstantRegister, Smi::FromInt(kSmiConstantRegisterValue), |
411 RelocInfo::NONE64); | 411 RelocInfo::NONE64); |
412 } | 412 } |
413 | 413 |
414 // Conversions between tagged smi values and non-tagged integer values. | 414 // Conversions between tagged smi values and non-tagged integer values. |
415 | 415 |
416 // Tag an integer value. The result must be known to be a valid smi value. | 416 // Tag an integer value. The result must be known to be a valid smi value. |
417 // Only uses the low 32 bits of the src register. Sets the N and Z flags | 417 // Only uses the low 32 bits of the src register. Sets the N and Z flags |
418 // based on the value of the resulting smi. | 418 // based on the value of the resulting smi. |
419 void Integer32ToSmi(Register dst, Register src); | 419 void Integer32ToSmi(Register dst, Register src); |
420 | 420 |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 // from the stack, clobbering only the rsp register. | 853 // from the stack, clobbering only the rsp register. |
854 void Drop(int stack_elements); | 854 void Drop(int stack_elements); |
855 | 855 |
856 void Call(Label* target) { call(target); } | 856 void Call(Label* target) { call(target); } |
857 void Push(Register src) { push(src); } | 857 void Push(Register src) { push(src); } |
858 void Pop(Register dst) { pop(dst); } | 858 void Pop(Register dst) { pop(dst); } |
859 void PushReturnAddressFrom(Register src) { push(src); } | 859 void PushReturnAddressFrom(Register src) { push(src); } |
860 void PopReturnAddressTo(Register dst) { pop(dst); } | 860 void PopReturnAddressTo(Register dst) { pop(dst); } |
861 void MoveDouble(Register dst, const Operand& src) { movq(dst, src); } | 861 void MoveDouble(Register dst, const Operand& src) { movq(dst, src); } |
862 void MoveDouble(const Operand& dst, Register src) { movq(dst, src); } | 862 void MoveDouble(const Operand& dst, Register src) { movq(dst, src); } |
| 863 |
863 void Move(Register dst, ExternalReference ext) { | 864 void Move(Register dst, ExternalReference ext) { |
864 movq(dst, reinterpret_cast<Address>(ext.address()), | 865 movp(dst, reinterpret_cast<Address>(ext.address()), |
865 RelocInfo::EXTERNAL_REFERENCE); | 866 RelocInfo::EXTERNAL_REFERENCE); |
866 } | 867 } |
867 | 868 |
| 869 // Loads a pointer into a register with a relocation mode. |
| 870 void Move(Register dst, void* ptr, RelocInfo::Mode rmode) { |
| 871 // This method must not be used with heap object references. The stored |
| 872 // address is not GC safe. Use the handle version instead. |
| 873 ASSERT(rmode > RelocInfo::LAST_GCED_ENUM); |
| 874 movp(dst, ptr, rmode); |
| 875 } |
| 876 |
| 877 void Move(Register dst, Handle<Object> value, RelocInfo::Mode rmode) { |
| 878 AllowDeferredHandleDereference using_raw_address; |
| 879 ASSERT(!RelocInfo::IsNone(rmode)); |
| 880 ASSERT(value->IsHeapObject()); |
| 881 ASSERT(!isolate()->heap()->InNewSpace(*value)); |
| 882 movp(dst, value.location(), rmode); |
| 883 } |
| 884 |
868 // Control Flow | 885 // Control Flow |
869 void Jump(Address destination, RelocInfo::Mode rmode); | 886 void Jump(Address destination, RelocInfo::Mode rmode); |
870 void Jump(ExternalReference ext); | 887 void Jump(ExternalReference ext); |
871 void Jump(Handle<Code> code_object, RelocInfo::Mode rmode); | 888 void Jump(Handle<Code> code_object, RelocInfo::Mode rmode); |
872 | 889 |
873 void Call(Address destination, RelocInfo::Mode rmode); | 890 void Call(Address destination, RelocInfo::Mode rmode); |
874 void Call(ExternalReference ext); | 891 void Call(ExternalReference ext); |
875 void Call(Handle<Code> code_object, | 892 void Call(Handle<Code> code_object, |
876 RelocInfo::Mode rmode, | 893 RelocInfo::Mode rmode, |
877 TypeFeedbackId ast_id = TypeFeedbackId::None()); | 894 TypeFeedbackId ast_id = TypeFeedbackId::None()); |
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1616 masm->popfq(); \ | 1633 masm->popfq(); \ |
1617 } \ | 1634 } \ |
1618 masm-> | 1635 masm-> |
1619 #else | 1636 #else |
1620 #define ACCESS_MASM(masm) masm-> | 1637 #define ACCESS_MASM(masm) masm-> |
1621 #endif | 1638 #endif |
1622 | 1639 |
1623 } } // namespace v8::internal | 1640 } } // namespace v8::internal |
1624 | 1641 |
1625 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ | 1642 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ |
OLD | NEW |