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

Side by Side Diff: src/hydrogen-instructions.h

Issue 5699002: RFC: Switch to ast ids (instead of positions) for type feedback. (Closed)
Patch Set: Cleanup Created 10 years 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
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 999 matching lines...) Expand 10 before | Expand all | Expand 10 after
1010 HSimulate(int ast_id, int pop_count, int environment_height) 1010 HSimulate(int ast_id, int pop_count, int environment_height)
1011 : ast_id_(ast_id), 1011 : ast_id_(ast_id),
1012 pop_count_(pop_count), 1012 pop_count_(pop_count),
1013 environment_height_(environment_height), 1013 environment_height_(environment_height),
1014 values_(2), 1014 values_(2),
1015 assigned_indexes_(2) {} 1015 assigned_indexes_(2) {}
1016 virtual ~HSimulate() {} 1016 virtual ~HSimulate() {}
1017 1017
1018 virtual void PrintDataTo(StringStream* stream) const; 1018 virtual void PrintDataTo(StringStream* stream) const;
1019 1019
1020 bool HasAstId() const { return ast_id_ != AstNode::kNoNumber; } 1020 bool HasAstId() const { return ast_id_ != kNoAstId; }
1021 int ast_id() const { return ast_id_; } 1021 AstId ast_id() const { return ast_id_; }
1022 void set_ast_id(int id) { 1022 void set_ast_id(AstId id) {
1023 ASSERT(!HasAstId()); 1023 ASSERT(!HasAstId());
1024 ast_id_ = id; 1024 ast_id_ = id;
1025 } 1025 }
1026 1026
1027 int environment_height() const { return environment_height_; } 1027 int environment_height() const { return environment_height_; }
1028 int pop_count() const { return pop_count_; } 1028 int pop_count() const { return pop_count_; }
1029 const ZoneList<HValue*>* values() const { return &values_; } 1029 const ZoneList<HValue*>* values() const { return &values_; }
1030 int GetAssignedIndexAt(int index) const { 1030 int GetAssignedIndexAt(int index) const {
1031 ASSERT(HasAssignedIndexAt(index)); 1031 ASSERT(HasAssignedIndexAt(index));
1032 return assigned_indexes_[index]; 1032 return assigned_indexes_[index];
(...skipping 24 matching lines...) Expand all
1057 private: 1057 private:
1058 static const int kNoIndex = -1; 1058 static const int kNoIndex = -1;
1059 void AddValue(int index, HValue* value) { 1059 void AddValue(int index, HValue* value) {
1060 assigned_indexes_.Add(index); 1060 assigned_indexes_.Add(index);
1061 // Resize the list of pushed values. 1061 // Resize the list of pushed values.
1062 values_.Add(NULL); 1062 values_.Add(NULL);
1063 // Set the operand through the base method in HValue to make sure that the 1063 // Set the operand through the base method in HValue to make sure that the
1064 // use lists are correctly updated. 1064 // use lists are correctly updated.
1065 SetOperandAt(values_.length() - 1, value); 1065 SetOperandAt(values_.length() - 1, value);
1066 } 1066 }
1067 int ast_id_; 1067 AstId ast_id_;
1068 int pop_count_; 1068 int pop_count_;
1069 int environment_height_; 1069 int environment_height_;
1070 ZoneList<HValue*> values_; 1070 ZoneList<HValue*> values_;
1071 ZoneList<int> assigned_indexes_; 1071 ZoneList<int> assigned_indexes_;
1072 }; 1072 };
1073 1073
1074 1074
1075 class HStackCheck: public HInstruction { 1075 class HStackCheck: public HInstruction {
1076 public: 1076 public:
1077 HStackCheck() { } 1077 HStackCheck() { }
(...skipping 1818 matching lines...) Expand 10 before | Expand all | Expand 10 after
2896 HValue* object() const { return left(); } 2896 HValue* object() const { return left(); }
2897 HValue* key() const { return right(); } 2897 HValue* key() const { return right(); }
2898 }; 2898 };
2899 2899
2900 #undef DECLARE_INSTRUCTION 2900 #undef DECLARE_INSTRUCTION
2901 #undef DECLARE_CONCRETE_INSTRUCTION 2901 #undef DECLARE_CONCRETE_INSTRUCTION
2902 2902
2903 } } // namespace v8::internal 2903 } } // namespace v8::internal
2904 2904
2905 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 2905 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698