OLD | NEW |
---|---|
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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
79 V(CallKeyed) \ | 79 V(CallKeyed) \ |
80 V(CallKnownGlobal) \ | 80 V(CallKnownGlobal) \ |
81 V(CallNamed) \ | 81 V(CallNamed) \ |
82 V(CallNew) \ | 82 V(CallNew) \ |
83 V(CallRuntime) \ | 83 V(CallRuntime) \ |
84 V(CallStub) \ | 84 V(CallStub) \ |
85 V(Change) \ | 85 V(Change) \ |
86 V(CheckFunction) \ | 86 V(CheckFunction) \ |
87 V(CheckInstanceType) \ | 87 V(CheckInstanceType) \ |
88 V(CheckMap) \ | 88 V(CheckMap) \ |
89 V(CheckMapSet) \ | |
89 V(CheckNonSmi) \ | 90 V(CheckNonSmi) \ |
90 V(CheckPrototypeMaps) \ | 91 V(CheckPrototypeMaps) \ |
91 V(CheckSmi) \ | 92 V(CheckSmi) \ |
92 V(ClampToUint8) \ | 93 V(ClampToUint8) \ |
93 V(ClassOfTestAndBranch) \ | 94 V(ClassOfTestAndBranch) \ |
94 V(CompareIDAndBranch) \ | 95 V(CompareIDAndBranch) \ |
95 V(CompareGeneric) \ | 96 V(CompareGeneric) \ |
96 V(CompareObjectEqAndBranch) \ | 97 V(CompareObjectEqAndBranch) \ |
97 V(CompareMap) \ | 98 V(CompareMap) \ |
98 V(CompareConstantEqAndBranch) \ | 99 V(CompareConstantEqAndBranch) \ |
(...skipping 1944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2043 (b->mode() == mode() || !has_element_transitions_); | 2044 (b->mode() == mode() || !has_element_transitions_); |
2044 } | 2045 } |
2045 | 2046 |
2046 private: | 2047 private: |
2047 bool has_element_transitions_; | 2048 bool has_element_transitions_; |
2048 Handle<Map> map_; | 2049 Handle<Map> map_; |
2049 CompareMapMode mode_; | 2050 CompareMapMode mode_; |
2050 }; | 2051 }; |
2051 | 2052 |
2052 | 2053 |
2054 class HCheckMapSet: public HTemplateInstruction<1> { | |
danno
2012/03/09 11:52:58
Please merge with HCheckMap as discussed
Michael Starzinger
2012/03/12 11:37:11
Done. HCheckMap now works with a SmallMapList back
| |
2055 public: | |
2056 HCheckMapSet(HValue* value, SmallMapList* map_set) : map_set_(map_set) { | |
2057 map_set->Sort(); | |
2058 SetOperandAt(0, value); | |
2059 set_representation(Representation::Tagged()); | |
2060 SetFlag(kUseGVN); | |
2061 SetGVNFlag(kDependsOnMaps); | |
2062 SetGVNFlag(kDependsOnElementsKind); | |
2063 } | |
2064 | |
2065 virtual Representation RequiredInputRepresentation(int index) { | |
2066 return Representation::Tagged(); | |
2067 } | |
2068 virtual void PrintDataTo(StringStream* stream); | |
2069 | |
2070 HValue* value() { return OperandAt(0); } | |
2071 SmallMapList* map_set() const { return map_set_; } | |
2072 | |
2073 DECLARE_CONCRETE_INSTRUCTION(CheckMapSet) | |
2074 | |
2075 protected: | |
2076 virtual bool DataEquals(HValue* other) { | |
danno
2012/03/09 11:52:58
Fast case single maps by just comparing b->map_set
Michael Starzinger
2012/03/12 11:37:11
The backing SmallMapList cannot be compared by ref
| |
2077 HCheckMapSet* b = HCheckMapSet::cast(other); | |
2078 // Relies on the fact that map_set has been sorted before. | |
2079 if (map_set_->length() != b->map_set()->length()) return false; | |
2080 for (int i = 0; i < map_set_->length(); i++) { | |
2081 if (!map_set_->at(i).is_identical_to(b->map_set()->at(i))) return false; | |
2082 } | |
2083 return true; | |
2084 } | |
2085 | |
2086 private: | |
2087 SmallMapList* map_set_; | |
2088 }; | |
2089 | |
2090 | |
2053 class HCheckFunction: public HUnaryOperation { | 2091 class HCheckFunction: public HUnaryOperation { |
2054 public: | 2092 public: |
2055 HCheckFunction(HValue* value, Handle<JSFunction> function) | 2093 HCheckFunction(HValue* value, Handle<JSFunction> function) |
2056 : HUnaryOperation(value), target_(function) { | 2094 : HUnaryOperation(value), target_(function) { |
2057 set_representation(Representation::Tagged()); | 2095 set_representation(Representation::Tagged()); |
2058 SetFlag(kUseGVN); | 2096 SetFlag(kUseGVN); |
2059 } | 2097 } |
2060 | 2098 |
2061 virtual Representation RequiredInputRepresentation(int index) { | 2099 virtual Representation RequiredInputRepresentation(int index) { |
2062 return Representation::Tagged(); | 2100 return Representation::Tagged(); |
(...skipping 2714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4777 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex); | 4815 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex); |
4778 }; | 4816 }; |
4779 | 4817 |
4780 | 4818 |
4781 #undef DECLARE_INSTRUCTION | 4819 #undef DECLARE_INSTRUCTION |
4782 #undef DECLARE_CONCRETE_INSTRUCTION | 4820 #undef DECLARE_CONCRETE_INSTRUCTION |
4783 | 4821 |
4784 } } // namespace v8::internal | 4822 } } // namespace v8::internal |
4785 | 4823 |
4786 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 4824 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |