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