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

Unified Diff: src/v8.cc

Issue 746263002: Ensure external snapshot is only set once. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years, 1 month 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 | « src/v8.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/v8.cc
diff --git a/src/v8.cc b/src/v8.cc
index 62c3da4cf79399e4b5f2895f2bcba0975a678e37..b04ccc07c700e35f572bc42f4eec949315174766 100644
--- a/src/v8.cc
+++ b/src/v8.cc
@@ -18,10 +18,12 @@
#include "src/hydrogen.h"
#include "src/isolate.h"
#include "src/lithium-allocator.h"
+#include "src/natives.h"
#include "src/objects.h"
#include "src/runtime-profiler.h"
#include "src/sampler.h"
#include "src/serialize.h"
+#include "src/snapshot.h"
namespace v8 {
@@ -29,6 +31,11 @@ namespace internal {
V8_DECLARE_ONCE(init_once);
+#ifdef V8_USE_EXTERNAL_STARTUP_DATA
+V8_DECLARE_ONCE(init_natives_once);
+V8_DECLARE_ONCE(init_snapshot_once);
+#endif
+
v8::ArrayBuffer::Allocator* V8::array_buffer_allocator_ = NULL;
v8::Platform* V8::platform_ = NULL;
@@ -117,4 +124,21 @@ v8::Platform* V8::GetCurrentPlatform() {
return platform_;
}
+
rmcilroy 2014/11/21 18:53:46 nit - remove extra newline here
+void V8::SetNativesBlob(StartupData* natives_blob) {
+#ifdef V8_USE_EXTERNAL_STARTUP_DATA
+ base::CallOnce(&init_natives_once, &SetNativesFromFile, natives_blob);
+#else
+ CHECK(false);
+#endif
+}
+
+
+void V8::SetSnapshotBlob(StartupData* snapshot_blob) {
+#ifdef V8_USE_EXTERNAL_STARTUP_DATA
+ base::CallOnce(&init_snapshot_once, &SetSnapshotFromFile, snapshot_blob);
+#else
+ CHECK(false);
+#endif
+}
rmcilroy 2014/11/21 18:53:46 nit - add newline here.
} } // namespace v8::internal
« no previous file with comments | « src/v8.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698