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

Unified Diff: src/api.cc

Issue 949623006: Attach snapshot data blob to the isolate. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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 | « include/v8.h ('k') | src/full-codegen.cc » ('j') | src/snapshot.h » ('J')
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 e5e674ac0e444c99ca45ed283076a5f499f4a58f..df6804df3e37c8e4f3f15b4ea2df3ccf20e8568c 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -207,7 +207,7 @@ void V8::SetSnapshotDataBlob(StartupData* snapshot_blob) {
}
-bool RunExtraCode(Isolate* isolate, char* utf8_source) {
+bool RunExtraCode(Isolate* isolate, const char* utf8_source) {
// Run custom script if provided.
TryCatch try_catch;
Local<String> source_string = String::NewFromUtf8(isolate, utf8_source);
@@ -221,7 +221,7 @@ bool RunExtraCode(Isolate* isolate, char* utf8_source) {
}
-StartupData V8::CreateSnapshotDataBlob(char* custom_source) {
+StartupData V8::CreateSnapshotDataBlob(const char* custom_source) {
Isolate::CreateParams params;
params.enable_serializer = true;
Isolate* isolate = v8::Isolate::New(params);
@@ -6526,6 +6526,13 @@ Isolate* Isolate::GetCurrent() {
Isolate* Isolate::New(const Isolate::CreateParams& params) {
i::Isolate* isolate = new i::Isolate(params.enable_serializer);
Isolate* v8_isolate = reinterpret_cast<Isolate*>(isolate);
+ if (!params.enable_serializer) {
vogelheim 2015/02/24 15:16:31 Why the check for !enable_serializer? The comment
Yang 2015/02/25 08:19:20 You are right. In fact, there is no point in havin
+ if (params.snapshot_blob != NULL) {
+ isolate->set_snapshot_blob(params.snapshot_blob);
+ } else {
+ isolate->set_snapshot_blob(i::Snapshot::DefaultSnapshotBlob());
+ }
+ }
if (params.entry_hook) {
isolate->set_function_entry_hook(params.entry_hook);
}
« no previous file with comments | « include/v8.h ('k') | src/full-codegen.cc » ('j') | src/snapshot.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698