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 | 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 17 matching lines...) Expand all Loading... |
28 #ifdef V8_SHARED | 28 #ifdef V8_SHARED |
29 #include "include/v8-testing.h" | 29 #include "include/v8-testing.h" |
30 #endif // V8_SHARED | 30 #endif // V8_SHARED |
31 | 31 |
32 #ifdef ENABLE_VTUNE_JIT_INTERFACE | 32 #ifdef ENABLE_VTUNE_JIT_INTERFACE |
33 #include "src/third_party/vtune/v8-vtune.h" | 33 #include "src/third_party/vtune/v8-vtune.h" |
34 #endif | 34 #endif |
35 | 35 |
36 #include "src/d8.h" | 36 #include "src/d8.h" |
37 | 37 |
| 38 #include "include/libplatform/libplatform.h" |
38 #ifndef V8_SHARED | 39 #ifndef V8_SHARED |
39 #include "src/api.h" | 40 #include "src/api.h" |
40 #include "src/base/cpu.h" | 41 #include "src/base/cpu.h" |
41 #include "src/base/logging.h" | 42 #include "src/base/logging.h" |
42 #include "src/base/platform/platform.h" | 43 #include "src/base/platform/platform.h" |
43 #include "src/d8-debug.h" | 44 #include "src/d8-debug.h" |
44 #include "src/debug.h" | 45 #include "src/debug.h" |
45 #include "src/natives.h" | 46 #include "src/natives.h" |
46 #include "src/v8.h" | 47 #include "src/v8.h" |
47 #endif // !V8_SHARED | 48 #endif // !V8_SHARED |
(...skipping 1494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1542 // Disallow copy & assign. | 1543 // Disallow copy & assign. |
1543 StartupDataHandler(const StartupDataHandler& other); | 1544 StartupDataHandler(const StartupDataHandler& other); |
1544 void operator=(const StartupDataHandler& other); | 1545 void operator=(const StartupDataHandler& other); |
1545 }; | 1546 }; |
1546 #endif // V8_USE_EXTERNAL_STARTUP_DATA | 1547 #endif // V8_USE_EXTERNAL_STARTUP_DATA |
1547 | 1548 |
1548 | 1549 |
1549 int Shell::Main(int argc, char* argv[]) { | 1550 int Shell::Main(int argc, char* argv[]) { |
1550 if (!SetOptions(argc, argv)) return 1; | 1551 if (!SetOptions(argc, argv)) return 1; |
1551 v8::V8::InitializeICU(options.icu_data_file); | 1552 v8::V8::InitializeICU(options.icu_data_file); |
| 1553 v8::Platform* platform = |
| 1554 v8::platform::CreateDefaultPlatform(base::OS::NumberOfProcessorsOnline()); |
| 1555 v8::V8::InitializePlatform(platform); |
1552 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | 1556 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
1553 StartupDataHandler startup_data(options.natives_blob, options.snapshot_blob); | 1557 StartupDataHandler startup_data(options.natives_blob, options.snapshot_blob); |
1554 #endif | 1558 #endif |
1555 SetFlagsFromString("--trace-hydrogen-file=hydrogen.cfg"); | 1559 SetFlagsFromString("--trace-hydrogen-file=hydrogen.cfg"); |
1556 SetFlagsFromString("--redirect-code-traces-to=code.asm"); | 1560 SetFlagsFromString("--redirect-code-traces-to=code.asm"); |
1557 ShellArrayBufferAllocator array_buffer_allocator; | 1561 ShellArrayBufferAllocator array_buffer_allocator; |
1558 MockArrayBufferAllocator mock_arraybuffer_allocator; | 1562 MockArrayBufferAllocator mock_arraybuffer_allocator; |
1559 if (options.mock_arraybuffer_allocator) { | 1563 if (options.mock_arraybuffer_allocator) { |
1560 v8::V8::SetArrayBufferAllocator(&mock_arraybuffer_allocator); | 1564 v8::V8::SetArrayBufferAllocator(&mock_arraybuffer_allocator); |
1561 } else { | 1565 } else { |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1619 #ifndef V8_SHARED | 1623 #ifndef V8_SHARED |
1620 if (!i::FLAG_debugger) { | 1624 if (!i::FLAG_debugger) { |
1621 InstallUtilityScript(isolate); | 1625 InstallUtilityScript(isolate); |
1622 } | 1626 } |
1623 #endif // !V8_SHARED | 1627 #endif // !V8_SHARED |
1624 RunShell(isolate); | 1628 RunShell(isolate); |
1625 } | 1629 } |
1626 } | 1630 } |
1627 isolate->Dispose(); | 1631 isolate->Dispose(); |
1628 V8::Dispose(); | 1632 V8::Dispose(); |
| 1633 V8::ShutdownPlatform(); |
| 1634 delete platform; |
1629 | 1635 |
1630 OnExit(); | 1636 OnExit(); |
1631 | 1637 |
1632 return result; | 1638 return result; |
1633 } | 1639 } |
1634 | 1640 |
1635 } // namespace v8 | 1641 } // namespace v8 |
1636 | 1642 |
1637 | 1643 |
1638 #ifndef GOOGLE3 | 1644 #ifndef GOOGLE3 |
1639 int main(int argc, char* argv[]) { | 1645 int main(int argc, char* argv[]) { |
1640 return v8::Shell::Main(argc, argv); | 1646 return v8::Shell::Main(argc, argv); |
1641 } | 1647 } |
1642 #endif | 1648 #endif |
OLD | NEW |