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/bootstrap.h" | 8 #include "vm/bootstrap.h" |
9 #include "vm/class_finalizer.h" | 9 #include "vm/class_finalizer.h" |
10 #include "vm/dart.h" | 10 #include "vm/dart.h" |
(...skipping 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1290 RawObject* SnapshotReader::ReadVMIsolateObject(intptr_t header_value) { | 1290 RawObject* SnapshotReader::ReadVMIsolateObject(intptr_t header_value) { |
1291 intptr_t object_id = GetVMIsolateObjectId(header_value); | 1291 intptr_t object_id = GetVMIsolateObjectId(header_value); |
1292 | 1292 |
1293 // First check if it is one of the singleton objects. | 1293 // First check if it is one of the singleton objects. |
1294 READ_VM_SINGLETON_OBJ(kNullObject, Object::null()); | 1294 READ_VM_SINGLETON_OBJ(kNullObject, Object::null()); |
1295 READ_VM_SINGLETON_OBJ(kSentinelObject, Object::sentinel().raw()); | 1295 READ_VM_SINGLETON_OBJ(kSentinelObject, Object::sentinel().raw()); |
1296 READ_VM_SINGLETON_OBJ(kTransitionSentinelObject, | 1296 READ_VM_SINGLETON_OBJ(kTransitionSentinelObject, |
1297 Object::transition_sentinel().raw()); | 1297 Object::transition_sentinel().raw()); |
1298 READ_VM_SINGLETON_OBJ(kEmptyArrayObject, Object::empty_array().raw()); | 1298 READ_VM_SINGLETON_OBJ(kEmptyArrayObject, Object::empty_array().raw()); |
1299 READ_VM_SINGLETON_OBJ(kZeroArrayObject, Object::zero_array().raw()); | 1299 READ_VM_SINGLETON_OBJ(kZeroArrayObject, Object::zero_array().raw()); |
1300 READ_VM_SINGLETON_OBJ(kDynamicType, Object::dynamic_type()); | 1300 READ_VM_SINGLETON_OBJ(kDynamicType, Object::dynamic_type().raw()); |
1301 READ_VM_SINGLETON_OBJ(kVoidType, Object::void_type()); | 1301 READ_VM_SINGLETON_OBJ(kVoidType, Object::void_type().raw()); |
1302 READ_VM_SINGLETON_OBJ(kTrueValue, Bool::True().raw()); | 1302 READ_VM_SINGLETON_OBJ(kTrueValue, Bool::True().raw()); |
1303 READ_VM_SINGLETON_OBJ(kFalseValue, Bool::False().raw()); | 1303 READ_VM_SINGLETON_OBJ(kFalseValue, Bool::False().raw()); |
1304 READ_VM_SINGLETON_OBJ(kExtractorParameterTypes, | 1304 READ_VM_SINGLETON_OBJ(kExtractorParameterTypes, |
1305 Object::extractor_parameter_types().raw()); | 1305 Object::extractor_parameter_types().raw()); |
1306 READ_VM_SINGLETON_OBJ(kExtractorParameterNames, | 1306 READ_VM_SINGLETON_OBJ(kExtractorParameterNames, |
1307 Object::extractor_parameter_names().raw()); | 1307 Object::extractor_parameter_names().raw()); |
1308 READ_VM_SINGLETON_OBJ(kEmptyContextScopeObject, | 1308 READ_VM_SINGLETON_OBJ(kEmptyContextScopeObject, |
1309 Object::empty_context_scope().raw()); | 1309 Object::empty_context_scope().raw()); |
1310 READ_VM_SINGLETON_OBJ(kEmptyObjectPool, Object::empty_object_pool().raw()); | 1310 READ_VM_SINGLETON_OBJ(kEmptyObjectPool, Object::empty_object_pool().raw()); |
1311 READ_VM_SINGLETON_OBJ(kEmptyDescriptors, Object::empty_descriptors().raw()); | 1311 READ_VM_SINGLETON_OBJ(kEmptyDescriptors, Object::empty_descriptors().raw()); |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1630 } \ | 1630 } \ |
1631 | 1631 |
1632 bool SnapshotWriter::HandleVMIsolateObject(RawObject* rawobj) { | 1632 bool SnapshotWriter::HandleVMIsolateObject(RawObject* rawobj) { |
1633 // Check if it is one of the singleton VM objects. | 1633 // Check if it is one of the singleton VM objects. |
1634 WRITE_VM_SINGLETON_OBJ(Object::null(), kNullObject); | 1634 WRITE_VM_SINGLETON_OBJ(Object::null(), kNullObject); |
1635 WRITE_VM_SINGLETON_OBJ(Object::sentinel().raw(), kSentinelObject); | 1635 WRITE_VM_SINGLETON_OBJ(Object::sentinel().raw(), kSentinelObject); |
1636 WRITE_VM_SINGLETON_OBJ(Object::transition_sentinel().raw(), | 1636 WRITE_VM_SINGLETON_OBJ(Object::transition_sentinel().raw(), |
1637 kTransitionSentinelObject); | 1637 kTransitionSentinelObject); |
1638 WRITE_VM_SINGLETON_OBJ(Object::empty_array().raw(), kEmptyArrayObject); | 1638 WRITE_VM_SINGLETON_OBJ(Object::empty_array().raw(), kEmptyArrayObject); |
1639 WRITE_VM_SINGLETON_OBJ(Object::zero_array().raw(), kZeroArrayObject); | 1639 WRITE_VM_SINGLETON_OBJ(Object::zero_array().raw(), kZeroArrayObject); |
1640 WRITE_VM_SINGLETON_OBJ(Object::dynamic_type(), kDynamicType); | 1640 WRITE_VM_SINGLETON_OBJ(Object::dynamic_type().raw(), kDynamicType); |
1641 WRITE_VM_SINGLETON_OBJ(Object::void_type(), kVoidType); | 1641 WRITE_VM_SINGLETON_OBJ(Object::void_type().raw(), kVoidType); |
1642 WRITE_VM_SINGLETON_OBJ(Bool::True().raw(), kTrueValue); | 1642 WRITE_VM_SINGLETON_OBJ(Bool::True().raw(), kTrueValue); |
1643 WRITE_VM_SINGLETON_OBJ(Bool::False().raw(), kFalseValue); | 1643 WRITE_VM_SINGLETON_OBJ(Bool::False().raw(), kFalseValue); |
1644 WRITE_VM_SINGLETON_OBJ(Object::extractor_parameter_types().raw(), | 1644 WRITE_VM_SINGLETON_OBJ(Object::extractor_parameter_types().raw(), |
1645 kExtractorParameterTypes); | 1645 kExtractorParameterTypes); |
1646 WRITE_VM_SINGLETON_OBJ(Object::extractor_parameter_names().raw(), | 1646 WRITE_VM_SINGLETON_OBJ(Object::extractor_parameter_names().raw(), |
1647 kExtractorParameterNames); | 1647 kExtractorParameterNames); |
1648 WRITE_VM_SINGLETON_OBJ(Object::empty_context_scope().raw(), | 1648 WRITE_VM_SINGLETON_OBJ(Object::empty_context_scope().raw(), |
1649 kEmptyContextScopeObject); | 1649 kEmptyContextScopeObject); |
1650 WRITE_VM_SINGLETON_OBJ(Object::empty_object_pool().raw(), kEmptyObjectPool); | 1650 WRITE_VM_SINGLETON_OBJ(Object::empty_object_pool().raw(), kEmptyObjectPool); |
1651 WRITE_VM_SINGLETON_OBJ(Object::empty_descriptors().raw(), kEmptyDescriptors); | 1651 WRITE_VM_SINGLETON_OBJ(Object::empty_descriptors().raw(), kEmptyDescriptors); |
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2555 if (setjmp(*jump.Set()) == 0) { | 2555 if (setjmp(*jump.Set()) == 0) { |
2556 NoSafepointScope no_safepoint; | 2556 NoSafepointScope no_safepoint; |
2557 WriteObject(obj.raw()); | 2557 WriteObject(obj.raw()); |
2558 } else { | 2558 } else { |
2559 ThrowException(exception_type(), exception_msg()); | 2559 ThrowException(exception_type(), exception_msg()); |
2560 } | 2560 } |
2561 } | 2561 } |
2562 | 2562 |
2563 | 2563 |
2564 } // namespace dart | 2564 } // namespace dart |
OLD | NEW |