| 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 9055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9066 void debug::PrepareStep(Isolate* v8_isolate, StepAction action) { | 9066 void debug::PrepareStep(Isolate* v8_isolate, StepAction action) { |
| 9067 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); | 9067 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); |
| 9068 ENTER_V8(isolate); | 9068 ENTER_V8(isolate); |
| 9069 CHECK(isolate->debug()->CheckExecutionState()); | 9069 CHECK(isolate->debug()->CheckExecutionState()); |
| 9070 // Clear all current stepping setup. | 9070 // Clear all current stepping setup. |
| 9071 isolate->debug()->ClearStepping(); | 9071 isolate->debug()->ClearStepping(); |
| 9072 // Prepare step. | 9072 // Prepare step. |
| 9073 isolate->debug()->PrepareStep(static_cast<i::StepAction>(action)); | 9073 isolate->debug()->PrepareStep(static_cast<i::StepAction>(action)); |
| 9074 } | 9074 } |
| 9075 | 9075 |
| 9076 void debug::ClearStepping(Isolate* v8_isolate) { |
| 9077 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); |
| 9078 ENTER_V8(isolate); |
| 9079 CHECK(isolate->debug()->CheckExecutionState()); |
| 9080 // Clear all current stepping setup. |
| 9081 isolate->debug()->ClearStepping(); |
| 9082 } |
| 9083 |
| 9076 bool debug::HasNonBlackboxedFrameOnStack(Isolate* v8_isolate) { | 9084 bool debug::HasNonBlackboxedFrameOnStack(Isolate* v8_isolate) { |
| 9077 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); | 9085 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); |
| 9078 ENTER_V8(isolate); | 9086 ENTER_V8(isolate); |
| 9079 i::HandleScope scope(isolate); | 9087 return isolate->debug()->HasNonBlackboxedFrameOnStack(); |
| 9080 for (i::StackTraceFrameIterator it(isolate); !it.done(); it.Advance()) { | |
| 9081 if (!it.is_javascript()) continue; | |
| 9082 if (!isolate->debug()->IsFrameBlackboxed(it.javascript_frame())) { | |
| 9083 return true; | |
| 9084 } | |
| 9085 } | |
| 9086 return false; | |
| 9087 } | 9088 } |
| 9088 | 9089 |
| 9089 v8::Isolate* debug::Script::GetIsolate() const { | 9090 v8::Isolate* debug::Script::GetIsolate() const { |
| 9090 return reinterpret_cast<v8::Isolate*>(Utils::OpenHandle(this)->GetIsolate()); | 9091 return reinterpret_cast<v8::Isolate*>(Utils::OpenHandle(this)->GetIsolate()); |
| 9091 } | 9092 } |
| 9092 | 9093 |
| 9093 ScriptOriginOptions debug::Script::OriginOptions() const { | 9094 ScriptOriginOptions debug::Script::OriginOptions() const { |
| 9094 return Utils::OpenHandle(this)->origin_options(); | 9095 return Utils::OpenHandle(this)->origin_options(); |
| 9095 } | 9096 } |
| 9096 | 9097 |
| (...skipping 1119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10216 Address callback_address = | 10217 Address callback_address = |
| 10217 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 10218 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 10218 VMState<EXTERNAL> state(isolate); | 10219 VMState<EXTERNAL> state(isolate); |
| 10219 ExternalCallbackScope call_scope(isolate, callback_address); | 10220 ExternalCallbackScope call_scope(isolate, callback_address); |
| 10220 callback(info); | 10221 callback(info); |
| 10221 } | 10222 } |
| 10222 | 10223 |
| 10223 | 10224 |
| 10224 } // namespace internal | 10225 } // namespace internal |
| 10225 } // namespace v8 | 10226 } // namespace v8 |
| OLD | NEW |