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 27 matching lines...) Expand all Loading... |
38 #endif | 38 #endif |
39 | 39 |
40 #include "src/d8.h" | 40 #include "src/d8.h" |
41 | 41 |
42 #include "include/libplatform/libplatform.h" | 42 #include "include/libplatform/libplatform.h" |
43 #ifndef V8_SHARED | 43 #ifndef V8_SHARED |
44 #include "src/api.h" | 44 #include "src/api.h" |
45 #include "src/base/cpu.h" | 45 #include "src/base/cpu.h" |
46 #include "src/base/logging.h" | 46 #include "src/base/logging.h" |
47 #include "src/base/platform/platform.h" | 47 #include "src/base/platform/platform.h" |
| 48 #include "src/base/sys-info.h" |
48 #include "src/d8-debug.h" | 49 #include "src/d8-debug.h" |
49 #include "src/debug.h" | 50 #include "src/debug.h" |
50 #include "src/natives.h" | 51 #include "src/natives.h" |
51 #include "src/v8.h" | 52 #include "src/v8.h" |
52 #endif // !V8_SHARED | 53 #endif // !V8_SHARED |
53 | 54 |
54 #if !defined(_WIN32) && !defined(_WIN64) | 55 #if !defined(_WIN32) && !defined(_WIN64) |
55 #include <unistd.h> // NOLINT | 56 #include <unistd.h> // NOLINT |
56 #endif | 57 #endif |
57 | 58 |
(...skipping 1549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1607 MockArrayBufferAllocator mock_arraybuffer_allocator; | 1608 MockArrayBufferAllocator mock_arraybuffer_allocator; |
1608 if (options.mock_arraybuffer_allocator) { | 1609 if (options.mock_arraybuffer_allocator) { |
1609 v8::V8::SetArrayBufferAllocator(&mock_arraybuffer_allocator); | 1610 v8::V8::SetArrayBufferAllocator(&mock_arraybuffer_allocator); |
1610 } else { | 1611 } else { |
1611 v8::V8::SetArrayBufferAllocator(&array_buffer_allocator); | 1612 v8::V8::SetArrayBufferAllocator(&array_buffer_allocator); |
1612 } | 1613 } |
1613 int result = 0; | 1614 int result = 0; |
1614 Isolate* isolate = Isolate::New(); | 1615 Isolate* isolate = Isolate::New(); |
1615 #ifndef V8_SHARED | 1616 #ifndef V8_SHARED |
1616 v8::ResourceConstraints constraints; | 1617 v8::ResourceConstraints constraints; |
1617 constraints.ConfigureDefaults(base::OS::TotalPhysicalMemory(), | 1618 constraints.ConfigureDefaults(base::SysInfo::AmountOfPhysicalMemory(), |
1618 base::OS::MaxVirtualMemory(), | 1619 base::SysInfo::AmountOfVirtualMemory(), |
1619 base::OS::NumberOfProcessorsOnline()); | 1620 base::SysInfo::NumberOfProcessors()); |
1620 v8::SetResourceConstraints(isolate, &constraints); | 1621 v8::SetResourceConstraints(isolate, &constraints); |
1621 #endif | 1622 #endif |
1622 DumbLineEditor dumb_line_editor(isolate); | 1623 DumbLineEditor dumb_line_editor(isolate); |
1623 { | 1624 { |
1624 Isolate::Scope scope(isolate); | 1625 Isolate::Scope scope(isolate); |
1625 Initialize(isolate); | 1626 Initialize(isolate); |
1626 #if !defined(V8_SHARED) && defined(ENABLE_GDB_JIT_INTERFACE) | 1627 #if !defined(V8_SHARED) && defined(ENABLE_GDB_JIT_INTERFACE) |
1627 if (i::FLAG_gdbjit) { | 1628 if (i::FLAG_gdbjit) { |
1628 v8::V8::SetJitCodeEventHandler(v8::kJitCodeEventDefault, | 1629 v8::V8::SetJitCodeEventHandler(v8::kJitCodeEventDefault, |
1629 i::GDBJITInterface::EventHandler); | 1630 i::GDBJITInterface::EventHandler); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1690 } | 1691 } |
1691 | 1692 |
1692 } // namespace v8 | 1693 } // namespace v8 |
1693 | 1694 |
1694 | 1695 |
1695 #ifndef GOOGLE3 | 1696 #ifndef GOOGLE3 |
1696 int main(int argc, char* argv[]) { | 1697 int main(int argc, char* argv[]) { |
1697 return v8::Shell::Main(argc, argv); | 1698 return v8::Shell::Main(argc, argv); |
1698 } | 1699 } |
1699 #endif | 1700 #endif |
OLD | NEW |