| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/flow_graph_optimizer.h" | 5 #include "vm/flow_graph_optimizer.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/cha.h" | 8 #include "vm/cha.h" |
| 9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
| 10 #include "vm/flow_graph_builder.h" | 10 #include "vm/flow_graph_builder.h" |
| (...skipping 2035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2046 call->ic_data()->AsUnaryClassChecksForArgNr(0)), | 2046 call->ic_data()->AsUnaryClassChecksForArgNr(0)), |
| 2047 call->deopt_id(), | 2047 call->deopt_id(), |
| 2048 call->env(), | 2048 call->env(), |
| 2049 call); | 2049 call); |
| 2050 Float32x4MinMaxInstr* minmax = | 2050 Float32x4MinMaxInstr* minmax = |
| 2051 new Float32x4MinMaxInstr(recognized_kind, new Value(left), | 2051 new Float32x4MinMaxInstr(recognized_kind, new Value(left), |
| 2052 new Value(right), call->deopt_id()); | 2052 new Value(right), call->deopt_id()); |
| 2053 ReplaceCall(call, minmax); | 2053 ReplaceCall(call, minmax); |
| 2054 return true; | 2054 return true; |
| 2055 } | 2055 } |
| 2056 case MethodRecognizer::kFloat32x4WithZWInXY: |
| 2057 case MethodRecognizer::kFloat32x4InterleaveXY: |
| 2058 case MethodRecognizer::kFloat32x4InterleaveZW: |
| 2059 case MethodRecognizer::kFloat32x4InterleaveXYPairs: |
| 2060 case MethodRecognizer::kFloat32x4InterleaveZWPairs: { |
| 2061 Definition* left = call->ArgumentAt(0); |
| 2062 Definition* right = call->ArgumentAt(1); |
| 2063 // Type check left. |
| 2064 AddCheckClass(left, |
| 2065 ICData::ZoneHandle( |
| 2066 call->ic_data()->AsUnaryClassChecksForArgNr(0)), |
| 2067 call->deopt_id(), |
| 2068 call->env(), |
| 2069 call); |
| 2070 Float32x4TwoArgShuffleInstr* two_arg_shuffle = |
| 2071 new Float32x4TwoArgShuffleInstr(recognized_kind, new Value(left), |
| 2072 new Value(right), call->deopt_id()); |
| 2073 ReplaceCall(call, two_arg_shuffle); |
| 2074 return true; |
| 2075 } |
| 2056 case MethodRecognizer::kFloat32x4Scale: { | 2076 case MethodRecognizer::kFloat32x4Scale: { |
| 2057 Definition* left = call->ArgumentAt(0); | 2077 Definition* left = call->ArgumentAt(0); |
| 2058 Definition* right = call->ArgumentAt(1); | 2078 Definition* right = call->ArgumentAt(1); |
| 2059 // Type check left. | 2079 // Type check left. |
| 2060 AddCheckClass(left, | 2080 AddCheckClass(left, |
| 2061 ICData::ZoneHandle( | 2081 ICData::ZoneHandle( |
| 2062 call->ic_data()->AsUnaryClassChecksForArgNr(0)), | 2082 call->ic_data()->AsUnaryClassChecksForArgNr(0)), |
| 2063 call->deopt_id(), | 2083 call->deopt_id(), |
| 2064 call->env(), | 2084 call->env(), |
| 2065 call); | 2085 call); |
| (...skipping 4299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6365 void ConstantPropagator::VisitFloat32x4With(Float32x4WithInstr* instr) { | 6385 void ConstantPropagator::VisitFloat32x4With(Float32x4WithInstr* instr) { |
| 6366 SetValue(instr, non_constant_); | 6386 SetValue(instr, non_constant_); |
| 6367 } | 6387 } |
| 6368 | 6388 |
| 6369 | 6389 |
| 6370 void ConstantPropagator::VisitFloat32x4ToUint32x4( | 6390 void ConstantPropagator::VisitFloat32x4ToUint32x4( |
| 6371 Float32x4ToUint32x4Instr* instr) { | 6391 Float32x4ToUint32x4Instr* instr) { |
| 6372 SetValue(instr, non_constant_); | 6392 SetValue(instr, non_constant_); |
| 6373 } | 6393 } |
| 6374 | 6394 |
| 6395 void ConstantPropagator::VisitFloat32x4TwoArgShuffle( |
| 6396 Float32x4TwoArgShuffleInstr* instr) { |
| 6397 SetValue(instr, non_constant_); |
| 6398 } |
| 6399 |
| 6375 | 6400 |
| 6376 void ConstantPropagator::VisitUint32x4BoolConstructor( | 6401 void ConstantPropagator::VisitUint32x4BoolConstructor( |
| 6377 Uint32x4BoolConstructorInstr* instr) { | 6402 Uint32x4BoolConstructorInstr* instr) { |
| 6378 SetValue(instr, non_constant_); | 6403 SetValue(instr, non_constant_); |
| 6379 } | 6404 } |
| 6380 | 6405 |
| 6381 | 6406 |
| 6382 void ConstantPropagator::VisitUint32x4GetFlag(Uint32x4GetFlagInstr* instr) { | 6407 void ConstantPropagator::VisitUint32x4GetFlag(Uint32x4GetFlagInstr* instr) { |
| 6383 SetValue(instr, non_constant_); | 6408 SetValue(instr, non_constant_); |
| 6384 } | 6409 } |
| (...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7342 | 7367 |
| 7343 // Insert materializations at environment uses. | 7368 // Insert materializations at environment uses. |
| 7344 const Class& cls = Class::Handle(alloc->constructor().Owner()); | 7369 const Class& cls = Class::Handle(alloc->constructor().Owner()); |
| 7345 for (intptr_t i = 0; i < exits.length(); i++) { | 7370 for (intptr_t i = 0; i < exits.length(); i++) { |
| 7346 CreateMaterializationAt(exits[i], alloc, cls, *fields); | 7371 CreateMaterializationAt(exits[i], alloc, cls, *fields); |
| 7347 } | 7372 } |
| 7348 } | 7373 } |
| 7349 | 7374 |
| 7350 | 7375 |
| 7351 } // namespace dart | 7376 } // namespace dart |
| OLD | NEW |