Chromium Code Reviews| Index: runtime/vm/intermediate_language.h |
| =================================================================== |
| --- runtime/vm/intermediate_language.h (revision 16607) |
| +++ runtime/vm/intermediate_language.h (working copy) |
| @@ -44,6 +44,8 @@ |
| V(_StringBase, [], StringBaseCharAt, 1062366987) \ |
| V(_IntegerImplementation, toDouble, IntegerToDouble, 733149324) \ |
| V(_Double, toInt, DoubleToInteger, 362666636) \ |
| + V(_Double, truncate, DoubleTruncate, 620870996) \ |
| + V(_Double, round, DoubleRound, 620870996) \ |
| V(::, sqrt, MathSqrt, 1662640002) \ |
| // Class that recognizes the name and owner of a function and returns the |
| @@ -254,6 +256,7 @@ |
| M(SmiToDouble) \ |
| M(DoubleToInteger) \ |
| M(DoubleToSmi) \ |
| + M(DoubleToDouble) \ |
| M(CheckClass) \ |
| M(CheckSmi) \ |
| M(Constant) \ |
| @@ -511,6 +514,7 @@ |
| friend class StringCharCodeAtInstr; |
| friend class LICM; |
| friend class DoubleToSmiInstr; |
| + friend class DoubleToDoubleInstr; |
| intptr_t deopt_id_; |
| intptr_t lifetime_position_; // Position used by register allocator. |
| @@ -4007,6 +4011,49 @@ |
| }; |
| +class DoubleToDoubleInstr : public TemplateDefinition<1> { |
| + public: |
| + DoubleToDoubleInstr(Value* value, |
| + InstanceCallInstr* instance_call, |
| + MethodRecognizer::Kind recognized_kind) |
| + : recognized_kind_(recognized_kind) { |
| + ASSERT(value != NULL); |
| + inputs_[0] = value; |
| + deopt_id_ = instance_call->deopt_id(); |
| + } |
| + |
| + Value* value() const { return inputs_[0]; } |
| + |
| + MethodRecognizer::Kind recognized_kind() const { return recognized_kind_; } |
| + |
| + DECLARE_INSTRUCTION(DoubleToDouble) |
| + virtual RawAbstractType* CompileType() const; |
| + |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| + virtual bool HasSideEffect() const { return false; } |
| + |
| + // Result could be any of the int types. |
|
Florian Schneider
2013/01/08 14:24:04
Comment is not valid here.
srdjan
2013/01/10 22:35:52
Removed
|
| + virtual intptr_t ResultCid() const { return kDoubleCid; } |
| + |
| + virtual Representation representation() const { |
| + return kUnboxedDouble; |
| + } |
| + |
| + virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
| + ASSERT(idx == 0); |
| + return kUnboxedDouble; |
| + } |
| + |
| + virtual intptr_t DeoptimizationTarget() const { return deopt_id_; } |
| + |
| + private: |
| + const MethodRecognizer::Kind recognized_kind_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(DoubleToDoubleInstr); |
| +}; |
| + |
| + |
| class CheckClassInstr : public TemplateInstruction<1> { |
| public: |
| CheckClassInstr(Value* value, |