Index: vm/snapshot.cc |
=================================================================== |
--- vm/snapshot.cc (revision 16591) |
+++ vm/snapshot.cc (working copy) |
@@ -661,6 +661,12 @@ |
if (object_id == kEmptyArrayObject) { |
return Object::empty_array().raw(); |
} |
+ if (object_id == kTrueValue) { |
+ return Bool::True().raw(); |
+ } |
+ if (object_id == kFalseValue) { |
+ return Bool::False().raw(); |
+ } |
intptr_t class_id = ClassIdFromObjectId(object_id); |
if (IsSingletonClassId(class_id)) { |
return isolate()->class_table()->At(class_id); // get singleton class. |
@@ -674,12 +680,6 @@ |
RawObject* SnapshotReader::ReadIndexedObject(intptr_t object_id) { |
- if (object_id == kTrueValue) { |
- return object_store()->true_value(); |
- } |
- if (object_id == kFalseValue) { |
- return object_store()->false_value(); |
- } |
intptr_t class_id = ClassIdFromObjectId(object_id); |
if (IsObjectStoreClassId(class_id)) { |
return isolate()->class_table()->At(class_id); // get singleton class. |
@@ -812,6 +812,18 @@ |
return; |
} |
+ // Check if it is a singleton boolean true object. |
+ if (rawobj == Bool::True().raw()) { |
+ WriteVMIsolateObject(kTrueValue); |
+ return; |
+ } |
+ |
+ // Check if it is a singleton boolean false object. |
+ if (rawobj == Bool::False().raw()) { |
+ WriteVMIsolateObject(kFalseValue); |
+ return; |
+ } |
+ |
// Check if it is a singleton class object which is shared by |
// all isolates. |
intptr_t id = rawobj->GetClassId(); |
@@ -1039,18 +1051,6 @@ |
return true; |
} |
- // Check if it is a singleton boolean true value. |
- if (rawobj == object_store()->true_value()) { |
- WriteIndexedObject(kTrueValue); |
- return true; |
- } |
- |
- // Check if it is a singleton boolean false value. |
- if (rawobj == object_store()->false_value()) { |
- WriteIndexedObject(kFalseValue); |
- return true; |
- } |
- |
// Check if the object is a Mint and could potentially be a Smi |
// on other architectures (64 bit), if so write it out as int64_t value. |
if (rawobj->GetClassId() == kMintCid) { |