Commit 9c888dff authored by marja's avatar marja Committed by Commit bot

includes: Make ast.h not need isolate.h any more.

Also remove other unnecessary includes from ast.h and dependencies.

BUG=v8:5294

Review-Url: https://codereview.chromium.org/2301423002
Cr-Commit-Position: refs/heads/master@{#39155}
parent 359a00bf
......@@ -68,7 +68,7 @@ class AsmWasmBuilderImpl final : public AstVisitor<AsmWasmBuilderImpl> {
ZoneHashMap::kDefaultHashMapCapacity,
ZoneAllocationPolicy(zone)),
imported_function_table_(this) {
InitializeAstVisitor(isolate);
InitializeAstVisitor(isolate->stack_guard()->real_climit());
}
void InitializeInitFunction() {
......
......@@ -21,9 +21,6 @@ namespace internal {
// methods so they can be specialized by subclasses.
class AstExpressionRewriter : public AstVisitor<AstExpressionRewriter> {
public:
explicit AstExpressionRewriter(Isolate* isolate) {
InitializeAstRewriter(isolate);
}
explicit AstExpressionRewriter(uintptr_t stack_limit) {
InitializeAstRewriter(stack_limit);
}
......
......@@ -6,6 +6,8 @@
#include "src/ast/ast.h"
#include "src/ast/scopes.h"
#include "src/execution.h"
#include "src/isolate.h"
namespace v8 {
namespace internal {
......@@ -21,7 +23,7 @@ class AstNumberingVisitor final : public AstVisitor<AstNumberingVisitor> {
slot_cache_(zone),
dont_optimize_reason_(kNoReason),
catch_prediction_(HandlerTable::UNCAUGHT) {
InitializeAstVisitor(isolate);
InitializeAstVisitor(isolate->stack_guard()->real_climit());
}
bool Renumber(FunctionLiteral* node);
......
......@@ -28,7 +28,6 @@ namespace internal {
template <class Subclass>
class AstTraversalVisitor : public AstVisitor<Subclass> {
public:
explicit AstTraversalVisitor(Isolate* isolate, AstNode* root = nullptr);
explicit AstTraversalVisitor(uintptr_t stack_limit, AstNode* root = nullptr);
void Run() {
......@@ -88,12 +87,6 @@ class AstTraversalVisitor : public AstVisitor<Subclass> {
if (HasStackOverflow()) return; \
} while (false)
template <class Subclass>
AstTraversalVisitor<Subclass>::AstTraversalVisitor(Isolate* isolate,
AstNode* root)
: root_(root), depth_(0) {
InitializeAstVisitor(isolate);
}
template <class Subclass>
AstTraversalVisitor<Subclass>::AstTraversalVisitor(uintptr_t stack_limit,
......
......@@ -11,9 +11,7 @@
#include "src/ast/variables.h"
#include "src/bailout-reason.h"
#include "src/base/flags.h"
#include "src/factory.h"
#include "src/globals.h"
#include "src/isolate.h"
#include "src/list.h"
#include "src/parsing/token.h"
#include "src/runtime/runtime.h"
......@@ -117,6 +115,7 @@ class Module;
class BreakableStatement;
class Expression;
class IterationStatement;
class Isolate;
class MaterializedLiteral;
class Statement;
class TypeFeedbackOracle;
......@@ -2904,11 +2903,6 @@ class AstVisitor BASE_EMBEDDED {
} \
\
private: \
void InitializeAstVisitor(Isolate* isolate) { \
stack_limit_ = isolate->stack_guard()->real_climit(); \
stack_overflow_ = false; \
} \
\
void InitializeAstVisitor(uintptr_t stack_limit) { \
stack_limit_ = stack_limit; \
stack_overflow_ = false; \
......@@ -2937,11 +2931,6 @@ class AstVisitor BASE_EMBEDDED {
} \
\
private: \
void InitializeAstRewriter(Isolate* isolate) { \
InitializeAstVisitor(isolate); \
replacement_ = nullptr; \
} \
\
void InitializeAstRewriter(uintptr_t stack_limit) { \
InitializeAstVisitor(stack_limit); \
replacement_ = nullptr; \
......
......@@ -5,6 +5,7 @@
#include "src/ast/modules.h"
#include "src/ast/ast-value-factory.h"
#include "src/ast/scopes.h"
#include "src/pending-compilation-error-handler.h"
namespace v8 {
namespace internal {
......
......@@ -6,15 +6,13 @@
#define V8_AST_MODULES_H_
#include "src/parsing/scanner.h" // Only for Scanner::Location.
#include "src/pending-compilation-error-handler.h"
#include "src/zone-containers.h"
namespace v8 {
namespace internal {
class AstRawString;
class PendingCompilationErrorHandler;
class ModuleDescriptor : public ZoneObject {
public:
......
......@@ -9,6 +9,8 @@
#include "src/ast/ast-value-factory.h"
#include "src/ast/scopes.h"
#include "src/base/platform/platform.h"
#include "src/execution.h"
#include "src/isolate.h"
namespace v8 {
namespace internal {
......@@ -21,7 +23,7 @@ CallPrinter::CallPrinter(Isolate* isolate, bool is_builtin)
found_ = false;
done_ = false;
is_builtin_ = is_builtin;
InitializeAstVisitor(isolate);
InitializeAstVisitor(isolate->stack_guard()->real_climit());
}
Handle<String> CallPrinter::Print(FunctionLiteral* program, int position) {
......@@ -569,7 +571,7 @@ class IndentedScope BASE_EMBEDDED {
AstPrinter::AstPrinter(Isolate* isolate)
: isolate_(isolate), output_(nullptr), size_(0), pos_(0), indent_(0) {
InitializeAstVisitor(isolate);
InitializeAstVisitor(isolate->stack_guard()->real_climit());
}
AstPrinter::~AstPrinter() {
......
......@@ -436,7 +436,7 @@ AstGraphBuilder::AstGraphBuilder(Zone* local_zone, CompilationInfo* info,
frame_state_function_info_(common()->CreateFrameStateFunctionInfo(
FrameStateType::kJavaScriptFunction, info->num_parameters() + 1,
info->scope()->num_stack_slots(), info->shared_info())) {
InitializeAstVisitor(info->isolate());
InitializeAstVisitor(info->isolate()->stack_guard()->real_climit());
}
......
......@@ -14,7 +14,7 @@ typedef class AstLoopAssignmentAnalyzer ALAA; // for code shortitude.
ALAA::AstLoopAssignmentAnalyzer(Zone* zone, CompilationInfo* info)
: info_(info), zone_(zone), loop_stack_(zone) {
InitializeAstVisitor(info->isolate());
InitializeAstVisitor(info->isolate()->stack_guard()->real_climit());
}
......
......@@ -41,8 +41,10 @@
#include "src/ic/call-optimization.h"
#include "src/ic/ic.h"
// GetRootConstructor
#include "src/execution.h"
#include "src/ic/ic-inl.h"
#include "src/isolate-inl.h"
#include "src/isolate.h"
#include "src/runtime/runtime.h"
#if V8_TARGET_ARCH_IA32
......@@ -3518,7 +3520,7 @@ HOptimizedGraphBuilder::HOptimizedGraphBuilder(CompilationInfo* info)
// constructor for the initial state relies on function_state_ == NULL
// to know it's the initial state.
function_state_ = &initial_function_state_;
InitializeAstVisitor(info->isolate());
InitializeAstVisitor(info->isolate()->stack_guard()->real_climit());
if (top_info()->is_tracking_positions()) {
SetSourcePosition(info->shared_info()->start_position());
}
......
......@@ -6,8 +6,10 @@
#include "src/ast/compile-time-value.h"
#include "src/ast/scopes.h"
#include "src/execution.h"
#include "src/frames-inl.h"
#include "src/frames.h"
#include "src/isolate.h"
#include "src/ostreams.h"
#include "src/splay-tree-inl.h"
......@@ -28,7 +30,7 @@ AstTyper::AstTyper(Isolate* isolate, Zone* zone, Handle<JSFunction> closure,
handle(closure->context()->native_context())),
store_(zone),
bounds_(bounds) {
InitializeAstVisitor(isolate);
InitializeAstVisitor(isolate->stack_guard()->real_climit());
}
......
......@@ -10,9 +10,11 @@
#include "src/compiler.h"
#include "src/debug/debug.h"
#include "src/deoptimizer.h"
#include "src/execution.h"
#include "src/frames-inl.h"
#include "src/global-handles.h"
#include "src/isolate-inl.h"
#include "src/isolate.h"
#include "src/messages.h"
#include "src/source-position-table.h"
#include "src/v8.h"
......@@ -1839,7 +1841,8 @@ Handle<JSArray> LiveEditFunctionTracker::Collect(FunctionLiteral* node,
LiveEditFunctionTracker::LiveEditFunctionTracker(Handle<Script> script,
Zone* zone, Isolate* isolate)
: AstTraversalVisitor<LiveEditFunctionTracker>(isolate) {
: AstTraversalVisitor<LiveEditFunctionTracker>(
isolate->stack_guard()->climit()) {
current_parent_index_ = -1;
isolate_ = isolate;
len_ = 0;
......
......@@ -6,6 +6,8 @@
#include "src/ast/ast.h"
#include "src/ast/scopes.h"
#include "src/execution.h"
#include "src/isolate.h"
#include "src/parsing/parse-info.h"
#include "src/parsing/parser.h"
......@@ -24,7 +26,7 @@ class Processor final : public AstVisitor<Processor> {
closure_scope_(closure_scope),
factory_(ast_value_factory) {
DCHECK_EQ(closure_scope, closure_scope->GetClosureScope());
InitializeAstVisitor(isolate);
InitializeAstVisitor(isolate->stack_guard()->climit());
}
Processor(Parser* parser, DeclarationScope* closure_scope, Variable* result,
......
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