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 555b8598e51571e389ed344f8a44353ab0e6b69b..548a1a2cbacfdc28182ca3cbb7961b76dc639522 100644 |
| --- a/runtime/vm/flow_graph_optimizer.cc |
| +++ b/runtime/vm/flow_graph_optimizer.cc |
| @@ -1802,16 +1802,83 @@ bool FlowGraphOptimizer::TryInlineInstanceMethod(InstanceCallInstr* call) { |
| case MethodRecognizer::kFloat32x4Reciprocal: { |
| Definition* left = call->ArgumentAt(0); |
| AddCheckClass(left, |
| - ICData::ZoneHandle( |
| - call->ic_data()->AsUnaryClassChecksForArgNr(0)), |
| - call->deopt_id(), |
| - call->env(), |
| - call); |
| + ICData::ZoneHandle( |
| + call->ic_data()->AsUnaryClassChecksForArgNr(0)), |
| + call->deopt_id(), |
| + call->env(), |
| + call); |
| Float32x4SqrtInstr* sqrt = |
| new Float32x4SqrtInstr(recognized_kind, new Value(left), call); |
| ReplaceCall(call, sqrt); |
| return true; |
| } |
| + case MethodRecognizer::kFloat32x4WithX: |
| + case MethodRecognizer::kFloat32x4WithY: |
| + case MethodRecognizer::kFloat32x4WithZ: |
| + case MethodRecognizer::kFloat32x4WithW: { |
| + Definition* left = call->ArgumentAt(0); |
| + Definition* right = call->ArgumentAt(1); |
| + // Type check left. |
| + AddCheckClass(left, |
| + ICData::ZoneHandle( |
| + call->ic_data()->AsUnaryClassChecksForArgNr(0)), |
| + call->deopt_id(), |
| + call->env(), |
| + call); |
| + Float32x4WithInstr* with = new Float32x4WithInstr(recognized_kind, |
| + new Value(left), |
| + new Value(right), |
| + call); |
| + ReplaceCall(call, with); |
| + return true; |
| + } |
| + case MethodRecognizer::kFloat32x4Absolute: |
| + case MethodRecognizer::kFloat32x4Negate: { |
| + Definition* left = call->ArgumentAt(0); |
| + // Type check left. |
| + AddCheckClass(left, |
| + ICData::ZoneHandle( |
| + call->ic_data()->AsUnaryClassChecksForArgNr(0)), |
| + call->deopt_id(), |
| + call->env(), |
| + call); |
| + Float32x4ZeroArgInstr* zeroArg = |
| + new Float32x4ZeroArgInstr(recognized_kind, new Value(left), call); |
| + ReplaceCall(call, zeroArg); |
| + return true; |
| + } |
| + case MethodRecognizer::kFloat32x4Clamp: { |
| + Definition* left = call->ArgumentAt(0); |
| + Definition* lower = call->ArgumentAt(1); |
| + Definition* upper = call->ArgumentAt(2); |
| + // Type check left. |
| + AddCheckClass(left, |
| + ICData::ZoneHandle( |
| + call->ic_data()->AsUnaryClassChecksForArgNr(0)), |
| + call->deopt_id(), |
| + call->env(), |
| + call); |
| + Float32x4ClampInstr* clamp = new Float32x4ClampInstr(new Value(left), |
| + new Value(lower), |
| + new Value(upper), |
| + call); |
| + ReplaceCall(call, clamp); |
| + return true; |
| + } |
| + case MethodRecognizer::kFloat32x4ToUint32x4: { |
| + Definition* left = call->ArgumentAt(0); |
| + // Type check left. |
| + AddCheckClass(left, |
| + ICData::ZoneHandle( |
| + call->ic_data()->AsUnaryClassChecksForArgNr(0)), |
| + call->deopt_id(), |
| + call->env(), |
| + call); |
| + Float32x4ToUint32x4Instr* cast = |
| + new Float32x4ToUint32x4Instr(new Value(left), call); |
| + ReplaceCall(call, cast); |
| + return true; |
| + } |
|
srdjan
2013/05/01 18:33:18
This method has been become unwieldy. You may cons
Cutch
2013/05/01 19:56:37
Done.
|
| default: |
| return false; |
| } |
| @@ -4937,6 +5004,27 @@ void ConstantPropagator::VisitFloat32x4Sqrt(Float32x4SqrtInstr* instr) { |
| } |
| +void ConstantPropagator::VisitFloat32x4ZeroArg(Float32x4ZeroArgInstr* instr) { |
| + SetValue(instr, non_constant_); |
| +} |
| + |
| + |
| +void ConstantPropagator::VisitFloat32x4Clamp(Float32x4ClampInstr* instr) { |
| + SetValue(instr, non_constant_); |
| +} |
| + |
| + |
| +void ConstantPropagator::VisitFloat32x4With(Float32x4WithInstr* instr) { |
| + SetValue(instr, non_constant_); |
| +} |
| + |
| + |
| +void ConstantPropagator::VisitFloat32x4ToUint32x4( |
| + Float32x4ToUint32x4Instr* instr) { |
| + SetValue(instr, non_constant_); |
| +} |
| + |
| + |
| void ConstantPropagator::VisitMathSqrt(MathSqrtInstr* instr) { |
| const Object& value = instr->value()->definition()->constant_value(); |
| if (IsNonConstant(value)) { |