| Index: runtime/vm/assembler_arm64.cc
|
| diff --git a/runtime/vm/assembler_arm64.cc b/runtime/vm/assembler_arm64.cc
|
| index d82088b57292b135748780e29852aac9fffdcc13..37024d2d0dc5607cdbb105e03bea0953811182f3 100644
|
| --- a/runtime/vm/assembler_arm64.cc
|
| +++ b/runtime/vm/assembler_arm64.cc
|
| @@ -31,28 +31,6 @@ Assembler::Assembler(bool use_far_branches)
|
| use_far_branches_(use_far_branches),
|
| comments_(),
|
| allow_constant_pool_(true) {
|
| - if (Isolate::Current() != Dart::vm_isolate()) {
|
| - // These objects and labels need to be accessible through every pool-pointer
|
| - // at the same index.
|
| - intptr_t index =
|
| - object_pool_wrapper_.AddObject(Object::null_object());
|
| - ASSERT(index == 0);
|
| -
|
| - index = object_pool_wrapper_.AddObject(Bool::True());
|
| - ASSERT(index == 1);
|
| -
|
| - index = object_pool_wrapper_.AddObject(Bool::False());
|
| - ASSERT(index == 2);
|
| -
|
| - const Smi& vacant = Smi::Handle(Smi::New(0xfa >> kSmiTagShift));
|
| - StubCode* stub_code = Isolate::Current()->stub_code();
|
| - if (stub_code->UpdateStoreBuffer_entry() != NULL) {
|
| - object_pool_wrapper_.AddExternalLabel(
|
| - &stub_code->UpdateStoreBufferLabel(), kNotPatchable);
|
| - } else {
|
| - object_pool_wrapper_.AddObject(vacant);
|
| - }
|
| - }
|
| }
|
|
|
|
|
| @@ -387,18 +365,10 @@ intptr_t Assembler::FindImmediate(int64_t imm) {
|
| }
|
|
|
|
|
| -// A set of VM objects that are present in every constant pool.
|
| -static bool IsAlwaysInConstantPool(const Object& object) {
|
| - // TODO(zra): Evaluate putting all VM heap objects into the pool.
|
| - return (object.raw() == Object::null())
|
| - || (object.raw() == Bool::True().raw())
|
| - || (object.raw() == Bool::False().raw());
|
| -}
|
| -
|
| -
|
| -bool Assembler::CanLoadObjectFromPool(const Object& object) {
|
| +bool Assembler::CanLoadFromObjectPool(const Object& object) const {
|
| + ASSERT(!Thread::CanLoadFromThread(object));
|
| if (!allow_constant_pool()) {
|
| - return IsAlwaysInConstantPool(object);
|
| + return false;
|
| }
|
|
|
| // TODO(zra, kmillikin): Also load other large immediates from the object
|
| @@ -458,7 +428,9 @@ void Assembler::LoadIsolate(Register dst, Register pp) {
|
|
|
|
|
| void Assembler::LoadObject(Register dst, const Object& object, Register pp) {
|
| - if (CanLoadObjectFromPool(object)) {
|
| + if (Thread::CanLoadFromThread(object)) {
|
| + ldr(dst, Address(THR, Thread::OffsetFromThread(object)));
|
| + } else if (CanLoadFromObjectPool(object)) {
|
| const int32_t offset =
|
| ObjectPool::element_offset(object_pool_wrapper_.FindObject(object));
|
| LoadWordFromPoolOffset(dst, pp, offset);
|
| @@ -472,7 +444,10 @@ void Assembler::LoadObject(Register dst, const Object& object, Register pp) {
|
|
|
|
|
| void Assembler::CompareObject(Register reg, const Object& object, Register pp) {
|
| - if (CanLoadObjectFromPool(object)) {
|
| + if (Thread::CanLoadFromThread(object)) {
|
| + ldr(TMP, Address(THR, Thread::OffsetFromThread(object)));
|
| + CompareRegisters(reg, TMP);
|
| + } else if (CanLoadFromObjectPool(object)) {
|
| LoadObject(TMP, object, pp);
|
| CompareRegisters(reg, TMP);
|
| } else {
|
| @@ -915,8 +890,8 @@ void Assembler::StoreIntoObject(Register object,
|
| if (object != R0) {
|
| mov(R0, object);
|
| }
|
| - StubCode* stub_code = Isolate::Current()->stub_code();
|
| - BranchLink(&stub_code->UpdateStoreBufferLabel(), PP);
|
| + ldr(TMP, Address(THR, Thread::update_store_buffer_entry_point_offset()));
|
| + blr(TMP);
|
| Pop(LR);
|
| if (value != R0) {
|
| // Restore R0.
|
|
|