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/debug/debug.h" | 5 #include "src/debug/debug.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "src/api.h" | 9 #include "src/api.h" |
10 #include "src/arguments.h" | 10 #include "src/arguments.h" |
(...skipping 2048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2059 !IsFrameBlackboxed(it.frame()); | 2059 !IsFrameBlackboxed(it.frame()); |
2060 } | 2060 } |
2061 debug_delegate_->PromiseEventOccurred( | 2061 debug_delegate_->PromiseEventOccurred( |
2062 Utils::ToLocal(debug_scope.GetContext()), type, id, parent_id, | 2062 Utils::ToLocal(debug_scope.GetContext()), type, id, parent_id, |
2063 created_by_user); | 2063 created_by_user); |
2064 } | 2064 } |
2065 | 2065 |
2066 void Debug::ProcessCompileEvent(v8::DebugEvent event, Handle<Script> script) { | 2066 void Debug::ProcessCompileEvent(v8::DebugEvent event, Handle<Script> script) { |
2067 // Attach the correct debug id to the script. The debug id is used by the | 2067 // Attach the correct debug id to the script. The debug id is used by the |
2068 // inspector to filter scripts by native context. | 2068 // inspector to filter scripts by native context. |
2069 FixedArray* array = isolate_->native_context()->embedder_data(); | 2069 script->set_context_data(isolate_->native_context()->debug_context_id()); |
2070 script->set_context_data(array->get(v8::Context::kDebugIdIndex)); | |
2071 if (ignore_events()) return; | 2070 if (ignore_events()) return; |
2072 if (!script->IsUserJavaScript() && script->type() != i::Script::TYPE_WASM) { | 2071 if (!script->IsUserJavaScript() && script->type() != i::Script::TYPE_WASM) { |
2073 return; | 2072 return; |
2074 } | 2073 } |
2075 if (!debug_delegate_) return; | 2074 if (!debug_delegate_) return; |
2076 SuppressDebug while_processing(this); | 2075 SuppressDebug while_processing(this); |
2077 DebugScope debug_scope(this); | 2076 DebugScope debug_scope(this); |
2078 if (debug_scope.failed()) return; | 2077 if (debug_scope.failed()) return; |
2079 HandleScope scope(isolate_); | 2078 HandleScope scope(isolate_); |
2080 PostponeInterruptsScope postpone(isolate_); | 2079 PostponeInterruptsScope postpone(isolate_); |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2495 isolate_->Throw(*isolate_->factory()->NewEvalError( | 2494 isolate_->Throw(*isolate_->factory()->NewEvalError( |
2496 MessageTemplate::kNoSideEffectDebugEvaluate)); | 2495 MessageTemplate::kNoSideEffectDebugEvaluate)); |
2497 } | 2496 } |
2498 isolate_->set_needs_side_effect_check(old_needs_side_effect_check_); | 2497 isolate_->set_needs_side_effect_check(old_needs_side_effect_check_); |
2499 isolate_->debug()->UpdateHookOnFunctionCall(); | 2498 isolate_->debug()->UpdateHookOnFunctionCall(); |
2500 isolate_->debug()->side_effect_check_failed_ = false; | 2499 isolate_->debug()->side_effect_check_failed_ = false; |
2501 } | 2500 } |
2502 | 2501 |
2503 } // namespace internal | 2502 } // namespace internal |
2504 } // namespace v8 | 2503 } // namespace v8 |
OLD | NEW |