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 954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
965 xorl(dst, dst); | 965 xorl(dst, dst); |
966 } else if (is_uint32(x)) { | 966 } else if (is_uint32(x)) { |
967 movl(dst, Immediate(static_cast<uint32_t>(x))); | 967 movl(dst, Immediate(static_cast<uint32_t>(x))); |
968 } else if (is_int32(x)) { | 968 } else if (is_int32(x)) { |
969 movq(dst, Immediate(static_cast<int32_t>(x))); | 969 movq(dst, Immediate(static_cast<int32_t>(x))); |
970 } else { | 970 } else { |
971 movq(dst, x, RelocInfo::NONE64); | 971 movq(dst, x, RelocInfo::NONE64); |
972 } | 972 } |
973 } | 973 } |
974 | 974 |
| 975 |
975 void MacroAssembler::Set(const Operand& dst, int64_t x) { | 976 void MacroAssembler::Set(const Operand& dst, int64_t x) { |
976 if (is_int32(x)) { | 977 if (is_int32(x)) { |
977 movq(dst, Immediate(static_cast<int32_t>(x))); | 978 movq(dst, Immediate(static_cast<int32_t>(x))); |
978 } else { | 979 } else { |
979 Set(kScratchRegister, x); | 980 Set(kScratchRegister, x); |
980 movq(dst, kScratchRegister); | 981 movq(dst, kScratchRegister); |
981 } | 982 } |
982 } | 983 } |
983 | 984 |
984 | 985 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1022 xorl(kScratchRegister, kScratchRegister); | 1023 xorl(kScratchRegister, kScratchRegister); |
1023 return kScratchRegister; | 1024 return kScratchRegister; |
1024 } | 1025 } |
1025 if (value == 1) { | 1026 if (value == 1) { |
1026 return kSmiConstantRegister; | 1027 return kSmiConstantRegister; |
1027 } | 1028 } |
1028 LoadSmiConstant(kScratchRegister, source); | 1029 LoadSmiConstant(kScratchRegister, source); |
1029 return kScratchRegister; | 1030 return kScratchRegister; |
1030 } | 1031 } |
1031 | 1032 |
| 1033 |
1032 void MacroAssembler::LoadSmiConstant(Register dst, Smi* source) { | 1034 void MacroAssembler::LoadSmiConstant(Register dst, Smi* source) { |
1033 if (emit_debug_code()) { | 1035 if (emit_debug_code()) { |
1034 movq(dst, | 1036 movq(dst, |
1035 reinterpret_cast<uint64_t>(Smi::FromInt(kSmiConstantRegisterValue)), | 1037 reinterpret_cast<uint64_t>(Smi::FromInt(kSmiConstantRegisterValue)), |
1036 RelocInfo::NONE64); | 1038 RelocInfo::NONE64); |
1037 cmpq(dst, kSmiConstantRegister); | 1039 cmpq(dst, kSmiConstantRegister); |
1038 if (allow_stub_calls()) { | 1040 if (allow_stub_calls()) { |
1039 Assert(equal, "Uninitialized kSmiConstantRegister"); | 1041 Assert(equal, "Uninitialized kSmiConstantRegister"); |
1040 } else { | 1042 } else { |
1041 Label ok; | 1043 Label ok; |
(...skipping 3686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4728 j(greater, &no_info_available); | 4730 j(greater, &no_info_available); |
4729 CompareRoot(MemOperand(scratch_reg, -AllocationSiteInfo::kSize), | 4731 CompareRoot(MemOperand(scratch_reg, -AllocationSiteInfo::kSize), |
4730 Heap::kAllocationSiteInfoMapRootIndex); | 4732 Heap::kAllocationSiteInfoMapRootIndex); |
4731 bind(&no_info_available); | 4733 bind(&no_info_available); |
4732 } | 4734 } |
4733 | 4735 |
4734 | 4736 |
4735 } } // namespace v8::internal | 4737 } } // namespace v8::internal |
4736 | 4738 |
4737 #endif // V8_TARGET_ARCH_X64 | 4739 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |