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

Side by Side Diff: src/ast.h

Issue 722793005: Classes: Implement correct name binding (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/ast-numbering.cc » ('j') | src/full-codegen.cc » ('J')
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 2653 matching lines...) Expand 10 before | Expand all | Expand 10 after
2664 2664
2665 2665
2666 class ClassLiteral FINAL : public Expression { 2666 class ClassLiteral FINAL : public Expression {
2667 public: 2667 public:
2668 typedef ObjectLiteralProperty Property; 2668 typedef ObjectLiteralProperty Property;
2669 2669
2670 DECLARE_NODE_TYPE(ClassLiteral) 2670 DECLARE_NODE_TYPE(ClassLiteral)
2671 2671
2672 Handle<String> name() const { return raw_name_->string(); } 2672 Handle<String> name() const { return raw_name_->string(); }
2673 const AstRawString* raw_name() const { return raw_name_; } 2673 const AstRawString* raw_name() const { return raw_name_; }
2674 Scope* scope() const { return scope_; }
2675 VariableProxy* proxy() const { return proxy_; }
Dmitry Lomov (no reviews) 2014/11/13 11:17:37 Nit: rename proxy => class_variable_proxy (also fi
arv (Not doing code reviews) 2014/11/13 20:47:49 Done.
2674 Expression* extends() const { return extends_; } 2676 Expression* extends() const { return extends_; }
2675 Expression* constructor() const { return constructor_; } 2677 Expression* constructor() const { return constructor_; }
2676 ZoneList<Property*>* properties() const { return properties_; } 2678 ZoneList<Property*>* properties() const { return properties_; }
2677 int start_position() const { return position(); } 2679 int start_position() const { return position(); }
2678 int end_position() const { return end_position_; } 2680 int end_position() const { return end_position_; }
2679 2681
2680 protected: 2682 protected:
2681 ClassLiteral(Zone* zone, const AstRawString* name, Expression* extends, 2683 ClassLiteral(Zone* zone, const AstRawString* name, Scope* scope,
2684 VariableProxy* proxy, Expression* extends,
Dmitry Lomov (no reviews) 2014/11/13 11:17:37 proxy => class_variable_proxy
arv (Not doing code reviews) 2014/11/13 20:47:49 Done.
2682 Expression* constructor, ZoneList<Property*>* properties, 2685 Expression* constructor, ZoneList<Property*>* properties,
2683 int start_position, int end_position) 2686 int start_position, int end_position)
2684 : Expression(zone, start_position), 2687 : Expression(zone, start_position),
2685 raw_name_(name), 2688 raw_name_(name),
2689 scope_(scope),
2690 proxy_(proxy),
2686 extends_(extends), 2691 extends_(extends),
2687 constructor_(constructor), 2692 constructor_(constructor),
2688 properties_(properties), 2693 properties_(properties),
2689 end_position_(end_position) {} 2694 end_position_(end_position) {}
2690 2695
2691 private: 2696 private:
2692 const AstRawString* raw_name_; 2697 const AstRawString* raw_name_;
2698 Scope* scope_;
2699 VariableProxy* proxy_;
Dmitry Lomov (no reviews) 2014/11/13 11:17:37 proxy_ => class_variable_proxy_
arv (Not doing code reviews) 2014/11/13 20:47:49 Done.
2693 Expression* extends_; 2700 Expression* extends_;
2694 Expression* constructor_; 2701 Expression* constructor_;
2695 ZoneList<Property*>* properties_; 2702 ZoneList<Property*>* properties_;
2696 int end_position_; 2703 int end_position_;
2697 }; 2704 };
2698 2705
2699 2706
2700 class NativeFunctionLiteral FINAL : public Expression { 2707 class NativeFunctionLiteral FINAL : public Expression {
2701 public: 2708 public:
2702 DECLARE_NODE_TYPE(NativeFunctionLiteral) 2709 DECLARE_NODE_TYPE(NativeFunctionLiteral)
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after
3666 expected_property_count, handler_count, parameter_count, function_type, 3673 expected_property_count, handler_count, parameter_count, function_type,
3667 has_duplicate_parameters, is_function, is_parenthesized, kind, 3674 has_duplicate_parameters, is_function, is_parenthesized, kind,
3668 position); 3675 position);
3669 // Top-level literal doesn't count for the AST's properties. 3676 // Top-level literal doesn't count for the AST's properties.
3670 if (is_function == FunctionLiteral::kIsFunction) { 3677 if (is_function == FunctionLiteral::kIsFunction) {
3671 visitor_.VisitFunctionLiteral(lit); 3678 visitor_.VisitFunctionLiteral(lit);
3672 } 3679 }
3673 return lit; 3680 return lit;
3674 } 3681 }
3675 3682
3676 ClassLiteral* NewClassLiteral(const AstRawString* name, Expression* extends, 3683 ClassLiteral* NewClassLiteral(const AstRawString* name, Scope* scope,
3684 VariableProxy* proxy, Expression* extends,
Dmitry Lomov (no reviews) 2014/11/13 11:17:37 proxy => class_variable_proxy
3677 Expression* constructor, 3685 Expression* constructor,
3678 ZoneList<ObjectLiteral::Property*>* properties, 3686 ZoneList<ObjectLiteral::Property*>* properties,
3679 int start_position, int end_position) { 3687 int start_position, int end_position) {
3680 ClassLiteral* lit = 3688 ClassLiteral* lit = new (zone_)
3681 new (zone_) ClassLiteral(zone_, name, extends, constructor, properties, 3689 ClassLiteral(zone_, name, scope, proxy, extends, constructor,
3682 start_position, end_position); 3690 properties, start_position, end_position);
3683 VISIT_AND_RETURN(ClassLiteral, lit) 3691 VISIT_AND_RETURN(ClassLiteral, lit)
3684 } 3692 }
3685 3693
3686 NativeFunctionLiteral* NewNativeFunctionLiteral(const AstRawString* name, 3694 NativeFunctionLiteral* NewNativeFunctionLiteral(const AstRawString* name,
3687 v8::Extension* extension, 3695 v8::Extension* extension,
3688 int pos) { 3696 int pos) {
3689 NativeFunctionLiteral* lit = 3697 NativeFunctionLiteral* lit =
3690 new (zone_) NativeFunctionLiteral(zone_, name, extension, pos); 3698 new (zone_) NativeFunctionLiteral(zone_, name, extension, pos);
3691 VISIT_AND_RETURN(NativeFunctionLiteral, lit) 3699 VISIT_AND_RETURN(NativeFunctionLiteral, lit)
3692 } 3700 }
(...skipping 13 matching lines...) Expand all
3706 private: 3714 private:
3707 Zone* zone_; 3715 Zone* zone_;
3708 Visitor visitor_; 3716 Visitor visitor_;
3709 AstValueFactory* ast_value_factory_; 3717 AstValueFactory* ast_value_factory_;
3710 }; 3718 };
3711 3719
3712 3720
3713 } } // namespace v8::internal 3721 } } // namespace v8::internal
3714 3722
3715 #endif // V8_AST_H_ 3723 #endif // V8_AST_H_
OLDNEW
« no previous file with comments | « no previous file | src/ast-numbering.cc » ('j') | src/full-codegen.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698