Chromium Code Reviews| Index: runtime/vm/intermediate_language.h |
| =================================================================== |
| --- runtime/vm/intermediate_language.h (revision 32793) |
| +++ runtime/vm/intermediate_language.h (working copy) |
| @@ -660,6 +660,8 @@ |
| M(DoubleToInteger) \ |
| M(DoubleToSmi) \ |
| M(DoubleToDouble) \ |
| + M(DoubleToFloat) \ |
| + M(FloatToDouble) \ |
| M(CheckClass) \ |
| M(CheckSmi) \ |
| M(Constant) \ |
| @@ -1015,6 +1017,8 @@ |
| friend class LICM; |
| friend class DoubleToSmiInstr; |
| friend class DoubleToDoubleInstr; |
| + friend class DoubleToFloatInstr; |
| + friend class FloatToDoubleInstr; |
| friend class InvokeMathCFunctionInstr; |
| friend class MergedMathInstr; |
| friend class FlowGraphOptimizer; |
| @@ -3197,7 +3201,8 @@ |
| argument_names_(argument_names), |
| arguments_(arguments), |
| result_cid_(kDynamicCid), |
| - is_known_list_constructor_(false) { |
| + is_known_list_constructor_(false), |
| + is_native_list_factory_(false) { |
| ASSERT(function.IsZoneHandle()); |
| ASSERT(argument_names.IsZoneHandle() || argument_names.InVMHeap()); |
| } |
| @@ -3236,6 +3241,11 @@ |
| is_known_list_constructor_ = value; |
| } |
| + bool is_native_list_factory() const { return is_native_list_factory_; } |
| + void set_is_native_list_factory(bool value) { |
| + is_native_list_factory_ = value; |
| + } |
| + |
| virtual bool MayThrow() const { return true; } |
| private: |
| @@ -3248,6 +3258,7 @@ |
| // 'True' for recognized list constructors. |
| bool is_known_list_constructor_; |
| + bool is_native_list_factory_; |
| DISALLOW_COPY_AND_ASSIGN(StaticCallInstr); |
| }; |
| @@ -6539,6 +6550,88 @@ |
| }; |
| +class DoubleToFloatInstr: public TemplateDefinition<1> { |
| + public: |
| + DoubleToFloatInstr(Value* value, intptr_t deopt_id) { |
| + SetInputAt(0, value); |
| + // Override generated deopt-id. |
| + deopt_id_ = deopt_id; |
| + } |
| + |
| + Value* value() const { return inputs_[0]; } |
| + |
| + DECLARE_INSTRUCTION(DoubleToFloat) |
| + |
| + virtual CompileType ComputeType() const; |
| + |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| + virtual Representation representation() const { |
| + return kUnboxedDouble; |
|
Cutch
2014/02/19 18:06:01
Is this valid?
|
| + } |
| + |
| + virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
| + ASSERT(idx == 0); |
| + return kUnboxedDouble; |
| + } |
| + |
| + virtual intptr_t DeoptimizationTarget() const { return deopt_id_; } |
| + |
| + virtual bool AllowsCSE() const { return true; } |
| + virtual EffectSet Effects() const { return EffectSet::None(); } |
| + virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| + virtual bool AttributesEqual(Instruction* other) const { return true; } |
| + |
| + virtual bool MayThrow() const { return false; } |
| + |
| + virtual Definition* Canonicalize(FlowGraph* flow_graph); |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(DoubleToFloatInstr); |
| +}; |
| + |
| + |
| +class FloatToDoubleInstr: public TemplateDefinition<1> { |
| + public: |
| + FloatToDoubleInstr(Value* value, intptr_t deopt_id) { |
| + SetInputAt(0, value); |
| + // Override generated deopt-id. |
| + deopt_id_ = deopt_id; |
| + } |
| + |
| + Value* value() const { return inputs_[0]; } |
| + |
| + DECLARE_INSTRUCTION(FloatToDouble) |
| + |
| + virtual CompileType ComputeType() const; |
| + |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| + virtual Representation representation() const { |
| + return kUnboxedDouble; |
| + } |
| + |
| + virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
| + ASSERT(idx == 0); |
| + return kUnboxedDouble; |
|
Cutch
2014/02/19 18:06:01
Similarly.
|
| + } |
| + |
| + virtual intptr_t DeoptimizationTarget() const { return deopt_id_; } |
| + |
| + virtual bool AllowsCSE() const { return true; } |
| + virtual EffectSet Effects() const { return EffectSet::None(); } |
| + virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| + virtual bool AttributesEqual(Instruction* other) const { return true; } |
| + |
| + virtual bool MayThrow() const { return false; } |
| + |
| + virtual Definition* Canonicalize(FlowGraph* flow_graph); |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(FloatToDoubleInstr); |
| +}; |
| + |
| + |
| class InvokeMathCFunctionInstr : public Definition { |
| public: |
| InvokeMathCFunctionInstr(ZoneGrowableArray<Value*>* inputs, |