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

Side by Side Diff: src/api.cc

Issue 315033002: Support external startup data in V8. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix build issue by making sure the target is empty (as opposed to not the chain of depedencies) whe… Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « include/v8.h ('k') | src/d8.h » ('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 10 matching lines...) Expand all
21 #include "src/cpu-profiler.h" 21 #include "src/cpu-profiler.h"
22 #include "src/debug.h" 22 #include "src/debug.h"
23 #include "src/deoptimizer.h" 23 #include "src/deoptimizer.h"
24 #include "src/execution.h" 24 #include "src/execution.h"
25 #include "src/global-handles.h" 25 #include "src/global-handles.h"
26 #include "src/heap-profiler.h" 26 #include "src/heap-profiler.h"
27 #include "src/heap-snapshot-generator-inl.h" 27 #include "src/heap-snapshot-generator-inl.h"
28 #include "src/icu_util.h" 28 #include "src/icu_util.h"
29 #include "src/json-parser.h" 29 #include "src/json-parser.h"
30 #include "src/messages.h" 30 #include "src/messages.h"
31 #ifdef COMPRESS_STARTUP_DATA_BZ2
32 #include "src/natives.h" 31 #include "src/natives.h"
33 #endif
34 #include "src/parser.h" 32 #include "src/parser.h"
35 #include "src/platform.h" 33 #include "src/platform.h"
36 #include "src/platform/time.h" 34 #include "src/platform/time.h"
37 #include "src/profile-generator-inl.h" 35 #include "src/profile-generator-inl.h"
38 #include "src/property-details.h" 36 #include "src/property-details.h"
39 #include "src/property.h" 37 #include "src/property.h"
40 #include "src/runtime.h" 38 #include "src/runtime.h"
41 #include "src/runtime-profiler.h" 39 #include "src/runtime-profiler.h"
42 #include "src/scanner-character-streams.h" 40 #include "src/scanner-character-streams.h"
43 #include "src/simulator.h" 41 #include "src/simulator.h"
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 ASSERT_EQ(i::ExperimentalNatives::GetRawScriptsSize(), 344 ASSERT_EQ(i::ExperimentalNatives::GetRawScriptsSize(),
347 decompressed_data[kExperimentalLibraries].raw_size); 345 decompressed_data[kExperimentalLibraries].raw_size);
348 i::Vector<const char> exp_libraries_source( 346 i::Vector<const char> exp_libraries_source(
349 decompressed_data[kExperimentalLibraries].data, 347 decompressed_data[kExperimentalLibraries].data,
350 decompressed_data[kExperimentalLibraries].raw_size); 348 decompressed_data[kExperimentalLibraries].raw_size);
351 i::ExperimentalNatives::SetRawScriptsSource(exp_libraries_source); 349 i::ExperimentalNatives::SetRawScriptsSource(exp_libraries_source);
352 #endif 350 #endif
353 } 351 }
354 352
355 353
354 void V8::SetNativesDataBlob(StartupData* natives_blob) {
355 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
356 i::SetNativesFromFile(natives_blob);
357 #else
358 CHECK(false);
359 #endif
360 }
361
362
363 void V8::SetSnapshotDataBlob(StartupData* snapshot_blob) {
364 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
365 i::SetSnapshotFromFile(snapshot_blob);
366 #else
367 CHECK(false);
368 #endif
369 }
370
371
356 void V8::SetFatalErrorHandler(FatalErrorCallback that) { 372 void V8::SetFatalErrorHandler(FatalErrorCallback that) {
357 i::Isolate* isolate = i::Isolate::UncheckedCurrent(); 373 i::Isolate* isolate = i::Isolate::UncheckedCurrent();
358 isolate->set_exception_behavior(that); 374 isolate->set_exception_behavior(that);
359 } 375 }
360 376
361 377
362 void V8::SetAllowCodeGenerationFromStringsCallback( 378 void V8::SetAllowCodeGenerationFromStringsCallback(
363 AllowCodeGenerationFromStringsCallback callback) { 379 AllowCodeGenerationFromStringsCallback callback) {
364 i::Isolate* isolate = i::Isolate::UncheckedCurrent(); 380 i::Isolate* isolate = i::Isolate::UncheckedCurrent();
365 isolate->set_allow_code_gen_callback(callback); 381 isolate->set_allow_code_gen_callback(callback);
(...skipping 7211 matching lines...) Expand 10 before | Expand all | Expand 10 after
7577 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7593 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7578 Address callback_address = 7594 Address callback_address =
7579 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7595 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7580 VMState<EXTERNAL> state(isolate); 7596 VMState<EXTERNAL> state(isolate);
7581 ExternalCallbackScope call_scope(isolate, callback_address); 7597 ExternalCallbackScope call_scope(isolate, callback_address);
7582 callback(info); 7598 callback(info);
7583 } 7599 }
7584 7600
7585 7601
7586 } } // namespace v8::internal 7602 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/d8.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698