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 1641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1652 SetStandaloneFlagsViaCommandLine(); | 1652 SetStandaloneFlagsViaCommandLine(); |
1653 #endif | 1653 #endif |
1654 ShellArrayBufferAllocator array_buffer_allocator; | 1654 ShellArrayBufferAllocator array_buffer_allocator; |
1655 MockArrayBufferAllocator mock_arraybuffer_allocator; | 1655 MockArrayBufferAllocator mock_arraybuffer_allocator; |
1656 if (options.mock_arraybuffer_allocator) { | 1656 if (options.mock_arraybuffer_allocator) { |
1657 v8::V8::SetArrayBufferAllocator(&mock_arraybuffer_allocator); | 1657 v8::V8::SetArrayBufferAllocator(&mock_arraybuffer_allocator); |
1658 } else { | 1658 } else { |
1659 v8::V8::SetArrayBufferAllocator(&array_buffer_allocator); | 1659 v8::V8::SetArrayBufferAllocator(&array_buffer_allocator); |
1660 } | 1660 } |
1661 int result = 0; | 1661 int result = 0; |
1662 Isolate* isolate = Isolate::GetCurrent(); | 1662 Isolate* isolate = Isolate::New(); |
1663 #ifndef V8_SHARED | 1663 #ifndef V8_SHARED |
1664 v8::ResourceConstraints constraints; | 1664 v8::ResourceConstraints constraints; |
1665 constraints.ConfigureDefaults(i::OS::TotalPhysicalMemory(), | 1665 constraints.ConfigureDefaults(i::OS::TotalPhysicalMemory(), |
1666 i::OS::MaxVirtualMemory(), | 1666 i::OS::MaxVirtualMemory(), |
1667 i::CPU::NumberOfProcessorsOnline()); | 1667 i::CPU::NumberOfProcessorsOnline()); |
1668 v8::SetResourceConstraints(isolate, &constraints); | 1668 v8::SetResourceConstraints(isolate, &constraints); |
1669 #endif | 1669 #endif |
1670 DumbLineEditor dumb_line_editor(isolate); | 1670 DumbLineEditor dumb_line_editor(isolate); |
1671 { | 1671 { |
| 1672 Isolate::Scope scope(isolate); |
1672 Initialize(isolate); | 1673 Initialize(isolate); |
1673 #ifdef ENABLE_VTUNE_JIT_INTERFACE | 1674 #ifdef ENABLE_VTUNE_JIT_INTERFACE |
1674 vTune::InitializeVtuneForV8(); | 1675 vTune::InitializeVtuneForV8(); |
1675 #endif | 1676 #endif |
1676 PerIsolateData data(isolate); | 1677 PerIsolateData data(isolate); |
1677 InitializeDebugger(isolate); | 1678 InitializeDebugger(isolate); |
1678 | 1679 |
1679 #ifndef V8_SHARED | 1680 #ifndef V8_SHARED |
1680 if (options.dump_heap_constants) { | 1681 if (options.dump_heap_constants) { |
1681 DumpHeapConstants(reinterpret_cast<i::Isolate*>(isolate)); | 1682 DumpHeapConstants(reinterpret_cast<i::Isolate*>(isolate)); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1740 } | 1741 } |
1741 | 1742 |
1742 } // namespace v8 | 1743 } // namespace v8 |
1743 | 1744 |
1744 | 1745 |
1745 #ifndef GOOGLE3 | 1746 #ifndef GOOGLE3 |
1746 int main(int argc, char* argv[]) { | 1747 int main(int argc, char* argv[]) { |
1747 return v8::Shell::Main(argc, argv); | 1748 return v8::Shell::Main(argc, argv); |
1748 } | 1749 } |
1749 #endif | 1750 #endif |
OLD | NEW |