| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/assembler.h" | 5 #include "vm/assembler.h" |
| 6 | 6 |
| 7 #include "platform/utils.h" | 7 #include "platform/utils.h" |
| 8 #include "vm/cpu.h" | 8 #include "vm/cpu.h" |
| 9 #include "vm/heap.h" | 9 #include "vm/heap.h" |
| 10 #include "vm/memory_region.h" | 10 #include "vm/memory_region.h" |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 for (intptr_t i = 0; i < comments_.length(); i++) { | 236 for (intptr_t i = 0; i < comments_.length(); i++) { |
| 237 comments.SetPCOffsetAt(i, comments_[i]->pc_offset()); | 237 comments.SetPCOffsetAt(i, comments_[i]->pc_offset()); |
| 238 comments.SetCommentAt(i, comments_[i]->comment()); | 238 comments.SetCommentAt(i, comments_[i]->comment()); |
| 239 } | 239 } |
| 240 | 240 |
| 241 return comments; | 241 return comments; |
| 242 } | 242 } |
| 243 | 243 |
| 244 | 244 |
| 245 intptr_t ObjectPool::AddObject(const Object& obj, Patchability patchable) { | 245 intptr_t ObjectPool::AddObject(const Object& obj, Patchability patchable) { |
| 246 // The object pool cannot be used in the vm isolate. |
| 246 ASSERT(Isolate::Current() != Dart::vm_isolate()); | 247 ASSERT(Isolate::Current() != Dart::vm_isolate()); |
| 247 if (object_pool_.IsNull()) { | 248 if (object_pool_.IsNull()) { |
| 248 // The object pool cannot be used in the vm isolate. | |
| 249 object_pool_ = GrowableObjectArray::New(Heap::kOld); | 249 object_pool_ = GrowableObjectArray::New(Heap::kOld); |
| 250 } | 250 } |
| 251 object_pool_.Add(obj, Heap::kOld); | 251 object_pool_.Add(obj, Heap::kOld); |
| 252 patchable_pool_entries_.Add(patchable); | 252 patchable_pool_entries_.Add(patchable); |
| 253 if (patchable == kNotPatchable) { | 253 if (patchable == kNotPatchable) { |
| 254 // The object isn't patchable. Record the index for fast lookup. | 254 // The object isn't patchable. Record the index for fast lookup. |
| 255 object_pool_index_table_.Insert( | 255 object_pool_index_table_.Insert( |
| 256 ObjIndexPair(&obj, object_pool_.Length() - 1)); | 256 ObjIndexPair(&obj, object_pool_.Length() - 1)); |
| 257 } | 257 } |
| 258 return object_pool_.Length() - 1; | 258 return object_pool_.Length() - 1; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 ASSERT(Isolate::Current() != Dart::vm_isolate()); | 294 ASSERT(Isolate::Current() != Dart::vm_isolate()); |
| 295 const uword address = label->address(); | 295 const uword address = label->address(); |
| 296 ASSERT(Utils::IsAligned(address, 4)); | 296 ASSERT(Utils::IsAligned(address, 4)); |
| 297 // The address is stored in the object array as a RawSmi. | 297 // The address is stored in the object array as a RawSmi. |
| 298 const Smi& smi = Smi::Handle(reinterpret_cast<RawSmi*>(address)); | 298 const Smi& smi = Smi::Handle(reinterpret_cast<RawSmi*>(address)); |
| 299 return FindObject(smi, patchable); | 299 return FindObject(smi, patchable); |
| 300 } | 300 } |
| 301 | 301 |
| 302 | 302 |
| 303 } // namespace dart | 303 } // namespace dart |
| OLD | NEW |