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 2007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2018 created_by_user = | 2018 created_by_user = |
2019 !it.done() && | 2019 !it.done() && |
2020 !IsFrameBlackboxed(it.frame()); | 2020 !IsFrameBlackboxed(it.frame()); |
2021 } | 2021 } |
2022 debug_delegate_->PromiseEventOccurred( | 2022 debug_delegate_->PromiseEventOccurred( |
2023 Utils::ToLocal(debug_scope.GetContext()), type, id, parent_id, | 2023 Utils::ToLocal(debug_scope.GetContext()), type, id, parent_id, |
2024 created_by_user); | 2024 created_by_user); |
2025 } | 2025 } |
2026 | 2026 |
2027 void Debug::ProcessCompileEvent(v8::DebugEvent event, Handle<Script> script) { | 2027 void Debug::ProcessCompileEvent(v8::DebugEvent event, Handle<Script> script) { |
| 2028 // Attach the correct debug id to the script. The debug id is used by the |
| 2029 // inspector to filter scripts by native context. |
| 2030 FixedArray* array = isolate_->native_context()->embedder_data(); |
| 2031 script->set_context_data(array->get(v8::Context::kDebugIdIndex)); |
2028 if (ignore_events()) return; | 2032 if (ignore_events()) return; |
2029 if (script->type() != i::Script::TYPE_NORMAL && | 2033 if (script->type() != i::Script::TYPE_NORMAL && |
2030 script->type() != i::Script::TYPE_WASM) { | 2034 script->type() != i::Script::TYPE_WASM) { |
2031 return; | 2035 return; |
2032 } | 2036 } |
2033 if (!debug_delegate_) return; | 2037 if (!debug_delegate_) return; |
2034 SuppressDebug while_processing(this); | 2038 SuppressDebug while_processing(this); |
2035 DebugScope debug_scope(this); | 2039 DebugScope debug_scope(this); |
2036 if (debug_scope.failed()) return; | 2040 if (debug_scope.failed()) return; |
2037 HandleScope scope(isolate_); | 2041 HandleScope scope(isolate_); |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2451 isolate_->Throw(*isolate_->factory()->NewEvalError( | 2455 isolate_->Throw(*isolate_->factory()->NewEvalError( |
2452 MessageTemplate::kNoSideEffectDebugEvaluate)); | 2456 MessageTemplate::kNoSideEffectDebugEvaluate)); |
2453 } | 2457 } |
2454 isolate_->set_needs_side_effect_check(old_needs_side_effect_check_); | 2458 isolate_->set_needs_side_effect_check(old_needs_side_effect_check_); |
2455 isolate_->debug()->UpdateHookOnFunctionCall(); | 2459 isolate_->debug()->UpdateHookOnFunctionCall(); |
2456 isolate_->debug()->side_effect_check_failed_ = false; | 2460 isolate_->debug()->side_effect_check_failed_ = false; |
2457 } | 2461 } |
2458 | 2462 |
2459 } // namespace internal | 2463 } // namespace internal |
2460 } // namespace v8 | 2464 } // namespace v8 |
OLD | NEW |