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 #include <errno.h> | 5 #include <errno.h> |
6 #include <stdlib.h> | 6 #include <stdlib.h> |
7 #include <string.h> | 7 #include <string.h> |
8 #include <sys/stat.h> | 8 #include <sys/stat.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 2584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2595 argv[i] = NULL; | 2595 argv[i] = NULL; |
2596 } else if (strncmp(argv[i], "--trace-config=", 15) == 0) { | 2596 } else if (strncmp(argv[i], "--trace-config=", 15) == 0) { |
2597 options.trace_config = argv[i] + 15; | 2597 options.trace_config = argv[i] + 15; |
2598 argv[i] = NULL; | 2598 argv[i] = NULL; |
2599 } else if (strcmp(argv[i], "--enable-inspector") == 0) { | 2599 } else if (strcmp(argv[i], "--enable-inspector") == 0) { |
2600 options.enable_inspector = true; | 2600 options.enable_inspector = true; |
2601 argv[i] = NULL; | 2601 argv[i] = NULL; |
2602 } else if (strncmp(argv[i], "--lcov=", 7) == 0) { | 2602 } else if (strncmp(argv[i], "--lcov=", 7) == 0) { |
2603 options.lcov_file = argv[i] + 7; | 2603 options.lcov_file = argv[i] + 7; |
2604 argv[i] = NULL; | 2604 argv[i] = NULL; |
| 2605 } else if (strcmp(argv[i], "--disable-in-process-stack-traces") == 0) { |
| 2606 options.disable_in_process_stack_traces = true; |
| 2607 argv[i] = NULL; |
2605 } | 2608 } |
2606 } | 2609 } |
2607 | 2610 |
2608 v8::V8::SetFlagsFromCommandLine(&argc, argv, true); | 2611 v8::V8::SetFlagsFromCommandLine(&argc, argv, true); |
2609 | 2612 |
2610 // Set up isolated source groups. | 2613 // Set up isolated source groups. |
2611 options.isolate_sources = new SourceGroup[options.num_isolates]; | 2614 options.isolate_sources = new SourceGroup[options.num_isolates]; |
2612 SourceGroup* current = options.isolate_sources; | 2615 SourceGroup* current = options.isolate_sources; |
2613 current->Begin(argv, 1); | 2616 current->Begin(argv, 1); |
2614 for (int i = 1; i < argc; i++) { | 2617 for (int i = 1; i < argc; i++) { |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2954 _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR); | 2957 _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR); |
2955 _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_FILE); | 2958 _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_FILE); |
2956 _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR); | 2959 _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR); |
2957 _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_FILE); | 2960 _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_FILE); |
2958 _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); | 2961 _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); |
2959 _set_error_mode(_OUT_TO_STDERR); | 2962 _set_error_mode(_OUT_TO_STDERR); |
2960 #endif // defined(_MSC_VER) | 2963 #endif // defined(_MSC_VER) |
2961 #endif // defined(_WIN32) || defined(_WIN64) | 2964 #endif // defined(_WIN32) || defined(_WIN64) |
2962 if (!SetOptions(argc, argv)) return 1; | 2965 if (!SetOptions(argc, argv)) return 1; |
2963 v8::V8::InitializeICUDefaultLocation(argv[0], options.icu_data_file); | 2966 v8::V8::InitializeICUDefaultLocation(argv[0], options.icu_data_file); |
| 2967 |
| 2968 v8::platform::InProcessStackDumping in_process_stack_dumping = |
| 2969 options.disable_in_process_stack_traces |
| 2970 ? v8::platform::InProcessStackDumping::kDisabled |
| 2971 : v8::platform::InProcessStackDumping::kEnabled; |
| 2972 |
2964 g_platform = i::FLAG_verify_predictable | 2973 g_platform = i::FLAG_verify_predictable |
2965 ? new PredictablePlatform() | 2974 ? new PredictablePlatform() |
2966 : v8::platform::CreateDefaultPlatform( | 2975 : v8::platform::CreateDefaultPlatform( |
2967 0, v8::platform::IdleTaskSupport::kEnabled); | 2976 0, v8::platform::IdleTaskSupport::kEnabled, |
| 2977 in_process_stack_dumping); |
2968 | 2978 |
2969 platform::tracing::TracingController* tracing_controller; | 2979 platform::tracing::TracingController* tracing_controller; |
2970 if (options.trace_enabled) { | 2980 if (options.trace_enabled) { |
2971 trace_file.open("v8_trace.json"); | 2981 trace_file.open("v8_trace.json"); |
2972 tracing_controller = new platform::tracing::TracingController(); | 2982 tracing_controller = new platform::tracing::TracingController(); |
2973 platform::tracing::TraceBuffer* trace_buffer = | 2983 platform::tracing::TraceBuffer* trace_buffer = |
2974 platform::tracing::TraceBuffer::CreateTraceBufferRingBuffer( | 2984 platform::tracing::TraceBuffer::CreateTraceBufferRingBuffer( |
2975 platform::tracing::TraceBuffer::kRingBufferChunks, | 2985 platform::tracing::TraceBuffer::kRingBufferChunks, |
2976 platform::tracing::TraceWriter::CreateJSONTraceWriter(trace_file)); | 2986 platform::tracing::TraceWriter::CreateJSONTraceWriter(trace_file)); |
2977 tracing_controller->Initialize(trace_buffer); | 2987 tracing_controller->Initialize(trace_buffer); |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3103 } | 3113 } |
3104 | 3114 |
3105 } // namespace v8 | 3115 } // namespace v8 |
3106 | 3116 |
3107 | 3117 |
3108 #ifndef GOOGLE3 | 3118 #ifndef GOOGLE3 |
3109 int main(int argc, char* argv[]) { | 3119 int main(int argc, char* argv[]) { |
3110 return v8::Shell::Main(argc, argv); | 3120 return v8::Shell::Main(argc, argv); |
3111 } | 3121 } |
3112 #endif | 3122 #endif |
OLD | NEW |