| 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 7105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7153 CHECK(params.array_buffer_allocator != NULL); | 7154 CHECK(params.array_buffer_allocator != NULL); |
| 7154 isolate->set_array_buffer_allocator(params.array_buffer_allocator); | 7155 isolate->set_array_buffer_allocator(params.array_buffer_allocator); |
| 7155 if (params.snapshot_blob != NULL) { | 7156 if (params.snapshot_blob != NULL) { |
| 7156 isolate->set_snapshot_blob(params.snapshot_blob); | 7157 isolate->set_snapshot_blob(params.snapshot_blob); |
| 7157 } else { | 7158 } else { |
| 7158 isolate->set_snapshot_blob(i::Snapshot::DefaultSnapshotBlob()); | 7159 isolate->set_snapshot_blob(i::Snapshot::DefaultSnapshotBlob()); |
| 7159 } | 7160 } |
| 7160 if (params.entry_hook) { | 7161 if (params.entry_hook) { |
| 7161 isolate->set_function_entry_hook(params.entry_hook); | 7162 isolate->set_function_entry_hook(params.entry_hook); |
| 7162 } | 7163 } |
| 7163 if (params.code_event_handler) { | 7164 auto code_event_handler = params.code_event_handler; |
| 7165 #ifdef ENABLE_GDB_JIT_INTERFACE |
| 7166 if (code_event_handler == nullptr && i::FLAG_gdbjit) { |
| 7167 code_event_handler = i::GDBJITInterface::EventHandler; |
| 7168 } |
| 7169 #endif // ENABLE_GDB_JIT_INTERFACE |
| 7170 if (code_event_handler) { |
| 7164 isolate->InitializeLoggingAndCounters(); | 7171 isolate->InitializeLoggingAndCounters(); |
| 7165 isolate->logger()->SetCodeEventHandler(kJitCodeEventDefault, | 7172 isolate->logger()->SetCodeEventHandler(kJitCodeEventDefault, |
| 7166 params.code_event_handler); | 7173 code_event_handler); |
| 7167 } | 7174 } |
| 7168 if (params.counter_lookup_callback) { | 7175 if (params.counter_lookup_callback) { |
| 7169 v8_isolate->SetCounterFunction(params.counter_lookup_callback); | 7176 v8_isolate->SetCounterFunction(params.counter_lookup_callback); |
| 7170 } | 7177 } |
| 7171 | 7178 |
| 7172 if (params.create_histogram_callback) { | 7179 if (params.create_histogram_callback) { |
| 7173 v8_isolate->SetCreateHistogramFunction(params.create_histogram_callback); | 7180 v8_isolate->SetCreateHistogramFunction(params.create_histogram_callback); |
| 7174 } | 7181 } |
| 7175 | 7182 |
| 7176 if (params.add_histogram_sample_callback) { | 7183 if (params.add_histogram_sample_callback) { |
| (...skipping 1407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8584 Address callback_address = | 8591 Address callback_address = |
| 8585 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8592 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 8586 VMState<EXTERNAL> state(isolate); | 8593 VMState<EXTERNAL> state(isolate); |
| 8587 ExternalCallbackScope call_scope(isolate, callback_address); | 8594 ExternalCallbackScope call_scope(isolate, callback_address); |
| 8588 callback(info); | 8595 callback(info); |
| 8589 } | 8596 } |
| 8590 | 8597 |
| 8591 | 8598 |
| 8592 } // namespace internal | 8599 } // namespace internal |
| 8593 } // namespace v8 | 8600 } // namespace v8 |
| OLD | NEW |