Index: src/snapshot/serialize.cc |
diff --git a/src/snapshot/serialize.cc b/src/snapshot/serialize.cc |
index 81e071c0fb05809d6b905fe8c5373bbb8e6bc5e6..afddb36bc38e696aa38518e464287874b9b83dab 100644 |
--- a/src/snapshot/serialize.cc |
+++ b/src/snapshot/serialize.cc |
@@ -570,19 +570,9 @@ void Deserializer::Deserialize(Isolate* isolate) { |
} |
// Update data pointers to the external strings containing natives sources. |
- for (int i = 0; i < Natives::GetBuiltinsCount(); i++) { |
- Object* source = isolate_->heap()->natives_source_cache()->get(i); |
- if (!source->IsUndefined()) { |
- ExternalOneByteString::cast(source)->update_data_cache(); |
- } |
- } |
- |
- for (int i = 0; i < CodeStubNatives::GetBuiltinsCount(); i++) { |
- Object* source = isolate_->heap()->code_stub_natives_source_cache()->get(i); |
- if (!source->IsUndefined()) { |
- ExternalOneByteString::cast(source)->update_data_cache(); |
- } |
- } |
+ Natives::UpdateSourceCache(isolate_->heap()); |
+ ExtraNatives::UpdateSourceCache(isolate_->heap()); |
+ CodeStubNatives::UpdateSourceCache(isolate_->heap()); |
FlushICacheForNewCodeObjects(); |
@@ -1181,6 +1171,11 @@ bool Deserializer::ReadData(Object** current, Object** limit, int source_space, |
current); |
break; |
+ case kExtraNativesStringResource: |
+ current = CopyInNativesSource( |
+ ExtraNatives::GetScriptSource(source_.Get()), current); |
+ break; |
+ |
case kCodeStubNativesStringResource: |
current = CopyInNativesSource( |
CodeStubNatives::GetScriptSource(source_.Get()), current); |
@@ -2187,13 +2182,19 @@ void Serializer::ObjectSerializer::VisitExternalOneByteString( |
OutputRawData(references_start); |
if (SerializeExternalNativeSourceString( |
Natives::GetBuiltinsCount(), resource_pointer, |
- serializer_->isolate()->heap()->natives_source_cache(), |
+ Natives::GetSourceCache(serializer_->isolate()->heap()), |
kNativesStringResource)) { |
return; |
} |
if (SerializeExternalNativeSourceString( |
+ ExtraNatives::GetBuiltinsCount(), resource_pointer, |
+ ExtraNatives::GetSourceCache(serializer_->isolate()->heap()), |
+ kExtraNativesStringResource)) { |
+ return; |
+ } |
+ if (SerializeExternalNativeSourceString( |
CodeStubNatives::GetBuiltinsCount(), resource_pointer, |
- serializer_->isolate()->heap()->code_stub_natives_source_cache(), |
+ CodeStubNatives::GetSourceCache(serializer_->isolate()->heap()), |
kCodeStubNativesStringResource)) { |
return; |
} |