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

Side by Side Diff: src/ast.h

Issue 9425045: Support fast case for-in in Crankshaft. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: port to x64&arm, cleanup Created 8 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 779
780 void Initialize(Expression* each, Expression* enumerable, Statement* body) { 780 void Initialize(Expression* each, Expression* enumerable, Statement* body) {
781 IterationStatement::Initialize(body); 781 IterationStatement::Initialize(body);
782 each_ = each; 782 each_ = each;
783 enumerable_ = enumerable; 783 enumerable_ = enumerable;
784 } 784 }
785 785
786 Expression* each() const { return each_; } 786 Expression* each() const { return each_; }
787 Expression* enumerable() const { return enumerable_; } 787 Expression* enumerable() const { return enumerable_; }
788 788
789 // Bailout support.
790 int AssignmentId() const { return assignment_id_; }
791 virtual int ContinueId() const { return EntryId(); } 789 virtual int ContinueId() const { return EntryId(); }
792 virtual int StackCheckId() const { return EntryId(); } 790 virtual int StackCheckId() const { return body_id_; }
791 int BodyId() const { return body_id_; }
792 int PrepareId() const { return prepare_id_; }
793 793
794 protected: 794 protected:
795 template<class> friend class AstNodeFactory; 795 template<class> friend class AstNodeFactory;
796 796
797 ForInStatement(Isolate* isolate, ZoneStringList* labels) 797 ForInStatement(Isolate* isolate, ZoneStringList* labels)
798 : IterationStatement(isolate, labels), 798 : IterationStatement(isolate, labels),
799 each_(NULL), 799 each_(NULL),
800 enumerable_(NULL), 800 enumerable_(NULL),
801 assignment_id_(GetNextId(isolate)) { 801 body_id_(GetNextId(isolate)),
802 prepare_id_(GetNextId(isolate)) {
802 } 803 }
803 804
804 private: 805 private:
805 Expression* each_; 806 Expression* each_;
806 Expression* enumerable_; 807 Expression* enumerable_;
807 int assignment_id_; 808 int body_id_;
809 int prepare_id_;
808 }; 810 };
809 811
810 812
811 class ExpressionStatement: public Statement { 813 class ExpressionStatement: public Statement {
812 public: 814 public:
813 DECLARE_NODE_TYPE(ExpressionStatement) 815 DECLARE_NODE_TYPE(ExpressionStatement)
814 816
815 void set_expression(Expression* e) { expression_ = e; } 817 void set_expression(Expression* e) { expression_ = e; }
816 Expression* expression() const { return expression_; } 818 Expression* expression() const { return expression_; }
817 819
(...skipping 2006 matching lines...) Expand 10 before | Expand all | Expand 10 after
2824 private: 2826 private:
2825 Isolate* isolate_; 2827 Isolate* isolate_;
2826 Zone* zone_; 2828 Zone* zone_;
2827 Visitor visitor_; 2829 Visitor visitor_;
2828 }; 2830 };
2829 2831
2830 2832
2831 } } // namespace v8::internal 2833 } } // namespace v8::internal
2832 2834
2833 #endif // V8_AST_H_ 2835 #endif // V8_AST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698