| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/globals.h" // Needed here to get TARGET_ARCH_XXX. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_XXX. |
| 6 | 6 |
| 7 #include "vm/flow_graph_compiler.h" | 7 #include "vm/flow_graph_compiler.h" |
| 8 | 8 |
| 9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
| 10 #include "vm/debugger.h" | 10 #include "vm/debugger.h" |
| (...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 void FlowGraphCompiler::EmitTestAndCall(const ICData& ic_data, | 569 void FlowGraphCompiler::EmitTestAndCall(const ICData& ic_data, |
| 570 Register class_id_reg, | 570 Register class_id_reg, |
| 571 intptr_t arg_count, | 571 intptr_t arg_count, |
| 572 const Array& arg_names, | 572 const Array& arg_names, |
| 573 Label* deopt, | 573 Label* deopt, |
| 574 intptr_t deopt_id, | 574 intptr_t deopt_id, |
| 575 intptr_t token_index, | 575 intptr_t token_index, |
| 576 LocationSummary* locs) { | 576 LocationSummary* locs) { |
| 577 ASSERT(!ic_data.IsNull() && (ic_data.NumberOfChecks() > 0)); | 577 ASSERT(!ic_data.IsNull() && (ic_data.NumberOfChecks() > 0)); |
| 578 Label match_found; | 578 Label match_found; |
| 579 for (intptr_t i = 0; i < ic_data.NumberOfChecks(); i++) { | 579 const intptr_t len = ic_data.NumberOfChecks(); |
| 580 const bool is_last_check = (i == (ic_data.NumberOfChecks() - 1)); | 580 for (intptr_t i = 0; i < len; i++) { |
| 581 const bool is_last_check = (i == (len - 1)); |
| 581 Label next_test; | 582 Label next_test; |
| 582 assembler()->cmpl(class_id_reg, Immediate(ic_data.GetReceiverClassIdAt(i))); | 583 assembler()->cmpl(class_id_reg, Immediate(ic_data.GetReceiverClassIdAt(i))); |
| 583 if (is_last_check) { | 584 if (is_last_check) { |
| 584 assembler()->j(NOT_EQUAL, deopt); | 585 assembler()->j(NOT_EQUAL, deopt); |
| 585 } else { | 586 } else { |
| 586 assembler()->j(NOT_EQUAL, &next_test); | 587 assembler()->j(NOT_EQUAL, &next_test); |
| 587 } | 588 } |
| 588 const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(i)); | 589 const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(i)); |
| 589 GenerateStaticCall(deopt_id, | 590 GenerateStaticCall(deopt_id, |
| 590 token_index, | 591 token_index, |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 917 ASSERT(Utils::IsInt(31, disp)); | 918 ASSERT(Utils::IsInt(31, disp)); |
| 918 return FieldAddress(array, disp); | 919 return FieldAddress(array, disp); |
| 919 } | 920 } |
| 920 default: | 921 default: |
| 921 UNIMPLEMENTED(); | 922 UNIMPLEMENTED(); |
| 922 return FieldAddress(SPREG, 0); | 923 return FieldAddress(SPREG, 0); |
| 923 } | 924 } |
| 924 } | 925 } |
| 925 | 926 |
| 926 } // namespace dart | 927 } // namespace dart |
| OLD | NEW |