Chromium Code Reviews| Index: runtime/vm/assembler_x64.cc |
| diff --git a/runtime/vm/assembler_x64.cc b/runtime/vm/assembler_x64.cc |
| index 913020a676565fb803d8d6713fe26505688ca73b..ecd6a1e915c618d900038047a534b73acf49d479 100644 |
| --- a/runtime/vm/assembler_x64.cc |
| +++ b/runtime/vm/assembler_x64.cc |
| @@ -28,28 +28,6 @@ Assembler::Assembler(bool use_far_branches) |
| allow_constant_pool_(true) { |
| // Far branching mode is only needed and implemented for MIPS and ARM. |
| ASSERT(!use_far_branches); |
| - Isolate* isolate = Isolate::Current(); |
| - if (isolate != 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->stub_code(); |
| - if (stub_code->UpdateStoreBuffer_entry() != NULL) { |
| - object_pool_wrapper_.AddExternalLabel( |
| - &stub_code->UpdateStoreBufferLabel(), kNotPatchable); |
| - } else { |
| - object_pool_wrapper_.AddObject(vacant); |
| - } |
| - } |
| } |
| @@ -2794,18 +2772,10 @@ void Assembler::Drop(intptr_t stack_elements, Register tmp) { |
| } |
| -// 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::CanLoadFromObjectPool(const Object& object) { |
|
srdjan
2015/07/07 16:58:27
const
Florian Schneider
2015/07/08 09:28:09
Done.
|
| + ASSERT(!Thread::CanLoadFromThread(object)); |
| if (!allow_constant_pool()) { |
| - return IsAlwaysInConstantPool(object); |
| + return false; |
| } |
| // TODO(zra, kmillikin): Also load other large immediates from the object |
| @@ -2835,7 +2805,9 @@ void Assembler::LoadIsolate(Register dst) { |
| void Assembler::LoadObject(Register dst, const Object& object, Register pp) { |
| - if (CanLoadFromObjectPool(object)) { |
| + if (Thread::CanLoadFromThread(object)) { |
| + movq(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 - kHeapObjectTag); |
| @@ -2850,7 +2822,10 @@ void Assembler::LoadObject(Register dst, const Object& object, Register pp) { |
| void Assembler::StoreObject(const Address& dst, const Object& object, |
| Register pp) { |
| - if (CanLoadFromObjectPool(object)) { |
| + if (Thread::CanLoadFromThread(object)) { |
| + movq(TMP, Address(THR, Thread::OffsetFromThread(object))); |
| + movq(dst, TMP); |
| + } else if (CanLoadFromObjectPool(object)) { |
| LoadObject(TMP, object, pp); |
| movq(dst, TMP); |
| } else { |
| @@ -2860,7 +2835,9 @@ void Assembler::StoreObject(const Address& dst, const Object& object, |
| void Assembler::PushObject(const Object& object, Register pp) { |
| - if (CanLoadFromObjectPool(object)) { |
| + if (Thread::CanLoadFromThread(object)) { |
| + pushq(Address(THR, Thread::OffsetFromThread(object))); |
| + } else if (CanLoadFromObjectPool(object)) { |
| LoadObject(TMP, object, pp); |
| pushq(TMP); |
| } else { |
| @@ -2870,7 +2847,9 @@ void Assembler::PushObject(const Object& object, Register pp) { |
| void Assembler::CompareObject(Register reg, const Object& object, Register pp) { |
| - if (CanLoadFromObjectPool(object)) { |
| + if (Thread::CanLoadFromThread(object)) { |
| + cmpq(reg, Address(THR, Thread::OffsetFromThread(object))); |
| + } else if (CanLoadFromObjectPool(object)) { |
| const int32_t offset = |
| ObjectPool::element_offset(object_pool_wrapper_.FindObject(object)); |
| cmpq(reg, Address(pp, offset-kHeapObjectTag)); |
| @@ -3074,8 +3053,8 @@ void Assembler::StoreIntoObject(Register object, |
| if (object != RDX) { |
| movq(RDX, object); |
| } |
| - StubCode* stub_code = Isolate::Current()->stub_code(); |
| - Call(&stub_code->UpdateStoreBufferLabel(), PP); |
| + movq(TMP, Address(THR, Thread::update_store_buffer_entry_point_offset())); |
| + call(TMP); |
| if (value != RDX) popq(RDX); |
| Bind(&done); |
| } |