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 <limits.h> // For LONG_MIN, LONG_MAX. | 5 #include <limits.h> // For LONG_MIN, LONG_MAX. |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM | 7 #if V8_TARGET_ARCH_ARM |
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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 } | 233 } |
234 | 234 |
235 | 235 |
236 void MacroAssembler::Push(Handle<Object> handle) { | 236 void MacroAssembler::Push(Handle<Object> handle) { |
237 mov(ip, Operand(handle)); | 237 mov(ip, Operand(handle)); |
238 push(ip); | 238 push(ip); |
239 } | 239 } |
240 | 240 |
241 | 241 |
242 void MacroAssembler::Move(Register dst, Handle<Object> value) { | 242 void MacroAssembler::Move(Register dst, Handle<Object> value) { |
| 243 AllowDeferredHandleDereference smi_check; |
243 if (value->IsSmi()) { | 244 if (value->IsSmi()) { |
244 mov(dst, Operand(value)); | 245 mov(dst, Operand(value)); |
245 } else { | 246 } else { |
246 DCHECK(value->IsHeapObject()); | 247 DCHECK(value->IsHeapObject()); |
247 mov(dst, Operand(value)); | 248 if (isolate()->heap()->InNewSpace(*value)) { |
| 249 Handle<Cell> cell = isolate()->factory()->NewCell(value); |
| 250 mov(dst, Operand(cell)); |
| 251 ldr(dst, FieldMemOperand(dst, Cell::kValueOffset)); |
| 252 } else { |
| 253 mov(dst, Operand(value)); |
| 254 } |
248 } | 255 } |
249 } | 256 } |
250 | 257 |
251 | 258 |
252 void MacroAssembler::Move(Register dst, Register src, Condition cond) { | 259 void MacroAssembler::Move(Register dst, Register src, Condition cond) { |
253 if (!dst.is(src)) { | 260 if (!dst.is(src)) { |
254 mov(dst, src, LeaveCC, cond); | 261 mov(dst, src, LeaveCC, cond); |
255 } | 262 } |
256 } | 263 } |
257 | 264 |
(...skipping 3771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4029 } | 4036 } |
4030 } | 4037 } |
4031 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); | 4038 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); |
4032 add(result, result, Operand(dividend, LSR, 31)); | 4039 add(result, result, Operand(dividend, LSR, 31)); |
4033 } | 4040 } |
4034 | 4041 |
4035 } // namespace internal | 4042 } // namespace internal |
4036 } // namespace v8 | 4043 } // namespace v8 |
4037 | 4044 |
4038 #endif // V8_TARGET_ARCH_ARM | 4045 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |