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

Side by Side Diff: vm/snapshot.cc

Issue 10861023: Currently we use a generated number as the class id for object class, this change tries to pin it t… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 4 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
« vm/raw_object_snapshot.cc ('K') | « vm/raw_object_snapshot.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/snapshot.h" 5 #include "vm/snapshot.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/bigint_operations.h" 8 #include "vm/bigint_operations.h"
9 #include "vm/bootstrap.h" 9 #include "vm/bootstrap.h"
10 #include "vm/exceptions.h" 10 #include "vm/exceptions.h"
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 AllocateUninitialized(cls_, Context::InstanceSize(num_variables))); 407 AllocateUninitialized(cls_, Context::InstanceSize(num_variables)));
408 obj->ptr()->num_variables_ = num_variables; 408 obj->ptr()->num_variables_ = num_variables;
409 return obj; 409 return obj;
410 } 410 }
411 411
412 412
413 RawClass* SnapshotReader::NewClass(intptr_t class_id, bool is_signature_class) { 413 RawClass* SnapshotReader::NewClass(intptr_t class_id, bool is_signature_class) {
414 ASSERT(kind_ == Snapshot::kFull); 414 ASSERT(kind_ == Snapshot::kFull);
415 ASSERT(isolate()->no_gc_scope_depth() != 0); 415 ASSERT(isolate()->no_gc_scope_depth() != 0);
416 if (class_id < kNumPredefinedCids) { 416 if (class_id < kNumPredefinedCids) {
417 return Class::GetClass(class_id, is_signature_class); 417 ASSERT(class_id >= kInstanceCid && class_id <= kWeakPropertyCid);
srdjan 2012/08/21 00:57:39 Add parenthesis
siva 2012/08/21 01:23:29 Done.
418 return isolate()->class_table()->At(class_id);
418 } 419 }
419 cls_ = Object::class_class(); 420 cls_ = Object::class_class();
420 RawClass* obj = reinterpret_cast<RawClass*>( 421 RawClass* obj = reinterpret_cast<RawClass*>(
421 AllocateUninitialized(cls_, Class::InstanceSize())); 422 AllocateUninitialized(cls_, Class::InstanceSize()));
422 if (is_signature_class) { 423 if (is_signature_class) {
423 Closure fake; 424 Closure fake;
424 obj->ptr()->handle_vtable_ = fake.vtable(); 425 obj->ptr()->handle_vtable_ = fake.vtable();
425 } else { 426 } else {
426 Instance fake; 427 Instance fake;
427 obj->ptr()->handle_vtable_ = fake.vtable(); 428 obj->ptr()->handle_vtable_ = fake.vtable();
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after
1120 RawObject* raw_obj = *current; 1121 RawObject* raw_obj = *current;
1121 if (as_references_) { 1122 if (as_references_) {
1122 writer_->WriteObjectRef(raw_obj); 1123 writer_->WriteObjectRef(raw_obj);
1123 } else { 1124 } else {
1124 writer_->WriteObjectImpl(raw_obj); 1125 writer_->WriteObjectImpl(raw_obj);
1125 } 1126 }
1126 } 1127 }
1127 } 1128 }
1128 1129
1129 } // namespace dart 1130 } // namespace dart
OLDNEW
« vm/raw_object_snapshot.cc ('K') | « vm/raw_object_snapshot.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698