Chromium Code Reviews| Index: runtime/vm/assembler_arm64.cc |
| =================================================================== |
| --- runtime/vm/assembler_arm64.cc (revision 42873) |
| +++ runtime/vm/assembler_arm64.cc (working copy) |
| @@ -40,16 +40,15 @@ |
| // at the same index. |
| object_pool_.Add(Object::null_object(), Heap::kOld); |
| patchable_pool_entries_.Add(kNotPatchable); |
| - // Not adding Object::null() to the index table. It is at index 0 in the |
| - // object pool, but the HashMap uses 0 to indicate not found. |
| + object_pool_index_table_.Insert(ObjIndexPair(&Object::null_object(), 0)); |
|
Ivan Posva
2015/01/15 23:59:58
We have three data structures in the assembler tha
|
| object_pool_.Add(Bool::True(), Heap::kOld); |
| patchable_pool_entries_.Add(kNotPatchable); |
| - object_pool_index_table_.Insert(ObjIndexPair(Bool::True().raw(), 1)); |
| + object_pool_index_table_.Insert(ObjIndexPair(&Bool::True(), 1)); |
| object_pool_.Add(Bool::False(), Heap::kOld); |
| patchable_pool_entries_.Add(kNotPatchable); |
| - object_pool_index_table_.Insert(ObjIndexPair(Bool::False().raw(), 2)); |
| + object_pool_index_table_.Insert(ObjIndexPair(&Bool::False(), 2)); |
| const Smi& vacant = Smi::Handle(Smi::New(0xfa >> kSmiTagShift)); |
| StubCode* stub_code = Isolate::Current()->stub_code(); |
| @@ -455,15 +454,8 @@ |
| // If the object is not patchable, check if we've already got it in the |
| // object pool. |
| if (patchable == kNotPatchable) { |
| - // Special case for Object::null(), which is always at object_pool_ index 0 |
| - // because Lookup() below returns 0 when the object is not mapped in the |
| - // table. |
| - if (obj.raw() == Object::null()) { |
| - return 0; |
| - } |
| - |
| - intptr_t idx = object_pool_index_table_.Lookup(obj.raw()); |
| - if (idx != 0) { |
| + intptr_t idx = object_pool_index_table_.Lookup(&obj); |
| + if (idx != ObjIndexPair::kNoIndex) { |
| ASSERT(patchable_pool_entries_[idx] == kNotPatchable); |
| return idx; |
| } |
| @@ -474,7 +466,7 @@ |
| if (patchable == kNotPatchable) { |
| // The object isn't patchable. Record the index for fast lookup. |
| object_pool_index_table_.Insert( |
| - ObjIndexPair(obj.raw(), object_pool_.Length() - 1)); |
| + ObjIndexPair(&obj, object_pool_.Length() - 1)); |
| } |
| return object_pool_.Length() - 1; |
| } |