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

Unified Diff: src/snapshot/serialize.cc

Issue 1289603002: Put V8 extras into the snapshot (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix nit Created 5 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
« src/snapshot/natives.h ('K') | « src/snapshot/serialize.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« src/snapshot/natives.h ('K') | « src/snapshot/serialize.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698