Commit d5b02187 authored by Leszek Swirski's avatar Leszek Swirski Committed by Commit Bot

[GetIsolate] Remove GetIsolate from src/ast/*

Bug: v8:7786
Change-Id: Id6a2e38e99fdaeaa619c7ec3e18865c3f64a2a47
Reviewed-on: https://chromium-review.googlesource.com/1095112Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53731}
parent 02a891a8
......@@ -199,11 +199,10 @@ ModuleScope::ModuleScope(DeclarationScope* script_scope,
DeclareThis(ast_value_factory);
}
ModuleScope::ModuleScope(Handle<ScopeInfo> scope_info,
ModuleScope::ModuleScope(Isolate* isolate, Handle<ScopeInfo> scope_info,
AstValueFactory* avfactory)
: DeclarationScope(avfactory->zone(), MODULE_SCOPE, scope_info) {
Zone* zone = avfactory->zone();
Isolate* isolate = scope_info->GetIsolate();
Handle<ModuleInfo> module_info(scope_info->ModuleDescriptorInfo(), isolate);
set_language_mode(LanguageMode::kStrict);
......@@ -390,12 +389,12 @@ bool Scope::ContainsAsmModule() const {
return false;
}
Scope* Scope::DeserializeScopeChain(Zone* zone, ScopeInfo* scope_info,
Scope* Scope::DeserializeScopeChain(Isolate* isolate, Zone* zone,
ScopeInfo* scope_info,
DeclarationScope* script_scope,
AstValueFactory* ast_value_factory,
DeserializationMode deserialization_mode) {
// Reconstruct the outer scope chain from a closure's context chain.
Isolate* isolate = scope_info->GetIsolate();
Scope* current_scope = nullptr;
Scope* innermost_scope = nullptr;
Scope* outer_scope = nullptr;
......@@ -437,7 +436,7 @@ Scope* Scope::DeserializeScopeChain(Zone* zone, ScopeInfo* scope_info,
}
} else if (scope_info->scope_type() == MODULE_SCOPE) {
outer_scope = new (zone)
ModuleScope(handle(scope_info, isolate), ast_value_factory);
ModuleScope(isolate, handle(scope_info, isolate), ast_value_factory);
} else {
DCHECK_EQ(scope_info->scope_type(), CATCH_SCOPE);
DCHECK_EQ(scope_info->LocalCount(), 1);
......@@ -447,8 +446,8 @@ Scope* Scope::DeserializeScopeChain(Zone* zone, ScopeInfo* scope_info,
String* name = scope_info->ContextLocalName(0);
MaybeAssignedFlag maybe_assigned =
scope_info->ContextLocalMaybeAssignedFlag(0);
outer_scope = new (zone) Scope(
zone, ast_value_factory->GetString(handle(name, name->GetIsolate())),
outer_scope = new (zone)
Scope(zone, ast_value_factory->GetString(handle(name, isolate)),
maybe_assigned, handle(scope_info, isolate));
}
if (deserialization_mode == DeserializationMode::kScopesOnly) {
......@@ -638,7 +637,7 @@ void DeclarationScope::AttachOuterScopeInfo(ParseInfo* info, Isolate* isolate) {
DeclarationScope(info->zone(), info->ast_value_factory());
info->set_script_scope(script_scope);
ReplaceOuterScope(Scope::DeserializeScopeChain(
info->zone(), *outer_scope_info, script_scope,
isolate, info->zone(), *outer_scope_info, script_scope,
info->ast_value_factory(),
Scope::DeserializationMode::kIncludingVariables));
} else {
......
......@@ -134,7 +134,8 @@ class V8_EXPORT_PRIVATE Scope : public NON_EXPORTED_BASE(ZoneObject) {
enum class DeserializationMode { kIncludingVariables, kScopesOnly };
static Scope* DeserializeScopeChain(Zone* zone, ScopeInfo* scope_info,
static Scope* DeserializeScopeChain(Isolate* isolate, Zone* zone,
ScopeInfo* scope_info,
DeclarationScope* script_scope,
AstValueFactory* ast_value_factory,
DeserializationMode deserialization_mode);
......@@ -1031,7 +1032,8 @@ class ModuleScope final : public DeclarationScope {
// The generated ModuleDescriptor does not preserve all information. In
// particular, its module_requests map will be empty because we no longer need
// the map after parsing.
ModuleScope(Handle<ScopeInfo> scope_info, AstValueFactory* ast_value_factory);
ModuleScope(Isolate* isolate, Handle<ScopeInfo> scope_info,
AstValueFactory* ast_value_factory);
ModuleDescriptor* module() const {
DCHECK_NOT_NULL(module_descriptor_);
......
......@@ -468,7 +468,7 @@ void Parser::DeserializeScopeChain(
if (maybe_outer_scope_info.ToHandle(&outer_scope_info)) {
DCHECK(ThreadId::Current().Equals(isolate->thread_id()));
scope = Scope::DeserializeScopeChain(
zone(), *outer_scope_info, script_scope, ast_value_factory(),
isolate, zone(), *outer_scope_info, script_scope, ast_value_factory(),
Scope::DeserializationMode::kScopesOnly);
}
original_scope_ = scope;
......
......@@ -2843,7 +2843,7 @@ TEST(SerializationOfMaybeAssignmentFlag) {
i::DeclarationScope* script_scope =
new (&zone) i::DeclarationScope(&zone, &avf);
i::Scope* s = i::Scope::DeserializeScopeChain(
&zone, context->scope_info(), script_scope, &avf,
isolate, &zone, context->scope_info(), script_scope, &avf,
i::Scope::DeserializationMode::kIncludingVariables);
CHECK(s != script_scope);
CHECK_NOT_NULL(name);
......@@ -2892,7 +2892,7 @@ TEST(IfArgumentsArrayAccessedThenParametersMaybeAssigned) {
i::DeclarationScope* script_scope =
new (&zone) i::DeclarationScope(&zone, &avf);
i::Scope* s = i::Scope::DeserializeScopeChain(
&zone, context->scope_info(), script_scope, &avf,
isolate, &zone, context->scope_info(), script_scope, &avf,
i::Scope::DeserializationMode::kIncludingVariables);
CHECK(s != script_scope);
......@@ -3613,7 +3613,7 @@ i::Scope* DeserializeFunctionScope(i::Isolate* isolate, i::Zone* zone,
i::DeclarationScope* script_scope =
new (zone) i::DeclarationScope(zone, &avf);
i::Scope* s = i::Scope::DeserializeScopeChain(
zone, f->context()->scope_info(), script_scope, &avf,
isolate, zone, f->context()->scope_info(), script_scope, &avf,
i::Scope::DeserializationMode::kIncludingVariables);
return s;
}
......
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