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 "src/api.h" | 5 #include "src/api.h" |
6 | 6 |
7 #include <string.h> // For memcpy, strlen. | 7 #include <string.h> // For memcpy, strlen. |
8 #ifdef V8_USE_ADDRESS_SANITIZER | 8 #ifdef V8_USE_ADDRESS_SANITIZER |
9 #include <sanitizer/asan_interface.h> | 9 #include <sanitizer/asan_interface.h> |
10 #endif // V8_USE_ADDRESS_SANITIZER | 10 #endif // V8_USE_ADDRESS_SANITIZER |
(...skipping 17 matching lines...) Expand all Loading... | |
28 #include "src/char-predicates-inl.h" | 28 #include "src/char-predicates-inl.h" |
29 #include "src/code-stubs.h" | 29 #include "src/code-stubs.h" |
30 #include "src/compiler.h" | 30 #include "src/compiler.h" |
31 #include "src/context-measure.h" | 31 #include "src/context-measure.h" |
32 #include "src/contexts.h" | 32 #include "src/contexts.h" |
33 #include "src/conversions-inl.h" | 33 #include "src/conversions-inl.h" |
34 #include "src/counters.h" | 34 #include "src/counters.h" |
35 #include "src/debug/debug.h" | 35 #include "src/debug/debug.h" |
36 #include "src/deoptimizer.h" | 36 #include "src/deoptimizer.h" |
37 #include "src/execution.h" | 37 #include "src/execution.h" |
38 #include "src/gdb-jit.h" | |
38 #include "src/global-handles.h" | 39 #include "src/global-handles.h" |
39 #include "src/icu_util.h" | 40 #include "src/icu_util.h" |
40 #include "src/isolate-inl.h" | 41 #include "src/isolate-inl.h" |
41 #include "src/json-parser.h" | 42 #include "src/json-parser.h" |
42 #include "src/messages.h" | 43 #include "src/messages.h" |
43 #include "src/parsing/parser.h" | 44 #include "src/parsing/parser.h" |
44 #include "src/parsing/scanner-character-streams.h" | 45 #include "src/parsing/scanner-character-streams.h" |
45 #include "src/pending-compilation-error-handler.h" | 46 #include "src/pending-compilation-error-handler.h" |
46 #include "src/profiler/cpu-profiler.h" | 47 #include "src/profiler/cpu-profiler.h" |
47 #include "src/profiler/heap-profiler.h" | 48 #include "src/profiler/heap-profiler.h" |
(...skipping 7104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7152 CHECK(params.array_buffer_allocator != NULL); | 7153 CHECK(params.array_buffer_allocator != NULL); |
7153 isolate->set_array_buffer_allocator(params.array_buffer_allocator); | 7154 isolate->set_array_buffer_allocator(params.array_buffer_allocator); |
7154 if (params.snapshot_blob != NULL) { | 7155 if (params.snapshot_blob != NULL) { |
7155 isolate->set_snapshot_blob(params.snapshot_blob); | 7156 isolate->set_snapshot_blob(params.snapshot_blob); |
7156 } else { | 7157 } else { |
7157 isolate->set_snapshot_blob(i::Snapshot::DefaultSnapshotBlob()); | 7158 isolate->set_snapshot_blob(i::Snapshot::DefaultSnapshotBlob()); |
7158 } | 7159 } |
7159 if (params.entry_hook) { | 7160 if (params.entry_hook) { |
7160 isolate->set_function_entry_hook(params.entry_hook); | 7161 isolate->set_function_entry_hook(params.entry_hook); |
7161 } | 7162 } |
7162 if (params.code_event_handler) { | 7163 auto code_event_handler = params.code_event_handler; |
7164 if (code_event_handler == nullptr && i::FLAG_gdbjit) { | |
Yang
2016/02/18 22:25:34
could we have the ifdef around the if-statement?
noordhuis
2016/02/19 08:24:43
The idea here was to keep the dead code if !define
Yang
2016/02/19 08:29:38
I still think it's nicer to get rid of the if-stat
| |
7165 #ifdef ENABLE_GDB_JIT_INTERFACE | |
7166 code_event_handler = i::GDBJITInterface::EventHandler; | |
7167 #endif | |
7168 } | |
7169 if (code_event_handler) { | |
7163 isolate->InitializeLoggingAndCounters(); | 7170 isolate->InitializeLoggingAndCounters(); |
7164 isolate->logger()->SetCodeEventHandler(kJitCodeEventDefault, | 7171 isolate->logger()->SetCodeEventHandler(kJitCodeEventDefault, |
7165 params.code_event_handler); | 7172 code_event_handler); |
7166 } | 7173 } |
7167 if (params.counter_lookup_callback) { | 7174 if (params.counter_lookup_callback) { |
7168 v8_isolate->SetCounterFunction(params.counter_lookup_callback); | 7175 v8_isolate->SetCounterFunction(params.counter_lookup_callback); |
7169 } | 7176 } |
7170 | 7177 |
7171 if (params.create_histogram_callback) { | 7178 if (params.create_histogram_callback) { |
7172 v8_isolate->SetCreateHistogramFunction(params.create_histogram_callback); | 7179 v8_isolate->SetCreateHistogramFunction(params.create_histogram_callback); |
7173 } | 7180 } |
7174 | 7181 |
7175 if (params.add_histogram_sample_callback) { | 7182 if (params.add_histogram_sample_callback) { |
(...skipping 1380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8556 Address callback_address = | 8563 Address callback_address = |
8557 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8564 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
8558 VMState<EXTERNAL> state(isolate); | 8565 VMState<EXTERNAL> state(isolate); |
8559 ExternalCallbackScope call_scope(isolate, callback_address); | 8566 ExternalCallbackScope call_scope(isolate, callback_address); |
8560 callback(info); | 8567 callback(info); |
8561 } | 8568 } |
8562 | 8569 |
8563 | 8570 |
8564 } // namespace internal | 8571 } // namespace internal |
8565 } // namespace v8 | 8572 } // namespace v8 |
OLD | NEW |