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

Side by Side Diff: src/api.cc

Issue 811333002: Quick-and-dirty fixes for on-demand snapshot. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Thread safety Created 6 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/bootstrapper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/api.h" 5 #include "src/api.h"
6 6
7 #include <string.h> // For memcpy, strlen. 7 #include <string.h> // For memcpy, strlen.
8 #ifdef V8_USE_ADDRESS_SANITIZER 8 #ifdef V8_USE_ADDRESS_SANITIZER
9 #include <sanitizer/asan_interface.h> 9 #include <sanitizer/asan_interface.h>
10 #endif // V8_USE_ADDRESS_SANITIZER 10 #endif // V8_USE_ADDRESS_SANITIZER
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 i::V8::SetSnapshotBlob(snapshot_blob); 205 i::V8::SetSnapshotBlob(snapshot_blob);
206 } 206 }
207 207
208 208
209 StartupData V8::CreateSnapshotDataBlob() { 209 StartupData V8::CreateSnapshotDataBlob() {
210 Isolate::CreateParams params; 210 Isolate::CreateParams params;
211 params.enable_serializer = true; 211 params.enable_serializer = true;
212 Isolate* isolate = v8::Isolate::New(params); 212 Isolate* isolate = v8::Isolate::New(params);
213 StartupData result = {NULL, 0}; 213 StartupData result = {NULL, 0};
214 { 214 {
215 Locker locker(isolate);
215 Isolate::Scope isolate_scope(isolate); 216 Isolate::Scope isolate_scope(isolate);
216 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate); 217 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate);
217 Persistent<Context> context; 218 Persistent<Context> context;
218 { 219 {
219 HandleScope handle_scope(isolate); 220 HandleScope handle_scope(isolate);
220 context.Reset(isolate, Context::New(isolate)); 221 context.Reset(isolate, Context::New(isolate));
221 } 222 }
222 if (!context.IsEmpty()) { 223 if (!context.IsEmpty()) {
223 // Make sure all builtin scripts are cached. 224 // Make sure all builtin scripts are cached.
224 { 225 {
(...skipping 7529 matching lines...) Expand 10 before | Expand all | Expand 10 after
7754 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7755 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7755 Address callback_address = 7756 Address callback_address =
7756 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7757 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7757 VMState<EXTERNAL> state(isolate); 7758 VMState<EXTERNAL> state(isolate);
7758 ExternalCallbackScope call_scope(isolate, callback_address); 7759 ExternalCallbackScope call_scope(isolate, callback_address);
7759 callback(info); 7760 callback(info);
7760 } 7761 }
7761 7762
7762 7763
7763 } } // namespace v8::internal 7764 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698