| Index: runtime/vm/intermediate_language.cc
|
| diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
|
| index 7b4d3853473e7bdbf4a41ae00f126bc9f9374024..22ac752813752a5e37aae456e2cc889d45c73fe7 100644
|
| --- a/runtime/vm/intermediate_language.cc
|
| +++ b/runtime/vm/intermediate_language.cc
|
| @@ -41,6 +41,7 @@ Definition::Definition()
|
| type_(NULL),
|
| temp_index_(-1),
|
| ssa_temp_index_(-1),
|
| + ssa_temp_index2_(-1),
|
| input_use_list_(NULL),
|
| env_use_list_(NULL),
|
| use_kind_(kValue), // Phis and parameters rely on this default.
|
| @@ -805,7 +806,13 @@ void Definition::ReplaceWith(Definition* other,
|
| ReplaceUsesWith(other);
|
| // Reuse this instruction's SSA name for other.
|
| ASSERT(!other->HasSSATemp());
|
| - if (HasSSATemp()) other->set_ssa_temp_index(ssa_temp_index());
|
| + if (HasSSATemp()) {
|
| + other->set_ssa_temp_index(ssa_temp_index());
|
| + if (RequiresTwoSSATempIndexes()) {
|
| + ASSERT(other->RequiresTwoSSATempIndexes());
|
| + other->set_ssa_temp_index2(ssa_temp_index2());
|
| + }
|
| + }
|
|
|
| // Finally insert the other definition in place of this one in the graph.
|
| previous()->LinkTo(other);
|
| @@ -3213,6 +3220,39 @@ const RuntimeEntry& MathUnaryInstr::TargetFunction() const {
|
| }
|
|
|
|
|
| +MergedMath2Instr::MergedMath2Instr(ZoneGrowableArray<Value*>* inputs,
|
| + intptr_t original_deopt_id,
|
| + MergedMath2Instr::Kind kind)
|
| + : inputs_(inputs),
|
| + kind_(kind) {
|
| + ASSERT(inputs_->length() == InputCountFor(kind_));
|
| + for (intptr_t i = 0; i < inputs_->length(); ++i) {
|
| + ASSERT((*inputs)[i] != NULL);
|
| + (*inputs)[i]->set_instruction(this);
|
| + (*inputs)[i]->set_use_index(i);
|
| + }
|
| + deopt_id_ = original_deopt_id;
|
| +}
|
| +
|
| +
|
| +intptr_t MergedMath2Instr::OutputIndexOf(intptr_t kind) {
|
| + switch (kind) {
|
| + case MethodRecognizer::kMathSin: return 1;
|
| + case MethodRecognizer::kMathCos: return 0;
|
| + default: UNIMPLEMENTED(); return -1;
|
| + }
|
| +}
|
| +
|
| +
|
| +intptr_t MergedMath2Instr::OutputIndexOf(Token::Kind token) {
|
| + switch (token) {
|
| + case Token::kTRUNCDIV: return 0;
|
| + case Token::kMOD: return 1;
|
| + default: UNIMPLEMENTED(); return -1;
|
| + }
|
| +}
|
| +
|
| +
|
| MergedMathInstr::MergedMathInstr(ZoneGrowableArray<Value*>* inputs,
|
| intptr_t original_deopt_id,
|
| MergedMathInstr::Kind kind)
|
|
|