Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: src/debug/debug.cc

Issue 2744613006: [object] Add Script::IsUserJavaScript(). (Closed)
Patch Set: Rebase. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler.cc ('k') | src/debug/debug-coverage.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1961 matching lines...) Expand 10 before | Expand all | Expand 10 after
1972 if (!shared->computed_debug_is_blackboxed()) { 1972 if (!shared->computed_debug_is_blackboxed()) {
1973 bool is_blackboxed = 1973 bool is_blackboxed =
1974 !shared->IsSubjectToDebugging() || !shared->script()->IsScript(); 1974 !shared->IsSubjectToDebugging() || !shared->script()->IsScript();
1975 if (!is_blackboxed) { 1975 if (!is_blackboxed) {
1976 SuppressDebug while_processing(this); 1976 SuppressDebug while_processing(this);
1977 HandleScope handle_scope(isolate_); 1977 HandleScope handle_scope(isolate_);
1978 PostponeInterruptsScope no_interrupts(isolate_); 1978 PostponeInterruptsScope no_interrupts(isolate_);
1979 DisableBreak no_recursive_break(this); 1979 DisableBreak no_recursive_break(this);
1980 DCHECK(shared->script()->IsScript()); 1980 DCHECK(shared->script()->IsScript());
1981 Handle<Script> script(Script::cast(shared->script())); 1981 Handle<Script> script(Script::cast(shared->script()));
1982 DCHECK(script->type() == i::Script::TYPE_NORMAL); 1982 DCHECK(script->IsUserJavaScript());
1983 debug::Location start = 1983 debug::Location start =
1984 GetDebugLocation(script, shared->start_position()); 1984 GetDebugLocation(script, shared->start_position());
1985 debug::Location end = GetDebugLocation(script, shared->end_position()); 1985 debug::Location end = GetDebugLocation(script, shared->end_position());
1986 is_blackboxed = debug_delegate_->IsFunctionBlackboxed( 1986 is_blackboxed = debug_delegate_->IsFunctionBlackboxed(
1987 ToApiHandle<debug::Script>(script), start, end); 1987 ToApiHandle<debug::Script>(script), start, end);
1988 } 1988 }
1989 shared->set_debug_is_blackboxed(is_blackboxed); 1989 shared->set_debug_is_blackboxed(is_blackboxed);
1990 shared->set_computed_debug_is_blackboxed(true); 1990 shared->set_computed_debug_is_blackboxed(true);
1991 } 1991 }
1992 return shared->debug_is_blackboxed(); 1992 return shared->debug_is_blackboxed();
(...skipping 30 matching lines...) Expand all
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 2028 // Attach the correct debug id to the script. The debug id is used by the
2029 // inspector to filter scripts by native context. 2029 // inspector to filter scripts by native context.
2030 FixedArray* array = isolate_->native_context()->embedder_data(); 2030 FixedArray* array = isolate_->native_context()->embedder_data();
2031 script->set_context_data(array->get(v8::Context::kDebugIdIndex)); 2031 script->set_context_data(array->get(v8::Context::kDebugIdIndex));
2032 if (ignore_events()) return; 2032 if (ignore_events()) return;
2033 if (script->type() != i::Script::TYPE_NORMAL && 2033 if (!script->IsUserJavaScript() && script->type() != i::Script::TYPE_WASM) {
2034 script->type() != i::Script::TYPE_WASM) {
2035 return; 2034 return;
2036 } 2035 }
2037 if (!debug_delegate_) return; 2036 if (!debug_delegate_) return;
2038 SuppressDebug while_processing(this); 2037 SuppressDebug while_processing(this);
2039 DebugScope debug_scope(this); 2038 DebugScope debug_scope(this);
2040 if (debug_scope.failed()) return; 2039 if (debug_scope.failed()) return;
2041 HandleScope scope(isolate_); 2040 HandleScope scope(isolate_);
2042 PostponeInterruptsScope postpone(isolate_); 2041 PostponeInterruptsScope postpone(isolate_);
2043 DisableBreak no_recursive_break(this); 2042 DisableBreak no_recursive_break(this);
2044 debug_delegate_->ScriptCompiled(ToApiHandle<debug::Script>(script), 2043 debug_delegate_->ScriptCompiled(ToApiHandle<debug::Script>(script),
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
2457 isolate_->Throw(*isolate_->factory()->NewEvalError( 2456 isolate_->Throw(*isolate_->factory()->NewEvalError(
2458 MessageTemplate::kNoSideEffectDebugEvaluate)); 2457 MessageTemplate::kNoSideEffectDebugEvaluate));
2459 } 2458 }
2460 isolate_->set_needs_side_effect_check(old_needs_side_effect_check_); 2459 isolate_->set_needs_side_effect_check(old_needs_side_effect_check_);
2461 isolate_->debug()->UpdateHookOnFunctionCall(); 2460 isolate_->debug()->UpdateHookOnFunctionCall();
2462 isolate_->debug()->side_effect_check_failed_ = false; 2461 isolate_->debug()->side_effect_check_failed_ = false;
2463 } 2462 }
2464 2463
2465 } // namespace internal 2464 } // namespace internal
2466 } // namespace v8 2465 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | src/debug/debug-coverage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698