Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(268)

Side by Side Diff: runtime/vm/assembler_arm.cc

Issue 848703002: Improve constant pool implementation in the assembler. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: updated test status file Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_ARM) 6 #if defined(TARGET_ARCH_ARM)
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 3488 matching lines...) Expand 10 before | Expand all | Expand 10 after
3499 3499
3500 3500
3501 int32_t Assembler::AddObject(const Object& obj) { 3501 int32_t Assembler::AddObject(const Object& obj) {
3502 ASSERT(obj.IsNotTemporaryScopedHandle()); 3502 ASSERT(obj.IsNotTemporaryScopedHandle());
3503 ASSERT(obj.IsOld()); 3503 ASSERT(obj.IsOld());
3504 if (object_pool_.IsNull()) { 3504 if (object_pool_.IsNull()) {
3505 // The object pool cannot be used in the vm isolate. 3505 // The object pool cannot be used in the vm isolate.
3506 ASSERT(Isolate::Current() != Dart::vm_isolate()); 3506 ASSERT(Isolate::Current() != Dart::vm_isolate());
3507 object_pool_ = GrowableObjectArray::New(Heap::kOld); 3507 object_pool_ = GrowableObjectArray::New(Heap::kOld);
3508 } 3508 }
3509 for (intptr_t i = 0; i < object_pool_.Length(); i++) { 3509
3510 if (object_pool_.At(i) == obj.raw()) { 3510 intptr_t index = object_pool_index_table_.Lookup(&obj);
3511 return i; 3511 if (index != ObjIndexPair::NoValue()) {
3512 } 3512 return index;
3513 } 3513 }
3514
3514 object_pool_.Add(obj, Heap::kOld); 3515 object_pool_.Add(obj, Heap::kOld);
3516 object_pool_index_table_.Insert(
3517 ObjIndexPair(&obj, object_pool_.Length() - 1));
3515 return object_pool_.Length() - 1; 3518 return object_pool_.Length() - 1;
3516 } 3519 }
3517 3520
3518 3521
3519 int32_t Assembler::AddExternalLabel(const ExternalLabel* label) { 3522 int32_t Assembler::AddExternalLabel(const ExternalLabel* label) {
3520 if (object_pool_.IsNull()) { 3523 if (object_pool_.IsNull()) {
3521 // The object pool cannot be used in the vm isolate. 3524 // The object pool cannot be used in the vm isolate.
3522 ASSERT(Isolate::Current() != Dart::vm_isolate()); 3525 ASSERT(Isolate::Current() != Dart::vm_isolate());
3523 object_pool_ = GrowableObjectArray::New(Heap::kOld); 3526 object_pool_ = GrowableObjectArray::New(Heap::kOld);
3524 } 3527 }
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
3621 3624
3622 3625
3623 const char* Assembler::FpuRegisterName(FpuRegister reg) { 3626 const char* Assembler::FpuRegisterName(FpuRegister reg) {
3624 ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters)); 3627 ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters));
3625 return fpu_reg_names[reg]; 3628 return fpu_reg_names[reg];
3626 } 3629 }
3627 3630
3628 } // namespace dart 3631 } // namespace dart
3629 3632
3630 #endif // defined TARGET_ARCH_ARM 3633 #endif // defined TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698