summaryrefslogtreecommitdiff
path: root/deps/v8/src/ast/ast.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/ast/ast.h')
-rw-r--r--deps/v8/src/ast/ast.h36
1 files changed, 24 insertions, 12 deletions
diff --git a/deps/v8/src/ast/ast.h b/deps/v8/src/ast/ast.h
index 6c1e989d30..6cc2cbc8ec 100644
--- a/deps/v8/src/ast/ast.h
+++ b/deps/v8/src/ast/ast.h
@@ -383,7 +383,7 @@ class DoExpression final : public Expression {
class Declaration : public AstNode {
public:
- typedef ThreadedList<Declaration> List;
+ typedef base::ThreadedList<Declaration> List;
VariableProxy* proxy() const { return proxy_; }
@@ -397,6 +397,7 @@ class Declaration : public AstNode {
Declaration** next() { return &next_; }
Declaration* next_;
friend List;
+ friend base::ThreadedListTraits<Declaration>;
};
class VariableDeclaration : public Declaration {
@@ -1477,8 +1478,6 @@ class ArrayLiteral final : public AggregateLiteral {
int first_spread_index() const { return first_spread_index_; }
- bool is_empty() const;
-
// Populate the depth field and flags, returns the depth.
int InitDepthAndFlags();
@@ -1578,8 +1577,15 @@ class VariableProxy final : public Expression {
// Bind this proxy to the variable var.
void BindTo(Variable* var);
- void set_next_unresolved(VariableProxy* next) { next_unresolved_ = next; }
- VariableProxy* next_unresolved() { return next_unresolved_; }
+ V8_INLINE VariableProxy* next_unresolved() { return next_unresolved_; }
+
+ // Provides an access type for the ThreadedList used by the PreParsers
+ // expressions, lists, and formal parameters.
+ struct PreParserNext {
+ static VariableProxy** next(VariableProxy* t) {
+ return t->pre_parser_expr_next();
+ }
+ };
private:
friend class AstNodeFactory;
@@ -1590,7 +1596,8 @@ class VariableProxy final : public Expression {
int start_position)
: Expression(start_position, kVariableProxy),
raw_name_(name),
- next_unresolved_(nullptr) {
+ next_unresolved_(nullptr),
+ pre_parser_expr_next_(nullptr) {
bit_field_ |= IsThisField::encode(variable_kind == THIS_VARIABLE) |
IsAssignedField::encode(false) |
IsResolvedField::encode(false) |
@@ -1613,9 +1620,15 @@ class VariableProxy final : public Expression {
const AstRawString* raw_name_; // if !is_resolved_
Variable* var_; // if is_resolved_
};
+
+ V8_INLINE VariableProxy** next() { return &next_unresolved_; }
VariableProxy* next_unresolved_;
-};
+ VariableProxy** pre_parser_expr_next() { return &pre_parser_expr_next_; }
+ VariableProxy* pre_parser_expr_next_;
+
+ friend base::ThreadedListTraits<VariableProxy>;
+};
// Left-hand side can only be a property, a global or a (parameter or local)
// slot.
@@ -2248,7 +2261,7 @@ class FunctionLiteral final : public Expression {
void mark_as_iife() { bit_field_ = IIFEBit::update(bit_field_, true); }
bool is_iife() const { return IIFEBit::decode(bit_field_); }
- bool is_top_level() const {
+ bool is_toplevel() const {
return function_literal_id() == FunctionLiteral::kIdTypeTopLevel;
}
bool is_wrapped() const { return function_type() == kWrapped; }
@@ -2308,7 +2321,7 @@ class FunctionLiteral final : public Expression {
// - (function() { ... })();
// - var x = function() { ... }();
bool ShouldEagerCompile() const;
- void SetShouldEagerCompile();
+ V8_EXPORT_PRIVATE void SetShouldEagerCompile();
FunctionType function_type() const {
return FunctionTypeBits::decode(bit_field_);
@@ -2736,7 +2749,7 @@ class TemplateLiteral final : public Expression {
// class SpecificVisitor : public AstVisitor<SpecificVisitor> { ... }
template <class Subclass>
-class AstVisitor BASE_EMBEDDED {
+class AstVisitor {
public:
void Visit(AstNode* node) { impl()->Visit(node); }
@@ -2823,7 +2836,7 @@ class AstVisitor BASE_EMBEDDED {
// ----------------------------------------------------------------------------
// AstNode factory
-class AstNodeFactory final BASE_EMBEDDED {
+class AstNodeFactory final {
public:
AstNodeFactory(AstValueFactory* ast_value_factory, Zone* zone)
: zone_(zone), ast_value_factory_(ast_value_factory) {}
@@ -3330,7 +3343,6 @@ class AstNodeFactory final BASE_EMBEDDED {
}
Zone* zone() const { return zone_; }
- void set_zone(Zone* zone) { zone_ = zone; }
private:
// This zone may be deallocated upon returning from parsing a function body