 Chromium Code Reviews
 Chromium Code Reviews Issue 293993021:
  Support external startup data in V8.  (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
    
  
    Issue 293993021:
  Support external startup data in V8.  (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge| 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 "api.h" | 5 #include "api.h" | 
| 6 | 6 | 
| 7 #include <string.h> // For memcpy, strlen. | 7 #include <string.h> // For memcpy, strlen. | 
| 8 #include <cmath> // For isnan. | 8 #include <cmath> // For isnan. | 
| 9 #include "../include/v8-debug.h" | 9 #include "../include/v8-debug.h" | 
| 10 #include "../include/v8-profiler.h" | 10 #include "../include/v8-profiler.h" | 
| 11 #include "../include/v8-testing.h" | 11 #include "../include/v8-testing.h" | 
| 12 #include "assert-scope.h" | 12 #include "assert-scope.h" | 
| 13 #include "bootstrapper.h" | 13 #include "bootstrapper.h" | 
| 14 #include "code-stubs.h" | 14 #include "code-stubs.h" | 
| 15 #include "compiler.h" | 15 #include "compiler.h" | 
| 16 #include "conversions-inl.h" | 16 #include "conversions-inl.h" | 
| 17 #include "counters.h" | 17 #include "counters.h" | 
| 18 #include "cpu-profiler.h" | 18 #include "cpu-profiler.h" | 
| 19 #include "debug.h" | 19 #include "debug.h" | 
| 20 #include "deoptimizer.h" | 20 #include "deoptimizer.h" | 
| 21 #include "execution.h" | 21 #include "execution.h" | 
| 22 #include "global-handles.h" | 22 #include "global-handles.h" | 
| 23 #include "heap-profiler.h" | 23 #include "heap-profiler.h" | 
| 24 #include "heap-snapshot-generator-inl.h" | 24 #include "heap-snapshot-generator-inl.h" | 
| 25 #include "icu_util.h" | 25 #include "icu_util.h" | 
| 26 #include "json-parser.h" | 26 #include "json-parser.h" | 
| 27 #include "messages.h" | 27 #include "messages.h" | 
| 28 #ifdef COMPRESS_STARTUP_DATA_BZ2 | |
| 29 #include "natives.h" | 28 #include "natives.h" | 
| 30 #endif | |
| 31 #include "parser.h" | 29 #include "parser.h" | 
| 32 #include "platform.h" | 30 #include "platform.h" | 
| 33 #include "platform/time.h" | 31 #include "platform/time.h" | 
| 34 #include "profile-generator-inl.h" | 32 #include "profile-generator-inl.h" | 
| 35 #include "property-details.h" | 33 #include "property-details.h" | 
| 36 #include "property.h" | 34 #include "property.h" | 
| 37 #include "runtime.h" | 35 #include "runtime.h" | 
| 38 #include "runtime-profiler.h" | 36 #include "runtime-profiler.h" | 
| 39 #include "scanner-character-streams.h" | 37 #include "scanner-character-streams.h" | 
| 40 #include "snapshot.h" | 38 #include "snapshot.h" | 
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 342 ASSERT_EQ(i::ExperimentalNatives::GetRawScriptsSize(), | 340 ASSERT_EQ(i::ExperimentalNatives::GetRawScriptsSize(), | 
| 343 decompressed_data[kExperimentalLibraries].raw_size); | 341 decompressed_data[kExperimentalLibraries].raw_size); | 
| 344 i::Vector<const char> exp_libraries_source( | 342 i::Vector<const char> exp_libraries_source( | 
| 345 decompressed_data[kExperimentalLibraries].data, | 343 decompressed_data[kExperimentalLibraries].data, | 
| 346 decompressed_data[kExperimentalLibraries].raw_size); | 344 decompressed_data[kExperimentalLibraries].raw_size); | 
| 347 i::ExperimentalNatives::SetRawScriptsSource(exp_libraries_source); | 345 i::ExperimentalNatives::SetRawScriptsSource(exp_libraries_source); | 
| 348 #endif | 346 #endif | 
| 349 } | 347 } | 
| 350 | 348 | 
| 351 | 349 | 
| 350 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | |
| 
jochen (gone - plz use gerrit)
2014/05/23 11:44:44
only #ifdef the function body (and maybe add an CH
 
vogelheim
2014/05/26 12:36:03
Done.
 | |
| 351 void V8::SetNativesDataBlob(StartupData* natives_blob) { | |
| 352 i::SetNativesFromFile(natives_blob); | |
| 353 } | |
| 354 | |
| 355 | |
| 356 void V8::SetSnapshotDataBlob(StartupData* snapshot_blob) { | |
| 357 i::SetSnapshotFromFile(snapshot_blob); | |
| 358 } | |
| 359 #endif // V8_USE_EXTERNAL_STARTUP_DATA | |
| 360 | |
| 361 | |
| 352 void V8::SetFatalErrorHandler(FatalErrorCallback that) { | 362 void V8::SetFatalErrorHandler(FatalErrorCallback that) { | 
| 353 i::Isolate* isolate = i::Isolate::UncheckedCurrent(); | 363 i::Isolate* isolate = i::Isolate::UncheckedCurrent(); | 
| 354 isolate->set_exception_behavior(that); | 364 isolate->set_exception_behavior(that); | 
| 355 } | 365 } | 
| 356 | 366 | 
| 357 | 367 | 
| 358 void V8::SetAllowCodeGenerationFromStringsCallback( | 368 void V8::SetAllowCodeGenerationFromStringsCallback( | 
| 359 AllowCodeGenerationFromStringsCallback callback) { | 369 AllowCodeGenerationFromStringsCallback callback) { | 
| 360 i::Isolate* isolate = i::Isolate::UncheckedCurrent(); | 370 i::Isolate* isolate = i::Isolate::UncheckedCurrent(); | 
| 361 isolate->set_allow_code_gen_callback(callback); | 371 isolate->set_allow_code_gen_callback(callback); | 
| (...skipping 7176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7538 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7548 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 
| 7539 Address callback_address = | 7549 Address callback_address = | 
| 7540 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7550 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 
| 7541 VMState<EXTERNAL> state(isolate); | 7551 VMState<EXTERNAL> state(isolate); | 
| 7542 ExternalCallbackScope call_scope(isolate, callback_address); | 7552 ExternalCallbackScope call_scope(isolate, callback_address); | 
| 7543 callback(info); | 7553 callback(info); | 
| 7544 } | 7554 } | 
| 7545 | 7555 | 
| 7546 | 7556 | 
| 7547 } } // namespace v8::internal | 7557 } } // namespace v8::internal | 
| OLD | NEW |