OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_AST_AST_H_ | 5 #ifndef V8_AST_AST_H_ |
6 #define V8_AST_AST_H_ | 6 #define V8_AST_AST_H_ |
7 | 7 |
8 #include "src/assembler.h" | |
9 #include "src/ast/ast-value-factory.h" | 8 #include "src/ast/ast-value-factory.h" |
10 #include "src/ast/modules.h" | 9 #include "src/ast/modules.h" |
11 #include "src/ast/variables.h" | 10 #include "src/ast/variables.h" |
12 #include "src/bailout-reason.h" | 11 #include "src/bailout-reason.h" |
13 #include "src/base/flags.h" | 12 #include "src/base/flags.h" |
14 #include "src/base/smart-pointers.h" | 13 #include "src/base/smart-pointers.h" |
15 #include "src/factory.h" | 14 #include "src/factory.h" |
| 15 #include "src/globals.h" |
16 #include "src/isolate.h" | 16 #include "src/isolate.h" |
17 #include "src/list.h" | 17 #include "src/list.h" |
18 #include "src/parsing/token.h" | 18 #include "src/parsing/token.h" |
19 #include "src/runtime/runtime.h" | 19 #include "src/runtime/runtime.h" |
20 #include "src/small-pointer-list.h" | 20 #include "src/small-pointer-list.h" |
21 #include "src/types.h" | 21 #include "src/types.h" |
22 #include "src/utils.h" | 22 #include "src/utils.h" |
23 | 23 |
24 namespace v8 { | 24 namespace v8 { |
25 namespace internal { | 25 namespace internal { |
(...skipping 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1256 class SloppyBlockFunctionStatement final : public Statement { | 1256 class SloppyBlockFunctionStatement final : public Statement { |
1257 public: | 1257 public: |
1258 DECLARE_NODE_TYPE(SloppyBlockFunctionStatement) | 1258 DECLARE_NODE_TYPE(SloppyBlockFunctionStatement) |
1259 | 1259 |
1260 Statement* statement() const { return statement_; } | 1260 Statement* statement() const { return statement_; } |
1261 void set_statement(Statement* statement) { statement_ = statement; } | 1261 void set_statement(Statement* statement) { statement_ = statement; } |
1262 Scope* scope() const { return scope_; } | 1262 Scope* scope() const { return scope_; } |
1263 | 1263 |
1264 private: | 1264 private: |
1265 SloppyBlockFunctionStatement(Zone* zone, Statement* statement, Scope* scope) | 1265 SloppyBlockFunctionStatement(Zone* zone, Statement* statement, Scope* scope) |
1266 : Statement(zone, RelocInfo::kNoPosition), | 1266 : Statement(zone, kNoSourcePosition), |
1267 statement_(statement), | 1267 statement_(statement), |
1268 scope_(scope) {} | 1268 scope_(scope) {} |
1269 | 1269 |
1270 Statement* statement_; | 1270 Statement* statement_; |
1271 Scope* const scope_; | 1271 Scope* const scope_; |
1272 }; | 1272 }; |
1273 | 1273 |
1274 | 1274 |
1275 class Literal final : public Expression { | 1275 class Literal final : public Expression { |
1276 public: | 1276 public: |
(...skipping 1420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2697 : Expression(zone, position), | 2697 : Expression(zone, position), |
2698 raw_name_(name), | 2698 raw_name_(name), |
2699 scope_(scope), | 2699 scope_(scope), |
2700 body_(body), | 2700 body_(body), |
2701 raw_inferred_name_(ast_value_factory->empty_string()), | 2701 raw_inferred_name_(ast_value_factory->empty_string()), |
2702 ast_properties_(zone), | 2702 ast_properties_(zone), |
2703 dont_optimize_reason_(kNoReason), | 2703 dont_optimize_reason_(kNoReason), |
2704 materialized_literal_count_(materialized_literal_count), | 2704 materialized_literal_count_(materialized_literal_count), |
2705 expected_property_count_(expected_property_count), | 2705 expected_property_count_(expected_property_count), |
2706 parameter_count_(parameter_count), | 2706 parameter_count_(parameter_count), |
2707 function_token_position_(RelocInfo::kNoPosition), | 2707 function_token_position_(kNoSourcePosition), |
2708 yield_count_(0) { | 2708 yield_count_(0) { |
2709 bitfield_ = | 2709 bitfield_ = |
2710 FunctionTypeBits::encode(function_type) | Pretenure::encode(false) | | 2710 FunctionTypeBits::encode(function_type) | Pretenure::encode(false) | |
2711 HasDuplicateParameters::encode(has_duplicate_parameters == | 2711 HasDuplicateParameters::encode(has_duplicate_parameters == |
2712 kHasDuplicateParameters) | | 2712 kHasDuplicateParameters) | |
2713 IsFunction::encode(is_function) | | 2713 IsFunction::encode(is_function) | |
2714 ShouldEagerCompile::encode(eager_compile_hint == kShouldEagerCompile) | | 2714 ShouldEagerCompile::encode(eager_compile_hint == kShouldEagerCompile) | |
2715 FunctionKindBits::encode(kind) | ShouldBeUsedOnceHint::encode(false); | 2715 FunctionKindBits::encode(kind) | ShouldBeUsedOnceHint::encode(false); |
2716 DCHECK(IsValidFunctionKind(kind)); | 2716 DCHECK(IsValidFunctionKind(kind)); |
2717 } | 2717 } |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3285 } | 3285 } |
3286 | 3286 |
3287 ArrayLiteral* NewArrayLiteral(ZoneList<Expression*>* values, | 3287 ArrayLiteral* NewArrayLiteral(ZoneList<Expression*>* values, |
3288 int first_spread_index, int literal_index, | 3288 int first_spread_index, int literal_index, |
3289 int pos) { | 3289 int pos) { |
3290 return new (local_zone_) ArrayLiteral( | 3290 return new (local_zone_) ArrayLiteral( |
3291 local_zone_, values, first_spread_index, literal_index, pos); | 3291 local_zone_, values, first_spread_index, literal_index, pos); |
3292 } | 3292 } |
3293 | 3293 |
3294 VariableProxy* NewVariableProxy(Variable* var, | 3294 VariableProxy* NewVariableProxy(Variable* var, |
3295 int start_position = RelocInfo::kNoPosition, | 3295 int start_position = kNoSourcePosition, |
3296 int end_position = RelocInfo::kNoPosition) { | 3296 int end_position = kNoSourcePosition) { |
3297 return new (parser_zone_) | 3297 return new (parser_zone_) |
3298 VariableProxy(parser_zone_, var, start_position, end_position); | 3298 VariableProxy(parser_zone_, var, start_position, end_position); |
3299 } | 3299 } |
3300 | 3300 |
3301 VariableProxy* NewVariableProxy(const AstRawString* name, | 3301 VariableProxy* NewVariableProxy(const AstRawString* name, |
3302 Variable::Kind variable_kind, | 3302 Variable::Kind variable_kind, |
3303 int start_position = RelocInfo::kNoPosition, | 3303 int start_position = kNoSourcePosition, |
3304 int end_position = RelocInfo::kNoPosition) { | 3304 int end_position = kNoSourcePosition) { |
3305 DCHECK_NOT_NULL(name); | 3305 DCHECK_NOT_NULL(name); |
3306 return new (parser_zone_) VariableProxy(parser_zone_, name, variable_kind, | 3306 return new (parser_zone_) VariableProxy(parser_zone_, name, variable_kind, |
3307 start_position, end_position); | 3307 start_position, end_position); |
3308 } | 3308 } |
3309 | 3309 |
3310 Property* NewProperty(Expression* obj, Expression* key, int pos) { | 3310 Property* NewProperty(Expression* obj, Expression* key, int pos) { |
3311 return new (local_zone_) Property(local_zone_, obj, key, pos); | 3311 return new (local_zone_) Property(local_zone_, obj, key, pos); |
3312 } | 3312 } |
3313 | 3313 |
3314 Call* NewCall(Expression* expression, | 3314 Call* NewCall(Expression* expression, |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3557 : NULL; \ | 3557 : NULL; \ |
3558 } | 3558 } |
3559 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) | 3559 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) |
3560 #undef DECLARE_NODE_FUNCTIONS | 3560 #undef DECLARE_NODE_FUNCTIONS |
3561 | 3561 |
3562 | 3562 |
3563 } // namespace internal | 3563 } // namespace internal |
3564 } // namespace v8 | 3564 } // namespace v8 |
3565 | 3565 |
3566 #endif // V8_AST_AST_H_ | 3566 #endif // V8_AST_AST_H_ |
OLD | NEW |