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 |
11 #include <errno.h> | 11 #include <errno.h> |
12 #include <stdlib.h> | 12 #include <stdlib.h> |
13 #include <string.h> | 13 #include <string.h> |
14 #include <sys/stat.h> | 14 #include <sys/stat.h> |
15 | 15 |
16 #ifdef V8_SHARED | 16 #ifdef V8_SHARED |
17 #include <assert.h> | 17 #include <assert.h> |
18 #endif // V8_SHARED | 18 #endif // V8_SHARED |
19 | 19 |
20 #ifndef V8_SHARED | 20 #ifndef V8_SHARED |
21 #include <algorithm> | 21 #include <algorithm> |
22 #include <vector> | 22 #include <vector> |
23 #endif // !V8_SHARED | 23 #endif // !V8_SHARED |
24 | 24 |
25 #ifdef V8_SHARED | 25 #ifdef V8_SHARED |
26 #include "include/v8-testing.h" | 26 #include "include/v8-testing.h" |
27 #endif // V8_SHARED | 27 #endif // V8_SHARED |
28 | 28 |
29 #if !defined(V8_SHARED) && defined(ENABLE_GDB_JIT_INTERFACE) | |
30 #include "src/gdb-jit.h" | |
31 #endif | |
32 | |
33 #ifdef ENABLE_VTUNE_JIT_INTERFACE | 29 #ifdef ENABLE_VTUNE_JIT_INTERFACE |
34 #include "src/third_party/vtune/v8-vtune.h" | 30 #include "src/third_party/vtune/v8-vtune.h" |
35 #endif | 31 #endif |
36 | 32 |
37 #include "src/d8.h" | 33 #include "src/d8.h" |
38 #include "src/ostreams.h" | 34 #include "src/ostreams.h" |
39 | 35 |
40 #include "include/libplatform/libplatform.h" | 36 #include "include/libplatform/libplatform.h" |
41 #ifndef V8_SHARED | 37 #ifndef V8_SHARED |
42 #include "src/api.h" | 38 #include "src/api.h" |
(...skipping 2417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2460 int result = 0; | 2456 int result = 0; |
2461 Isolate::CreateParams create_params; | 2457 Isolate::CreateParams create_params; |
2462 ShellArrayBufferAllocator shell_array_buffer_allocator; | 2458 ShellArrayBufferAllocator shell_array_buffer_allocator; |
2463 MockArrayBufferAllocator mock_arraybuffer_allocator; | 2459 MockArrayBufferAllocator mock_arraybuffer_allocator; |
2464 if (options.mock_arraybuffer_allocator) { | 2460 if (options.mock_arraybuffer_allocator) { |
2465 Shell::array_buffer_allocator = &mock_arraybuffer_allocator; | 2461 Shell::array_buffer_allocator = &mock_arraybuffer_allocator; |
2466 } else { | 2462 } else { |
2467 Shell::array_buffer_allocator = &shell_array_buffer_allocator; | 2463 Shell::array_buffer_allocator = &shell_array_buffer_allocator; |
2468 } | 2464 } |
2469 create_params.array_buffer_allocator = Shell::array_buffer_allocator; | 2465 create_params.array_buffer_allocator = Shell::array_buffer_allocator; |
2470 #if !defined(V8_SHARED) && defined(ENABLE_GDB_JIT_INTERFACE) | |
2471 if (i::FLAG_gdbjit) { | |
2472 create_params.code_event_handler = i::GDBJITInterface::EventHandler; | |
2473 } | |
2474 #endif | |
2475 #ifdef ENABLE_VTUNE_JIT_INTERFACE | 2466 #ifdef ENABLE_VTUNE_JIT_INTERFACE |
2476 create_params.code_event_handler = vTune::GetVtuneCodeEventHandler(); | 2467 create_params.code_event_handler = vTune::GetVtuneCodeEventHandler(); |
2477 #endif | 2468 #endif |
2478 #ifndef V8_SHARED | 2469 #ifndef V8_SHARED |
2479 create_params.constraints.ConfigureDefaults( | 2470 create_params.constraints.ConfigureDefaults( |
2480 base::SysInfo::AmountOfPhysicalMemory(), | 2471 base::SysInfo::AmountOfPhysicalMemory(), |
2481 base::SysInfo::AmountOfVirtualMemory()); | 2472 base::SysInfo::AmountOfVirtualMemory()); |
2482 | 2473 |
2483 Shell::counter_map_ = new CounterMap(); | 2474 Shell::counter_map_ = new CounterMap(); |
2484 if (i::FLAG_dump_counters || i::FLAG_track_gc_object_stats) { | 2475 if (i::FLAG_dump_counters || i::FLAG_track_gc_object_stats) { |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2563 } | 2554 } |
2564 | 2555 |
2565 } // namespace v8 | 2556 } // namespace v8 |
2566 | 2557 |
2567 | 2558 |
2568 #ifndef GOOGLE3 | 2559 #ifndef GOOGLE3 |
2569 int main(int argc, char* argv[]) { | 2560 int main(int argc, char* argv[]) { |
2570 return v8::Shell::Main(argc, argv); | 2561 return v8::Shell::Main(argc, argv); |
2571 } | 2562 } |
2572 #endif | 2563 #endif |
OLD | NEW |