| 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_H_ | 5 #ifndef V8_AST_H_ |
| 6 #define V8_AST_H_ | 6 #define V8_AST_H_ |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/assembler.h" | 10 #include "src/assembler.h" |
| (...skipping 1512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1523 }; | 1523 }; |
| 1524 | 1524 |
| 1525 struct Accessors: public ZoneObject { | 1525 struct Accessors: public ZoneObject { |
| 1526 Accessors() : getter(NULL), setter(NULL) {} | 1526 Accessors() : getter(NULL), setter(NULL) {} |
| 1527 Expression* getter; | 1527 Expression* getter; |
| 1528 Expression* setter; | 1528 Expression* setter; |
| 1529 }; | 1529 }; |
| 1530 | 1530 |
| 1531 BailoutId CreateLiteralId() const { return BailoutId(local_id(0)); } | 1531 BailoutId CreateLiteralId() const { return BailoutId(local_id(0)); } |
| 1532 | 1532 |
| 1533 static int num_ids() { return parent_num_ids() + 1; } | 1533 // Return an AST id for a property that is used in simulate instructions. |
| 1534 BailoutId GetIdForProperty(int i) { return BailoutId(local_id(i + 1)); } |
| 1535 |
| 1536 // Unlike other AST nodes, this number of bailout IDs allocated for an |
| 1537 // ObjectLiteral can vary, so num_ids() is not a static method. |
| 1538 int num_ids() const { return parent_num_ids() + 1 + properties()->length(); } |
| 1534 | 1539 |
| 1535 protected: | 1540 protected: |
| 1536 ObjectLiteral(Zone* zone, ZoneList<Property*>* properties, int literal_index, | 1541 ObjectLiteral(Zone* zone, ZoneList<Property*>* properties, int literal_index, |
| 1537 int boilerplate_properties, bool has_function, int pos) | 1542 int boilerplate_properties, bool has_function, int pos) |
| 1538 : MaterializedLiteral(zone, literal_index, pos), | 1543 : MaterializedLiteral(zone, literal_index, pos), |
| 1539 properties_(properties), | 1544 properties_(properties), |
| 1540 boilerplate_properties_(boilerplate_properties), | 1545 boilerplate_properties_(boilerplate_properties), |
| 1541 fast_elements_(false), | 1546 fast_elements_(false), |
| 1542 may_store_doubles_(false), | 1547 may_store_doubles_(false), |
| 1543 has_function_(has_function) {} | 1548 has_function_(has_function) {} |
| (...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2634 Handle<String> name() const { return raw_name_->string(); } | 2639 Handle<String> name() const { return raw_name_->string(); } |
| 2635 const AstRawString* raw_name() const { return raw_name_; } | 2640 const AstRawString* raw_name() const { return raw_name_; } |
| 2636 Scope* scope() const { return scope_; } | 2641 Scope* scope() const { return scope_; } |
| 2637 VariableProxy* class_variable_proxy() const { return class_variable_proxy_; } | 2642 VariableProxy* class_variable_proxy() const { return class_variable_proxy_; } |
| 2638 Expression* extends() const { return extends_; } | 2643 Expression* extends() const { return extends_; } |
| 2639 FunctionLiteral* constructor() const { return constructor_; } | 2644 FunctionLiteral* constructor() const { return constructor_; } |
| 2640 ZoneList<Property*>* properties() const { return properties_; } | 2645 ZoneList<Property*>* properties() const { return properties_; } |
| 2641 int start_position() const { return position(); } | 2646 int start_position() const { return position(); } |
| 2642 int end_position() const { return end_position_; } | 2647 int end_position() const { return end_position_; } |
| 2643 | 2648 |
| 2644 static int num_ids() { return parent_num_ids() + 3; } | |
| 2645 BailoutId EntryId() const { return BailoutId(local_id(0)); } | 2649 BailoutId EntryId() const { return BailoutId(local_id(0)); } |
| 2646 BailoutId DeclsId() const { return BailoutId(local_id(1)); } | 2650 BailoutId DeclsId() const { return BailoutId(local_id(1)); } |
| 2647 BailoutId ExitId() { return BailoutId(local_id(2)); } | 2651 BailoutId ExitId() { return BailoutId(local_id(2)); } |
| 2648 | 2652 |
| 2653 // Return an AST id for a property that is used in simulate instructions. |
| 2654 BailoutId GetIdForProperty(int i) { return BailoutId(local_id(i + 3)); } |
| 2655 |
| 2656 // Unlike other AST nodes, this number of bailout IDs allocated for an |
| 2657 // ClassLiteral can vary, so num_ids() is not a static method. |
| 2658 int num_ids() const { return parent_num_ids() + 3 + properties()->length(); } |
| 2659 |
| 2649 protected: | 2660 protected: |
| 2650 ClassLiteral(Zone* zone, const AstRawString* name, Scope* scope, | 2661 ClassLiteral(Zone* zone, const AstRawString* name, Scope* scope, |
| 2651 VariableProxy* class_variable_proxy, Expression* extends, | 2662 VariableProxy* class_variable_proxy, Expression* extends, |
| 2652 FunctionLiteral* constructor, ZoneList<Property*>* properties, | 2663 FunctionLiteral* constructor, ZoneList<Property*>* properties, |
| 2653 int start_position, int end_position) | 2664 int start_position, int end_position) |
| 2654 : Expression(zone, start_position), | 2665 : Expression(zone, start_position), |
| 2655 raw_name_(name), | 2666 raw_name_(name), |
| 2656 scope_(scope), | 2667 scope_(scope), |
| 2657 class_variable_proxy_(class_variable_proxy), | 2668 class_variable_proxy_(class_variable_proxy), |
| 2658 extends_(extends), | 2669 extends_(extends), |
| (...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3537 | 3548 |
| 3538 private: | 3549 private: |
| 3539 Zone* zone_; | 3550 Zone* zone_; |
| 3540 AstValueFactory* ast_value_factory_; | 3551 AstValueFactory* ast_value_factory_; |
| 3541 }; | 3552 }; |
| 3542 | 3553 |
| 3543 | 3554 |
| 3544 } } // namespace v8::internal | 3555 } } // namespace v8::internal |
| 3545 | 3556 |
| 3546 #endif // V8_AST_H_ | 3557 #endif // V8_AST_H_ |
| OLD | NEW |