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

Side by Side Diff: src/ast/ast.h

Issue 1618613002: [for-in] Sanitize for-in optimizations and fix bailout points. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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/macro-assembler-arm64.cc ('k') | src/crankshaft/arm/lithium-codegen-arm.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_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" 8 #include "src/assembler.h"
9 #include "src/ast/ast-value-factory.h" 9 #include "src/ast/ast-value-factory.h"
10 #include "src/ast/modules.h" 10 #include "src/ast/modules.h"
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 855
856 FeedbackVectorSlot ForInFeedbackSlot() { 856 FeedbackVectorSlot ForInFeedbackSlot() {
857 DCHECK(!for_in_feedback_slot_.IsInvalid()); 857 DCHECK(!for_in_feedback_slot_.IsInvalid());
858 return for_in_feedback_slot_; 858 return for_in_feedback_slot_;
859 } 859 }
860 860
861 enum ForInType { FAST_FOR_IN, SLOW_FOR_IN }; 861 enum ForInType { FAST_FOR_IN, SLOW_FOR_IN };
862 ForInType for_in_type() const { return for_in_type_; } 862 ForInType for_in_type() const { return for_in_type_; }
863 void set_for_in_type(ForInType type) { for_in_type_ = type; } 863 void set_for_in_type(ForInType type) { for_in_type_ = type; }
864 864
865 static int num_ids() { return parent_num_ids() + 6; } 865 static int num_ids() { return parent_num_ids() + 5; }
866 BailoutId BodyId() const { return BailoutId(local_id(0)); } 866 BailoutId BodyId() const { return BailoutId(local_id(0)); }
867 BailoutId PrepareId() const { return BailoutId(local_id(1)); } 867 BailoutId EnumId() const { return BailoutId(local_id(1)); }
868 BailoutId EnumId() const { return BailoutId(local_id(2)); } 868 BailoutId ToObjectId() const { return BailoutId(local_id(2)); }
869 BailoutId ToObjectId() const { return BailoutId(local_id(3)); } 869 BailoutId FilterId() const { return BailoutId(local_id(3)); }
870 BailoutId FilterId() const { return BailoutId(local_id(4)); } 870 BailoutId AssignmentId() const { return BailoutId(local_id(4)); }
871 BailoutId AssignmentId() const { return BailoutId(local_id(5)); }
872 BailoutId ContinueId() const override { return EntryId(); } 871 BailoutId ContinueId() const override { return EntryId(); }
873 BailoutId StackCheckId() const override { return BodyId(); } 872 BailoutId StackCheckId() const override { return BodyId(); }
874 873
875 protected: 874 protected:
876 ForInStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos) 875 ForInStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos)
877 : ForEachStatement(zone, labels, pos), for_in_type_(SLOW_FOR_IN) {} 876 : ForEachStatement(zone, labels, pos), for_in_type_(SLOW_FOR_IN) {}
878 static int parent_num_ids() { return ForEachStatement::num_ids(); } 877 static int parent_num_ids() { return ForEachStatement::num_ids(); }
879 878
880 private: 879 private:
881 int local_id(int n) const { return base_id() + parent_num_ids() + n; } 880 int local_id(int n) const { return base_id() + parent_num_ids() + n; }
(...skipping 2667 matching lines...) Expand 10 before | Expand all | Expand 10 after
3549 // the parser-level zone. 3548 // the parser-level zone.
3550 Zone* parser_zone_; 3549 Zone* parser_zone_;
3551 AstValueFactory* ast_value_factory_; 3550 AstValueFactory* ast_value_factory_;
3552 }; 3551 };
3553 3552
3554 3553
3555 } // namespace internal 3554 } // namespace internal
3556 } // namespace v8 3555 } // namespace v8
3557 3556
3558 #endif // V8_AST_AST_H_ 3557 #endif // V8_AST_AST_H_
OLDNEW
« no previous file with comments | « src/arm64/macro-assembler-arm64.cc ('k') | src/crankshaft/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698