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