OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_ARM64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. |
6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
7 | 7 |
8 #include "vm/flow_graph_compiler.h" | 8 #include "vm/flow_graph_compiler.h" |
9 | 9 |
10 #include "vm/ast_printer.h" | 10 #include "vm/ast_printer.h" |
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 opt_param_position[i + 1] = opt_param_position[i]; | 792 opt_param_position[i + 1] = opt_param_position[i]; |
793 } | 793 } |
794 opt_param[i + 1] = parameter; | 794 opt_param[i + 1] = parameter; |
795 opt_param_position[i + 1] = pos; | 795 opt_param_position[i + 1] = pos; |
796 } | 796 } |
797 // Generate code handling each optional parameter in alphabetical order. | 797 // Generate code handling each optional parameter in alphabetical order. |
798 __ LoadFieldFromOffset(R7, R4, ArgumentsDescriptor::count_offset()); | 798 __ LoadFieldFromOffset(R7, R4, ArgumentsDescriptor::count_offset()); |
799 // Let R7 point to the first passed argument, i.e. to | 799 // Let R7 point to the first passed argument, i.e. to |
800 // fp[kParamEndSlotFromFp + num_args - 0]; num_args (R7) is Smi. | 800 // fp[kParamEndSlotFromFp + num_args - 0]; num_args (R7) is Smi. |
801 __ add(R7, FP, Operand(R7, LSL, 2)); | 801 __ add(R7, FP, Operand(R7, LSL, 2)); |
802 __ AddImmediate(R7, R7, kParamEndSlotFromFp * kWordSize); | 802 __ AddImmediate(R7, kParamEndSlotFromFp * kWordSize); |
803 // Let R6 point to the entry of the first named argument. | 803 // Let R6 point to the entry of the first named argument. |
804 __ add(R6, R4, Operand(ArgumentsDescriptor::first_named_entry_offset() - | 804 __ add(R6, R4, Operand(ArgumentsDescriptor::first_named_entry_offset() - |
805 kHeapObjectTag)); | 805 kHeapObjectTag)); |
806 for (int i = 0; i < num_opt_named_params; i++) { | 806 for (int i = 0; i < num_opt_named_params; i++) { |
807 Label load_default_value, assign_optional_parameter; | 807 Label load_default_value, assign_optional_parameter; |
808 const int param_pos = opt_param_position[i]; | 808 const int param_pos = opt_param_position[i]; |
809 // Check if this named parameter was passed in. | 809 // Check if this named parameter was passed in. |
810 // Load R5 with the name of the argument. | 810 // Load R5 with the name of the argument. |
811 __ LoadFromOffset(R5, R6, ArgumentsDescriptor::name_offset()); | 811 __ LoadFromOffset(R5, R6, ArgumentsDescriptor::name_offset()); |
812 ASSERT(opt_param[i]->name().IsSymbol()); | 812 ASSERT(opt_param[i]->name().IsSymbol()); |
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1484 | 1484 |
1485 int FlowGraphCompiler::EmitTestAndCallCheckCid(Label* next_label, | 1485 int FlowGraphCompiler::EmitTestAndCallCheckCid(Label* next_label, |
1486 const CidRange& range, | 1486 const CidRange& range, |
1487 int bias) { | 1487 int bias) { |
1488 intptr_t cid_start = range.cid_start; | 1488 intptr_t cid_start = range.cid_start; |
1489 intptr_t cid_end = range.cid_end; | 1489 intptr_t cid_end = range.cid_end; |
1490 if (cid_start == cid_end) { | 1490 if (cid_start == cid_end) { |
1491 __ CompareImmediate(R2, cid_start - bias); | 1491 __ CompareImmediate(R2, cid_start - bias); |
1492 __ b(next_label, NE); | 1492 __ b(next_label, NE); |
1493 } else { | 1493 } else { |
1494 __ AddImmediate(R2, R2, bias - cid_start); | 1494 __ AddImmediate(R2, bias - cid_start); |
1495 bias = cid_start; | 1495 bias = cid_start; |
1496 __ CompareImmediate(R2, cid_end - cid_start); | 1496 __ CompareImmediate(R2, cid_end - cid_start); |
1497 __ b(next_label, HI); // Unsigned higher. | 1497 __ b(next_label, HI); // Unsigned higher. |
1498 } | 1498 } |
1499 return bias; | 1499 return bias; |
1500 } | 1500 } |
1501 | 1501 |
1502 | 1502 |
1503 #undef __ | 1503 #undef __ |
1504 #define __ compiler_->assembler()-> | 1504 #define __ compiler_->assembler()-> |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1772 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { | 1772 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { |
1773 __ PopDouble(reg); | 1773 __ PopDouble(reg); |
1774 } | 1774 } |
1775 | 1775 |
1776 | 1776 |
1777 #undef __ | 1777 #undef __ |
1778 | 1778 |
1779 } // namespace dart | 1779 } // namespace dart |
1780 | 1780 |
1781 #endif // defined TARGET_ARCH_ARM64 | 1781 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |