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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 #include "src/base/platform/platform.h" | 47 #include "src/base/platform/platform.h" |
48 #include "src/base/sys-info.h" | 48 #include "src/base/sys-info.h" |
49 #include "src/d8-debug.h" | 49 #include "src/d8-debug.h" |
50 #include "src/debug.h" | 50 #include "src/debug.h" |
51 #include "src/natives.h" | 51 #include "src/natives.h" |
52 #include "src/v8.h" | 52 #include "src/v8.h" |
53 #endif // !V8_SHARED | 53 #endif // !V8_SHARED |
54 | 54 |
55 #if !defined(_WIN32) && !defined(_WIN64) | 55 #if !defined(_WIN32) && !defined(_WIN64) |
56 #include <unistd.h> // NOLINT | 56 #include <unistd.h> // NOLINT |
57 #endif | 57 #else |
| 58 #include <windows.h> // NOLINT |
| 59 #if defined(_MSC_VER) |
| 60 #include <crtdbg.h> // NOLINT |
| 61 #endif // defined(_MSC_VER) |
| 62 #endif // !defined(_WIN32) && !defined(_WIN64) |
58 | 63 |
59 #ifndef DCHECK | 64 #ifndef DCHECK |
60 #define DCHECK(condition) assert(condition) | 65 #define DCHECK(condition) assert(condition) |
61 #endif | 66 #endif |
62 | 67 |
63 namespace v8 { | 68 namespace v8 { |
64 | 69 |
65 | 70 |
66 static Handle<Value> Throw(Isolate* isolate, const char* message) { | 71 static Handle<Value> Throw(Isolate* isolate, const char* message) { |
67 return isolate->ThrowException(String::NewFromUtf8(isolate, message)); | 72 return isolate->ThrowException(String::NewFromUtf8(isolate, message)); |
(...skipping 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1588 v8::StartupData snapshot_; | 1593 v8::StartupData snapshot_; |
1589 | 1594 |
1590 // Disallow copy & assign. | 1595 // Disallow copy & assign. |
1591 StartupDataHandler(const StartupDataHandler& other); | 1596 StartupDataHandler(const StartupDataHandler& other); |
1592 void operator=(const StartupDataHandler& other); | 1597 void operator=(const StartupDataHandler& other); |
1593 }; | 1598 }; |
1594 #endif // V8_USE_EXTERNAL_STARTUP_DATA | 1599 #endif // V8_USE_EXTERNAL_STARTUP_DATA |
1595 | 1600 |
1596 | 1601 |
1597 int Shell::Main(int argc, char* argv[]) { | 1602 int Shell::Main(int argc, char* argv[]) { |
| 1603 #if (defined(_WIN32) || defined(_WIN64)) |
| 1604 UINT new_flags = |
| 1605 SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX; |
| 1606 UINT existing_flags = SetErrorMode(new_flags); |
| 1607 SetErrorMode(existing_flags | new_flags); |
| 1608 #if defined(_MSC_VER) |
| 1609 _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_FILE); |
| 1610 _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR); |
| 1611 _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_FILE); |
| 1612 _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR); |
| 1613 _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_FILE); |
| 1614 _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); |
| 1615 _set_error_mode(_OUT_TO_STDERR); |
| 1616 #endif // defined(_MSC_VER) |
| 1617 #endif // defined(_WIN32) || defined(_WIN64) |
1598 if (!SetOptions(argc, argv)) return 1; | 1618 if (!SetOptions(argc, argv)) return 1; |
1599 v8::V8::InitializeICU(options.icu_data_file); | 1619 v8::V8::InitializeICU(options.icu_data_file); |
1600 v8::Platform* platform = v8::platform::CreateDefaultPlatform(); | 1620 v8::Platform* platform = v8::platform::CreateDefaultPlatform(); |
1601 v8::V8::InitializePlatform(platform); | 1621 v8::V8::InitializePlatform(platform); |
1602 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | 1622 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
1603 StartupDataHandler startup_data(options.natives_blob, options.snapshot_blob); | 1623 StartupDataHandler startup_data(options.natives_blob, options.snapshot_blob); |
1604 #endif | 1624 #endif |
1605 SetFlagsFromString("--trace-hydrogen-file=hydrogen.cfg"); | 1625 SetFlagsFromString("--trace-hydrogen-file=hydrogen.cfg"); |
1606 SetFlagsFromString("--redirect-code-traces-to=code.asm"); | 1626 SetFlagsFromString("--redirect-code-traces-to=code.asm"); |
1607 ShellArrayBufferAllocator array_buffer_allocator; | 1627 ShellArrayBufferAllocator array_buffer_allocator; |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1691 } | 1711 } |
1692 | 1712 |
1693 } // namespace v8 | 1713 } // namespace v8 |
1694 | 1714 |
1695 | 1715 |
1696 #ifndef GOOGLE3 | 1716 #ifndef GOOGLE3 |
1697 int main(int argc, char* argv[]) { | 1717 int main(int argc, char* argv[]) { |
1698 return v8::Shell::Main(argc, argv); | 1718 return v8::Shell::Main(argc, argv); |
1699 } | 1719 } |
1700 #endif | 1720 #endif |
OLD | NEW |