OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/globals.h" // NOLINT | 5 #include "vm/globals.h" // NOLINT |
6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
7 | 7 |
8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
9 #include "vm/cpu.h" | 9 #include "vm/cpu.h" |
10 #include "vm/longjump.h" | 10 #include "vm/longjump.h" |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 // If the raw smi does not fit into a 32-bit signed int, then we'll keep | 377 // If the raw smi does not fit into a 32-bit signed int, then we'll keep |
378 // the raw value in the object pool. | 378 // the raw value in the object pool. |
379 return !Utils::IsInt(32, reinterpret_cast<int64_t>(object.raw())); | 379 return !Utils::IsInt(32, reinterpret_cast<int64_t>(object.raw())); |
380 } | 380 } |
381 ASSERT(object.IsNotTemporaryScopedHandle()); | 381 ASSERT(object.IsNotTemporaryScopedHandle()); |
382 ASSERT(object.IsOld()); | 382 ASSERT(object.IsOld()); |
383 return true; | 383 return true; |
384 } | 384 } |
385 | 385 |
386 | 386 |
387 void Assembler::LoadExternalLabel(Register dst, const ExternalLabel* label) { | |
388 if (constant_pool_allowed()) { | |
389 const int32_t offset = ObjectPool::element_offset( | |
390 object_pool_wrapper_.FindExternalLabel(label, kNotPatchable)); | |
391 LoadWordFromPoolOffset(dst, offset); | |
392 } else { | |
393 const int64_t target = static_cast<int64_t>(label->address()); | |
394 LoadImmediate(dst, target); | |
395 } | |
396 } | |
397 | |
398 | |
399 void Assembler::LoadNativeEntry(Register dst, | 387 void Assembler::LoadNativeEntry(Register dst, |
400 const ExternalLabel* label) { | 388 const ExternalLabel* label) { |
401 const int32_t offset = ObjectPool::element_offset( | 389 const int32_t offset = ObjectPool::element_offset( |
402 object_pool_wrapper_.FindNativeEntry(label, kNotPatchable)); | 390 object_pool_wrapper_.FindNativeEntry(label, kNotPatchable)); |
403 LoadWordFromPoolOffset(dst, offset); | 391 LoadWordFromPoolOffset(dst, offset); |
404 } | 392 } |
405 | 393 |
406 | 394 |
407 void Assembler::LoadExternalLabelFixed(Register dst, | |
408 const ExternalLabel* label, | |
409 Patchability patchable) { | |
410 const int32_t offset = ObjectPool::element_offset( | |
411 object_pool_wrapper_.FindExternalLabel(label, patchable)); | |
412 LoadWordFromPoolOffsetFixed(dst, offset); | |
413 } | |
414 | |
415 | |
416 void Assembler::LoadIsolate(Register dst) { | 395 void Assembler::LoadIsolate(Register dst) { |
417 ldr(dst, Address(THR, Thread::isolate_offset())); | 396 ldr(dst, Address(THR, Thread::isolate_offset())); |
418 } | 397 } |
419 | 398 |
420 | 399 |
421 void Assembler::LoadObjectHelper(Register dst, | 400 void Assembler::LoadObjectHelper(Register dst, |
422 const Object& object, | 401 const Object& object, |
423 bool is_unique) { | 402 bool is_unique) { |
424 if (Thread::CanLoadFromThread(object)) { | 403 if (Thread::CanLoadFromThread(object)) { |
425 ldr(dst, Address(THR, Thread::OffsetFromThread(object))); | 404 ldr(dst, Address(THR, Thread::OffsetFromThread(object))); |
(...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1481 add(base, array, Operand(index, LSL, shift)); | 1460 add(base, array, Operand(index, LSL, shift)); |
1482 } | 1461 } |
1483 const OperandSize size = Address::OperandSizeFor(cid); | 1462 const OperandSize size = Address::OperandSizeFor(cid); |
1484 ASSERT(Address::CanHoldOffset(offset, Address::Offset, size)); | 1463 ASSERT(Address::CanHoldOffset(offset, Address::Offset, size)); |
1485 return Address(base, offset, Address::Offset, size); | 1464 return Address(base, offset, Address::Offset, size); |
1486 } | 1465 } |
1487 | 1466 |
1488 } // namespace dart | 1467 } // namespace dart |
1489 | 1468 |
1490 #endif // defined TARGET_ARCH_ARM64 | 1469 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |