Chromium Code Reviews| 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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 504 | 504 |
| 505 // TODO(zra, kmillikin): Also load other large immediates from the object | 505 // TODO(zra, kmillikin): Also load other large immediates from the object |
| 506 // pool | 506 // pool |
| 507 if (object.IsSmi()) { | 507 if (object.IsSmi()) { |
| 508 // If the raw smi does not fit into a 32-bit signed int, then we'll keep | 508 // If the raw smi does not fit into a 32-bit signed int, then we'll keep |
| 509 // the raw value in the object pool. | 509 // the raw value in the object pool. |
| 510 return !Utils::IsInt(32, reinterpret_cast<int64_t>(object.raw())); | 510 return !Utils::IsInt(32, reinterpret_cast<int64_t>(object.raw())); |
| 511 } | 511 } |
| 512 ASSERT(object.IsNotTemporaryScopedHandle()); | 512 ASSERT(object.IsNotTemporaryScopedHandle()); |
| 513 ASSERT(object.IsOld()); | 513 ASSERT(object.IsOld()); |
| 514 return (Isolate::Current() != Dart::vm_isolate()) && | 514 return (Isolate::Current() != Dart::vm_isolate()); |
| 515 // Not in the VMHeap, OR is one of the VMHeap objects we put in every | |
| 516 // object pool. | |
| 517 (!object.InVMHeap() || IsAlwaysInConstantPool(object)); | |
| 518 } | 515 } |
| 519 | 516 |
| 520 | 517 |
| 521 bool Assembler::CanLoadImmediateFromPool(int64_t imm, Register pp) { | 518 bool Assembler::CanLoadImmediateFromPool(int64_t imm, Register pp) { |
| 522 if (!allow_constant_pool()) { | 519 if (!allow_constant_pool()) { |
| 523 return false; | 520 return false; |
| 524 } | 521 } |
| 525 return !Utils::IsInt(32, imm) && | 522 return !Utils::IsInt(32, imm) && |
| 526 (pp != kNoPP) && | 523 (pp != kNoPP) && |
| 527 // We *could* put constants in the pool in a VM isolate, but it is | 524 // We *could* put constants in the pool in a VM isolate, but it is |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 562 | 559 |
| 563 | 560 |
| 564 void Assembler::LoadObject(Register dst, const Object& object, Register pp) { | 561 void Assembler::LoadObject(Register dst, const Object& object, Register pp) { |
| 565 if (CanLoadObjectFromPool(object)) { | 562 if (CanLoadObjectFromPool(object)) { |
| 566 const int32_t offset = | 563 const int32_t offset = |
| 567 Array::element_offset(FindObject(object, kNotPatchable)); | 564 Array::element_offset(FindObject(object, kNotPatchable)); |
| 568 LoadWordFromPoolOffset(dst, pp, offset); | 565 LoadWordFromPoolOffset(dst, pp, offset); |
| 569 } else { | 566 } else { |
| 570 ASSERT((Isolate::Current() == Dart::vm_isolate()) || | 567 ASSERT((Isolate::Current() == Dart::vm_isolate()) || |
| 571 object.IsSmi() || | 568 object.IsSmi() || |
| 572 object.InVMHeap()); | 569 object.InVMHeap()); |
|
zra
2015/01/14 17:53:24
Don't need this anymore, I think.
Vyacheslav Egorov (Google)
2015/01/14 17:56:33
It still falls down here if !allow_constant_pool()
| |
| 573 LoadDecodableImmediate(dst, reinterpret_cast<int64_t>(object.raw()), pp); | 570 LoadDecodableImmediate(dst, reinterpret_cast<int64_t>(object.raw()), pp); |
| 574 } | 571 } |
| 575 } | 572 } |
| 576 | 573 |
| 577 | 574 |
| 578 void Assembler::CompareObject(Register reg, const Object& object, Register pp) { | 575 void Assembler::CompareObject(Register reg, const Object& object, Register pp) { |
| 579 if (CanLoadObjectFromPool(object)) { | 576 if (CanLoadObjectFromPool(object)) { |
| 580 LoadObject(TMP, object, pp); | 577 LoadObject(TMP, object, pp); |
| 581 CompareRegisters(reg, TMP); | 578 CompareRegisters(reg, TMP); |
| 582 } else { | 579 } else { |
| (...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1557 add(base, array, Operand(index, LSL, shift)); | 1554 add(base, array, Operand(index, LSL, shift)); |
| 1558 } | 1555 } |
| 1559 const OperandSize size = Address::OperandSizeFor(cid); | 1556 const OperandSize size = Address::OperandSizeFor(cid); |
| 1560 ASSERT(Address::CanHoldOffset(offset, Address::Offset, size)); | 1557 ASSERT(Address::CanHoldOffset(offset, Address::Offset, size)); |
| 1561 return Address(base, offset, Address::Offset, size); | 1558 return Address(base, offset, Address::Offset, size); |
| 1562 } | 1559 } |
| 1563 | 1560 |
| 1564 } // namespace dart | 1561 } // namespace dart |
| 1565 | 1562 |
| 1566 #endif // defined TARGET_ARCH_ARM64 | 1563 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |