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 18 matching lines...) Expand all Loading... |
29 #include "src/base/platform/platform.h" | 29 #include "src/base/platform/platform.h" |
30 #include "src/base/platform/time.h" | 30 #include "src/base/platform/time.h" |
31 #include "src/base/sys-info.h" | 31 #include "src/base/sys-info.h" |
32 #include "src/basic-block-profiler.h" | 32 #include "src/basic-block-profiler.h" |
33 #include "src/debug/debug-interface.h" | 33 #include "src/debug/debug-interface.h" |
34 #include "src/interpreter/interpreter.h" | 34 #include "src/interpreter/interpreter.h" |
35 #include "src/list-inl.h" | 35 #include "src/list-inl.h" |
36 #include "src/msan.h" | 36 #include "src/msan.h" |
37 #include "src/objects-inl.h" | 37 #include "src/objects-inl.h" |
38 #include "src/snapshot/natives.h" | 38 #include "src/snapshot/natives.h" |
39 #include "src/trap-handler/trap-handler.h" | |
40 #include "src/utils.h" | 39 #include "src/utils.h" |
41 #include "src/v8.h" | 40 #include "src/v8.h" |
42 | 41 |
43 #ifdef V8_INSPECTOR_ENABLED | 42 #ifdef V8_INSPECTOR_ENABLED |
44 #include "include/v8-inspector.h" | 43 #include "include/v8-inspector.h" |
45 #endif // V8_INSPECTOR_ENABLED | 44 #endif // V8_INSPECTOR_ENABLED |
46 | 45 |
47 #if !defined(_WIN32) && !defined(_WIN64) | 46 #if !defined(_WIN32) && !defined(_WIN64) |
48 #include <unistd.h> // NOLINT | 47 #include <unistd.h> // NOLINT |
49 #else | 48 #else |
(...skipping 2887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2937 base::SysInfo::AmountOfPhysicalMemory(), | 2936 base::SysInfo::AmountOfPhysicalMemory(), |
2938 base::SysInfo::AmountOfVirtualMemory()); | 2937 base::SysInfo::AmountOfVirtualMemory()); |
2939 | 2938 |
2940 Shell::counter_map_ = new CounterMap(); | 2939 Shell::counter_map_ = new CounterMap(); |
2941 if (i::FLAG_dump_counters || i::FLAG_dump_counters_nvp || i::FLAG_gc_stats) { | 2940 if (i::FLAG_dump_counters || i::FLAG_dump_counters_nvp || i::FLAG_gc_stats) { |
2942 create_params.counter_lookup_callback = LookupCounter; | 2941 create_params.counter_lookup_callback = LookupCounter; |
2943 create_params.create_histogram_callback = CreateHistogram; | 2942 create_params.create_histogram_callback = CreateHistogram; |
2944 create_params.add_histogram_sample_callback = AddHistogramSample; | 2943 create_params.add_histogram_sample_callback = AddHistogramSample; |
2945 } | 2944 } |
2946 | 2945 |
2947 if (i::trap_handler::UseTrapHandler()) { | |
2948 if (!v8::V8::RegisterDefaultSignalHandler()) { | |
2949 fprintf(stderr, "Could not register signal handler"); | |
2950 exit(1); | |
2951 } | |
2952 } | |
2953 | |
2954 Isolate* isolate = Isolate::New(create_params); | 2946 Isolate* isolate = Isolate::New(create_params); |
2955 { | 2947 { |
2956 Isolate::Scope scope(isolate); | 2948 Isolate::Scope scope(isolate); |
2957 Initialize(isolate); | 2949 Initialize(isolate); |
2958 PerIsolateData data(isolate); | 2950 PerIsolateData data(isolate); |
2959 | 2951 |
2960 if (options.trace_enabled) { | 2952 if (options.trace_enabled) { |
2961 platform::tracing::TraceConfig* trace_config; | 2953 platform::tracing::TraceConfig* trace_config; |
2962 if (options.trace_config) { | 2954 if (options.trace_config) { |
2963 int size = 0; | 2955 int size = 0; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3033 } | 3025 } |
3034 | 3026 |
3035 } // namespace v8 | 3027 } // namespace v8 |
3036 | 3028 |
3037 | 3029 |
3038 #ifndef GOOGLE3 | 3030 #ifndef GOOGLE3 |
3039 int main(int argc, char* argv[]) { | 3031 int main(int argc, char* argv[]) { |
3040 return v8::Shell::Main(argc, argv); | 3032 return v8::Shell::Main(argc, argv); |
3041 } | 3033 } |
3042 #endif | 3034 #endif |
OLD | NEW |