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 1594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1605 SetFlagsFromString("--trace-hydrogen-file=hydrogen.cfg"); | 1605 SetFlagsFromString("--trace-hydrogen-file=hydrogen.cfg"); |
1606 SetFlagsFromString("--redirect-code-traces-to=code.asm"); | 1606 SetFlagsFromString("--redirect-code-traces-to=code.asm"); |
1607 ShellArrayBufferAllocator array_buffer_allocator; | 1607 ShellArrayBufferAllocator array_buffer_allocator; |
1608 MockArrayBufferAllocator mock_arraybuffer_allocator; | 1608 MockArrayBufferAllocator mock_arraybuffer_allocator; |
1609 if (options.mock_arraybuffer_allocator) { | 1609 if (options.mock_arraybuffer_allocator) { |
1610 v8::V8::SetArrayBufferAllocator(&mock_arraybuffer_allocator); | 1610 v8::V8::SetArrayBufferAllocator(&mock_arraybuffer_allocator); |
1611 } else { | 1611 } else { |
1612 v8::V8::SetArrayBufferAllocator(&array_buffer_allocator); | 1612 v8::V8::SetArrayBufferAllocator(&array_buffer_allocator); |
1613 } | 1613 } |
1614 int result = 0; | 1614 int result = 0; |
1615 Isolate* isolate = Isolate::New(); | 1615 Isolate::CreateParams create_params; |
| 1616 #if !defined(V8_SHARED) && defined(ENABLE_GDB_JIT_INTERFACE) |
| 1617 if (i::FLAG_gdbjit) { |
| 1618 create_params.code_event_handler = i::GDBJITInterface::EventHandler; |
| 1619 } |
| 1620 #endif |
| 1621 #ifdef ENABLE_VTUNE_JIT_INTERFACE |
| 1622 vTune::InitializeVtuneForV8(create_params); |
| 1623 #endif |
| 1624 Isolate* isolate = Isolate::New(create_params); |
1616 #ifndef V8_SHARED | 1625 #ifndef V8_SHARED |
1617 v8::ResourceConstraints constraints; | 1626 v8::ResourceConstraints constraints; |
1618 constraints.ConfigureDefaults(base::SysInfo::AmountOfPhysicalMemory(), | 1627 constraints.ConfigureDefaults(base::SysInfo::AmountOfPhysicalMemory(), |
1619 base::SysInfo::AmountOfVirtualMemory(), | 1628 base::SysInfo::AmountOfVirtualMemory(), |
1620 base::SysInfo::NumberOfProcessors()); | 1629 base::SysInfo::NumberOfProcessors()); |
1621 v8::SetResourceConstraints(isolate, &constraints); | 1630 v8::SetResourceConstraints(isolate, &constraints); |
1622 #endif | 1631 #endif |
1623 DumbLineEditor dumb_line_editor(isolate); | 1632 DumbLineEditor dumb_line_editor(isolate); |
1624 { | 1633 { |
1625 Isolate::Scope scope(isolate); | 1634 Isolate::Scope scope(isolate); |
1626 Initialize(isolate); | 1635 Initialize(isolate); |
1627 #if !defined(V8_SHARED) && defined(ENABLE_GDB_JIT_INTERFACE) | |
1628 if (i::FLAG_gdbjit) { | |
1629 v8::V8::SetJitCodeEventHandler(v8::kJitCodeEventDefault, | |
1630 i::GDBJITInterface::EventHandler); | |
1631 } | |
1632 #endif | |
1633 #ifdef ENABLE_VTUNE_JIT_INTERFACE | |
1634 vTune::InitializeVtuneForV8(); | |
1635 #endif | |
1636 PerIsolateData data(isolate); | 1636 PerIsolateData data(isolate); |
1637 InitializeDebugger(isolate); | 1637 InitializeDebugger(isolate); |
1638 | 1638 |
1639 #ifndef V8_SHARED | 1639 #ifndef V8_SHARED |
1640 if (options.dump_heap_constants) { | 1640 if (options.dump_heap_constants) { |
1641 DumpHeapConstants(reinterpret_cast<i::Isolate*>(isolate)); | 1641 DumpHeapConstants(reinterpret_cast<i::Isolate*>(isolate)); |
1642 return 0; | 1642 return 0; |
1643 } | 1643 } |
1644 #endif | 1644 #endif |
1645 | 1645 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1691 } | 1691 } |
1692 | 1692 |
1693 } // namespace v8 | 1693 } // namespace v8 |
1694 | 1694 |
1695 | 1695 |
1696 #ifndef GOOGLE3 | 1696 #ifndef GOOGLE3 |
1697 int main(int argc, char* argv[]) { | 1697 int main(int argc, char* argv[]) { |
1698 return v8::Shell::Main(argc, argv); | 1698 return v8::Shell::Main(argc, argv); |
1699 } | 1699 } |
1700 #endif | 1700 #endif |
OLD | NEW |