Index: src/snapshot/deserializer.cc |
diff --git a/src/snapshot/deserializer.cc b/src/snapshot/deserializer.cc |
index ab17b28bb2505196a5fa70716858927ea42f1fae..5656dee3bc1650ac2a3ebeb4ba383eee88738bbf 100644 |
--- a/src/snapshot/deserializer.cc |
+++ b/src/snapshot/deserializer.cc |
@@ -356,6 +356,14 @@ HeapObject* Deserializer::PostProcessNewObject(HeapObject* obj, int space) { |
if (isolate_->external_reference_redirector()) { |
accessor_infos_.Add(AccessorInfo::cast(obj)); |
} |
+ } else if (obj->IsExternalOneByteString()) { |
+ DCHECK(obj->map() == isolate_->heap()->native_source_string_map()); |
+ ExternalOneByteString* string = ExternalOneByteString::cast(obj); |
+ DCHECK(string->is_short()); |
+ string->set_resource( |
+ NativesExternalStringResource::DecodeForDeserialization( |
+ string->resource())); |
+ isolate_->heap()->RegisterExternalString(string); |
} |
// Check alignment. |
DCHECK_EQ(0, Heap::GetFillToAlign(obj->address(), obj->RequiredAlignment())); |
@@ -502,16 +510,6 @@ Address Deserializer::Allocate(int space_index, int size) { |
} |
} |
-Object** Deserializer::CopyInNativesSource(Vector<const char> source_vector, |
- Object** current) { |
- DCHECK(!isolate_->heap()->deserialization_complete()); |
- NativesExternalStringResource* resource = new NativesExternalStringResource( |
- source_vector.start(), source_vector.length()); |
- Object* resource_obj = reinterpret_cast<Object*>(resource); |
- UnalignedCopy(current++, &resource_obj); |
- return current; |
-} |
- |
bool Deserializer::ReadData(Object** current, Object** limit, int source_space, |
Address current_object_address) { |
Isolate* const isolate = isolate_; |
@@ -814,16 +812,6 @@ bool Deserializer::ReadData(Object** current, Object** limit, int source_space, |
CHECK(false); |
break; |
- case kNativesStringResource: |
- current = CopyInNativesSource(Natives::GetScriptSource(source_.Get()), |
- current); |
- break; |
- |
- case kExtraNativesStringResource: |
- current = CopyInNativesSource( |
- ExtraNatives::GetScriptSource(source_.Get()), current); |
- break; |
- |
// Deserialize raw data of variable length. |
case kVariableRawData: { |
int size_in_bytes = source_.GetInt(); |