Commit f3e9edd1 authored by Igor Sheludko's avatar Igor Sheludko Committed by Commit Bot

[zone] Cleanup zone allocations in src/ast and tests

... by migrating old-style code
  MyObject* obj = new (zone) MyObject(...)

to the new style
  MyObject* obj = zone->New<MyObject>(...)

Bug: v8:10689
Change-Id: I79fc4f9793a0c7a3bd38230ca4e23d33344fc1b2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2288863Reviewed-by: 's avatarSathya Gunasekaran  <gsathya@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68792}
parent e4f5f23b
...@@ -268,21 +268,21 @@ AstStringConstants::AstStringConstants(Isolate* isolate, uint64_t hash_seed) ...@@ -268,21 +268,21 @@ AstStringConstants::AstStringConstants(Isolate* isolate, uint64_t hash_seed)
string_table_(AstRawString::Compare), string_table_(AstRawString::Compare),
hash_seed_(hash_seed) { hash_seed_(hash_seed) {
DCHECK_EQ(ThreadId::Current(), isolate->thread_id()); DCHECK_EQ(ThreadId::Current(), isolate->thread_id());
#define F(name, str) \ #define F(name, str) \
{ \ { \
const char* data = str; \ const char* data = str; \
Vector<const uint8_t> literal(reinterpret_cast<const uint8_t*>(data), \ Vector<const uint8_t> literal(reinterpret_cast<const uint8_t*>(data), \
static_cast<int>(strlen(data))); \ static_cast<int>(strlen(data))); \
uint32_t hash_field = StringHasher::HashSequentialString<uint8_t>( \ uint32_t hash_field = StringHasher::HashSequentialString<uint8_t>( \
literal.begin(), literal.length(), hash_seed_); \ literal.begin(), literal.length(), hash_seed_); \
name##_string_ = new (&zone_) AstRawString(true, literal, hash_field); \ name##_string_ = zone_.New<AstRawString>(true, literal, hash_field); \
/* The Handle returned by the factory is located on the roots */ \ /* The Handle returned by the factory is located on the roots */ \
/* array, not on the temporary HandleScope, so this is safe. */ \ /* array, not on the temporary HandleScope, so this is safe. */ \
name##_string_->set_string(isolate->factory()->name##_string()); \ name##_string_->set_string(isolate->factory()->name##_string()); \
base::HashMap::Entry* entry = \ base::HashMap::Entry* entry = \
string_table_.InsertNew(name##_string_, name##_string_->Hash()); \ string_table_.InsertNew(name##_string_, name##_string_->Hash()); \
DCHECK_NULL(entry->value); \ DCHECK_NULL(entry->value); \
entry->value = reinterpret_cast<void*>(1); \ entry->value = reinterpret_cast<void*>(1); \
} }
AST_STRING_CONSTANTS(F) AST_STRING_CONSTANTS(F)
#undef F #undef F
...@@ -333,7 +333,7 @@ const AstRawString* AstValueFactory::CloneFromOtherFactory( ...@@ -333,7 +333,7 @@ const AstRawString* AstValueFactory::CloneFromOtherFactory(
} }
AstConsString* AstValueFactory::NewConsString() { AstConsString* AstValueFactory::NewConsString() {
return new (zone()) AstConsString; return zone()->New<AstConsString>();
} }
AstConsString* AstValueFactory::NewConsString(const AstRawString* str) { AstConsString* AstValueFactory::NewConsString(const AstRawString* str) {
...@@ -379,7 +379,7 @@ AstRawString* AstValueFactory::GetString(uint32_t hash_field, bool is_one_byte, ...@@ -379,7 +379,7 @@ AstRawString* AstValueFactory::GetString(uint32_t hash_field, bool is_one_byte,
int length = literal_bytes.length(); int length = literal_bytes.length();
byte* new_literal_bytes = zone()->NewArray<byte>(length); byte* new_literal_bytes = zone()->NewArray<byte>(length);
memcpy(new_literal_bytes, literal_bytes.begin(), length); memcpy(new_literal_bytes, literal_bytes.begin(), length);
AstRawString* new_string = new (zone()) AstRawString( AstRawString* new_string = zone()->New<AstRawString>(
is_one_byte, Vector<const byte>(new_literal_bytes, length), hash_field); is_one_byte, Vector<const byte>(new_literal_bytes, length), hash_field);
CHECK_NOT_NULL(new_string); CHECK_NOT_NULL(new_string);
AddString(new_string); AddString(new_string);
......
...@@ -83,6 +83,7 @@ class AstRawString final : public ZoneObject { ...@@ -83,6 +83,7 @@ class AstRawString final : public ZoneObject {
friend class AstRawStringInternalizationKey; friend class AstRawStringInternalizationKey;
friend class AstStringConstants; friend class AstStringConstants;
friend class AstValueFactory; friend class AstValueFactory;
friend Zone;
// Members accessed only by the AstValueFactory & related classes: // Members accessed only by the AstValueFactory & related classes:
static bool Compare(void* a, void* b); static bool Compare(void* a, void* b);
...@@ -133,8 +134,7 @@ class AstConsString final : public ZoneObject { ...@@ -133,8 +134,7 @@ class AstConsString final : public ZoneObject {
if (!IsEmpty()) { if (!IsEmpty()) {
// We're putting the new string to the head of the list, meaning // We're putting the new string to the head of the list, meaning
// the string segments will be in reverse order. // the string segments will be in reverse order.
Segment* tmp = new (zone->New(sizeof(Segment))) Segment; Segment* tmp = zone->New<Segment>(segment_);
*tmp = segment_;
segment_.next = tmp; segment_.next = tmp;
} }
segment_.string = s; segment_.string = s;
...@@ -163,6 +163,7 @@ class AstConsString final : public ZoneObject { ...@@ -163,6 +163,7 @@ class AstConsString final : public ZoneObject {
private: private:
friend class AstValueFactory; friend class AstValueFactory;
friend Zone;
AstConsString() : string_(), segment_({nullptr, nullptr}) {} AstConsString() : string_(), segment_({nullptr, nullptr}) {}
......
...@@ -1063,7 +1063,7 @@ Literal* AstNodeFactory::NewNumberLiteral(double number, int pos) { ...@@ -1063,7 +1063,7 @@ Literal* AstNodeFactory::NewNumberLiteral(double number, int pos) {
if (DoubleToSmiInteger(number, &int_value)) { if (DoubleToSmiInteger(number, &int_value)) {
return NewSmiLiteral(int_value, pos); return NewSmiLiteral(int_value, pos);
} }
return new (zone_) Literal(number, pos); return zone_->New<Literal>(number, pos);
} }
const char* CallRuntime::debug_name() { const char* CallRuntime::debug_name() {
......
This diff is collapsed.
...@@ -32,7 +32,7 @@ void SourceTextModuleDescriptor::AddImport( ...@@ -32,7 +32,7 @@ void SourceTextModuleDescriptor::AddImport(
const AstRawString* import_name, const AstRawString* local_name, const AstRawString* import_name, const AstRawString* local_name,
const AstRawString* module_request, const Scanner::Location loc, const AstRawString* module_request, const Scanner::Location loc,
const Scanner::Location specifier_loc, Zone* zone) { const Scanner::Location specifier_loc, Zone* zone) {
Entry* entry = new (zone) Entry(loc); Entry* entry = zone->New<Entry>(loc);
entry->local_name = local_name; entry->local_name = local_name;
entry->import_name = import_name; entry->import_name = import_name;
entry->module_request = AddModuleRequest(module_request, specifier_loc); entry->module_request = AddModuleRequest(module_request, specifier_loc);
...@@ -43,7 +43,7 @@ void SourceTextModuleDescriptor::AddStarImport( ...@@ -43,7 +43,7 @@ void SourceTextModuleDescriptor::AddStarImport(
const AstRawString* local_name, const AstRawString* module_request, const AstRawString* local_name, const AstRawString* module_request,
const Scanner::Location loc, const Scanner::Location specifier_loc, const Scanner::Location loc, const Scanner::Location specifier_loc,
Zone* zone) { Zone* zone) {
Entry* entry = new (zone) Entry(loc); Entry* entry = zone->New<Entry>(loc);
entry->local_name = local_name; entry->local_name = local_name;
entry->module_request = AddModuleRequest(module_request, specifier_loc); entry->module_request = AddModuleRequest(module_request, specifier_loc);
AddNamespaceImport(entry, zone); AddNamespaceImport(entry, zone);
...@@ -57,7 +57,7 @@ void SourceTextModuleDescriptor::AddEmptyImport( ...@@ -57,7 +57,7 @@ void SourceTextModuleDescriptor::AddEmptyImport(
void SourceTextModuleDescriptor::AddExport(const AstRawString* local_name, void SourceTextModuleDescriptor::AddExport(const AstRawString* local_name,
const AstRawString* export_name, const AstRawString* export_name,
Scanner::Location loc, Zone* zone) { Scanner::Location loc, Zone* zone) {
Entry* entry = new (zone) Entry(loc); Entry* entry = zone->New<Entry>(loc);
entry->export_name = export_name; entry->export_name = export_name;
entry->local_name = local_name; entry->local_name = local_name;
AddRegularExport(entry); AddRegularExport(entry);
...@@ -69,7 +69,7 @@ void SourceTextModuleDescriptor::AddExport( ...@@ -69,7 +69,7 @@ void SourceTextModuleDescriptor::AddExport(
const Scanner::Location specifier_loc, Zone* zone) { const Scanner::Location specifier_loc, Zone* zone) {
DCHECK_NOT_NULL(import_name); DCHECK_NOT_NULL(import_name);
DCHECK_NOT_NULL(export_name); DCHECK_NOT_NULL(export_name);
Entry* entry = new (zone) Entry(loc); Entry* entry = zone->New<Entry>(loc);
entry->export_name = export_name; entry->export_name = export_name;
entry->import_name = import_name; entry->import_name = import_name;
entry->module_request = AddModuleRequest(module_request, specifier_loc); entry->module_request = AddModuleRequest(module_request, specifier_loc);
...@@ -79,7 +79,7 @@ void SourceTextModuleDescriptor::AddExport( ...@@ -79,7 +79,7 @@ void SourceTextModuleDescriptor::AddExport(
void SourceTextModuleDescriptor::AddStarExport( void SourceTextModuleDescriptor::AddStarExport(
const AstRawString* module_request, const Scanner::Location loc, const AstRawString* module_request, const Scanner::Location loc,
const Scanner::Location specifier_loc, Zone* zone) { const Scanner::Location specifier_loc, Zone* zone) {
Entry* entry = new (zone) Entry(loc); Entry* entry = zone->New<Entry>(loc);
entry->module_request = AddModuleRequest(module_request, specifier_loc); entry->module_request = AddModuleRequest(module_request, specifier_loc);
AddSpecialExport(entry, zone); AddSpecialExport(entry, zone);
} }
......
...@@ -54,7 +54,7 @@ Variable* VariableMap::Declare(Zone* zone, Scope* scope, ...@@ -54,7 +54,7 @@ Variable* VariableMap::Declare(Zone* zone, Scope* scope,
// The variable has not been declared yet -> insert it. // The variable has not been declared yet -> insert it.
DCHECK_EQ(name, p->key); DCHECK_EQ(name, p->key);
Variable* variable = Variable* variable =
new (zone) Variable(scope, name, mode, kind, initialization_flag, zone->New<Variable>(scope, name, mode, kind, initialization_flag,
maybe_assigned_flag, is_static_flag); maybe_assigned_flag, is_static_flag);
p->value = variable; p->value = variable;
} }
...@@ -138,8 +138,8 @@ DeclarationScope::DeclarationScope(Zone* zone, Scope* outer_scope, ...@@ -138,8 +138,8 @@ DeclarationScope::DeclarationScope(Zone* zone, Scope* outer_scope,
ModuleScope::ModuleScope(DeclarationScope* script_scope, ModuleScope::ModuleScope(DeclarationScope* script_scope,
AstValueFactory* avfactory) AstValueFactory* avfactory)
: DeclarationScope(avfactory->zone(), script_scope, MODULE_SCOPE, kModule), : DeclarationScope(avfactory->zone(), script_scope, MODULE_SCOPE, kModule),
module_descriptor_(new (avfactory->zone()) module_descriptor_(avfactory->zone()->New<SourceTextModuleDescriptor>(
SourceTextModuleDescriptor(avfactory->zone())) { avfactory->zone())) {
set_language_mode(LanguageMode::kStrict); set_language_mode(LanguageMode::kStrict);
DeclareThis(avfactory); DeclareThis(avfactory);
} }
...@@ -357,13 +357,13 @@ Scope* Scope::DeserializeScopeChain(Isolate* isolate, Zone* zone, ...@@ -357,13 +357,13 @@ Scope* Scope::DeserializeScopeChain(Isolate* isolate, Zone* zone,
while (!scope_info.is_null()) { while (!scope_info.is_null()) {
if (scope_info.scope_type() == WITH_SCOPE) { if (scope_info.scope_type() == WITH_SCOPE) {
if (scope_info.IsDebugEvaluateScope()) { if (scope_info.IsDebugEvaluateScope()) {
outer_scope = new (zone) outer_scope = zone->New<DeclarationScope>(zone, FUNCTION_SCOPE,
DeclarationScope(zone, FUNCTION_SCOPE, handle(scope_info, isolate)); handle(scope_info, isolate));
outer_scope->set_is_debug_evaluate_scope(); outer_scope->set_is_debug_evaluate_scope();
} else { } else {
// For scope analysis, debug-evaluate is equivalent to a with scope. // For scope analysis, debug-evaluate is equivalent to a with scope.
outer_scope = outer_scope =
new (zone) Scope(zone, WITH_SCOPE, handle(scope_info, isolate)); zone->New<Scope>(zone, WITH_SCOPE, handle(scope_info, isolate));
} }
} else if (scope_info.scope_type() == SCRIPT_SCOPE) { } else if (scope_info.scope_type() == SCRIPT_SCOPE) {
...@@ -377,28 +377,28 @@ Scope* Scope::DeserializeScopeChain(Isolate* isolate, Zone* zone, ...@@ -377,28 +377,28 @@ Scope* Scope::DeserializeScopeChain(Isolate* isolate, Zone* zone,
DCHECK(!scope_info.HasOuterScopeInfo()); DCHECK(!scope_info.HasOuterScopeInfo());
break; break;
} else if (scope_info.scope_type() == FUNCTION_SCOPE) { } else if (scope_info.scope_type() == FUNCTION_SCOPE) {
outer_scope = new (zone) outer_scope = zone->New<DeclarationScope>(zone, FUNCTION_SCOPE,
DeclarationScope(zone, FUNCTION_SCOPE, handle(scope_info, isolate)); handle(scope_info, isolate));
if (scope_info.IsAsmModule()) { if (scope_info.IsAsmModule()) {
outer_scope->AsDeclarationScope()->set_is_asm_module(); outer_scope->AsDeclarationScope()->set_is_asm_module();
} }
} else if (scope_info.scope_type() == EVAL_SCOPE) { } else if (scope_info.scope_type() == EVAL_SCOPE) {
outer_scope = new (zone) outer_scope = zone->New<DeclarationScope>(zone, EVAL_SCOPE,
DeclarationScope(zone, EVAL_SCOPE, handle(scope_info, isolate)); handle(scope_info, isolate));
} else if (scope_info.scope_type() == CLASS_SCOPE) { } else if (scope_info.scope_type() == CLASS_SCOPE) {
outer_scope = new (zone) ClassScope(isolate, zone, ast_value_factory, outer_scope = zone->New<ClassScope>(isolate, zone, ast_value_factory,
handle(scope_info, isolate)); handle(scope_info, isolate));
} else if (scope_info.scope_type() == BLOCK_SCOPE) { } else if (scope_info.scope_type() == BLOCK_SCOPE) {
if (scope_info.is_declaration_scope()) { if (scope_info.is_declaration_scope()) {
outer_scope = new (zone) outer_scope = zone->New<DeclarationScope>(zone, BLOCK_SCOPE,
DeclarationScope(zone, BLOCK_SCOPE, handle(scope_info, isolate)); handle(scope_info, isolate));
} else { } else {
outer_scope = outer_scope =
new (zone) Scope(zone, BLOCK_SCOPE, handle(scope_info, isolate)); zone->New<Scope>(zone, BLOCK_SCOPE, handle(scope_info, isolate));
} }
} else if (scope_info.scope_type() == MODULE_SCOPE) { } else if (scope_info.scope_type() == MODULE_SCOPE) {
outer_scope = new (zone) outer_scope = zone->New<ModuleScope>(isolate, handle(scope_info, isolate),
ModuleScope(isolate, handle(scope_info, isolate), ast_value_factory); ast_value_factory);
} else { } else {
DCHECK_EQ(scope_info.scope_type(), CATCH_SCOPE); DCHECK_EQ(scope_info.scope_type(), CATCH_SCOPE);
DCHECK_EQ(scope_info.ContextLocalCount(), 1); DCHECK_EQ(scope_info.ContextLocalCount(), 1);
...@@ -407,9 +407,9 @@ Scope* Scope::DeserializeScopeChain(Isolate* isolate, Zone* zone, ...@@ -407,9 +407,9 @@ Scope* Scope::DeserializeScopeChain(Isolate* isolate, Zone* zone,
String name = scope_info.ContextLocalName(0); String name = scope_info.ContextLocalName(0);
MaybeAssignedFlag maybe_assigned = MaybeAssignedFlag maybe_assigned =
scope_info.ContextLocalMaybeAssignedFlag(0); scope_info.ContextLocalMaybeAssignedFlag(0);
outer_scope = new (zone) outer_scope = zone->New<Scope>(
Scope(zone, ast_value_factory->GetString(handle(name, isolate)), zone, ast_value_factory->GetString(handle(name, isolate)),
maybe_assigned, handle(scope_info, isolate)); maybe_assigned, handle(scope_info, isolate));
} }
if (deserialization_mode == DeserializationMode::kScopesOnly) { if (deserialization_mode == DeserializationMode::kScopesOnly) {
outer_scope->scope_info_ = Handle<ScopeInfo>::null(); outer_scope->scope_info_ = Handle<ScopeInfo>::null();
...@@ -621,12 +621,12 @@ void DeclarationScope::DeclareThis(AstValueFactory* ast_value_factory) { ...@@ -621,12 +621,12 @@ void DeclarationScope::DeclareThis(AstValueFactory* ast_value_factory) {
bool derived_constructor = IsDerivedConstructor(function_kind_); bool derived_constructor = IsDerivedConstructor(function_kind_);
receiver_ = new (zone()) receiver_ = zone()->New<Variable>(
Variable(this, ast_value_factory->this_string(), this, ast_value_factory->this_string(),
derived_constructor ? VariableMode::kConst : VariableMode::kVar, derived_constructor ? VariableMode::kConst : VariableMode::kVar,
THIS_VARIABLE, THIS_VARIABLE,
derived_constructor ? kNeedsInitialization : kCreatedInitialized, derived_constructor ? kNeedsInitialization : kCreatedInitialized,
kNotAssigned); kNotAssigned);
} }
void DeclarationScope::DeclareArguments(AstValueFactory* ast_value_factory) { void DeclarationScope::DeclareArguments(AstValueFactory* ast_value_factory) {
...@@ -677,8 +677,8 @@ Variable* DeclarationScope::DeclareFunctionVar(const AstRawString* name, ...@@ -677,8 +677,8 @@ Variable* DeclarationScope::DeclareFunctionVar(const AstRawString* name,
DCHECK_NULL(cache->variables_.Lookup(name)); DCHECK_NULL(cache->variables_.Lookup(name));
VariableKind kind = is_sloppy(language_mode()) ? SLOPPY_FUNCTION_NAME_VARIABLE VariableKind kind = is_sloppy(language_mode()) ? SLOPPY_FUNCTION_NAME_VARIABLE
: NORMAL_VARIABLE; : NORMAL_VARIABLE;
function_ = new (zone()) function_ = zone()->New<Variable>(this, name, VariableMode::kConst, kind,
Variable(this, name, VariableMode::kConst, kind, kCreatedInitialized); kCreatedInitialized);
if (sloppy_eval_can_extend_vars()) { if (sloppy_eval_can_extend_vars()) {
cache->NonLocal(name, VariableMode::kDynamic); cache->NonLocal(name, VariableMode::kDynamic);
} else { } else {
...@@ -1131,7 +1131,7 @@ Variable* Scope::NewTemporary(const AstRawString* name) { ...@@ -1131,7 +1131,7 @@ Variable* Scope::NewTemporary(const AstRawString* name) {
Variable* Scope::NewTemporary(const AstRawString* name, Variable* Scope::NewTemporary(const AstRawString* name,
MaybeAssignedFlag maybe_assigned) { MaybeAssignedFlag maybe_assigned) {
DeclarationScope* scope = GetClosureScope(); DeclarationScope* scope = GetClosureScope();
Variable* var = new (zone()) Variable(scope, name, VariableMode::kTemporary, Variable* var = zone()->New<Variable>(scope, name, VariableMode::kTemporary,
NORMAL_VARIABLE, kCreatedInitialized); NORMAL_VARIABLE, kCreatedInitialized);
scope->AddLocal(var); scope->AddLocal(var);
if (maybe_assigned == kMaybeAssigned) var->SetMaybeAssigned(); if (maybe_assigned == kMaybeAssigned) var->SetMaybeAssigned();
......
...@@ -699,6 +699,7 @@ class V8_EXPORT_PRIVATE Scope : public NON_EXPORTED_BASE(ZoneObject) { ...@@ -699,6 +699,7 @@ class V8_EXPORT_PRIVATE Scope : public NON_EXPORTED_BASE(ZoneObject) {
friend class DeclarationScope; friend class DeclarationScope;
friend class ClassScope; friend class ClassScope;
friend class ScopeTestHelper; friend class ScopeTestHelper;
friend Zone;
Zone* zone_; Zone* zone_;
...@@ -1260,7 +1261,7 @@ class V8_EXPORT_PRIVATE DeclarationScope : public Scope { ...@@ -1260,7 +1261,7 @@ class V8_EXPORT_PRIVATE DeclarationScope : public Scope {
V8_INLINE RareData* EnsureRareData() { V8_INLINE RareData* EnsureRareData() {
if (rare_data_ == nullptr) { if (rare_data_ == nullptr) {
rare_data_ = new (zone_) RareData; rare_data_ = zone_->New<RareData>();
} }
return rare_data_; return rare_data_;
} }
...@@ -1441,8 +1442,8 @@ class V8_EXPORT_PRIVATE ClassScope : public Scope { ...@@ -1441,8 +1442,8 @@ class V8_EXPORT_PRIVATE ClassScope : public Scope {
} }
V8_INLINE RareData* EnsureRareData() { V8_INLINE RareData* EnsureRareData() {
if (GetRareData() == nullptr) { if (GetRareData() == nullptr) {
rare_data_and_is_parsing_heritage_.SetPointer(new (zone_) rare_data_and_is_parsing_heritage_.SetPointer(
RareData(zone_)); zone_->New<RareData>(zone_));
} }
return GetRareData(); return GetRareData();
} }
......
...@@ -3375,7 +3375,7 @@ TEST(SerializationOfMaybeAssignmentFlag) { ...@@ -3375,7 +3375,7 @@ TEST(SerializationOfMaybeAssignmentFlag) {
i::Handle<i::String> str = name->string(); i::Handle<i::String> str = name->string();
CHECK(str->IsInternalizedString()); CHECK(str->IsInternalizedString());
i::DeclarationScope* script_scope = i::DeclarationScope* script_scope =
new (&zone) i::DeclarationScope(&zone, &avf); zone.New<i::DeclarationScope>(&zone, &avf);
i::Scope* s = i::Scope::DeserializeScopeChain( i::Scope* s = i::Scope::DeserializeScopeChain(
isolate, &zone, context->scope_info(), script_scope, &avf, isolate, &zone, context->scope_info(), script_scope, &avf,
i::Scope::DeserializationMode::kIncludingVariables); i::Scope::DeserializationMode::kIncludingVariables);
...@@ -3424,7 +3424,7 @@ TEST(IfArgumentsArrayAccessedThenParametersMaybeAssigned) { ...@@ -3424,7 +3424,7 @@ TEST(IfArgumentsArrayAccessedThenParametersMaybeAssigned) {
avf.Internalize(isolate); avf.Internalize(isolate);
i::DeclarationScope* script_scope = i::DeclarationScope* script_scope =
new (&zone) i::DeclarationScope(&zone, &avf); zone.New<i::DeclarationScope>(&zone, &avf);
i::Scope* s = i::Scope::DeserializeScopeChain( i::Scope* s = i::Scope::DeserializeScopeChain(
isolate, &zone, context->scope_info(), script_scope, &avf, isolate, &zone, context->scope_info(), script_scope, &avf,
i::Scope::DeserializationMode::kIncludingVariables); i::Scope::DeserializationMode::kIncludingVariables);
...@@ -4349,7 +4349,7 @@ i::Scope* DeserializeFunctionScope(i::Isolate* isolate, i::Zone* zone, ...@@ -4349,7 +4349,7 @@ i::Scope* DeserializeFunctionScope(i::Isolate* isolate, i::Zone* zone,
i::Handle<i::JSFunction> f = i::Handle<i::JSFunction>::cast( i::Handle<i::JSFunction> f = i::Handle<i::JSFunction>::cast(
i::JSReceiver::GetProperty(isolate, m, name).ToHandleChecked()); i::JSReceiver::GetProperty(isolate, m, name).ToHandleChecked());
i::DeclarationScope* script_scope = i::DeclarationScope* script_scope =
new (zone) i::DeclarationScope(zone, &avf); zone->New<i::DeclarationScope>(zone, &avf);
i::Scope* s = i::Scope::DeserializeScopeChain( i::Scope* s = i::Scope::DeserializeScopeChain(
isolate, zone, f->context().scope_info(), script_scope, &avf, isolate, zone, f->context().scope_info(), script_scope, &avf,
i::Scope::DeserializationMode::kIncludingVariables); i::Scope::DeserializationMode::kIncludingVariables);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment