| 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/intermediate_language.h" | 5 #include "vm/intermediate_language.h" | 
| 6 | 6 | 
| 7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" | 
| 8 #include "vm/bit_vector.h" | 8 #include "vm/bit_vector.h" | 
| 9 #include "vm/cpu.h" | 9 #include "vm/cpu.h" | 
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" | 
| (...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 798     input->definition()->AddInputUse(input); | 798     input->definition()->AddInputUse(input); | 
| 799   } | 799   } | 
| 800   // Take other's environment from this definition. | 800   // Take other's environment from this definition. | 
| 801   ASSERT(other->env() == NULL); | 801   ASSERT(other->env() == NULL); | 
| 802   other->SetEnvironment(env()); | 802   other->SetEnvironment(env()); | 
| 803   env_ = NULL; | 803   env_ = NULL; | 
| 804   // Replace all uses of this definition with other. | 804   // Replace all uses of this definition with other. | 
| 805   ReplaceUsesWith(other); | 805   ReplaceUsesWith(other); | 
| 806   // Reuse this instruction's SSA name for other. | 806   // Reuse this instruction's SSA name for other. | 
| 807   ASSERT(!other->HasSSATemp()); | 807   ASSERT(!other->HasSSATemp()); | 
| 808   if (HasSSATemp()) other->set_ssa_temp_index(ssa_temp_index()); | 808   if (HasSSATemp()) { | 
|  | 809     other->set_ssa_temp_index(ssa_temp_index()); | 
|  | 810   } | 
| 809 | 811 | 
| 810   // Finally insert the other definition in place of this one in the graph. | 812   // Finally insert the other definition in place of this one in the graph. | 
| 811   previous()->LinkTo(other); | 813   previous()->LinkTo(other); | 
| 812   if ((iterator != NULL) && (this == iterator->Current())) { | 814   if ((iterator != NULL) && (this == iterator->Current())) { | 
| 813     // Remove through the iterator. | 815     // Remove through the iterator. | 
| 814     other->LinkTo(this); | 816     other->LinkTo(this); | 
| 815     iterator->RemoveCurrentFromGraph(); | 817     iterator->RemoveCurrentFromGraph(); | 
| 816   } else { | 818   } else { | 
| 817     other->LinkTo(next()); | 819     other->LinkTo(next()); | 
| 818     // Remove this definition's input uses. | 820     // Remove this definition's input uses. | 
| (...skipping 2402 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 3221   ASSERT(inputs_->length() == InputCountFor(kind_)); | 3223   ASSERT(inputs_->length() == InputCountFor(kind_)); | 
| 3222   for (intptr_t i = 0; i < inputs_->length(); ++i) { | 3224   for (intptr_t i = 0; i < inputs_->length(); ++i) { | 
| 3223     ASSERT((*inputs)[i] != NULL); | 3225     ASSERT((*inputs)[i] != NULL); | 
| 3224     (*inputs)[i]->set_instruction(this); | 3226     (*inputs)[i]->set_instruction(this); | 
| 3225     (*inputs)[i]->set_use_index(i); | 3227     (*inputs)[i]->set_use_index(i); | 
| 3226   } | 3228   } | 
| 3227   deopt_id_ = original_deopt_id; | 3229   deopt_id_ = original_deopt_id; | 
| 3228 } | 3230 } | 
| 3229 | 3231 | 
| 3230 | 3232 | 
| 3231 intptr_t MergedMathInstr::ResultIndexOf(MethodRecognizer::Kind kind) { | 3233 intptr_t MergedMathInstr::OutputIndexOf(intptr_t kind) { | 
| 3232   switch (kind) { | 3234   switch (kind) { | 
| 3233     case MethodRecognizer::kMathSin: return 0; | 3235     case MethodRecognizer::kMathSin: return 1; | 
| 3234     case MethodRecognizer::kMathCos: return 1; | 3236     case MethodRecognizer::kMathCos: return 0; | 
| 3235     default: UNIMPLEMENTED(); return -1; | 3237     default: UNIMPLEMENTED(); return -1; | 
| 3236   } | 3238   } | 
| 3237 } | 3239 } | 
| 3238 | 3240 | 
| 3239 | 3241 | 
| 3240 intptr_t MergedMathInstr::ResultIndexOf(Token::Kind token) { | 3242 intptr_t MergedMathInstr::OutputIndexOf(Token::Kind token) { | 
| 3241   switch (token) { | 3243   switch (token) { | 
| 3242     case Token::kTRUNCDIV: return 0; | 3244     case Token::kTRUNCDIV: return 0; | 
| 3243     case Token::kMOD: return 1; | 3245     case Token::kMOD: return 1; | 
| 3244     default: UNIMPLEMENTED(); return -1; | 3246     default: UNIMPLEMENTED(); return -1; | 
| 3245   } | 3247   } | 
| 3246 } | 3248 } | 
| 3247 | 3249 | 
| 3248 | 3250 | 
| 3249 #undef __ | 3251 #undef __ | 
| 3250 | 3252 | 
| 3251 }  // namespace dart | 3253 }  // namespace dart | 
| OLD | NEW | 
|---|