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

Side by Side Diff: src/ast.h

Issue 8589019: Landing: [hydrogen] optimize switch with string clauses. Patch by Fedor Indutny <fedor.indutny@gm... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 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 | « src/arm/lithium-codegen-arm.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 719
720 int position() const { return position_; } 720 int position() const { return position_; }
721 void set_position(int pos) { position_ = pos; } 721 void set_position(int pos) { position_ = pos; }
722 722
723 int EntryId() { return entry_id_; } 723 int EntryId() { return entry_id_; }
724 int CompareId() { return compare_id_; } 724 int CompareId() { return compare_id_; }
725 725
726 // Type feedback information. 726 // Type feedback information.
727 void RecordTypeFeedback(TypeFeedbackOracle* oracle); 727 void RecordTypeFeedback(TypeFeedbackOracle* oracle);
728 bool IsSmiCompare() { return compare_type_ == SMI_ONLY; } 728 bool IsSmiCompare() { return compare_type_ == SMI_ONLY; }
729 bool IsSymbolCompare() { return compare_type_ == SYMBOL_ONLY; }
730 bool IsStringCompare() { return compare_type_ == STRING_ONLY; }
729 bool IsObjectCompare() { return compare_type_ == OBJECT_ONLY; } 731 bool IsObjectCompare() { return compare_type_ == OBJECT_ONLY; }
730 732
731 private: 733 private:
732 Expression* label_; 734 Expression* label_;
733 Label body_target_; 735 Label body_target_;
734 ZoneList<Statement*>* statements_; 736 ZoneList<Statement*>* statements_;
735 int position_; 737 int position_;
736 enum CompareTypeFeedback { NONE, SMI_ONLY, OBJECT_ONLY }; 738 enum CompareTypeFeedback {
739 NONE,
740 SMI_ONLY,
741 SYMBOL_ONLY,
742 STRING_ONLY,
743 OBJECT_ONLY
744 };
737 CompareTypeFeedback compare_type_; 745 CompareTypeFeedback compare_type_;
738 int compare_id_; 746 int compare_id_;
739 int entry_id_; 747 int entry_id_;
740 }; 748 };
741 749
742 750
743 class SwitchStatement: public BreakableStatement { 751 class SwitchStatement: public BreakableStatement {
744 public: 752 public:
745 SwitchStatement(Isolate* isolate, ZoneStringList* labels) 753 SwitchStatement(Isolate* isolate, ZoneStringList* labels)
746 : BreakableStatement(isolate, labels, TARGET_FOR_ANONYMOUS), 754 : BreakableStatement(isolate, labels, TARGET_FOR_ANONYMOUS),
(...skipping 1420 matching lines...) Expand 10 before | Expand all | Expand 10 after
2167 2175
2168 private: 2176 private:
2169 Isolate* isolate_; 2177 Isolate* isolate_;
2170 bool stack_overflow_; 2178 bool stack_overflow_;
2171 }; 2179 };
2172 2180
2173 2181
2174 } } // namespace v8::internal 2182 } } // namespace v8::internal
2175 2183
2176 #endif // V8_AST_H_ 2184 #endif // V8_AST_H_
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698