Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Side by Side Diff: src/ast.h

Issue 1146863007: [es6] Super call in arrows and eval (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/arm64/full-codegen-arm64.cc ('k') | src/ast.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 V(Property) \ 80 V(Property) \
81 V(Call) \ 81 V(Call) \
82 V(CallNew) \ 82 V(CallNew) \
83 V(CallRuntime) \ 83 V(CallRuntime) \
84 V(UnaryOperation) \ 84 V(UnaryOperation) \
85 V(CountOperation) \ 85 V(CountOperation) \
86 V(BinaryOperation) \ 86 V(BinaryOperation) \
87 V(CompareOperation) \ 87 V(CompareOperation) \
88 V(Spread) \ 88 V(Spread) \
89 V(ThisFunction) \ 89 V(ThisFunction) \
90 V(SuperReference) \ 90 V(SuperPropertyReference) \
91 V(SuperCallReference) \
91 V(CaseClause) 92 V(CaseClause)
92 93
93 #define AST_NODE_LIST(V) \ 94 #define AST_NODE_LIST(V) \
94 DECLARATION_NODE_LIST(V) \ 95 DECLARATION_NODE_LIST(V) \
95 STATEMENT_NODE_LIST(V) \ 96 STATEMENT_NODE_LIST(V) \
96 EXPRESSION_NODE_LIST(V) 97 EXPRESSION_NODE_LIST(V)
97 98
98 // Forward declarations 99 // Forward declarations
99 class AstNodeFactory; 100 class AstNodeFactory;
100 class AstVisitor; 101 class AstVisitor;
(...skipping 1652 matching lines...) Expand 10 before | Expand all | Expand 10 after
1753 bit_field_ = KeyTypeField::update(bit_field_, key_type); 1754 bit_field_ = KeyTypeField::update(bit_field_, key_type);
1754 } 1755 }
1755 void set_inline_cache_state(InlineCacheState state) { 1756 void set_inline_cache_state(InlineCacheState state) {
1756 bit_field_ = InlineCacheStateField::update(bit_field_, state); 1757 bit_field_ = InlineCacheStateField::update(bit_field_, state);
1757 } 1758 }
1758 void mark_for_call() { 1759 void mark_for_call() {
1759 bit_field_ = IsForCallField::update(bit_field_, true); 1760 bit_field_ = IsForCallField::update(bit_field_, true);
1760 } 1761 }
1761 bool is_for_call() const { return IsForCallField::decode(bit_field_); } 1762 bool is_for_call() const { return IsForCallField::decode(bit_field_); }
1762 1763
1763 bool IsSuperAccess() { 1764 bool IsSuperAccess() { return obj()->IsSuperPropertyReference(); }
1764 return obj()->IsSuperReference();
1765 }
1766 1765
1767 virtual FeedbackVectorRequirements ComputeFeedbackRequirements( 1766 virtual FeedbackVectorRequirements ComputeFeedbackRequirements(
1768 Isolate* isolate, const ICSlotCache* cache) override { 1767 Isolate* isolate, const ICSlotCache* cache) override {
1769 return FeedbackVectorRequirements(0, 1); 1768 return FeedbackVectorRequirements(0, 1);
1770 } 1769 }
1771 void SetFirstFeedbackICSlot(FeedbackVectorICSlot slot, 1770 void SetFirstFeedbackICSlot(FeedbackVectorICSlot slot,
1772 ICSlotCache* cache) override { 1771 ICSlotCache* cache) override {
1773 property_feedback_slot_ = slot; 1772 property_feedback_slot_ = slot;
1774 } 1773 }
1775 Code::Kind FeedbackICSlotKind(int index) override { 1774 Code::Kind FeedbackICSlotKind(int index) override {
(...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after
2784 2783
2785 class ThisFunction final : public Expression { 2784 class ThisFunction final : public Expression {
2786 public: 2785 public:
2787 DECLARE_NODE_TYPE(ThisFunction) 2786 DECLARE_NODE_TYPE(ThisFunction)
2788 2787
2789 protected: 2788 protected:
2790 ThisFunction(Zone* zone, int pos) : Expression(zone, pos) {} 2789 ThisFunction(Zone* zone, int pos) : Expression(zone, pos) {}
2791 }; 2790 };
2792 2791
2793 2792
2794 class SuperReference final : public Expression { 2793 class SuperPropertyReference final : public Expression {
2795 public: 2794 public:
2796 DECLARE_NODE_TYPE(SuperReference) 2795 DECLARE_NODE_TYPE(SuperPropertyReference)
2797 2796
2798 VariableProxy* this_var() const { return this_var_; } 2797 VariableProxy* this_var() const { return this_var_; }
2799 VariableProxy* home_object_var() const { return home_object_var_; } 2798 VariableProxy* home_object_var() const { return home_object_var_; }
2800 2799
2801 protected: 2800 protected:
2802 SuperReference(Zone* zone, VariableProxy* this_var, 2801 SuperPropertyReference(Zone* zone, VariableProxy* this_var,
2803 VariableProxy* home_object_var, int pos) 2802 VariableProxy* home_object_var, int pos)
2804 : Expression(zone, pos), 2803 : Expression(zone, pos),
2805 this_var_(this_var), 2804 this_var_(this_var),
2806 home_object_var_(home_object_var) { 2805 home_object_var_(home_object_var) {
2807 DCHECK(this_var->is_this()); 2806 DCHECK(this_var->is_this());
2808 DCHECK(home_object_var->raw_name()->IsOneByteEqualTo(".home_object")); 2807 DCHECK(home_object_var->raw_name()->IsOneByteEqualTo(".home_object"));
2809 } 2808 }
2810 2809
2811 private: 2810 private:
2812 VariableProxy* this_var_; 2811 VariableProxy* this_var_;
2813 VariableProxy* home_object_var_; 2812 VariableProxy* home_object_var_;
2814 }; 2813 };
2815 2814
2816 2815
2816 class SuperCallReference final : public Expression {
2817 public:
2818 DECLARE_NODE_TYPE(SuperCallReference)
2819
2820 VariableProxy* this_var() const { return this_var_; }
2821 VariableProxy* new_target_var() const { return new_target_var_; }
2822 VariableProxy* this_function_var() const { return this_function_var_; }
2823
2824 protected:
2825 SuperCallReference(Zone* zone, VariableProxy* this_var,
2826 VariableProxy* new_target_var,
2827 VariableProxy* this_function_var, int pos)
2828 : Expression(zone, pos),
2829 this_var_(this_var),
2830 new_target_var_(new_target_var),
2831 this_function_var_(this_function_var) {
2832 DCHECK(this_var->is_this());
2833 DCHECK(new_target_var->raw_name()->IsOneByteEqualTo("new.target"));
2834 DCHECK(this_function_var->raw_name()->IsOneByteEqualTo(".this_function"));
2835 }
2836
2837 private:
2838 VariableProxy* this_var_;
2839 VariableProxy* new_target_var_;
2840 VariableProxy* this_function_var_;
2841 };
2842
2843
2817 #undef DECLARE_NODE_TYPE 2844 #undef DECLARE_NODE_TYPE
2818 2845
2819 2846
2820 // ---------------------------------------------------------------------------- 2847 // ----------------------------------------------------------------------------
2821 // Regular expressions 2848 // Regular expressions
2822 2849
2823 2850
2824 class RegExpVisitor BASE_EMBEDDED { 2851 class RegExpVisitor BASE_EMBEDDED {
2825 public: 2852 public:
2826 virtual ~RegExpVisitor() { } 2853 virtual ~RegExpVisitor() { }
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after
3574 NativeFunctionLiteral* NewNativeFunctionLiteral(const AstRawString* name, 3601 NativeFunctionLiteral* NewNativeFunctionLiteral(const AstRawString* name,
3575 v8::Extension* extension, 3602 v8::Extension* extension,
3576 int pos) { 3603 int pos) {
3577 return new (zone_) NativeFunctionLiteral(zone_, name, extension, pos); 3604 return new (zone_) NativeFunctionLiteral(zone_, name, extension, pos);
3578 } 3605 }
3579 3606
3580 ThisFunction* NewThisFunction(int pos) { 3607 ThisFunction* NewThisFunction(int pos) {
3581 return new (zone_) ThisFunction(zone_, pos); 3608 return new (zone_) ThisFunction(zone_, pos);
3582 } 3609 }
3583 3610
3584 SuperReference* NewSuperReference(VariableProxy* this_var, 3611 SuperPropertyReference* NewSuperPropertyReference(
3585 VariableProxy* home_object_var, int pos) { 3612 VariableProxy* this_var, VariableProxy* home_object_var, int pos) {
3586 return new (zone_) SuperReference(zone_, this_var, home_object_var, pos); 3613 return new (zone_)
3614 SuperPropertyReference(zone_, this_var, home_object_var, pos);
3615 }
3616
3617 SuperCallReference* NewSuperCallReference(VariableProxy* this_var,
3618 VariableProxy* new_target_var,
3619 VariableProxy* this_function_var,
3620 int pos) {
3621 return new (zone_) SuperCallReference(zone_, this_var, new_target_var,
3622 this_function_var, pos);
3587 } 3623 }
3588 3624
3589 private: 3625 private:
3590 Zone* zone_; 3626 Zone* zone_;
3591 AstValueFactory* ast_value_factory_; 3627 AstValueFactory* ast_value_factory_;
3592 }; 3628 };
3593 3629
3594 3630
3595 } } // namespace v8::internal 3631 } } // namespace v8::internal
3596 3632
3597 #endif // V8_AST_H_ 3633 #endif // V8_AST_H_
OLDNEW
« no previous file with comments | « src/arm64/full-codegen-arm64.cc ('k') | src/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698