OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 | 179 |
180 // Push and pop the registers that can hold pointers. | 180 // Push and pop the registers that can hold pointers. |
181 void PushSafepointRegisters() { Pushad(); } | 181 void PushSafepointRegisters() { Pushad(); } |
182 void PopSafepointRegisters() { Popad(); } | 182 void PopSafepointRegisters() { Popad(); } |
183 // Store the value in register src in the safepoint register stack | 183 // Store the value in register src in the safepoint register stack |
184 // slot for register dst. | 184 // slot for register dst. |
185 void StoreToSafepointRegisterSlot(Register dst, Register src); | 185 void StoreToSafepointRegisterSlot(Register dst, Register src); |
186 void LoadFromSafepointRegisterSlot(Register dst, Register src); | 186 void LoadFromSafepointRegisterSlot(Register dst, Register src); |
187 | 187 |
188 void InitializeRootRegister() { | 188 void InitializeRootRegister() { |
189 ExternalReference roots_address = ExternalReference::roots_address(); | 189 ExternalReference roots_address = |
| 190 ExternalReference::roots_address(isolate()); |
190 movq(kRootRegister, roots_address); | 191 movq(kRootRegister, roots_address); |
191 addq(kRootRegister, Immediate(kRootRegisterBias)); | 192 addq(kRootRegister, Immediate(kRootRegisterBias)); |
192 } | 193 } |
193 | 194 |
194 // --------------------------------------------------------------------------- | 195 // --------------------------------------------------------------------------- |
195 // JavaScript invokes | 196 // JavaScript invokes |
196 | 197 |
197 // Invoke the JavaScript function code by either calling or jumping. | 198 // Invoke the JavaScript function code by either calling or jumping. |
198 void InvokeCode(Register code, | 199 void InvokeCode(Register code, |
199 const ParameterCount& expected, | 200 const ParameterCount& expected, |
(...skipping 1590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1790 void MacroAssembler::InNewSpace(Register object, | 1791 void MacroAssembler::InNewSpace(Register object, |
1791 Register scratch, | 1792 Register scratch, |
1792 Condition cc, | 1793 Condition cc, |
1793 LabelType* branch) { | 1794 LabelType* branch) { |
1794 if (Serializer::enabled()) { | 1795 if (Serializer::enabled()) { |
1795 // Can't do arithmetic on external references if it might get serialized. | 1796 // Can't do arithmetic on external references if it might get serialized. |
1796 // The mask isn't really an address. We load it as an external reference in | 1797 // The mask isn't really an address. We load it as an external reference in |
1797 // case the size of the new space is different between the snapshot maker | 1798 // case the size of the new space is different between the snapshot maker |
1798 // and the running system. | 1799 // and the running system. |
1799 if (scratch.is(object)) { | 1800 if (scratch.is(object)) { |
1800 movq(kScratchRegister, ExternalReference::new_space_mask()); | 1801 movq(kScratchRegister, ExternalReference::new_space_mask(isolate())); |
1801 and_(scratch, kScratchRegister); | 1802 and_(scratch, kScratchRegister); |
1802 } else { | 1803 } else { |
1803 movq(scratch, ExternalReference::new_space_mask()); | 1804 movq(scratch, ExternalReference::new_space_mask(isolate())); |
1804 and_(scratch, object); | 1805 and_(scratch, object); |
1805 } | 1806 } |
1806 movq(kScratchRegister, ExternalReference::new_space_start()); | 1807 movq(kScratchRegister, ExternalReference::new_space_start(isolate())); |
1807 cmpq(scratch, kScratchRegister); | 1808 cmpq(scratch, kScratchRegister); |
1808 j(cc, branch); | 1809 j(cc, branch); |
1809 } else { | 1810 } else { |
1810 ASSERT(is_int32(static_cast<int64_t>(HEAP->NewSpaceMask()))); | 1811 ASSERT(is_int32(static_cast<int64_t>(HEAP->NewSpaceMask()))); |
1811 intptr_t new_space_start = | 1812 intptr_t new_space_start = |
1812 reinterpret_cast<intptr_t>(HEAP->NewSpaceStart()); | 1813 reinterpret_cast<intptr_t>(HEAP->NewSpaceStart()); |
1813 movq(kScratchRegister, -new_space_start, RelocInfo::NONE); | 1814 movq(kScratchRegister, -new_space_start, RelocInfo::NONE); |
1814 if (scratch.is(object)) { | 1815 if (scratch.is(object)) { |
1815 addq(scratch, kScratchRegister); | 1816 addq(scratch, kScratchRegister); |
1816 } else { | 1817 } else { |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1888 Jump(adaptor, RelocInfo::CODE_TARGET); | 1889 Jump(adaptor, RelocInfo::CODE_TARGET); |
1889 } | 1890 } |
1890 bind(&invoke); | 1891 bind(&invoke); |
1891 } | 1892 } |
1892 } | 1893 } |
1893 | 1894 |
1894 | 1895 |
1895 } } // namespace v8::internal | 1896 } } // namespace v8::internal |
1896 | 1897 |
1897 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ | 1898 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ |
OLD | NEW |