Chromium Code Reviews| Index: runtime/vm/flow_graph_optimizer.cc |
| diff --git a/runtime/vm/flow_graph_optimizer.cc b/runtime/vm/flow_graph_optimizer.cc |
| index 84879f5c9e46a2ed32f4687808a5d7137a6d9119..91b7fe1db37c50a6a28151ac292044f923d0efd3 100644 |
| --- a/runtime/vm/flow_graph_optimizer.cc |
| +++ b/runtime/vm/flow_graph_optimizer.cc |
| @@ -1505,8 +1505,8 @@ bool FlowGraphOptimizer::InlineFloat32x4Getter(InstanceCallInstr* call, |
| call); |
| intptr_t mask = 0; |
| if (getter == MethodRecognizer::kFloat32x4Shuffle) { |
| - ASSERT(call->ArgumentCount() == 2); |
| // Extract shuffle mask. |
| + ASSERT(call->ArgumentCount() == 2); |
| Definition* mask_definition = call->ArgumentAt(1); |
| if (!mask_definition->IsConstant()) { |
| // Not a constant. |
| @@ -1526,13 +1526,28 @@ bool FlowGraphOptimizer::InlineFloat32x4Getter(InstanceCallInstr* call, |
| return false; |
| } |
| } |
| - Float32x4ShuffleInstr* instr = new Float32x4ShuffleInstr( |
| - getter, |
| - new Value(call->ArgumentAt(0)), |
| - mask, |
| - call->deopt_id()); |
| - ReplaceCall(call, instr); |
| - return true; |
| + if (getter == MethodRecognizer::kFloat32x4GetSignMask) { |
| + Float32x4GetSignMaskInstr* instr = new Float32x4GetSignMaskInstr( |
| + new Value(call->ArgumentAt(0)), |
| + call->deopt_id()); |
| + ReplaceCall(call, instr); |
| + return true; |
| + } else { |
| + ASSERT((getter == MethodRecognizer::kFloat32x4Shuffle) || |
| + (getter == MethodRecognizer::kFloat32x4ShuffleX) || |
| + (getter == MethodRecognizer::kFloat32x4ShuffleY) || |
| + (getter == MethodRecognizer::kFloat32x4ShuffleZ) || |
| + (getter == MethodRecognizer::kFloat32x4ShuffleW)); |
| + Float32x4ShuffleInstr* instr = new Float32x4ShuffleInstr( |
| + getter, |
| + new Value(call->ArgumentAt(0)), |
| + mask, |
| + call->deopt_id()); |
| + ReplaceCall(call, instr); |
| + return true; |
| + } |
| + UNREACHABLE(); |
| + return false; |
| } |
| @@ -1547,12 +1562,22 @@ bool FlowGraphOptimizer::InlineUint32x4Getter(InstanceCallInstr* call, |
| call->deopt_id(), |
| call->env(), |
| call); |
| - Uint32x4GetFlagInstr* instr = new Uint32x4GetFlagInstr( |
| - getter, |
| - new Value(call->ArgumentAt(0)), |
| - call->deopt_id()); |
| - ReplaceCall(call, instr); |
| - return true; |
| + if (getter == MethodRecognizer::kUint32x4GetSignMask) { |
| + Uint32x4GetSignMaskInstr* instr = new Uint32x4GetSignMaskInstr( |
| + new Value(call->ArgumentAt(0)), |
| + call->deopt_id()); |
| + ReplaceCall(call, instr); |
| + return true; |
| + } else { |
| + Uint32x4GetFlagInstr* instr = new Uint32x4GetFlagInstr( |
| + getter, |
| + new Value(call->ArgumentAt(0)), |
| + call->deopt_id()); |
| + ReplaceCall(call, instr); |
| + return true; |
| + } |
| + UNREACHABLE(); |
| + return false; |
|
srdjan
2013/08/19 17:30:27
Does the compiler complain if you remove the two l
Cutch
2013/08/19 17:53:21
Done.
|
| } |
| @@ -1690,6 +1715,7 @@ bool FlowGraphOptimizer::TryInlineInstanceGetter(InstanceCallInstr* call) { |
| case MethodRecognizer::kFloat32x4ShuffleY: |
| case MethodRecognizer::kFloat32x4ShuffleZ: |
| case MethodRecognizer::kFloat32x4ShuffleW: |
| + case MethodRecognizer::kFloat32x4GetSignMask: |
| if (!ic_data.HasReceiverClassId(kFloat32x4Cid) || |
| !ic_data.HasOneTarget()) { |
| return false; |
| @@ -1698,7 +1724,8 @@ bool FlowGraphOptimizer::TryInlineInstanceGetter(InstanceCallInstr* call) { |
| case MethodRecognizer::kUint32x4GetFlagX: |
| case MethodRecognizer::kUint32x4GetFlagY: |
| case MethodRecognizer::kUint32x4GetFlagZ: |
| - case MethodRecognizer::kUint32x4GetFlagW: { |
| + case MethodRecognizer::kUint32x4GetFlagW: |
| + case MethodRecognizer::kUint32x4GetSignMask: { |
| if (!ic_data.HasReceiverClassId(kUint32x4Cid) || |
| !ic_data.HasOneTarget()) { |
| return false; |
| @@ -6510,6 +6537,12 @@ void ConstantPropagator::VisitFloat32x4Shuffle(Float32x4ShuffleInstr* instr) { |
| } |
| +void ConstantPropagator::VisitFloat32x4GetSignMask( |
| + Float32x4GetSignMaskInstr* instr) { |
| + SetValue(instr, non_constant_); |
| +} |
| + |
| + |
| void ConstantPropagator::VisitFloat32x4Zero(Float32x4ZeroInstr* instr) { |
| SetValue(instr, non_constant_); |
| } |
| @@ -6561,6 +6594,7 @@ void ConstantPropagator::VisitFloat32x4ToUint32x4( |
| SetValue(instr, non_constant_); |
| } |
| + |
| void ConstantPropagator::VisitFloat32x4TwoArgShuffle( |
| Float32x4TwoArgShuffleInstr* instr) { |
| SetValue(instr, non_constant_); |
| @@ -6578,6 +6612,12 @@ void ConstantPropagator::VisitUint32x4GetFlag(Uint32x4GetFlagInstr* instr) { |
| } |
| +void ConstantPropagator::VisitUint32x4GetSignMask( |
| + Uint32x4GetSignMaskInstr* instr) { |
| + SetValue(instr, non_constant_); |
| +} |
| + |
| + |
| void ConstantPropagator::VisitUint32x4SetFlag(Uint32x4SetFlagInstr* instr) { |
| SetValue(instr, non_constant_); |
| } |