| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 return StartupData::kUncompressed; | 391 return StartupData::kUncompressed; |
| 392 #endif | 392 #endif |
| 393 } | 393 } |
| 394 | 394 |
| 395 | 395 |
| 396 enum CompressedStartupDataItems { | 396 enum CompressedStartupDataItems { |
| 397 kSnapshot = 0, | 397 kSnapshot = 0, |
| 398 kSnapshotContext, | 398 kSnapshotContext, |
| 399 kLibraries, | 399 kLibraries, |
| 400 kExperimentalLibraries, | 400 kExperimentalLibraries, |
| 401 #if defined(ENABLE_I18N_SUPPORT) | 401 #if defined(V8_I18N_SUPPORT) |
| 402 kI18NExtension, | 402 kI18NExtension, |
| 403 #endif | 403 #endif |
| 404 kCompressedStartupDataCount | 404 kCompressedStartupDataCount |
| 405 }; | 405 }; |
| 406 | 406 |
| 407 | 407 |
| 408 int V8::GetCompressedStartupDataCount() { | 408 int V8::GetCompressedStartupDataCount() { |
| 409 #ifdef COMPRESS_STARTUP_DATA_BZ2 | 409 #ifdef COMPRESS_STARTUP_DATA_BZ2 |
| 410 return kCompressedStartupDataCount; | 410 return kCompressedStartupDataCount; |
| 411 #else | 411 #else |
| (...skipping 23 matching lines...) Expand all Loading... |
| 435 | 435 |
| 436 i::Vector<const i::byte> exp_libraries_source = | 436 i::Vector<const i::byte> exp_libraries_source = |
| 437 i::ExperimentalNatives::GetScriptsSource(); | 437 i::ExperimentalNatives::GetScriptsSource(); |
| 438 compressed_data[kExperimentalLibraries].data = | 438 compressed_data[kExperimentalLibraries].data = |
| 439 reinterpret_cast<const char*>(exp_libraries_source.start()); | 439 reinterpret_cast<const char*>(exp_libraries_source.start()); |
| 440 compressed_data[kExperimentalLibraries].compressed_size = | 440 compressed_data[kExperimentalLibraries].compressed_size = |
| 441 exp_libraries_source.length(); | 441 exp_libraries_source.length(); |
| 442 compressed_data[kExperimentalLibraries].raw_size = | 442 compressed_data[kExperimentalLibraries].raw_size = |
| 443 i::ExperimentalNatives::GetRawScriptsSize(); | 443 i::ExperimentalNatives::GetRawScriptsSize(); |
| 444 | 444 |
| 445 #if defined(ENABLE_I18N_SUPPORT) | 445 #if defined(V8_I18N_SUPPORT) |
| 446 i::Vector<const ii:byte> i18n_extension_source = | 446 i::Vector<const ii:byte> i18n_extension_source = |
| 447 i::I18NNatives::GetScriptsSource(); | 447 i::I18NNatives::GetScriptsSource(); |
| 448 compressed_data[kI18NExtension].data = | 448 compressed_data[kI18NExtension].data = |
| 449 reinterpret_cast<const char*>(i18n_extension_source.start()); | 449 reinterpret_cast<const char*>(i18n_extension_source.start()); |
| 450 compressed_data[kI18NExtension].compressed_size = | 450 compressed_data[kI18NExtension].compressed_size = |
| 451 i18n_extension_source.length(); | 451 i18n_extension_source.length(); |
| 452 compressed_data[kI18NExtension].raw_size = | 452 compressed_data[kI18NExtension].raw_size = |
| 453 i::I18NNatives::GetRawScriptsSize(); | 453 i::I18NNatives::GetRawScriptsSize(); |
| 454 #endif | 454 #endif |
| 455 #endif | 455 #endif |
| (...skipping 19 matching lines...) Expand all Loading... |
| 475 decompressed_data[kLibraries].raw_size); | 475 decompressed_data[kLibraries].raw_size); |
| 476 i::Natives::SetRawScriptsSource(libraries_source); | 476 i::Natives::SetRawScriptsSource(libraries_source); |
| 477 | 477 |
| 478 ASSERT_EQ(i::ExperimentalNatives::GetRawScriptsSize(), | 478 ASSERT_EQ(i::ExperimentalNatives::GetRawScriptsSize(), |
| 479 decompressed_data[kExperimentalLibraries].raw_size); | 479 decompressed_data[kExperimentalLibraries].raw_size); |
| 480 i::Vector<const char> exp_libraries_source( | 480 i::Vector<const char> exp_libraries_source( |
| 481 decompressed_data[kExperimentalLibraries].data, | 481 decompressed_data[kExperimentalLibraries].data, |
| 482 decompressed_data[kExperimentalLibraries].raw_size); | 482 decompressed_data[kExperimentalLibraries].raw_size); |
| 483 i::ExperimentalNatives::SetRawScriptsSource(exp_libraries_source); | 483 i::ExperimentalNatives::SetRawScriptsSource(exp_libraries_source); |
| 484 | 484 |
| 485 #if defined(ENABLE_I18N_SUPPORT) | 485 #if defined(V8_I18N_SUPPORT) |
| 486 ASSERT_EQ(i::I18NNatives::GetRawScriptsSize(), | 486 ASSERT_EQ(i::I18NNatives::GetRawScriptsSize(), |
| 487 decompressed_data[kI18NExtension].raw_size); | 487 decompressed_data[kI18NExtension].raw_size); |
| 488 i::Vector<const char> i18n_extension_source( | 488 i::Vector<const char> i18n_extension_source( |
| 489 decompressed_data[kI18NExtension].data, | 489 decompressed_data[kI18NExtension].data, |
| 490 decompressed_data[kI18NExtension].raw_size); | 490 decompressed_data[kI18NExtension].raw_size); |
| 491 i::I18NNatives::SetRawScriptsSource(i18n_extension_source); | 491 i::I18NNatives::SetRawScriptsSource(i18n_extension_source); |
| 492 #endif | 492 #endif |
| 493 #endif | 493 #endif |
| 494 } | 494 } |
| 495 | 495 |
| (...skipping 7622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8118 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 8118 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
| 8119 Address callback_address = | 8119 Address callback_address = |
| 8120 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8120 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 8121 VMState<EXTERNAL> state(isolate); | 8121 VMState<EXTERNAL> state(isolate); |
| 8122 ExternalCallbackScope call_scope(isolate, callback_address); | 8122 ExternalCallbackScope call_scope(isolate, callback_address); |
| 8123 return callback(info); | 8123 return callback(info); |
| 8124 } | 8124 } |
| 8125 | 8125 |
| 8126 | 8126 |
| 8127 } } // namespace v8::internal | 8127 } } // namespace v8::internal |
| OLD | NEW |