Chromium Code Reviews| 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 143 V(RegExpLiteral) \ | 143 V(RegExpLiteral) \ |
| 144 V(Return) \ | 144 V(Return) \ |
| 145 V(Sar) \ | 145 V(Sar) \ |
| 146 V(Shl) \ | 146 V(Shl) \ |
| 147 V(Shr) \ | 147 V(Shr) \ |
| 148 V(Simulate) \ | 148 V(Simulate) \ |
| 149 V(StackCheck) \ | 149 V(StackCheck) \ |
| 150 V(StoreContextSlot) \ | 150 V(StoreContextSlot) \ |
| 151 V(StoreGlobal) \ | 151 V(StoreGlobal) \ |
| 152 V(StoreKeyedFastElement) \ | 152 V(StoreKeyedFastElement) \ |
| 153 V(StorePixelArrayElement) \ | |
| 153 V(StoreKeyedGeneric) \ | 154 V(StoreKeyedGeneric) \ |
| 154 V(StoreNamedField) \ | 155 V(StoreNamedField) \ |
| 155 V(StoreNamedGeneric) \ | 156 V(StoreNamedGeneric) \ |
| 156 V(StringCharCodeAt) \ | 157 V(StringCharCodeAt) \ |
| 157 V(StringLength) \ | 158 V(StringLength) \ |
| 158 V(Sub) \ | 159 V(Sub) \ |
| 159 V(Test) \ | 160 V(Test) \ |
| 160 V(Throw) \ | 161 V(Throw) \ |
| 161 V(Typeof) \ | 162 V(Typeof) \ |
| 162 V(TypeofIs) \ | 163 V(TypeofIs) \ |
| (...skipping 3000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3163 // The key is supposed to be Integer32. | 3164 // The key is supposed to be Integer32. |
| 3164 return (index == 1) ? Representation::Integer32() | 3165 return (index == 1) ? Representation::Integer32() |
| 3165 : Representation::Tagged(); | 3166 : Representation::Tagged(); |
| 3166 } | 3167 } |
| 3167 | 3168 |
| 3168 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement, | 3169 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement, |
| 3169 "store_keyed_fast_element") | 3170 "store_keyed_fast_element") |
| 3170 }; | 3171 }; |
| 3171 | 3172 |
| 3172 | 3173 |
| 3174 class HStorePixelArrayElement: public HInstruction { | |
| 3175 public: | |
| 3176 HStorePixelArrayElement(HValue* external_elements, HValue* key, HValue* val) { | |
| 3177 SetFlag(kChangesPixelArrayElements); | |
| 3178 SetOperandAt(0, external_elements); | |
| 3179 SetOperandAt(1, key); | |
| 3180 SetOperandAt(2, val); | |
| 3181 } | |
| 3182 | |
| 3183 virtual void PrintDataTo(StringStream* stream) const; | |
| 3184 virtual int OperandCount() const { return operands_.length(); } | |
| 3185 virtual HValue* OperandAt(int index) const { return operands_[index]; } | |
| 3186 | |
| 3187 virtual Representation RequiredInputRepresentation(int index) const { | |
| 3188 if (index == 0) { | |
| 3189 return Representation::External(); | |
| 3190 } else { | |
| 3191 return Representation::Integer32(); | |
| 3192 } | |
| 3193 } | |
| 3194 | |
| 3195 HValue* external_pointer() const { return OperandAt(0); } | |
|
Kevin Millikin (Chromium)
2011/02/16 08:51:25
I would just use return operands_[0] (OperandAt is
danno
2011/02/16 13:54:22
Done.
| |
| 3196 HValue* key() const { return OperandAt(1); } | |
| 3197 HValue* value() const { return OperandAt(2); } | |
| 3198 | |
| 3199 DECLARE_CONCRETE_INSTRUCTION(StorePixelArrayElement, | |
| 3200 "store_pixel_array_element") | |
| 3201 | |
| 3202 protected: | |
| 3203 virtual void InternalSetOperandAt(int index, HValue* value) { | |
| 3204 operands_[index] = value; | |
| 3205 } | |
| 3206 | |
| 3207 HOperandVector<3> operands_; | |
| 3208 }; | |
| 3209 | |
| 3210 | |
| 3173 class HStoreKeyedGeneric: public HStoreKeyed { | 3211 class HStoreKeyedGeneric: public HStoreKeyed { |
| 3174 public: | 3212 public: |
| 3175 HStoreKeyedGeneric(HValue* context, | 3213 HStoreKeyedGeneric(HValue* context, |
| 3176 HValue* object, | 3214 HValue* object, |
| 3177 HValue* key, | 3215 HValue* key, |
| 3178 HValue* value) | 3216 HValue* value) |
| 3179 : HStoreKeyed(object, key, value), context_(NULL) { | 3217 : HStoreKeyed(object, key, value), context_(NULL) { |
| 3180 SetOperandAt(3, context); | 3218 SetOperandAt(3, context); |
| 3181 SetAllSideEffects(); | 3219 SetAllSideEffects(); |
| 3182 } | 3220 } |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3414 HValue* object() const { return left(); } | 3452 HValue* object() const { return left(); } |
| 3415 HValue* key() const { return right(); } | 3453 HValue* key() const { return right(); } |
| 3416 }; | 3454 }; |
| 3417 | 3455 |
| 3418 #undef DECLARE_INSTRUCTION | 3456 #undef DECLARE_INSTRUCTION |
| 3419 #undef DECLARE_CONCRETE_INSTRUCTION | 3457 #undef DECLARE_CONCRETE_INSTRUCTION |
| 3420 | 3458 |
| 3421 } } // namespace v8::internal | 3459 } } // namespace v8::internal |
| 3422 | 3460 |
| 3423 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 3461 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |