Chromium Code Reviews| Index: runtime/vm/intermediate_language.h |
| diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h |
| index ac497ff5ea74f2a71dbaff1d97f2598fa80b0f54..0820151f12c3e6c3ace3b018880b78d8c3e48674 100644 |
| --- a/runtime/vm/intermediate_language.h |
| +++ b/runtime/vm/intermediate_language.h |
| @@ -46,6 +46,7 @@ class Range; |
| V(_TypedList, _getUint32, ByteArrayBaseGetUint32, 380843687) \ |
| V(_TypedList, _getFloat32, ByteArrayBaseGetFloat32, 979971573) \ |
| V(_TypedList, _getFloat64, ByteArrayBaseGetFloat64, 979971573) \ |
| + V(_TypedList, _getFloat32x4, ByteArrayBaseGetFloat32x4, 690339584) \ |
| V(_TypedList, _setInt8, ByteArrayBaseSetInt8, 287047804) \ |
| V(_TypedList, _setUint8, ByteArrayBaseSetUint8, 287047804) \ |
| V(_TypedList, _setInt16, ByteArrayBaseSetInt16, 287047804) \ |
| @@ -54,6 +55,7 @@ class Range; |
| V(_TypedList, _setUint32, ByteArrayBaseSetUint32, 287047804) \ |
| V(_TypedList, _setFloat32, ByteArrayBaseSetFloat32, 1032541114) \ |
| V(_TypedList, _setFloat64, ByteArrayBaseSetFloat64, 1032541114) \ |
| + V(_TypedList, _setFloat32x4, ByteArrayBaseSetFloat32x4, 1016704782) \ |
| V(_GrowableObjectArray, get:length, GrowableArrayLength, 725548050) \ |
| V(_GrowableObjectArray, get:_capacity, GrowableArrayCapacity, 725548050) \ |
| V(_StringBase, get:length, StringBaseLength, 320803993) \ |
| @@ -489,6 +491,8 @@ class EmbeddedArray<T, 0> { |
| M(MathSqrt) \ |
| M(UnboxDouble) \ |
| M(BoxDouble) \ |
| + M(BoxFloat32x4) \ |
| + M(UnboxFloat32x4) \ |
| M(UnboxInteger) \ |
| M(BoxInteger) \ |
| M(BinaryMintOp) \ |
| @@ -740,6 +744,7 @@ FOR_EACH_INSTRUCTION(INSTRUCTION_TYPE_CHECK) |
| // Classes that set deopt_id_. |
| friend class UnboxIntegerInstr; |
| friend class UnboxDoubleInstr; |
| + friend class UnboxFloat32x4Instr; |
| friend class BinaryDoubleOpInstr; |
| friend class BinaryMintOpInstr; |
| friend class BinarySmiOpInstr; |
| @@ -3708,6 +3713,39 @@ class BoxDoubleInstr : public TemplateDefinition<1> { |
| }; |
| +class BoxFloat32x4Instr : public TemplateDefinition<1> { |
| + public: |
| + BoxFloat32x4Instr(Value* value, InstanceCallInstr* instance_call) |
| + : token_pos_((instance_call != NULL) ? instance_call->token_pos() : 0) { |
| + SetInputAt(0, value); |
| + } |
| + |
| + Value* value() const { return inputs_[0]; } |
| + |
| + intptr_t token_pos() const { return token_pos_; } |
| + |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| + virtual bool HasSideEffect() const { return false; } |
| + |
| + virtual bool AffectedBySideEffect() const { return false; } |
| + virtual bool AttributesEqual(Instruction* other) const { return true; } |
| + |
| + virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
| + ASSERT(idx == 0); |
| + return kUnboxedFloat32x4; |
| + } |
| + |
| + DECLARE_INSTRUCTION(BoxFloat32x4) |
| + virtual CompileType ComputeType() const; |
| + |
| + private: |
| + const intptr_t token_pos_; |
|
srdjan
2013/04/10 15:33:23
Why do we need token_pos_ (here and in BoxDoubleIn
Cutch
2013/04/10 16:36:13
We don't. instance_call was always NULL. I've remo
|
| + |
| + DISALLOW_COPY_AND_ASSIGN(BoxFloat32x4Instr); |
| +}; |
| + |
| + |
| class BoxIntegerInstr : public TemplateDefinition<1> { |
| public: |
| explicit BoxIntegerInstr(Value* value) { |
| @@ -3767,6 +3805,36 @@ class UnboxDoubleInstr : public TemplateDefinition<1> { |
| }; |
| +class UnboxFloat32x4Instr : public TemplateDefinition<1> { |
| + public: |
| + UnboxFloat32x4Instr(Value* value, intptr_t deopt_id) { |
| + SetInputAt(0, value); |
| + deopt_id_ = deopt_id; |
| + } |
| + |
| + Value* value() const { return inputs_[0]; } |
| + |
| + virtual bool CanDeoptimize() const { |
| + return (value()->Type()->ToCid() != kFloat32x4Cid); |
| + } |
| + |
| + virtual bool HasSideEffect() const { return false; } |
| + |
| + virtual Representation representation() const { |
| + return kUnboxedFloat32x4; |
| + } |
| + |
| + virtual bool AffectedBySideEffect() const { return false; } |
| + virtual bool AttributesEqual(Instruction* other) const { return true; } |
| + |
| + DECLARE_INSTRUCTION(UnboxFloat32x4) |
| + virtual CompileType ComputeType() const; |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(UnboxFloat32x4Instr); |
| +}; |
| + |
| + |
| class UnboxIntegerInstr : public TemplateDefinition<1> { |
| public: |
| UnboxIntegerInstr(Value* value, intptr_t deopt_id) { |