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

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

Issue 22638011: Move Null class out of the VM isolate. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
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/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 obj->ptr()->num_variables_ = num_variables; 463 obj->ptr()->num_variables_ = num_variables;
464 return obj; 464 return obj;
465 } 465 }
466 466
467 467
468 RawClass* SnapshotReader::NewClass(intptr_t class_id) { 468 RawClass* SnapshotReader::NewClass(intptr_t class_id) {
469 ASSERT(kind_ == Snapshot::kFull); 469 ASSERT(kind_ == Snapshot::kFull);
470 ASSERT(isolate()->no_gc_scope_depth() != 0); 470 ASSERT(isolate()->no_gc_scope_depth() != 0);
471 if (class_id < kNumPredefinedCids) { 471 if (class_id < kNumPredefinedCids) {
472 ASSERT((class_id >= kInstanceCid) && 472 ASSERT((class_id >= kInstanceCid) &&
473 (class_id <= kExternalTypedDataFloat32x4ArrayCid)); 473 (class_id <= kNullCid));
474 return isolate()->class_table()->At(class_id); 474 return isolate()->class_table()->At(class_id);
475 } 475 }
476 cls_ = Object::class_class(); 476 cls_ = Object::class_class();
477 RawClass* obj = reinterpret_cast<RawClass*>( 477 RawClass* obj = reinterpret_cast<RawClass*>(
478 AllocateUninitialized(cls_, Class::InstanceSize())); 478 AllocateUninitialized(cls_, Class::InstanceSize()));
479 Instance fake; 479 Instance fake;
480 obj->ptr()->handle_vtable_ = fake.vtable(); 480 obj->ptr()->handle_vtable_ = fake.vtable();
481 cls_ = obj; 481 cls_ = obj;
482 cls_.set_id(kIllegalCid); 482 cls_.set_id(kIllegalCid);
483 isolate()->RegisterClass(cls_); 483 isolate()->RegisterClass(cls_);
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after
1473 UnmarkAll(); 1473 UnmarkAll();
1474 isolate->set_long_jump_base(base); 1474 isolate->set_long_jump_base(base);
1475 } else { 1475 } else {
1476 isolate->set_long_jump_base(base); 1476 isolate->set_long_jump_base(base);
1477 ThrowException(exception_type(), exception_msg()); 1477 ThrowException(exception_type(), exception_msg());
1478 } 1478 }
1479 } 1479 }
1480 1480
1481 1481
1482 } // namespace dart 1482 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698