| OLD | NEW |
| 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 Loading... |
| 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 |
| 31 #include "src/natives.h" | 32 #include "src/natives.h" |
| 33 #endif |
| 32 #include "src/parser.h" | 34 #include "src/parser.h" |
| 33 #include "src/platform.h" | 35 #include "src/platform.h" |
| 34 #include "src/platform/time.h" | 36 #include "src/platform/time.h" |
| 35 #include "src/profile-generator-inl.h" | 37 #include "src/profile-generator-inl.h" |
| 36 #include "src/property-details.h" | 38 #include "src/property-details.h" |
| 37 #include "src/property.h" | 39 #include "src/property.h" |
| 38 #include "src/runtime.h" | 40 #include "src/runtime.h" |
| 39 #include "src/runtime-profiler.h" | 41 #include "src/runtime-profiler.h" |
| 40 #include "src/scanner-character-streams.h" | 42 #include "src/scanner-character-streams.h" |
| 41 #include "src/simulator.h" | 43 #include "src/simulator.h" |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 ASSERT_EQ(i::ExperimentalNatives::GetRawScriptsSize(), | 346 ASSERT_EQ(i::ExperimentalNatives::GetRawScriptsSize(), |
| 345 decompressed_data[kExperimentalLibraries].raw_size); | 347 decompressed_data[kExperimentalLibraries].raw_size); |
| 346 i::Vector<const char> exp_libraries_source( | 348 i::Vector<const char> exp_libraries_source( |
| 347 decompressed_data[kExperimentalLibraries].data, | 349 decompressed_data[kExperimentalLibraries].data, |
| 348 decompressed_data[kExperimentalLibraries].raw_size); | 350 decompressed_data[kExperimentalLibraries].raw_size); |
| 349 i::ExperimentalNatives::SetRawScriptsSource(exp_libraries_source); | 351 i::ExperimentalNatives::SetRawScriptsSource(exp_libraries_source); |
| 350 #endif | 352 #endif |
| 351 } | 353 } |
| 352 | 354 |
| 353 | 355 |
| 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 | |
| 372 void V8::SetFatalErrorHandler(FatalErrorCallback that) { | 356 void V8::SetFatalErrorHandler(FatalErrorCallback that) { |
| 373 i::Isolate* isolate = i::Isolate::UncheckedCurrent(); | 357 i::Isolate* isolate = i::Isolate::UncheckedCurrent(); |
| 374 isolate->set_exception_behavior(that); | 358 isolate->set_exception_behavior(that); |
| 375 } | 359 } |
| 376 | 360 |
| 377 | 361 |
| 378 void V8::SetAllowCodeGenerationFromStringsCallback( | 362 void V8::SetAllowCodeGenerationFromStringsCallback( |
| 379 AllowCodeGenerationFromStringsCallback callback) { | 363 AllowCodeGenerationFromStringsCallback callback) { |
| 380 i::Isolate* isolate = i::Isolate::UncheckedCurrent(); | 364 i::Isolate* isolate = i::Isolate::UncheckedCurrent(); |
| 381 isolate->set_allow_code_gen_callback(callback); | 365 isolate->set_allow_code_gen_callback(callback); |
| (...skipping 7212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7594 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7578 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
| 7595 Address callback_address = | 7579 Address callback_address = |
| 7596 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7580 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 7597 VMState<EXTERNAL> state(isolate); | 7581 VMState<EXTERNAL> state(isolate); |
| 7598 ExternalCallbackScope call_scope(isolate, callback_address); | 7582 ExternalCallbackScope call_scope(isolate, callback_address); |
| 7599 callback(info); | 7583 callback(info); |
| 7600 } | 7584 } |
| 7601 | 7585 |
| 7602 | 7586 |
| 7603 } } // namespace v8::internal | 7587 } } // namespace v8::internal |
| OLD | NEW |