| Index: runtime/vm/flow_graph_optimizer.cc
|
| ===================================================================
|
| --- runtime/vm/flow_graph_optimizer.cc (revision 32793)
|
| +++ runtime/vm/flow_graph_optimizer.cc (working copy)
|
| @@ -1220,6 +1220,15 @@
|
| Definition::kEffect);
|
| }
|
|
|
| + if (array_cid == kTypedDataFloat32ArrayCid) {
|
| + stored_value =
|
| + new DoubleToFloatInstr(new Value(stored_value), call->deopt_id());
|
| + cursor = flow_graph()->AppendTo(cursor,
|
| + stored_value,
|
| + NULL,
|
| + Definition::kValue);
|
| + }
|
| +
|
| intptr_t index_scale = FlowGraphCompiler::ElementSizeFor(array_cid);
|
| *last = new StoreIndexedInstr(new Value(array),
|
| new Value(index),
|
| @@ -1516,10 +1525,19 @@
|
| index_scale,
|
| array_cid,
|
| deopt_id);
|
| - flow_graph()->AppendTo(cursor,
|
| - *last,
|
| - deopt_id != Isolate::kNoDeoptId ? call->env() : NULL,
|
| - Definition::kValue);
|
| + cursor = flow_graph()->AppendTo(
|
| + cursor,
|
| + *last,
|
| + deopt_id != Isolate::kNoDeoptId ? call->env() : NULL,
|
| + Definition::kValue);
|
| +
|
| + if (array_cid == kTypedDataFloat32ArrayCid) {
|
| + *last = new FloatToDoubleInstr(new Value(*last), deopt_id);
|
| + flow_graph()->AppendTo(cursor,
|
| + *last,
|
| + deopt_id != Isolate::kNoDeoptId ? call->env() : NULL,
|
| + Definition::kValue);
|
| + }
|
| return true;
|
| }
|
|
|
| @@ -3165,10 +3183,19 @@
|
| 1,
|
| view_cid,
|
| deopt_id);
|
| - flow_graph()->AppendTo(cursor,
|
| - *last,
|
| - deopt_id != Isolate::kNoDeoptId ? call->env() : NULL,
|
| - Definition::kValue);
|
| + cursor = flow_graph()->AppendTo(
|
| + cursor,
|
| + *last,
|
| + deopt_id != Isolate::kNoDeoptId ? call->env() : NULL,
|
| + Definition::kValue);
|
| +
|
| + if (view_cid == kTypedDataFloat32ArrayCid) {
|
| + *last = new FloatToDoubleInstr(new Value(*last), deopt_id);
|
| + flow_graph()->AppendTo(cursor,
|
| + *last,
|
| + deopt_id != Isolate::kNoDeoptId ? call->env() : NULL,
|
| + Definition::kValue);
|
| + }
|
| return true;
|
| }
|
|
|
| @@ -3279,6 +3306,16 @@
|
| AddCheckClass(stored_value, value_check, call->deopt_id(), call->env(),
|
| call);
|
| }
|
| +
|
| + if (view_cid == kTypedDataFloat32ArrayCid) {
|
| + stored_value =
|
| + new DoubleToFloatInstr(new Value(stored_value), call->deopt_id());
|
| + cursor = flow_graph()->AppendTo(cursor,
|
| + stored_value,
|
| + NULL,
|
| + Definition::kValue);
|
| + }
|
| +
|
| StoreBarrierType needs_store_barrier = kNoStoreBarrier;
|
| *last = new StoreIndexedInstr(new Value(array),
|
| new Value(index),
|
| @@ -5263,8 +5300,8 @@
|
|
|
| const PhiPlaceMoves* phi_moves() const { return phi_moves_; }
|
|
|
| - // Returns true if the result of AllocateObject can be aliased by some
|
| - // other SSA variable and false otherwise. Currently simply checks if
|
| + // Returns true if the result of an allocation instruction can be aliased by
|
| + // some other SSA variable and false otherwise. Currently simply checks if
|
| // this value is stored in a field, escapes to another function or
|
| // participates in a phi.
|
| static bool CanBeAliased(AllocateObjectInstr* alloc) {
|
| @@ -5725,6 +5762,7 @@
|
| if ((array_store == NULL) ||
|
| (array_store->class_id() == kArrayCid) ||
|
| (array_store->class_id() == kTypedDataFloat64ArrayCid) ||
|
| + (array_store->class_id() == kTypedDataFloat32ArrayCid) ||
|
| (array_store->class_id() == kTypedDataFloat32x4ArrayCid)) {
|
| bool is_load = false;
|
| Place store_place(instr, &is_load);
|
| @@ -7440,6 +7478,18 @@
|
| }
|
|
|
|
|
| +void ConstantPropagator::VisitDoubleToFloat(DoubleToFloatInstr* instr) {
|
| + // TODO(kmillikin): Handle conversion.
|
| + SetValue(instr, non_constant_);
|
| +}
|
| +
|
| +
|
| +void ConstantPropagator::VisitFloatToDouble(FloatToDoubleInstr* instr) {
|
| + // TODO(kmillikin): Handle conversion.
|
| + SetValue(instr, non_constant_);
|
| +}
|
| +
|
| +
|
| void ConstantPropagator::VisitInvokeMathCFunction(
|
| InvokeMathCFunctionInstr* instr) {
|
| // TODO(kmillikin): Handle conversion.
|
|
|