| 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/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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 obj->ptr()->num_variables_ = num_variables; | 460 obj->ptr()->num_variables_ = num_variables; |
| 461 return obj; | 461 return obj; |
| 462 } | 462 } |
| 463 | 463 |
| 464 | 464 |
| 465 RawClass* SnapshotReader::NewClass(intptr_t class_id) { | 465 RawClass* SnapshotReader::NewClass(intptr_t class_id) { |
| 466 ASSERT(kind_ == Snapshot::kFull); | 466 ASSERT(kind_ == Snapshot::kFull); |
| 467 ASSERT(isolate()->no_gc_scope_depth() != 0); | 467 ASSERT(isolate()->no_gc_scope_depth() != 0); |
| 468 if (class_id < kNumPredefinedCids) { | 468 if (class_id < kNumPredefinedCids) { |
| 469 ASSERT((class_id >= kInstanceCid) && | 469 ASSERT((class_id >= kInstanceCid) && |
| 470 (class_id <= kExternalTypedDataFloat32x4ArrayCid)); | 470 (class_id <= kExternalTypedDataFloat64ArrayCid)); |
| 471 return isolate()->class_table()->At(class_id); | 471 return isolate()->class_table()->At(class_id); |
| 472 } | 472 } |
| 473 cls_ = Object::class_class(); | 473 cls_ = Object::class_class(); |
| 474 RawClass* obj = reinterpret_cast<RawClass*>( | 474 RawClass* obj = reinterpret_cast<RawClass*>( |
| 475 AllocateUninitialized(cls_, Class::InstanceSize())); | 475 AllocateUninitialized(cls_, Class::InstanceSize())); |
| 476 Instance fake; | 476 Instance fake; |
| 477 obj->ptr()->handle_vtable_ = fake.vtable(); | 477 obj->ptr()->handle_vtable_ = fake.vtable(); |
| 478 cls_ = obj; | 478 cls_ = obj; |
| 479 cls_.set_id(kIllegalCid); | 479 cls_.set_id(kIllegalCid); |
| 480 isolate()->class_table()->Register(cls_); | 480 isolate()->class_table()->Register(cls_); |
| (...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1466 UnmarkAll(); | 1466 UnmarkAll(); |
| 1467 isolate->set_long_jump_base(base); | 1467 isolate->set_long_jump_base(base); |
| 1468 } else { | 1468 } else { |
| 1469 isolate->set_long_jump_base(base); | 1469 isolate->set_long_jump_base(base); |
| 1470 ThrowException(exception_type(), exception_msg()); | 1470 ThrowException(exception_type(), exception_msg()); |
| 1471 } | 1471 } |
| 1472 } | 1472 } |
| 1473 | 1473 |
| 1474 | 1474 |
| 1475 } // namespace dart | 1475 } // namespace dart |
| OLD | NEW |