diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-12 14:27:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:35:20 +0000 |
commit | c30a6232df03e1efbd9f3b226777b07e087a1122 (patch) | |
tree | e992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/v8/src/debug | |
parent | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff) | |
download | qtwebengine-chromium-85-based.tar.gz |
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/v8/src/debug')
-rw-r--r-- | chromium/v8/src/debug/debug-coverage.cc | 4 | ||||
-rw-r--r-- | chromium/v8/src/debug/debug-evaluate.cc | 35 | ||||
-rw-r--r-- | chromium/v8/src/debug/debug-evaluate.h | 2 | ||||
-rw-r--r-- | chromium/v8/src/debug/debug-frames.cc | 1 | ||||
-rw-r--r-- | chromium/v8/src/debug/debug-interface.h | 10 | ||||
-rw-r--r-- | chromium/v8/src/debug/debug-scopes.cc | 96 | ||||
-rw-r--r-- | chromium/v8/src/debug/debug-scopes.h | 12 | ||||
-rw-r--r-- | chromium/v8/src/debug/debug.cc | 7 | ||||
-rw-r--r-- | chromium/v8/src/debug/liveedit.cc | 20 | ||||
-rw-r--r-- | chromium/v8/src/debug/wasm/gdb-server/wasm-module-debug.cc | 3 |
10 files changed, 105 insertions, 85 deletions
diff --git a/chromium/v8/src/debug/debug-coverage.cc b/chromium/v8/src/debug/debug-coverage.cc index 9b359fde36e..f4355d9a66c 100644 --- a/chromium/v8/src/debug/debug-coverage.cc +++ b/chromium/v8/src/debug/debug-coverage.cc @@ -793,7 +793,9 @@ void Coverage::SelectMode(Isolate* isolate, debug::CoverageMode mode) { } for (Handle<JSFunction> func : funcs_needing_feedback_vector) { - JSFunction::EnsureFeedbackVector(func); + IsCompiledScope is_compiled_scope(func->shared().is_compiled_scope()); + CHECK(is_compiled_scope.is_compiled()); + JSFunction::EnsureFeedbackVector(func, &is_compiled_scope); } // Root all feedback vectors to avoid early collection. diff --git a/chromium/v8/src/debug/debug-evaluate.cc b/chromium/v8/src/debug/debug-evaluate.cc index 473bac1bf99..21b709325fc 100644 --- a/chromium/v8/src/debug/debug-evaluate.cc +++ b/chromium/v8/src/debug/debug-evaluate.cc @@ -189,10 +189,10 @@ DebugEvaluate::ContextBuilder::ContextBuilder(Isolate* isolate, // - Between the function scope and the native context, we only resolve // variable names that are guaranteed to not be shadowed by stack-allocated // variables. Contexts between the function context and the original - // context have a blacklist attached to implement that. + // context have a blocklist attached to implement that. // Context::Lookup has special handling for debug-evaluate contexts: // - Look up in the materialized stack variables. - // - Check the blacklist to find out whether to abort further lookup. + // - Check the blocklist to find out whether to abort further lookup. // - Look up in the original context. for (; !scope_iterator_.Done(); scope_iterator_.Next()) { ScopeIterator::ScopeType scope_type = scope_iterator_.Type(); @@ -208,7 +208,7 @@ DebugEvaluate::ContextBuilder::ContextBuilder(Isolate* isolate, context_chain_element.wrapped_context = scope_iterator_.CurrentContext(); } if (!scope_iterator_.InInnerScope()) { - context_chain_element.blacklist = scope_iterator_.GetLocals(); + context_chain_element.blocklist = scope_iterator_.GetLocals(); } context_chain_.push_back(context_chain_element); } @@ -224,7 +224,7 @@ DebugEvaluate::ContextBuilder::ContextBuilder(Isolate* isolate, scope_info->SetIsDebugEvaluateScope(); evaluation_context_ = factory->NewDebugEvaluateContext( evaluation_context_, scope_info, element.materialized_object, - element.wrapped_context, element.blacklist); + element.wrapped_context, element.blocklist); } } @@ -254,7 +254,7 @@ namespace { bool IntrinsicHasNoSideEffect(Runtime::FunctionId id) { // Use macro to include only the non-inlined version of an intrinsic. -#define INTRINSIC_WHITELIST(V) \ +#define INTRINSIC_ALLOWLIST(V) \ /* Conversions */ \ V(NumberToStringSlow) \ V(ToBigInt) \ @@ -357,8 +357,8 @@ bool IntrinsicHasNoSideEffect(Runtime::FunctionId id) { V(OptimizeOsr) \ V(UnblockConcurrentRecompilation) -// Intrinsics with inline versions have to be whitelisted here a second time. -#define INLINE_INTRINSIC_WHITELIST(V) \ +// Intrinsics with inline versions have to be allowlisted here a second time. +#define INLINE_INTRINSIC_ALLOWLIST(V) \ V(Call) \ V(IsJSReceiver) \ V(AsyncFunctionEnter) \ @@ -368,8 +368,8 @@ bool IntrinsicHasNoSideEffect(Runtime::FunctionId id) { #define CASE(Name) case Runtime::k##Name: #define INLINE_CASE(Name) case Runtime::kInline##Name: switch (id) { - INTRINSIC_WHITELIST(CASE) - INLINE_INTRINSIC_WHITELIST(INLINE_CASE) + INTRINSIC_ALLOWLIST(CASE) + INLINE_INTRINSIC_ALLOWLIST(INLINE_CASE) return true; default: if (FLAG_trace_side_effect_free_debug_evaluate) { @@ -381,8 +381,8 @@ bool IntrinsicHasNoSideEffect(Runtime::FunctionId id) { #undef CASE #undef INLINE_CASE -#undef INTRINSIC_WHITELIST -#undef INLINE_INTRINSIC_WHITELIST +#undef INTRINSIC_ALLOWLIST +#undef INLINE_INTRINSIC_ALLOWLIST } bool BytecodeHasNoSideEffect(interpreter::Bytecode bytecode) { @@ -393,7 +393,7 @@ bool BytecodeHasNoSideEffect(interpreter::Bytecode bytecode) { if (Bytecodes::IsJumpIfToBoolean(bytecode)) return true; if (Bytecodes::IsPrefixScalingBytecode(bytecode)) return true; switch (bytecode) { - // Whitelist for bytecodes. + // Allowlist for bytecodes. // Loads. case Bytecode::kLdaLookupSlot: case Bytecode::kLdaGlobal: @@ -496,7 +496,7 @@ bool BytecodeHasNoSideEffect(interpreter::Bytecode bytecode) { DebugInfo::SideEffectState BuiltinGetSideEffectState(Builtins::Name id) { switch (id) { - // Whitelist for builtins. + // Allowlist for builtins. // Object builtins. case Builtins::kObjectConstructor: case Builtins::kObjectCreate: @@ -672,7 +672,6 @@ DebugInfo::SideEffectState BuiltinGetSideEffectState(Builtins::Name id) { case Builtins::kMathMax: case Builtins::kMathMin: case Builtins::kMathPow: - case Builtins::kMathRandom: case Builtins::kMathRound: case Builtins::kMathSign: case Builtins::kMathSin: @@ -862,7 +861,7 @@ DebugInfo::SideEffectState DebugEvaluate::FunctionGetSideEffectState( DCHECK(info->is_compiled()); DCHECK(!info->needs_script_context()); if (info->HasBytecodeArray()) { - // Check bytecodes against whitelist. + // Check bytecodes against allowlist. Handle<BytecodeArray> bytecode_array(info->GetBytecodeArray(), isolate); if (FLAG_trace_side_effect_free_debug_evaluate) { bytecode_array->Print(); @@ -892,7 +891,7 @@ DebugInfo::SideEffectState DebugEvaluate::FunctionGetSideEffectState( interpreter::Bytecodes::ToString(bytecode)); } - // Did not match whitelist. + // Did not match allowlist. return DebugInfo::kHasSideEffects; } return requires_runtime_checks ? DebugInfo::kRequiresRuntimeChecks @@ -904,7 +903,7 @@ DebugInfo::SideEffectState DebugEvaluate::FunctionGetSideEffectState( : DebugInfo::kHasSideEffects; } } else { - // Check built-ins against whitelist. + // Check built-ins against allowlist. int builtin_index = info->HasBuiltinId() ? info->builtin_id() : Builtins::kNoBuiltinId; if (!Builtins::IsBuiltinId(builtin_index)) @@ -1054,7 +1053,7 @@ void DebugEvaluate::VerifyTransitiveBuiltins(Isolate* isolate) { sanity_check = true; continue; } - PrintF("Whitelisted builtin %s calls non-whitelisted builtin %s\n", + PrintF("Allowlisted builtin %s calls non-allowlisted builtin %s\n", Builtins::name(caller), Builtins::name(callee)); failed = true; } diff --git a/chromium/v8/src/debug/debug-evaluate.h b/chromium/v8/src/debug/debug-evaluate.h index 516a0dac7c2..608466e4860 100644 --- a/chromium/v8/src/debug/debug-evaluate.h +++ b/chromium/v8/src/debug/debug-evaluate.h @@ -84,7 +84,7 @@ class DebugEvaluate : public AllStatic { struct ContextChainElement { Handle<Context> wrapped_context; Handle<JSObject> materialized_object; - Handle<StringSet> blacklist; + Handle<StringSet> blocklist; }; Handle<Context> evaluation_context_; diff --git a/chromium/v8/src/debug/debug-frames.cc b/chromium/v8/src/debug/debug-frames.cc index 3f79f5ee3f8..d0ee6bda42a 100644 --- a/chromium/v8/src/debug/debug-frames.cc +++ b/chromium/v8/src/debug/debug-frames.cc @@ -6,7 +6,6 @@ #include "src/builtins/accessors.h" #include "src/execution/frames-inl.h" -#include "src/wasm/wasm-interpreter.h" #include "src/wasm/wasm-objects-inl.h" namespace v8 { diff --git a/chromium/v8/src/debug/debug-interface.h b/chromium/v8/src/debug/debug-interface.h index 3a46cf9b391..e52bd1ba2a2 100644 --- a/chromium/v8/src/debug/debug-interface.h +++ b/chromium/v8/src/debug/debug-interface.h @@ -528,6 +528,7 @@ class PostponeInterruptsScope { class WeakMap : public v8::Object { public: + WeakMap() = delete; V8_EXPORT_PRIVATE V8_WARN_UNUSED_RESULT v8::MaybeLocal<v8::Value> Get( v8::Local<v8::Context> context, v8::Local<v8::Value> key); V8_EXPORT_PRIVATE V8_WARN_UNUSED_RESULT v8::MaybeLocal<WeakMap> Set( @@ -536,9 +537,6 @@ class WeakMap : public v8::Object { V8_EXPORT_PRIVATE static Local<WeakMap> New(v8::Isolate* isolate); V8_INLINE static WeakMap* Cast(Value* obj); - - private: - WeakMap(); }; /** @@ -549,6 +547,7 @@ class WeakMap : public v8::Object { */ class V8_EXPORT_PRIVATE AccessorPair : public v8::Value { public: + AccessorPair() = delete; v8::Local<v8::Value> getter(); v8::Local<v8::Value> setter(); @@ -556,7 +555,6 @@ class V8_EXPORT_PRIVATE AccessorPair : public v8::Value { V8_INLINE static AccessorPair* Cast(v8::Value* obj); private: - AccessorPair(); static void CheckCast(v8::Value* obj); }; @@ -596,17 +594,17 @@ class PropertyIterator { // Wrapper around v8::internal::WasmValue. class V8_EXPORT_PRIVATE WasmValue : public v8::Value { public: + WasmValue() = delete; static bool IsWasmValue(v8::Local<v8::Value> obj); V8_INLINE static WasmValue* Cast(v8::Value* obj); int value_type(); // Get the underlying values as a byte array, this is only valid if value_type // is i32, i64, f32, f64, or s128. v8::Local<v8::Array> bytes(); - // Get the underlying anyref, only valid if value_type is anyref. + // Get the underlying externref, only valid if value_type is externref. v8::Local<v8::Value> ref(); private: - WasmValue(); static void CheckCast(v8::Value* obj); }; diff --git a/chromium/v8/src/debug/debug-scopes.cc b/chromium/v8/src/debug/debug-scopes.cc index 6b838a69af0..3afbcfd309e 100644 --- a/chromium/v8/src/debug/debug-scopes.cc +++ b/chromium/v8/src/debug/debug-scopes.cc @@ -269,8 +269,9 @@ void ScopeIterator::TryParseAndRetrieveScopes(ReparseStrategy strategy) { const bool parse_result = flags.is_toplevel() ? parsing::ParseProgram(info_.get(), script, maybe_outer_scope, - isolate_) - : parsing::ParseFunction(info_.get(), shared_info, isolate_); + isolate_, parsing::ReportStatisticsMode::kNo) + : parsing::ParseFunction(info_.get(), shared_info, isolate_, + parsing::ReportStatisticsMode::kNo); if (parse_result) { DeclarationScope* literal_scope = info_->literal()->scope(); @@ -300,14 +301,13 @@ void ScopeIterator::TryParseAndRetrieveScopes(ReparseStrategy strategy) { UnwrapEvaluationContext(); } else { // A failed reparse indicates that the preparser has diverged from the - // parser or that the preparse data given to the initial parse has been - // faulty. We fail in debug mode but in release mode we only provide the - // information we get from the context chain but nothing about - // completely stack allocated scopes or stack allocated locals. - // Or it could be due to stack overflow. + // parser, that the preparse data given to the initial parse was faulty, or + // a stack overflow. + // TODO(leszeks): This error is pretty unexpected, so we could report the + // error in debug mode. Better to not fail in release though, in case it's + // just a stack overflow. + // Silently fail by presenting an empty context chain. - CHECK(isolate_->has_pending_exception()); - isolate_->clear_pending_exception(); context_ = Handle<Context>(); } } @@ -373,7 +373,8 @@ bool ScopeIterator::DeclaresLocals(Mode mode) const { if (type == ScopeTypeGlobal) return mode == Mode::ALL; bool declares_local = false; - auto visitor = [&](Handle<String> name, Handle<Object> value) { + auto visitor = [&](Handle<String> name, Handle<Object> value, + ScopeType scope_type) { declares_local = true; return true; }; @@ -421,7 +422,7 @@ void ScopeIterator::AdvanceContext() { // While advancing one context, we need to advance at least one // scope, but until we hit the next scope that actually requires // a context. All the locals collected along the way build the - // blacklist for debug-evaluate for this context. + // blocklist for debug-evaluate for this context. locals_ = StringSet::New(isolate_); do { if (!current_scope_ || !current_scope_->outer_scope()) break; @@ -462,7 +463,7 @@ void ScopeIterator::Next() { if (leaving_closure) { DCHECK(current_scope_ != closure_scope_); // Edge case when we just go past {closure_scope_}. This case - // already needs to start collecting locals for the blacklist. + // already needs to start collecting locals for the blocklist. locals_ = StringSet::New(isolate_); CollectLocalsFromCurrentScope(); } @@ -546,7 +547,18 @@ Handle<JSObject> ScopeIterator::ScopeObject(Mode mode) { } Handle<JSObject> scope = isolate_->factory()->NewJSObjectWithNullProto(); - auto visitor = [=](Handle<String> name, Handle<Object> value) { + auto visitor = [=](Handle<String> name, Handle<Object> value, + ScopeType scope_type) { + if (value->IsTheHole(isolate_)) { + // Reflect variables under TDZ as undefined in scope object. + if (scope_type == ScopeTypeScript && + JSReceiver::HasOwnProperty(scope, name).FromMaybe(true)) { + // We also use the hole to represent overridden let-declarations via + // REPL mode in a script context. Catch this case. + return false; + } + value = isolate_->factory()->undefined_value(); + } JSObject::AddProperty(isolate_, scope, name, value, NONE); return false; }; @@ -562,10 +574,10 @@ void ScopeIterator::VisitScope(const Visitor& visitor, Mode mode) const { case ScopeTypeCatch: case ScopeTypeBlock: case ScopeTypeEval: - return VisitLocalScope(visitor, mode); + return VisitLocalScope(visitor, mode, Type()); case ScopeTypeModule: if (InInnerScope()) { - return VisitLocalScope(visitor, mode); + return VisitLocalScope(visitor, mode, Type()); } DCHECK_EQ(Mode::ALL, mode); return VisitModuleScope(visitor); @@ -714,7 +726,8 @@ void ScopeIterator::VisitScriptScope(const Visitor& visitor) const { Handle<Context> context = ScriptContextTable::GetContext( isolate_, script_contexts, context_index); Handle<ScopeInfo> scope_info(context->scope_info(), isolate_); - if (VisitContextLocals(visitor, scope_info, context)) return; + if (VisitContextLocals(visitor, scope_info, context, ScopeTypeScript)) + return; } } @@ -722,7 +735,8 @@ void ScopeIterator::VisitModuleScope(const Visitor& visitor) const { DCHECK(context_->IsModuleContext()); Handle<ScopeInfo> scope_info(context_->scope_info(), isolate_); - if (VisitContextLocals(visitor, scope_info, context_)) return; + if (VisitContextLocals(visitor, scope_info, context_, ScopeTypeModule)) + return; int count_index = scope_info->ModuleVariableCountIndex(); int module_variable_count = Smi::cast(scope_info->get(count_index)).value(); @@ -741,29 +755,27 @@ void ScopeIterator::VisitModuleScope(const Visitor& visitor) const { Handle<Object> value = SourceTextModule::LoadVariable(isolate_, module, index); - // Reflect variables under TDZ as undeclared in scope object. - if (value->IsTheHole(isolate_)) continue; - if (visitor(name, value)) return; + if (visitor(name, value, ScopeTypeModule)) return; } } bool ScopeIterator::VisitContextLocals(const Visitor& visitor, Handle<ScopeInfo> scope_info, - Handle<Context> context) const { + Handle<Context> context, + ScopeType scope_type) const { // Fill all context locals to the context extension. for (int i = 0; i < scope_info->ContextLocalCount(); ++i) { Handle<String> name(scope_info->ContextLocalName(i), isolate_); if (ScopeInfo::VariableIsSynthetic(*name)) continue; int context_index = scope_info->ContextHeaderLength() + i; Handle<Object> value(context->get(context_index), isolate_); - // Reflect variables under TDZ as undefined in scope object. - if (value->IsTheHole(isolate_)) continue; - if (visitor(name, value)) return true; + if (visitor(name, value, scope_type)) return true; } return false; } -bool ScopeIterator::VisitLocals(const Visitor& visitor, Mode mode) const { +bool ScopeIterator::VisitLocals(const Visitor& visitor, Mode mode, + ScopeType scope_type) const { if (mode == Mode::STACK && current_scope_->is_declaration_scope() && current_scope_->AsDeclarationScope()->has_this_declaration()) { // TODO(bmeurer): We should refactor the general variable lookup @@ -776,10 +788,11 @@ bool ScopeIterator::VisitLocals(const Visitor& visitor, Mode mode) const { : frame_inspector_ == nullptr ? handle(generator_->receiver(), isolate_) : frame_inspector_->GetReceiver(); - if (receiver->IsOptimizedOut(isolate_) || receiver->IsTheHole(isolate_)) { + if (receiver->IsOptimizedOut(isolate_)) { receiver = isolate_->factory()->undefined_value(); } - if (visitor(isolate_->factory()->this_string(), receiver)) return true; + if (visitor(isolate_->factory()->this_string(), receiver, scope_type)) + return true; } if (current_scope_->is_function_scope()) { @@ -790,7 +803,7 @@ bool ScopeIterator::VisitLocals(const Visitor& visitor, Mode mode) const { ? function_ : frame_inspector_->GetFunction(); Handle<String> name = function_var->name(); - if (visitor(name, function)) return true; + if (visitor(name, function, scope_type)) return true; } } @@ -839,9 +852,6 @@ bool ScopeIterator::VisitLocals(const Visitor& visitor, Mode mode) const { index += parameter_count; DCHECK_LT(index, parameters_and_registers.length()); value = handle(parameters_and_registers.get(index), isolate_); - if (value->IsTheHole(isolate_)) { - value = isolate_->factory()->undefined_value(); - } } else { value = frame_inspector_->GetExpression(index); if (value->IsOptimizedOut(isolate_)) { @@ -851,9 +861,6 @@ bool ScopeIterator::VisitLocals(const Visitor& visitor, Mode mode) const { continue; } value = isolate_->factory()->undefined_value(); - } else if (value->IsTheHole(isolate_)) { - // Reflect variables under TDZ as undeclared in scope object. - continue; } } break; @@ -862,8 +869,6 @@ bool ScopeIterator::VisitLocals(const Visitor& visitor, Mode mode) const { if (mode == Mode::STACK) continue; DCHECK(var->IsContextSlot()); value = handle(context_->get(index), isolate_); - // Reflect variables under TDZ as undeclared in scope object. - if (value->IsTheHole(isolate_)) continue; break; case VariableLocation::MODULE: { @@ -871,13 +876,11 @@ bool ScopeIterator::VisitLocals(const Visitor& visitor, Mode mode) const { // if (var->IsExport()) continue; Handle<SourceTextModule> module(context_->module(), isolate_); value = SourceTextModule::LoadVariable(isolate_, module, var->index()); - // Reflect variables under TDZ as undeclared in scope object. - if (value->IsTheHole(isolate_)) continue; break; } } - if (visitor(var->name(), value)) return true; + if (visitor(var->name(), value, scope_type)) return true; } return false; } @@ -894,9 +897,10 @@ Handle<JSObject> ScopeIterator::WithContextExtension() { // Create a plain JSObject which materializes the block scope for the specified // block context. -void ScopeIterator::VisitLocalScope(const Visitor& visitor, Mode mode) const { +void ScopeIterator::VisitLocalScope(const Visitor& visitor, Mode mode, + ScopeType scope_type) const { if (InInnerScope()) { - if (VisitLocals(visitor, mode)) return; + if (VisitLocals(visitor, mode, scope_type)) return; if (mode == Mode::STACK && Type() == ScopeTypeLocal) { // Hide |this| in arrow functions that may be embedded in other functions // but don't force |this| to be context-allocated. Otherwise we'd find the @@ -904,7 +908,7 @@ void ScopeIterator::VisitLocalScope(const Visitor& visitor, Mode mode) const { if (!closure_scope_->has_this_declaration() && !closure_scope_->HasThisReference()) { if (visitor(isolate_->factory()->this_string(), - isolate_->factory()->undefined_value())) + isolate_->factory()->undefined_value(), scope_type)) return; } // Add |arguments| to the function scope even if it wasn't used. @@ -919,13 +923,15 @@ void ScopeIterator::VisitLocalScope(const Visitor& visitor, Mode mode) const { JavaScriptFrame* frame = GetFrame(); Handle<JSObject> arguments = Accessors::FunctionGetArguments( frame, frame_inspector_->inlined_frame_index()); - if (visitor(isolate_->factory()->arguments_string(), arguments)) return; + if (visitor(isolate_->factory()->arguments_string(), arguments, + scope_type)) + return; } } } else { DCHECK_EQ(Mode::ALL, mode); Handle<ScopeInfo> scope_info(context_->scope_info(), isolate_); - if (VisitContextLocals(visitor, scope_info, context_)) return; + if (VisitContextLocals(visitor, scope_info, context_, scope_type)) return; } if (mode == Mode::ALL && HasContext()) { @@ -945,7 +951,7 @@ void ScopeIterator::VisitLocalScope(const Visitor& visitor, Mode mode) const { DCHECK(keys->get(i).IsString()); Handle<String> key(String::cast(keys->get(i)), isolate_); Handle<Object> value = JSReceiver::GetDataProperty(extension, key); - if (visitor(key, value)) return; + if (visitor(key, value, scope_type)) return; } } } diff --git a/chromium/v8/src/debug/debug-scopes.h b/chromium/v8/src/debug/debug-scopes.h index a0357c73838..590e9e9bfe6 100644 --- a/chromium/v8/src/debug/debug-scopes.h +++ b/chromium/v8/src/debug/debug-scopes.h @@ -141,8 +141,8 @@ class ScopeIterator { void UnwrapEvaluationContext(); - using Visitor = - std::function<bool(Handle<String> name, Handle<Object> value)>; + using Visitor = std::function<bool(Handle<String> name, Handle<Object> value, + ScopeType scope_type)>; Handle<JSObject> WithContextExtension(); @@ -159,12 +159,14 @@ class ScopeIterator { // Helper functions. void VisitScope(const Visitor& visitor, Mode mode) const; - void VisitLocalScope(const Visitor& visitor, Mode mode) const; + void VisitLocalScope(const Visitor& visitor, Mode mode, + ScopeType scope_type) const; void VisitScriptScope(const Visitor& visitor) const; void VisitModuleScope(const Visitor& visitor) const; - bool VisitLocals(const Visitor& visitor, Mode mode) const; + bool VisitLocals(const Visitor& visitor, Mode mode, + ScopeType scope_type) const; bool VisitContextLocals(const Visitor& visitor, Handle<ScopeInfo> scope_info, - Handle<Context> context) const; + Handle<Context> context, ScopeType scope_type) const; DISALLOW_IMPLICIT_CONSTRUCTORS(ScopeIterator); }; diff --git a/chromium/v8/src/debug/debug.cc b/chromium/v8/src/debug/debug.cc index 627ccc7c567..0c71bf8308f 100644 --- a/chromium/v8/src/debug/debug.cc +++ b/chromium/v8/src/debug/debug.cc @@ -820,7 +820,10 @@ void Debug::ClearAllBreakPoints() { HeapObject raw_wasm_script; if (wasm_scripts_with_breakpoints_->Get(idx).GetHeapObject( &raw_wasm_script)) { - WasmScript::ClearAllBreakpoints(Script::cast(raw_wasm_script)); + Script wasm_script = Script::cast(raw_wasm_script); + WasmScript::ClearAllBreakpoints(wasm_script); + wasm_script.wasm_native_module()->GetDebugInfo()->RemoveIsolate( + isolate_); } } wasm_scripts_with_breakpoints_ = Handle<WeakArrayList>{}; @@ -2327,7 +2330,7 @@ bool Debug::PerformSideEffectCheckForCallback( // TODO(7515): always pass a valid callback info object. if (!callback_info.is_null()) { if (callback_info->IsAccessorInfo()) { - // List of whitelisted internal accessors can be found in accessors.h. + // List of allowlisted internal accessors can be found in accessors.h. AccessorInfo info = AccessorInfo::cast(*callback_info); DCHECK_NE(kNotAccessor, accessor_kind); switch (accessor_kind == kSetter ? info.setter_side_effect_type() diff --git a/chromium/v8/src/debug/liveedit.cc b/chromium/v8/src/debug/liveedit.cc index cd40eae6561..e1891af0ce4 100644 --- a/chromium/v8/src/debug/liveedit.cc +++ b/chromium/v8/src/debug/liveedit.cc @@ -757,7 +757,14 @@ bool ParseScript(Isolate* isolate, Handle<Script> script, ParseInfo* parse_info, success = Compiler::CompileForLiveEdit(parse_info, script, isolate) .ToHandle(&shared); } else { - success = parsing::ParseProgram(parse_info, script, isolate); + success = parsing::ParseProgram(parse_info, script, isolate, + parsing::ReportStatisticsMode::kYes); + if (!success) { + // Throw the parser error. + parse_info->pending_error_handler()->PrepareErrors( + isolate, parse_info->ast_value_factory()); + parse_info->pending_error_handler()->ReportErrors(isolate, script); + } } if (!success) { isolate->OptionalRescheduleException(false); @@ -1003,7 +1010,8 @@ bool CanRestartFrame( void TranslateSourcePositionTable(Isolate* isolate, Handle<BytecodeArray> code, const std::vector<SourceChangeRange>& diffs) { - SourcePositionTableBuilder builder; + Zone zone(isolate->allocator(), ZONE_NAME); + SourcePositionTableBuilder builder(&zone); Handle<ByteArray> source_position_table(code->SourcePositionTable(), isolate); for (SourcePositionTableIterator iterator(*source_position_table); @@ -1145,7 +1153,9 @@ void LiveEdit::PatchScript(Isolate* isolate, Handle<Script> script, js_function->set_raw_feedback_cell( *isolate->factory()->many_closures_cell()); if (!js_function->is_compiled()) continue; - JSFunction::EnsureFeedbackVector(js_function); + IsCompiledScope is_compiled_scope( + js_function->shared().is_compiled_scope()); + JSFunction::EnsureFeedbackVector(js_function, &is_compiled_scope); } if (!sfi->HasBytecodeArray()) continue; @@ -1186,7 +1196,9 @@ void LiveEdit::PatchScript(Isolate* isolate, Handle<Script> script, js_function->set_raw_feedback_cell( *isolate->factory()->many_closures_cell()); if (!js_function->is_compiled()) continue; - JSFunction::EnsureFeedbackVector(js_function); + IsCompiledScope is_compiled_scope( + js_function->shared().is_compiled_scope()); + JSFunction::EnsureFeedbackVector(js_function, &is_compiled_scope); } } SharedFunctionInfo::ScriptIterator it(isolate, *new_script); diff --git a/chromium/v8/src/debug/wasm/gdb-server/wasm-module-debug.cc b/chromium/v8/src/debug/wasm/gdb-server/wasm-module-debug.cc index 2bd9b1e5d49..5074acbb63e 100644 --- a/chromium/v8/src/debug/wasm/gdb-server/wasm-module-debug.cc +++ b/chromium/v8/src/debug/wasm/gdb-server/wasm-module-debug.cc @@ -371,9 +371,8 @@ bool WasmModuleDebug::GetWasmValue(const wasm::WasmValue& wasm_value, return StoreValue(wasm_value.to_s128(), buffer, buffer_size, size); case wasm::kWasmStmt.kind(): - case wasm::kWasmAnyRef.kind(): + case wasm::kWasmExternRef.kind(): case wasm::kWasmFuncRef.kind(): - case wasm::kWasmNullRef.kind(): case wasm::kWasmExnRef.kind(): case wasm::kWasmBottom.kind(): default: |