| 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 9106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9117 void debug::PrepareStep(Isolate* v8_isolate, StepAction action) { | 9117 void debug::PrepareStep(Isolate* v8_isolate, StepAction action) { |
| 9118 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); | 9118 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); |
| 9119 ENTER_V8(isolate); | 9119 ENTER_V8(isolate); |
| 9120 CHECK(isolate->debug()->CheckExecutionState()); | 9120 CHECK(isolate->debug()->CheckExecutionState()); |
| 9121 // Clear all current stepping setup. | 9121 // Clear all current stepping setup. |
| 9122 isolate->debug()->ClearStepping(); | 9122 isolate->debug()->ClearStepping(); |
| 9123 // Prepare step. | 9123 // Prepare step. |
| 9124 isolate->debug()->PrepareStep(static_cast<i::StepAction>(action)); | 9124 isolate->debug()->PrepareStep(static_cast<i::StepAction>(action)); |
| 9125 } | 9125 } |
| 9126 | 9126 |
| 9127 void debug::ClearStepping(Isolate* v8_isolate) { |
| 9128 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); |
| 9129 ENTER_V8(isolate); |
| 9130 CHECK(isolate->debug()->CheckExecutionState()); |
| 9131 // Clear all current stepping setup. |
| 9132 isolate->debug()->ClearStepping(); |
| 9133 } |
| 9134 |
| 9127 bool debug::HasNonBlackboxedFrameOnStack(Isolate* v8_isolate) { | 9135 bool debug::HasNonBlackboxedFrameOnStack(Isolate* v8_isolate) { |
| 9128 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); | 9136 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); |
| 9129 ENTER_V8(isolate); | 9137 ENTER_V8(isolate); |
| 9130 i::HandleScope scope(isolate); | 9138 return isolate->debug()->HasNonBlackboxedFrameOnStack(); |
| 9131 for (i::StackTraceFrameIterator it(isolate); !it.done(); it.Advance()) { | |
| 9132 if (!it.is_javascript()) continue; | |
| 9133 if (!isolate->debug()->IsFrameBlackboxed(it.javascript_frame())) { | |
| 9134 return true; | |
| 9135 } | |
| 9136 } | |
| 9137 return false; | |
| 9138 } | 9139 } |
| 9139 | 9140 |
| 9140 v8::Isolate* debug::Script::GetIsolate() const { | 9141 v8::Isolate* debug::Script::GetIsolate() const { |
| 9141 return reinterpret_cast<v8::Isolate*>(Utils::OpenHandle(this)->GetIsolate()); | 9142 return reinterpret_cast<v8::Isolate*>(Utils::OpenHandle(this)->GetIsolate()); |
| 9142 } | 9143 } |
| 9143 | 9144 |
| 9144 ScriptOriginOptions debug::Script::OriginOptions() const { | 9145 ScriptOriginOptions debug::Script::OriginOptions() const { |
| 9145 return Utils::OpenHandle(this)->origin_options(); | 9146 return Utils::OpenHandle(this)->origin_options(); |
| 9146 } | 9147 } |
| 9147 | 9148 |
| (...skipping 1149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10297 Address callback_address = | 10298 Address callback_address = |
| 10298 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 10299 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 10299 VMState<EXTERNAL> state(isolate); | 10300 VMState<EXTERNAL> state(isolate); |
| 10300 ExternalCallbackScope call_scope(isolate, callback_address); | 10301 ExternalCallbackScope call_scope(isolate, callback_address); |
| 10301 callback(info); | 10302 callback(info); |
| 10302 } | 10303 } |
| 10303 | 10304 |
| 10304 | 10305 |
| 10305 } // namespace internal | 10306 } // namespace internal |
| 10306 } // namespace v8 | 10307 } // namespace v8 |
| OLD | NEW |