OLD | NEW |
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 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
967 && to().Equals(change->to()); | 967 && to().Equals(change->to()); |
968 } | 968 } |
969 | 969 |
970 private: | 970 private: |
971 Representation from_; | 971 Representation from_; |
972 }; | 972 }; |
973 | 973 |
974 | 974 |
975 class HSimulate: public HInstruction { | 975 class HSimulate: public HInstruction { |
976 public: | 976 public: |
977 HSimulate(int ast_id, int pop_count, int environment_length) | 977 HSimulate(int ast_id, int pop_count) |
978 : ast_id_(ast_id), | 978 : ast_id_(ast_id), |
979 pop_count_(pop_count), | 979 pop_count_(pop_count), |
980 environment_length_(environment_length), | |
981 values_(2), | 980 values_(2), |
982 assigned_indexes_(2) {} | 981 assigned_indexes_(2) {} |
983 virtual ~HSimulate() {} | 982 virtual ~HSimulate() {} |
984 | 983 |
985 virtual void PrintDataTo(StringStream* stream); | 984 virtual void PrintDataTo(StringStream* stream); |
986 | 985 |
987 bool HasAstId() const { return ast_id_ != AstNode::kNoNumber; } | 986 bool HasAstId() const { return ast_id_ != AstNode::kNoNumber; } |
988 int ast_id() const { return ast_id_; } | 987 int ast_id() const { return ast_id_; } |
989 void set_ast_id(int id) { | 988 void set_ast_id(int id) { |
990 ASSERT(!HasAstId()); | 989 ASSERT(!HasAstId()); |
991 ast_id_ = id; | 990 ast_id_ = id; |
992 } | 991 } |
993 | 992 |
994 int environment_length() const { return environment_length_; } | |
995 int pop_count() const { return pop_count_; } | 993 int pop_count() const { return pop_count_; } |
996 const ZoneList<HValue*>* values() const { return &values_; } | 994 const ZoneList<HValue*>* values() const { return &values_; } |
997 int GetAssignedIndexAt(int index) const { | 995 int GetAssignedIndexAt(int index) const { |
998 ASSERT(HasAssignedIndexAt(index)); | 996 ASSERT(HasAssignedIndexAt(index)); |
999 return assigned_indexes_[index]; | 997 return assigned_indexes_[index]; |
1000 } | 998 } |
1001 bool HasAssignedIndexAt(int index) const { | 999 bool HasAssignedIndexAt(int index) const { |
1002 return assigned_indexes_[index] != kNoIndex; | 1000 return assigned_indexes_[index] != kNoIndex; |
1003 } | 1001 } |
1004 void AddAssignedValue(int index, HValue* value) { | 1002 void AddAssignedValue(int index, HValue* value) { |
(...skipping 25 matching lines...) Expand all Loading... |
1030 void AddValue(int index, HValue* value) { | 1028 void AddValue(int index, HValue* value) { |
1031 assigned_indexes_.Add(index); | 1029 assigned_indexes_.Add(index); |
1032 // Resize the list of pushed values. | 1030 // Resize the list of pushed values. |
1033 values_.Add(NULL); | 1031 values_.Add(NULL); |
1034 // Set the operand through the base method in HValue to make sure that the | 1032 // Set the operand through the base method in HValue to make sure that the |
1035 // use lists are correctly updated. | 1033 // use lists are correctly updated. |
1036 SetOperandAt(values_.length() - 1, value); | 1034 SetOperandAt(values_.length() - 1, value); |
1037 } | 1035 } |
1038 int ast_id_; | 1036 int ast_id_; |
1039 int pop_count_; | 1037 int pop_count_; |
1040 int environment_length_; | |
1041 ZoneList<HValue*> values_; | 1038 ZoneList<HValue*> values_; |
1042 ZoneList<int> assigned_indexes_; | 1039 ZoneList<int> assigned_indexes_; |
1043 }; | 1040 }; |
1044 | 1041 |
1045 | 1042 |
1046 class HStackCheck: public HTemplateInstruction<0> { | 1043 class HStackCheck: public HTemplateInstruction<0> { |
1047 public: | 1044 public: |
1048 HStackCheck() { } | 1045 HStackCheck() { } |
1049 | 1046 |
1050 virtual Representation RequiredInputRepresentation(int index) const { | 1047 virtual Representation RequiredInputRepresentation(int index) const { |
(...skipping 2567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3618 HValue* object() { return left(); } | 3615 HValue* object() { return left(); } |
3619 HValue* key() { return right(); } | 3616 HValue* key() { return right(); } |
3620 }; | 3617 }; |
3621 | 3618 |
3622 #undef DECLARE_INSTRUCTION | 3619 #undef DECLARE_INSTRUCTION |
3623 #undef DECLARE_CONCRETE_INSTRUCTION | 3620 #undef DECLARE_CONCRETE_INSTRUCTION |
3624 | 3621 |
3625 } } // namespace v8::internal | 3622 } } // namespace v8::internal |
3626 | 3623 |
3627 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 3624 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |