| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 V(Simulate) \ | 144 V(Simulate) \ |
| 145 V(StackCheck) \ | 145 V(StackCheck) \ |
| 146 V(StoreContextSlot) \ | 146 V(StoreContextSlot) \ |
| 147 V(StoreGlobal) \ | 147 V(StoreGlobal) \ |
| 148 V(StoreKeyedFastElement) \ | 148 V(StoreKeyedFastElement) \ |
| 149 V(StorePixelArrayElement) \ | 149 V(StorePixelArrayElement) \ |
| 150 V(StoreKeyedGeneric) \ | 150 V(StoreKeyedGeneric) \ |
| 151 V(StoreNamedField) \ | 151 V(StoreNamedField) \ |
| 152 V(StoreNamedGeneric) \ | 152 V(StoreNamedGeneric) \ |
| 153 V(StringCharCodeAt) \ | 153 V(StringCharCodeAt) \ |
| 154 V(StringCharFromCode) \ |
| 154 V(StringLength) \ | 155 V(StringLength) \ |
| 155 V(Sub) \ | 156 V(Sub) \ |
| 156 V(Test) \ | 157 V(Test) \ |
| 157 V(Throw) \ | 158 V(Throw) \ |
| 158 V(Typeof) \ | 159 V(Typeof) \ |
| 159 V(TypeofIs) \ | 160 V(TypeofIs) \ |
| 160 V(UnaryMathOperation) \ | 161 V(UnaryMathOperation) \ |
| 161 V(UnknownOSRValue) \ | 162 V(UnknownOSRValue) \ |
| 162 V(ValueOf) | 163 V(ValueOf) |
| 163 | 164 |
| (...skipping 2396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2560 virtual Range* InferRange(); | 2561 virtual Range* InferRange(); |
| 2561 }; | 2562 }; |
| 2562 | 2563 |
| 2563 | 2564 |
| 2564 class HMod: public HArithmeticBinaryOperation { | 2565 class HMod: public HArithmeticBinaryOperation { |
| 2565 public: | 2566 public: |
| 2566 HMod(HValue* left, HValue* right) : HArithmeticBinaryOperation(left, right) { | 2567 HMod(HValue* left, HValue* right) : HArithmeticBinaryOperation(left, right) { |
| 2567 SetFlag(kCanBeDivByZero); | 2568 SetFlag(kCanBeDivByZero); |
| 2568 } | 2569 } |
| 2569 | 2570 |
| 2571 bool HasPowerOf2Divisor() { |
| 2572 if (right()->IsConstant() && |
| 2573 HConstant::cast(right())->HasInteger32Value()) { |
| 2574 int32_t value = HConstant::cast(right())->Integer32Value(); |
| 2575 return value != 0 && (IsPowerOf2(value) || IsPowerOf2(-value)); |
| 2576 } |
| 2577 |
| 2578 return false; |
| 2579 } |
| 2580 |
| 2570 virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited); | 2581 virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited); |
| 2571 | 2582 |
| 2572 DECLARE_CONCRETE_INSTRUCTION(Mod, "mod") | 2583 DECLARE_CONCRETE_INSTRUCTION(Mod, "mod") |
| 2573 | 2584 |
| 2574 protected: | 2585 protected: |
| 2575 virtual bool DataEquals(HValue* other) { return true; } | 2586 virtual bool DataEquals(HValue* other) { return true; } |
| 2576 | 2587 |
| 2577 virtual Range* InferRange(); | 2588 virtual Range* InferRange(); |
| 2578 }; | 2589 }; |
| 2579 | 2590 |
| (...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3251 | 3262 |
| 3252 protected: | 3263 protected: |
| 3253 virtual bool DataEquals(HValue* other) { return true; } | 3264 virtual bool DataEquals(HValue* other) { return true; } |
| 3254 | 3265 |
| 3255 virtual Range* InferRange() { | 3266 virtual Range* InferRange() { |
| 3256 return new Range(0, String::kMaxUC16CharCode); | 3267 return new Range(0, String::kMaxUC16CharCode); |
| 3257 } | 3268 } |
| 3258 }; | 3269 }; |
| 3259 | 3270 |
| 3260 | 3271 |
| 3272 class HStringCharFromCode: public HUnaryOperation { |
| 3273 public: |
| 3274 explicit HStringCharFromCode(HValue* char_code) : HUnaryOperation(char_code) { |
| 3275 set_representation(Representation::Tagged()); |
| 3276 SetFlag(kUseGVN); |
| 3277 } |
| 3278 |
| 3279 virtual Representation RequiredInputRepresentation(int index) const { |
| 3280 return Representation::Integer32(); |
| 3281 } |
| 3282 |
| 3283 virtual bool DataEquals(HValue* other) { return true; } |
| 3284 |
| 3285 DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string_char_from_code") |
| 3286 }; |
| 3287 |
| 3288 |
| 3261 class HStringLength: public HUnaryOperation { | 3289 class HStringLength: public HUnaryOperation { |
| 3262 public: | 3290 public: |
| 3263 explicit HStringLength(HValue* string) : HUnaryOperation(string) { | 3291 explicit HStringLength(HValue* string) : HUnaryOperation(string) { |
| 3264 set_representation(Representation::Tagged()); | 3292 set_representation(Representation::Tagged()); |
| 3265 SetFlag(kUseGVN); | 3293 SetFlag(kUseGVN); |
| 3266 } | 3294 } |
| 3267 | 3295 |
| 3268 virtual Representation RequiredInputRepresentation(int index) const { | 3296 virtual Representation RequiredInputRepresentation(int index) const { |
| 3269 return Representation::Tagged(); | 3297 return Representation::Tagged(); |
| 3270 } | 3298 } |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3451 HValue* object() { return left(); } | 3479 HValue* object() { return left(); } |
| 3452 HValue* key() { return right(); } | 3480 HValue* key() { return right(); } |
| 3453 }; | 3481 }; |
| 3454 | 3482 |
| 3455 #undef DECLARE_INSTRUCTION | 3483 #undef DECLARE_INSTRUCTION |
| 3456 #undef DECLARE_CONCRETE_INSTRUCTION | 3484 #undef DECLARE_CONCRETE_INSTRUCTION |
| 3457 | 3485 |
| 3458 } } // namespace v8::internal | 3486 } } // namespace v8::internal |
| 3459 | 3487 |
| 3460 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 3488 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |