OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/base/division-by-constant.h" | 10 #include "src/base/division-by-constant.h" |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 int fixed_offset) { | 170 int fixed_offset) { |
171 DCHECK(root_array_available_); | 171 DCHECK(root_array_available_); |
172 movp(destination, | 172 movp(destination, |
173 Operand(kRootRegister, | 173 Operand(kRootRegister, |
174 variable_offset, times_pointer_size, | 174 variable_offset, times_pointer_size, |
175 (fixed_offset << kPointerSizeLog2) - kRootRegisterBias)); | 175 (fixed_offset << kPointerSizeLog2) - kRootRegisterBias)); |
176 } | 176 } |
177 | 177 |
178 | 178 |
179 void MacroAssembler::StoreRoot(Register source, Heap::RootListIndex index) { | 179 void MacroAssembler::StoreRoot(Register source, Heap::RootListIndex index) { |
| 180 DCHECK(Heap::RootCanBeWrittenAfterInitialization(index)); |
180 DCHECK(root_array_available_); | 181 DCHECK(root_array_available_); |
181 movp(Operand(kRootRegister, (index << kPointerSizeLog2) - kRootRegisterBias), | 182 movp(Operand(kRootRegister, (index << kPointerSizeLog2) - kRootRegisterBias), |
182 source); | 183 source); |
183 } | 184 } |
184 | 185 |
185 | 186 |
186 void MacroAssembler::PushRoot(Heap::RootListIndex index) { | 187 void MacroAssembler::PushRoot(Heap::RootListIndex index) { |
187 DCHECK(root_array_available_); | 188 DCHECK(root_array_available_); |
188 Push(Operand(kRootRegister, (index << kPointerSizeLog2) - kRootRegisterBias)); | 189 Push(Operand(kRootRegister, (index << kPointerSizeLog2) - kRootRegisterBias)); |
189 } | 190 } |
(...skipping 4897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5087 if (mag.shift > 0) sarl(rdx, Immediate(mag.shift)); | 5088 if (mag.shift > 0) sarl(rdx, Immediate(mag.shift)); |
5088 movl(rax, dividend); | 5089 movl(rax, dividend); |
5089 shrl(rax, Immediate(31)); | 5090 shrl(rax, Immediate(31)); |
5090 addl(rdx, rax); | 5091 addl(rdx, rax); |
5091 } | 5092 } |
5092 | 5093 |
5093 | 5094 |
5094 } } // namespace v8::internal | 5095 } } // namespace v8::internal |
5095 | 5096 |
5096 #endif // V8_TARGET_ARCH_X64 | 5097 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |