| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ | 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ |
| 6 #define VM_INTERMEDIATE_LANGUAGE_H_ | 6 #define VM_INTERMEDIATE_LANGUAGE_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/ast.h" | 9 #include "vm/ast.h" |
| 10 #include "vm/growable_array.h" | 10 #include "vm/growable_array.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 V(_Float32x4, _reciprocalSqrt, Float32x4ReciprocalSqrt, 157194268) \ | 101 V(_Float32x4, _reciprocalSqrt, Float32x4ReciprocalSqrt, 157194268) \ |
| 102 V(_Float32x4, _reciprocal, Float32x4Reciprocal, 157194268) \ | 102 V(_Float32x4, _reciprocal, Float32x4Reciprocal, 157194268) \ |
| 103 V(_Float32x4, _negate, Float32x4Negate, 157194268) \ | 103 V(_Float32x4, _negate, Float32x4Negate, 157194268) \ |
| 104 V(_Float32x4, _abs, Float32x4Absolute, 157194268) \ | 104 V(_Float32x4, _abs, Float32x4Absolute, 157194268) \ |
| 105 V(_Float32x4, _clamp, Float32x4Clamp, 1553901850) \ | 105 V(_Float32x4, _clamp, Float32x4Clamp, 1553901850) \ |
| 106 V(_Float32x4, withX, Float32x4WithX, 1816943014) \ | 106 V(_Float32x4, withX, Float32x4WithX, 1816943014) \ |
| 107 V(_Float32x4, withY, Float32x4WithY, 820404963) \ | 107 V(_Float32x4, withY, Float32x4WithY, 820404963) \ |
| 108 V(_Float32x4, withZ, Float32x4WithZ, 881355277) \ | 108 V(_Float32x4, withZ, Float32x4WithZ, 881355277) \ |
| 109 V(_Float32x4, withW, Float32x4WithW, 441497035) \ | 109 V(_Float32x4, withW, Float32x4WithW, 441497035) \ |
| 110 V(_Float32x4, _toUint32x4, Float32x4ToUint32x4, 802289205) \ | 110 V(_Float32x4, _toUint32x4, Float32x4ToUint32x4, 802289205) \ |
| 111 V(_Float32x4, withZWInXY, Float32x4WithZWInXY, 465519415) \ |
| 112 V(_Float32x4, interleaveXY, Float32x4InterleaveXY, 465519415) \ |
| 113 V(_Float32x4, interleaveZW, Float32x4InterleaveZW, 465519415) \ |
| 114 V(_Float32x4, interleaveXYPairs, Float32x4InterleaveXYPairs, 465519415) \ |
| 115 V(_Float32x4, interleaveZWPairs, Float32x4InterleaveZWPairs, 465519415) \ |
| 111 V(Uint32x4, Uint32x4.bool, Uint32x4BoolConstructor, 487876159) \ | 116 V(Uint32x4, Uint32x4.bool, Uint32x4BoolConstructor, 487876159) \ |
| 112 V(_Uint32x4, get:flagX, Uint32x4GetFlagX, 782547529) \ | 117 V(_Uint32x4, get:flagX, Uint32x4GetFlagX, 782547529) \ |
| 113 V(_Uint32x4, get:flagY, Uint32x4GetFlagY, 782547529) \ | 118 V(_Uint32x4, get:flagY, Uint32x4GetFlagY, 782547529) \ |
| 114 V(_Uint32x4, get:flagZ, Uint32x4GetFlagZ, 782547529) \ | 119 V(_Uint32x4, get:flagZ, Uint32x4GetFlagZ, 782547529) \ |
| 115 V(_Uint32x4, get:flagW, Uint32x4GetFlagW, 782547529) \ | 120 V(_Uint32x4, get:flagW, Uint32x4GetFlagW, 782547529) \ |
| 116 V(_Uint32x4, select, Uint32x4Select, 810336099) \ | 121 V(_Uint32x4, select, Uint32x4Select, 810336099) \ |
| 117 V(_Uint32x4, withFlagX, Uint32x4WithFlagX, 25547408) \ | 122 V(_Uint32x4, withFlagX, Uint32x4WithFlagX, 25547408) \ |
| 118 V(_Uint32x4, withFlagY, Uint32x4WithFlagY, 1176493005) \ | 123 V(_Uint32x4, withFlagY, Uint32x4WithFlagY, 1176493005) \ |
| 119 V(_Uint32x4, withFlagZ, Uint32x4WithFlagZ, 1237443319) \ | 124 V(_Uint32x4, withFlagZ, Uint32x4WithFlagZ, 1237443319) \ |
| 120 V(_Uint32x4, withFlagW, Uint32x4WithFlagW, 797585077) \ | 125 V(_Uint32x4, withFlagW, Uint32x4WithFlagW, 797585077) \ |
| (...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 M(Float32x4Zero) \ | 611 M(Float32x4Zero) \ |
| 607 M(Float32x4Splat) \ | 612 M(Float32x4Splat) \ |
| 608 M(Float32x4Comparison) \ | 613 M(Float32x4Comparison) \ |
| 609 M(Float32x4MinMax) \ | 614 M(Float32x4MinMax) \ |
| 610 M(Float32x4Scale) \ | 615 M(Float32x4Scale) \ |
| 611 M(Float32x4Sqrt) \ | 616 M(Float32x4Sqrt) \ |
| 612 M(Float32x4ZeroArg) \ | 617 M(Float32x4ZeroArg) \ |
| 613 M(Float32x4Clamp) \ | 618 M(Float32x4Clamp) \ |
| 614 M(Float32x4With) \ | 619 M(Float32x4With) \ |
| 615 M(Float32x4ToUint32x4) \ | 620 M(Float32x4ToUint32x4) \ |
| 621 M(Float32x4TwoArgShuffle) \ |
| 616 M(MaterializeObject) \ | 622 M(MaterializeObject) \ |
| 617 M(Uint32x4BoolConstructor) \ | 623 M(Uint32x4BoolConstructor) \ |
| 618 M(Uint32x4GetFlag) \ | 624 M(Uint32x4GetFlag) \ |
| 619 M(Uint32x4Select) \ | 625 M(Uint32x4Select) \ |
| 620 M(Uint32x4SetFlag) \ | 626 M(Uint32x4SetFlag) \ |
| 621 M(Uint32x4ToFloat32x4) \ | 627 M(Uint32x4ToFloat32x4) \ |
| 622 M(BinaryUint32x4Op) \ | 628 M(BinaryUint32x4Op) \ |
| 623 | 629 |
| 624 | 630 |
| 625 #define FORWARD_DECLARATION(type) class type##Instr; | 631 #define FORWARD_DECLARATION(type) class type##Instr; |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 892 friend class Float32x4ShuffleInstr; | 898 friend class Float32x4ShuffleInstr; |
| 893 friend class Float32x4ConstructorInstr; | 899 friend class Float32x4ConstructorInstr; |
| 894 friend class Float32x4ComparisonInstr; | 900 friend class Float32x4ComparisonInstr; |
| 895 friend class Float32x4MinMaxInstr; | 901 friend class Float32x4MinMaxInstr; |
| 896 friend class Float32x4ScaleInstr; | 902 friend class Float32x4ScaleInstr; |
| 897 friend class Float32x4SqrtInstr; | 903 friend class Float32x4SqrtInstr; |
| 898 friend class Float32x4ZeroArgInstr; | 904 friend class Float32x4ZeroArgInstr; |
| 899 friend class Float32x4ClampInstr; | 905 friend class Float32x4ClampInstr; |
| 900 friend class Float32x4WithInstr; | 906 friend class Float32x4WithInstr; |
| 901 friend class Float32x4ToUint32x4Instr; | 907 friend class Float32x4ToUint32x4Instr; |
| 908 friend class Float32x4TwoArgShuffleInstr; |
| 902 friend class Uint32x4BoolConstructorInstr; | 909 friend class Uint32x4BoolConstructorInstr; |
| 903 friend class Uint32x4GetFlagInstr; | 910 friend class Uint32x4GetFlagInstr; |
| 904 friend class Uint32x4SetFlagInstr; | 911 friend class Uint32x4SetFlagInstr; |
| 905 friend class Uint32x4SelectInstr; | 912 friend class Uint32x4SelectInstr; |
| 906 friend class Uint32x4ToFloat32x4Instr; | 913 friend class Uint32x4ToFloat32x4Instr; |
| 907 friend class BinaryUint32x4OpInstr; | 914 friend class BinaryUint32x4OpInstr; |
| 908 friend class BinaryMintOpInstr; | 915 friend class BinaryMintOpInstr; |
| 909 friend class BinarySmiOpInstr; | 916 friend class BinarySmiOpInstr; |
| 910 friend class UnarySmiOpInstr; | 917 friend class UnarySmiOpInstr; |
| 911 friend class ShiftMintOpInstr; | 918 friend class ShiftMintOpInstr; |
| (...skipping 4593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5505 | 5512 |
| 5506 virtual bool MayThrow() const { return false; } | 5513 virtual bool MayThrow() const { return false; } |
| 5507 | 5514 |
| 5508 private: | 5515 private: |
| 5509 const MethodRecognizer::Kind op_kind_; | 5516 const MethodRecognizer::Kind op_kind_; |
| 5510 | 5517 |
| 5511 DISALLOW_COPY_AND_ASSIGN(Uint32x4GetFlagInstr); | 5518 DISALLOW_COPY_AND_ASSIGN(Uint32x4GetFlagInstr); |
| 5512 }; | 5519 }; |
| 5513 | 5520 |
| 5514 | 5521 |
| 5522 class Float32x4TwoArgShuffleInstr : public TemplateDefinition<2> { |
| 5523 public: |
| 5524 Float32x4TwoArgShuffleInstr(MethodRecognizer::Kind op_kind, Value* left, |
| 5525 Value* right, intptr_t deopt_id) |
| 5526 : op_kind_(op_kind) { |
| 5527 SetInputAt(0, left); |
| 5528 SetInputAt(1, right); |
| 5529 deopt_id_ = deopt_id; |
| 5530 } |
| 5531 |
| 5532 Value* left() const { return inputs_[0]; } |
| 5533 Value* right() const { return inputs_[1]; } |
| 5534 |
| 5535 MethodRecognizer::Kind op_kind() const { return op_kind_; } |
| 5536 |
| 5537 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 5538 |
| 5539 virtual bool CanDeoptimize() const { return false; } |
| 5540 |
| 5541 virtual Representation representation() const { |
| 5542 return kUnboxedFloat32x4; |
| 5543 } |
| 5544 |
| 5545 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
| 5546 ASSERT((idx == 0) || (idx == 1)); |
| 5547 return kUnboxedFloat32x4; |
| 5548 } |
| 5549 |
| 5550 virtual intptr_t DeoptimizationTarget() const { |
| 5551 // Direct access since this instruction cannot deoptimize, and the deopt-id |
| 5552 // was inherited from another instruction that could deoptimize. |
| 5553 return deopt_id_; |
| 5554 } |
| 5555 |
| 5556 DECLARE_INSTRUCTION(Float32x4TwoArgShuffle) |
| 5557 virtual CompileType ComputeType() const; |
| 5558 |
| 5559 virtual bool AllowsCSE() const { return true; } |
| 5560 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 5561 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 5562 virtual bool AttributesEqual(Instruction* other) const { |
| 5563 return op_kind() == other->AsFloat32x4TwoArgShuffle()->op_kind(); |
| 5564 } |
| 5565 |
| 5566 virtual bool MayThrow() const { return false; } |
| 5567 |
| 5568 private: |
| 5569 const MethodRecognizer::Kind op_kind_; |
| 5570 |
| 5571 DISALLOW_COPY_AND_ASSIGN(Float32x4TwoArgShuffleInstr); |
| 5572 }; |
| 5573 |
| 5574 |
| 5515 class Uint32x4SelectInstr : public TemplateDefinition<3> { | 5575 class Uint32x4SelectInstr : public TemplateDefinition<3> { |
| 5516 public: | 5576 public: |
| 5517 Uint32x4SelectInstr(Value* mask, Value* trueValue, Value* falseValue, | 5577 Uint32x4SelectInstr(Value* mask, Value* trueValue, Value* falseValue, |
| 5518 intptr_t deopt_id) { | 5578 intptr_t deopt_id) { |
| 5519 SetInputAt(0, mask); | 5579 SetInputAt(0, mask); |
| 5520 SetInputAt(1, trueValue); | 5580 SetInputAt(1, trueValue); |
| 5521 SetInputAt(2, falseValue); | 5581 SetInputAt(2, falseValue); |
| 5522 deopt_id_ = deopt_id; | 5582 deopt_id_ = deopt_id; |
| 5523 } | 5583 } |
| 5524 | 5584 |
| (...skipping 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6556 ForwardInstructionIterator* current_iterator_; | 6616 ForwardInstructionIterator* current_iterator_; |
| 6557 | 6617 |
| 6558 private: | 6618 private: |
| 6559 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 6619 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 6560 }; | 6620 }; |
| 6561 | 6621 |
| 6562 | 6622 |
| 6563 } // namespace dart | 6623 } // namespace dart |
| 6564 | 6624 |
| 6565 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 6625 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |