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

Side by Side Diff: src/d8.cc

Issue 1292053002: Rework startup-data-util. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Same as Patch Set 3, but revert the "Test for all platforms" bits. Created 5 years, 4 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
« no previous file with comments | « src/api.cc ('k') | src/d8.gyp » ('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 5
6 // Defined when linking against shared lib on Windows. 6 // Defined when linking against shared lib on Windows.
7 #if defined(USING_V8_SHARED) && !defined(V8_SHARED) 7 #if defined(USING_V8_SHARED) && !defined(V8_SHARED)
8 #define V8_SHARED 8 #define V8_SHARED
9 #endif 9 #endif
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 #include "src/base/cpu.h" 42 #include "src/base/cpu.h"
43 #include "src/base/logging.h" 43 #include "src/base/logging.h"
44 #include "src/base/platform/platform.h" 44 #include "src/base/platform/platform.h"
45 #include "src/base/sys-info.h" 45 #include "src/base/sys-info.h"
46 #include "src/basic-block-profiler.h" 46 #include "src/basic-block-profiler.h"
47 #include "src/snapshot/natives.h" 47 #include "src/snapshot/natives.h"
48 #include "src/utils.h" 48 #include "src/utils.h"
49 #include "src/v8.h" 49 #include "src/v8.h"
50 #endif // !V8_SHARED 50 #endif // !V8_SHARED
51 51
52 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
53 #include "src/startup-data-util.h"
54 #endif // V8_USE_EXTERNAL_STARTUP_DATA
55
56 #if !defined(_WIN32) && !defined(_WIN64) 52 #if !defined(_WIN32) && !defined(_WIN64)
57 #include <unistd.h> // NOLINT 53 #include <unistd.h> // NOLINT
58 #else 54 #else
59 #include <windows.h> // NOLINT 55 #include <windows.h> // NOLINT
60 #if defined(_MSC_VER) 56 #if defined(_MSC_VER)
61 #include <crtdbg.h> // NOLINT 57 #include <crtdbg.h> // NOLINT
62 #endif // defined(_MSC_VER) 58 #endif // defined(_MSC_VER)
63 #endif // !defined(_WIN32) && !defined(_WIN64) 59 #endif // !defined(_WIN32) && !defined(_WIN64)
64 60
65 #ifndef DCHECK 61 #ifndef DCHECK
(...skipping 2284 matching lines...) Expand 10 before | Expand all | Expand 10 after
2350 _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_FILE); 2346 _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_FILE);
2351 _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); 2347 _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR);
2352 _set_error_mode(_OUT_TO_STDERR); 2348 _set_error_mode(_OUT_TO_STDERR);
2353 #endif // defined(_MSC_VER) 2349 #endif // defined(_MSC_VER)
2354 #endif // defined(_WIN32) || defined(_WIN64) 2350 #endif // defined(_WIN32) || defined(_WIN64)
2355 if (!SetOptions(argc, argv)) return 1; 2351 if (!SetOptions(argc, argv)) return 1;
2356 v8::V8::InitializeICU(options.icu_data_file); 2352 v8::V8::InitializeICU(options.icu_data_file);
2357 g_platform = v8::platform::CreateDefaultPlatform(); 2353 g_platform = v8::platform::CreateDefaultPlatform();
2358 v8::V8::InitializePlatform(g_platform); 2354 v8::V8::InitializePlatform(g_platform);
2359 v8::V8::Initialize(); 2355 v8::V8::Initialize();
2360 #ifdef V8_USE_EXTERNAL_STARTUP_DATA 2356 if (options.natives_blob || options.snapshot_blob) {
2361 v8::StartupDataHandler startup_data(argv[0], options.natives_blob, 2357 v8::V8::InitializeExternalStartupData(options.natives_blob,
2362 options.snapshot_blob); 2358 options.snapshot_blob);
2363 #endif 2359 } else {
2360 v8::V8::InitializeExternalStartupData(argv[0]);
2361 }
2364 SetFlagsFromString("--trace-hydrogen-file=hydrogen.cfg"); 2362 SetFlagsFromString("--trace-hydrogen-file=hydrogen.cfg");
2365 SetFlagsFromString("--trace-turbo-cfg-file=turbo.cfg"); 2363 SetFlagsFromString("--trace-turbo-cfg-file=turbo.cfg");
2366 SetFlagsFromString("--redirect-code-traces-to=code.asm"); 2364 SetFlagsFromString("--redirect-code-traces-to=code.asm");
2367 int result = 0; 2365 int result = 0;
2368 Isolate::CreateParams create_params; 2366 Isolate::CreateParams create_params;
2369 ShellArrayBufferAllocator shell_array_buffer_allocator; 2367 ShellArrayBufferAllocator shell_array_buffer_allocator;
2370 MockArrayBufferAllocator mock_arraybuffer_allocator; 2368 MockArrayBufferAllocator mock_arraybuffer_allocator;
2371 if (options.mock_arraybuffer_allocator) { 2369 if (options.mock_arraybuffer_allocator) {
2372 Shell::array_buffer_allocator = &mock_arraybuffer_allocator; 2370 Shell::array_buffer_allocator = &mock_arraybuffer_allocator;
2373 } else { 2371 } else {
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
2470 } 2468 }
2471 2469
2472 } // namespace v8 2470 } // namespace v8
2473 2471
2474 2472
2475 #ifndef GOOGLE3 2473 #ifndef GOOGLE3
2476 int main(int argc, char* argv[]) { 2474 int main(int argc, char* argv[]) {
2477 return v8::Shell::Main(argc, argv); 2475 return v8::Shell::Main(argc, argv);
2478 } 2476 }
2479 #endif 2477 #endif
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/d8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698