| 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 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 752 if (object_id == kNullObject) { | 752 if (object_id == kNullObject) { |
| 753 // This is a singleton null object, return it. | 753 // This is a singleton null object, return it. |
| 754 return Object::null(); | 754 return Object::null(); |
| 755 } | 755 } |
| 756 if (object_id == kSentinelObject) { | 756 if (object_id == kSentinelObject) { |
| 757 return Object::sentinel().raw(); | 757 return Object::sentinel().raw(); |
| 758 } | 758 } |
| 759 if (object_id == kEmptyArrayObject) { | 759 if (object_id == kEmptyArrayObject) { |
| 760 return Object::empty_array().raw(); | 760 return Object::empty_array().raw(); |
| 761 } | 761 } |
| 762 if (object_id == kZeroArrayObject) { |
| 763 return Object::zero_array().raw(); |
| 764 } |
| 762 if (object_id == kDynamicType) { | 765 if (object_id == kDynamicType) { |
| 763 return Object::dynamic_type(); | 766 return Object::dynamic_type(); |
| 764 } | 767 } |
| 765 if (object_id == kVoidType) { | 768 if (object_id == kVoidType) { |
| 766 return Object::void_type(); | 769 return Object::void_type(); |
| 767 } | 770 } |
| 768 if (object_id == kTrueValue) { | 771 if (object_id == kTrueValue) { |
| 769 return Bool::True().raw(); | 772 return Bool::True().raw(); |
| 770 } | 773 } |
| 771 if (object_id == kFalseValue) { | 774 if (object_id == kFalseValue) { |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 951 WriteVMIsolateObject(kSentinelObject); | 954 WriteVMIsolateObject(kSentinelObject); |
| 952 return; | 955 return; |
| 953 } | 956 } |
| 954 | 957 |
| 955 // Check if it is a singleton empty array object. | 958 // Check if it is a singleton empty array object. |
| 956 if (rawobj == Object::empty_array().raw()) { | 959 if (rawobj == Object::empty_array().raw()) { |
| 957 WriteVMIsolateObject(kEmptyArrayObject); | 960 WriteVMIsolateObject(kEmptyArrayObject); |
| 958 return; | 961 return; |
| 959 } | 962 } |
| 960 | 963 |
| 964 // Check if it is a singleton zero array object. |
| 965 if (rawobj == Object::zero_array().raw()) { |
| 966 WriteVMIsolateObject(kZeroArrayObject); |
| 967 return; |
| 968 } |
| 969 |
| 961 // Check if it is a singleton dyanmic Type object. | 970 // Check if it is a singleton dyanmic Type object. |
| 962 if (rawobj == Object::dynamic_type()) { | 971 if (rawobj == Object::dynamic_type()) { |
| 963 WriteVMIsolateObject(kDynamicType); | 972 WriteVMIsolateObject(kDynamicType); |
| 964 return; | 973 return; |
| 965 } | 974 } |
| 966 | 975 |
| 967 // Check if it is a singleton void Type object. | 976 // Check if it is a singleton void Type object. |
| 968 if (rawobj == Object::void_type()) { | 977 if (rawobj == Object::void_type()) { |
| 969 WriteVMIsolateObject(kVoidType); | 978 WriteVMIsolateObject(kVoidType); |
| 970 return; | 979 return; |
| (...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1540 NoGCScope no_gc; | 1549 NoGCScope no_gc; |
| 1541 WriteObject(obj.raw()); | 1550 WriteObject(obj.raw()); |
| 1542 UnmarkAll(); | 1551 UnmarkAll(); |
| 1543 } else { | 1552 } else { |
| 1544 ThrowException(exception_type(), exception_msg()); | 1553 ThrowException(exception_type(), exception_msg()); |
| 1545 } | 1554 } |
| 1546 } | 1555 } |
| 1547 | 1556 |
| 1548 | 1557 |
| 1549 } // namespace dart | 1558 } // namespace dart |
| OLD | NEW |