Commit ab1d4cda authored by machenbach's avatar machenbach Committed by Commit bot

Revert of includes: Make ast.h not need isolate.h any more. (patchset #3...

Revert of includes: Make ast.h not need isolate.h any more. (patchset #3 id:60001 of https://codereview.chromium.org/2301423002/ )

Reason for revert:
Breaks gc stress:
https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20gc%20stress/builds/5642

Original issue's description:
> includes: Make ast.h not need isolate.h any more.
>
> Also remove other unnecessary includes from ast.h and dependencies.
>
> BUG=v8:5294
>
> Committed: https://crrev.com/9c888dffda4bff420ec3ef21e623aa4e5054d1c3
> Cr-Commit-Position: refs/heads/master@{#39155}

TBR=adamk@chromium.org,mstarzinger@chromium.org,bmeurer@chromium.org,marja@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:5294

Review-Url: https://codereview.chromium.org/2305373002
Cr-Commit-Position: refs/heads/master@{#39159}
parent 49e13ea6
......@@ -68,7 +68,7 @@ class AsmWasmBuilderImpl final : public AstVisitor<AsmWasmBuilderImpl> {
ZoneHashMap::kDefaultHashMapCapacity,
ZoneAllocationPolicy(zone)),
imported_function_table_(this) {
InitializeAstVisitor(isolate->stack_guard()->real_climit());
InitializeAstVisitor(isolate);
}
void InitializeInitFunction() {
......
......@@ -21,6 +21,9 @@ 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,8 +6,6 @@
#include "src/ast/ast.h"
#include "src/ast/scopes.h"
#include "src/execution.h"
#include "src/isolate.h"
namespace v8 {
namespace internal {
......@@ -23,7 +21,7 @@ class AstNumberingVisitor final : public AstVisitor<AstNumberingVisitor> {
slot_cache_(zone),
dont_optimize_reason_(kNoReason),
catch_prediction_(HandlerTable::UNCAUGHT) {
InitializeAstVisitor(isolate->stack_guard()->real_climit());
InitializeAstVisitor(isolate);
}
bool Renumber(FunctionLiteral* node);
......
......@@ -28,6 +28,7 @@ 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() {
......@@ -87,6 +88,12 @@ 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,7 +11,9 @@
#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"
......@@ -115,7 +117,6 @@ class Module;
class BreakableStatement;
class Expression;
class IterationStatement;
class Isolate;
class MaterializedLiteral;
class Statement;
class TypeFeedbackOracle;
......@@ -2903,6 +2904,11 @@ 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; \
......@@ -2931,6 +2937,11 @@ 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,7 +5,6 @@
#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,13 +6,15 @@
#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,8 +9,6 @@
#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 {
......@@ -23,7 +21,7 @@ CallPrinter::CallPrinter(Isolate* isolate, bool is_builtin)
found_ = false;
done_ = false;
is_builtin_ = is_builtin;
InitializeAstVisitor(isolate->stack_guard()->real_climit());
InitializeAstVisitor(isolate);
}
Handle<String> CallPrinter::Print(FunctionLiteral* program, int position) {
......@@ -571,7 +569,7 @@ class IndentedScope BASE_EMBEDDED {
AstPrinter::AstPrinter(Isolate* isolate)
: isolate_(isolate), output_(nullptr), size_(0), pos_(0), indent_(0) {
InitializeAstVisitor(isolate->stack_guard()->real_climit());
InitializeAstVisitor(isolate);
}
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()->stack_guard()->real_climit());
InitializeAstVisitor(info->isolate());
}
......
......@@ -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()->stack_guard()->real_climit());
InitializeAstVisitor(info->isolate());
}
......
......@@ -41,10 +41,8 @@
#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
......@@ -3520,7 +3518,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()->stack_guard()->real_climit());
InitializeAstVisitor(info->isolate());
if (top_info()->is_tracking_positions()) {
SetSourcePosition(info->shared_info()->start_position());
}
......
......@@ -6,10 +6,8 @@
#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"
......@@ -30,7 +28,7 @@ AstTyper::AstTyper(Isolate* isolate, Zone* zone, Handle<JSFunction> closure,
handle(closure->context()->native_context())),
store_(zone),
bounds_(bounds) {
InitializeAstVisitor(isolate->stack_guard()->real_climit());
InitializeAstVisitor(isolate);
}
......
......@@ -10,11 +10,9 @@
#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"
......@@ -1841,8 +1839,7 @@ Handle<JSArray> LiveEditFunctionTracker::Collect(FunctionLiteral* node,
LiveEditFunctionTracker::LiveEditFunctionTracker(Handle<Script> script,
Zone* zone, Isolate* isolate)
: AstTraversalVisitor<LiveEditFunctionTracker>(
isolate->stack_guard()->climit()) {
: AstTraversalVisitor<LiveEditFunctionTracker>(isolate) {
current_parent_index_ = -1;
isolate_ = isolate;
len_ = 0;
......
......@@ -6,8 +6,6 @@
#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"
......@@ -26,7 +24,7 @@ class Processor final : public AstVisitor<Processor> {
closure_scope_(closure_scope),
factory_(ast_value_factory) {
DCHECK_EQ(closure_scope, closure_scope->GetClosureScope());
InitializeAstVisitor(isolate->stack_guard()->climit());
InitializeAstVisitor(isolate);
}
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