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

Unified Diff: src/api.cc

Issue 991803002: Do not include cached code in the start-up snapshot. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix test case Created 5 years, 9 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 | « no previous file | test/cctest/test-heap-profiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 0d0bf3f75a6a8d2e01e1d57ac006ff2b7b5cb1c1..4954081067a830200d86a03b54726fd98a1aae04 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -359,12 +359,12 @@ bool RunExtraCode(Isolate* isolate, const char* utf8_source) {
StartupData V8::CreateSnapshotDataBlob(const char* custom_source) {
- i::Isolate* internal_isolate = new i::Isolate(true);
- Isolate* isolate = reinterpret_cast<Isolate*>(internal_isolate);
+ i::Isolate* i_isolate = new i::Isolate(true);
+ Isolate* isolate = reinterpret_cast<Isolate*>(i_isolate);
StartupData result = {NULL, 0};
{
Isolate::Scope isolate_scope(isolate);
- internal_isolate->Init(NULL);
+ i_isolate->Init(NULL);
Persistent<Context> context;
i::Snapshot::Metadata metadata;
{
@@ -382,21 +382,31 @@ StartupData V8::CreateSnapshotDataBlob(const char* custom_source) {
{
HandleScope scope(isolate);
for (int i = 0; i < i::Natives::GetBuiltinsCount(); i++) {
- internal_isolate->bootstrapper()->NativesSourceLookup(i);
+ i_isolate->bootstrapper()->NativesSourceLookup(i);
}
}
// If we don't do this then we end up with a stray root pointing at the
// context even after we have disposed of the context.
- internal_isolate->heap()->CollectAllAvailableGarbage("mksnapshot");
+ i_isolate->heap()->CollectAllAvailableGarbage("mksnapshot");
+
+ {
+ HandleScope scope(isolate);
+ // Clear code caches.
+ i_isolate->heap()->public_set_code_stubs(
+ *i::UnseededNumberDictionary::New(i_isolate, 128, i::TENURED));
Toon Verwaest 2015/03/09 12:32:50 What about extracting the original constructor fro
+ i_isolate->heap()->public_set_non_monomorphic_cache(
+ *i::UnseededNumberDictionary::New(i_isolate, 64, i::TENURED));
+ }
+
i::Object* raw_context = *v8::Utils::OpenPersistent(context);
context.Reset();
i::SnapshotByteSink snapshot_sink;
- i::StartupSerializer ser(internal_isolate, &snapshot_sink);
+ i::StartupSerializer ser(i_isolate, &snapshot_sink);
ser.SerializeStrongReferences();
i::SnapshotByteSink context_sink;
- i::PartialSerializer context_ser(internal_isolate, &ser, &context_sink);
+ i::PartialSerializer context_ser(i_isolate, &ser, &context_sink);
context_ser.Serialize(&raw_context);
ser.SerializeWeakReferences();
« no previous file with comments | « no previous file | test/cctest/test-heap-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698