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 14 matching lines...) Expand all Loading... |
25 #include "src/api.h" | 25 #include "src/api.h" |
26 #include "src/base/cpu.h" | 26 #include "src/base/cpu.h" |
27 #include "src/base/debug/stack_trace.h" | 27 #include "src/base/debug/stack_trace.h" |
28 #include "src/base/logging.h" | 28 #include "src/base/logging.h" |
29 #include "src/base/platform/platform.h" | 29 #include "src/base/platform/platform.h" |
30 #include "src/base/sys-info.h" | 30 #include "src/base/sys-info.h" |
31 #include "src/basic-block-profiler.h" | 31 #include "src/basic-block-profiler.h" |
32 #include "src/interpreter/interpreter.h" | 32 #include "src/interpreter/interpreter.h" |
33 #include "src/msan.h" | 33 #include "src/msan.h" |
34 #include "src/snapshot/natives.h" | 34 #include "src/snapshot/natives.h" |
| 35 #include "src/trap-handler/trap-handler.h" |
35 #include "src/utils.h" | 36 #include "src/utils.h" |
36 #include "src/v8.h" | 37 #include "src/v8.h" |
37 | 38 |
38 #ifdef V8_INSPECTOR_ENABLED | 39 #ifdef V8_INSPECTOR_ENABLED |
39 #include "include/v8-inspector.h" | 40 #include "include/v8-inspector.h" |
40 #endif // V8_INSPECTOR_ENABLED | 41 #endif // V8_INSPECTOR_ENABLED |
41 | 42 |
42 #if !defined(_WIN32) && !defined(_WIN64) | 43 #if !defined(_WIN32) && !defined(_WIN64) |
43 #include <unistd.h> // NOLINT | 44 #include <unistd.h> // NOLINT |
44 #else | 45 #else |
(...skipping 2936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2981 base::SysInfo::AmountOfPhysicalMemory(), | 2982 base::SysInfo::AmountOfPhysicalMemory(), |
2982 base::SysInfo::AmountOfVirtualMemory()); | 2983 base::SysInfo::AmountOfVirtualMemory()); |
2983 | 2984 |
2984 Shell::counter_map_ = new CounterMap(); | 2985 Shell::counter_map_ = new CounterMap(); |
2985 if (i::FLAG_dump_counters || i::FLAG_dump_counters_nvp || i::FLAG_gc_stats) { | 2986 if (i::FLAG_dump_counters || i::FLAG_dump_counters_nvp || i::FLAG_gc_stats) { |
2986 create_params.counter_lookup_callback = LookupCounter; | 2987 create_params.counter_lookup_callback = LookupCounter; |
2987 create_params.create_histogram_callback = CreateHistogram; | 2988 create_params.create_histogram_callback = CreateHistogram; |
2988 create_params.add_histogram_sample_callback = AddHistogramSample; | 2989 create_params.add_histogram_sample_callback = AddHistogramSample; |
2989 } | 2990 } |
2990 | 2991 |
| 2992 if (i::trap_handler::EnableTrapHandler()) { |
| 2993 v8::V8::RegisterDefaultSignalHandler(); |
| 2994 } |
| 2995 |
2991 Isolate* isolate = Isolate::New(create_params); | 2996 Isolate* isolate = Isolate::New(create_params); |
2992 { | 2997 { |
2993 Isolate::Scope scope(isolate); | 2998 Isolate::Scope scope(isolate); |
2994 Initialize(isolate); | 2999 Initialize(isolate); |
2995 PerIsolateData data(isolate); | 3000 PerIsolateData data(isolate); |
2996 | 3001 |
2997 if (options.trace_enabled) { | 3002 if (options.trace_enabled) { |
2998 platform::tracing::TraceConfig* trace_config; | 3003 platform::tracing::TraceConfig* trace_config; |
2999 if (options.trace_config) { | 3004 if (options.trace_config) { |
3000 int size = 0; | 3005 int size = 0; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3077 } | 3082 } |
3078 | 3083 |
3079 } // namespace v8 | 3084 } // namespace v8 |
3080 | 3085 |
3081 | 3086 |
3082 #ifndef GOOGLE3 | 3087 #ifndef GOOGLE3 |
3083 int main(int argc, char* argv[]) { | 3088 int main(int argc, char* argv[]) { |
3084 return v8::Shell::Main(argc, argv); | 3089 return v8::Shell::Main(argc, argv); |
3085 } | 3090 } |
3086 #endif | 3091 #endif |
OLD | NEW |