| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/longjump.h" | 9 #include "vm/longjump.h" |
| 10 #include "vm/runtime_entry.h" | 10 #include "vm/runtime_entry.h" |
| (...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 | 479 |
| 480 | 480 |
| 481 int32_t Assembler::AddObject(const Object& obj) { | 481 int32_t Assembler::AddObject(const Object& obj) { |
| 482 ASSERT(obj.IsNotTemporaryScopedHandle()); | 482 ASSERT(obj.IsNotTemporaryScopedHandle()); |
| 483 ASSERT(obj.IsOld()); | 483 ASSERT(obj.IsOld()); |
| 484 if (object_pool_.IsNull()) { | 484 if (object_pool_.IsNull()) { |
| 485 // The object pool cannot be used in the vm isolate. | 485 // The object pool cannot be used in the vm isolate. |
| 486 ASSERT(Isolate::Current() != Dart::vm_isolate()); | 486 ASSERT(Isolate::Current() != Dart::vm_isolate()); |
| 487 object_pool_ = GrowableObjectArray::New(Heap::kOld); | 487 object_pool_ = GrowableObjectArray::New(Heap::kOld); |
| 488 } | 488 } |
| 489 for (intptr_t i = 0; i < object_pool_.Length(); i++) { | 489 |
| 490 if (object_pool_.At(i) == obj.raw()) { | 490 intptr_t index = object_pool_index_table_.Lookup(&obj); |
| 491 return i; | 491 if (index != ObjIndexPair::kNoIndex) { |
| 492 } | 492 return index; |
| 493 } | 493 } |
| 494 |
| 494 object_pool_.Add(obj, Heap::kOld); | 495 object_pool_.Add(obj, Heap::kOld); |
| 496 object_pool_index_table_.Insert( |
| 497 ObjIndexPair(&obj, object_pool_.Length() - 1)); |
| 495 return object_pool_.Length() - 1; | 498 return object_pool_.Length() - 1; |
| 496 } | 499 } |
| 497 | 500 |
| 498 | 501 |
| 499 void Assembler::PushObject(const Object& object) { | 502 void Assembler::PushObject(const Object& object) { |
| 500 ASSERT(!in_delay_slot_); | 503 ASSERT(!in_delay_slot_); |
| 501 LoadObject(TMP, object); | 504 LoadObject(TMP, object); |
| 502 Push(TMP); | 505 Push(TMP); |
| 503 } | 506 } |
| 504 | 507 |
| (...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1259 Emit(reinterpret_cast<int32_t>(message)); | 1262 Emit(reinterpret_cast<int32_t>(message)); |
| 1260 Bind(&msg); | 1263 Bind(&msg); |
| 1261 break_(Instr::kSimulatorMessageCode); | 1264 break_(Instr::kSimulatorMessageCode); |
| 1262 } | 1265 } |
| 1263 #endif | 1266 #endif |
| 1264 } | 1267 } |
| 1265 | 1268 |
| 1266 } // namespace dart | 1269 } // namespace dart |
| 1267 | 1270 |
| 1268 #endif // defined TARGET_ARCH_MIPS | 1271 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |