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

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

Issue 1316673005: Track which entries in the ObjectPool are native entries, and reset them when loading a precompiled… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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
OLDNEW
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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 299
300 300
301 intptr_t ObjectPoolWrapper::FindExternalLabel(const ExternalLabel* label, 301 intptr_t ObjectPoolWrapper::FindExternalLabel(const ExternalLabel* label,
302 Patchability patchable) { 302 Patchability patchable) {
303 return FindObject(ObjectPool::Entry(label->address(), 303 return FindObject(ObjectPool::Entry(label->address(),
304 ObjectPool::kExternalLabel), 304 ObjectPool::kExternalLabel),
305 patchable); 305 patchable);
306 } 306 }
307 307
308 308
309 intptr_t ObjectPoolWrapper::FindNativeEntry(const ExternalLabel* label,
310 Patchability patchable) {
311 return FindObject(ObjectPool::Entry(label->address(),
312 ObjectPool::kNativeEntry),
313 patchable);
314 }
315
316
309 RawObjectPool* ObjectPoolWrapper::MakeObjectPool() { 317 RawObjectPool* ObjectPoolWrapper::MakeObjectPool() {
310 intptr_t len = object_pool_.length(); 318 intptr_t len = object_pool_.length();
311 if (len == 0) { 319 if (len == 0) {
312 return Object::empty_object_pool().raw(); 320 return Object::empty_object_pool().raw();
313 } 321 }
314 const ObjectPool& result = ObjectPool::Handle(ObjectPool::New(len)); 322 const ObjectPool& result = ObjectPool::Handle(ObjectPool::New(len));
315 const TypedData& info_array = TypedData::Handle(result.info_array()); 323 const TypedData& info_array = TypedData::Handle(result.info_array());
316 for (intptr_t i = 0; i < len; ++i) { 324 for (intptr_t i = 0; i < len; ++i) {
317 ObjectPool::EntryType info = object_pool_[i].type_; 325 ObjectPool::EntryType info = object_pool_[i].type_;
318 info_array.SetInt8(i, static_cast<int8_t>(info)); 326 info_array.SetInt8(i, static_cast<int8_t>(info));
319 if (info == ObjectPool::kTaggedObject) { 327 if (info == ObjectPool::kTaggedObject) {
320 result.SetObjectAt(i, *object_pool_[i].obj_); 328 result.SetObjectAt(i, *object_pool_[i].obj_);
321 } else { 329 } else {
322 result.SetRawValueAt(i, object_pool_[i].raw_value_); 330 result.SetRawValueAt(i, object_pool_[i].raw_value_);
323 } 331 }
324 } 332 }
325 return result.raw(); 333 return result.raw();
326 } 334 }
327 335
328 336
329 } // namespace dart 337 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/assembler.h ('k') | runtime/vm/assembler_arm.h » ('j') | runtime/vm/simulator_arm.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698