| 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 17 matching lines...) Expand all Loading... |
| 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/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/interpreter/interpreter.h" | 33 #include "src/interpreter/interpreter.h" |
| 34 #include "src/list-inl.h" | 34 #include "src/list-inl.h" |
| 35 #include "src/msan.h" | 35 #include "src/msan.h" |
| 36 #include "src/objects-inl.h" | 36 #include "src/objects-inl.h" |
| 37 #include "src/snapshot/natives.h" | 37 #include "src/snapshot/natives.h" |
| 38 #include "src/trap-handler/trap-handler.h" |
| 38 #include "src/utils.h" | 39 #include "src/utils.h" |
| 39 #include "src/v8.h" | 40 #include "src/v8.h" |
| 40 | 41 |
| 41 #ifdef V8_INSPECTOR_ENABLED | 42 #ifdef V8_INSPECTOR_ENABLED |
| 42 #include "include/v8-inspector.h" | 43 #include "include/v8-inspector.h" |
| 43 #endif // V8_INSPECTOR_ENABLED | 44 #endif // V8_INSPECTOR_ENABLED |
| 44 | 45 |
| 45 #if !defined(_WIN32) && !defined(_WIN64) | 46 #if !defined(_WIN32) && !defined(_WIN64) |
| 46 #include <unistd.h> // NOLINT | 47 #include <unistd.h> // NOLINT |
| 47 #else | 48 #else |
| (...skipping 2784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2832 base::SysInfo::AmountOfPhysicalMemory(), | 2833 base::SysInfo::AmountOfPhysicalMemory(), |
| 2833 base::SysInfo::AmountOfVirtualMemory()); | 2834 base::SysInfo::AmountOfVirtualMemory()); |
| 2834 | 2835 |
| 2835 Shell::counter_map_ = new CounterMap(); | 2836 Shell::counter_map_ = new CounterMap(); |
| 2836 if (i::FLAG_dump_counters || i::FLAG_dump_counters_nvp || i::FLAG_gc_stats) { | 2837 if (i::FLAG_dump_counters || i::FLAG_dump_counters_nvp || i::FLAG_gc_stats) { |
| 2837 create_params.counter_lookup_callback = LookupCounter; | 2838 create_params.counter_lookup_callback = LookupCounter; |
| 2838 create_params.create_histogram_callback = CreateHistogram; | 2839 create_params.create_histogram_callback = CreateHistogram; |
| 2839 create_params.add_histogram_sample_callback = AddHistogramSample; | 2840 create_params.add_histogram_sample_callback = AddHistogramSample; |
| 2840 } | 2841 } |
| 2841 | 2842 |
| 2843 if (i::trap_handler::ShouldEnableTrapHandler()) { |
| 2844 if (!v8::V8::RegisterDefaultSignalHandler()) { |
| 2845 fprintf(stderr, "Could not register signal handler"); |
| 2846 exit(1); |
| 2847 } |
| 2848 } |
| 2849 |
| 2842 Isolate* isolate = Isolate::New(create_params); | 2850 Isolate* isolate = Isolate::New(create_params); |
| 2843 { | 2851 { |
| 2844 Isolate::Scope scope(isolate); | 2852 Isolate::Scope scope(isolate); |
| 2845 Initialize(isolate); | 2853 Initialize(isolate); |
| 2846 PerIsolateData data(isolate); | 2854 PerIsolateData data(isolate); |
| 2847 | 2855 |
| 2848 if (options.trace_enabled) { | 2856 if (options.trace_enabled) { |
| 2849 platform::tracing::TraceConfig* trace_config; | 2857 platform::tracing::TraceConfig* trace_config; |
| 2850 if (options.trace_config) { | 2858 if (options.trace_config) { |
| 2851 int size = 0; | 2859 int size = 0; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2928 } | 2936 } |
| 2929 | 2937 |
| 2930 } // namespace v8 | 2938 } // namespace v8 |
| 2931 | 2939 |
| 2932 | 2940 |
| 2933 #ifndef GOOGLE3 | 2941 #ifndef GOOGLE3 |
| 2934 int main(int argc, char* argv[]) { | 2942 int main(int argc, char* argv[]) { |
| 2935 return v8::Shell::Main(argc, argv); | 2943 return v8::Shell::Main(argc, argv); |
| 2936 } | 2944 } |
| 2937 #endif | 2945 #endif |
| OLD | NEW |