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

Unified Diff: runtime/vm/snapshot.cc

Issue 22902002: Ensure the classes void and dynamic have empty arrays for fields, functions, etc. Move their Types … (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: remove redudant mirror asserts, fix test 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/object_test.cc ('k') | tests/language/dynamic_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/snapshot.cc
diff --git a/runtime/vm/snapshot.cc b/runtime/vm/snapshot.cc
index a6be317c3c7b4a251e402cf2eca11556819bf943..d7e551bd06b57c67c5a098d5baf7cd3e7b4d93b0 100644
--- a/runtime/vm/snapshot.cc
+++ b/runtime/vm/snapshot.cc
@@ -65,8 +65,6 @@ static RawType* GetType(ObjectStore* object_store, int index) {
switch (index) {
case kObjectType: return object_store->object_type();
case kNullType: return object_store->null_type();
- case kDynamicType: return object_store->dynamic_type();
- case kVoidType: return object_store->void_type();
case kFunctionType: return object_store->function_type();
case kNumberType: return object_store->number_type();
case kSmiType: return object_store->smi_type();
@@ -89,10 +87,6 @@ static int GetTypeIndex(ObjectStore* object_store, const RawType* raw_type) {
return kObjectType;
} else if (raw_type == object_store->null_type()) {
return kNullType;
- } else if (raw_type == object_store->dynamic_type()) {
- return kDynamicType;
- } else if (raw_type == object_store->void_type()) {
- return kVoidType;
} else if (raw_type == object_store->function_type()) {
return kFunctionType;
} else if (raw_type == object_store->number_type()) {
@@ -726,6 +720,12 @@ RawObject* SnapshotReader::ReadVMIsolateObject(intptr_t header_value) {
if (object_id == kEmptyArrayObject) {
return Object::empty_array().raw();
}
+ if (object_id == kDynamicType) {
+ return Object::dynamic_type();
+ }
+ if (object_id == kVoidType) {
+ return Object::void_type();
+ }
if (object_id == kTrueValue) {
return Bool::True().raw();
}
@@ -893,6 +893,18 @@ void SnapshotWriter::HandleVMIsolateObject(RawObject* rawobj) {
return;
}
+ // Check if it is a singleton dyanmic Type object.
+ if (rawobj == Object::dynamic_type()) {
+ WriteVMIsolateObject(kDynamicType);
+ return;
+ }
+
+ // Check if it is a singleton void Type object.
+ if (rawobj == Object::void_type()) {
+ WriteVMIsolateObject(kVoidType);
+ return;
+ }
+
// Check if it is a singleton boolean true object.
if (rawobj == Bool::True().raw()) {
WriteVMIsolateObject(kTrueValue);
« no previous file with comments | « runtime/vm/object_test.cc ('k') | tests/language/dynamic_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698