| 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/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/bit_vector.h" | 9 #include "vm/bit_vector.h" |
| 10 #include "vm/cha.h" | 10 #include "vm/cha.h" |
| (...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 Environment* FlowGraphCompiler::SlowPathEnvironmentFor( | 741 Environment* FlowGraphCompiler::SlowPathEnvironmentFor( |
| 742 Instruction* instruction) { | 742 Instruction* instruction) { |
| 743 if (instruction->env() == NULL) { | 743 if (instruction->env() == NULL) { |
| 744 ASSERT(!is_optimizing()); | 744 ASSERT(!is_optimizing()); |
| 745 return NULL; | 745 return NULL; |
| 746 } | 746 } |
| 747 | 747 |
| 748 Environment* env = instruction->env()->DeepCopy(isolate()); | 748 Environment* env = instruction->env()->DeepCopy(isolate()); |
| 749 // 1. Iterate the registers in the order they will be spilled to compute | 749 // 1. Iterate the registers in the order they will be spilled to compute |
| 750 // the slots they will be spilled to. | 750 // the slots they will be spilled to. |
| 751 intptr_t next_slot = StackSize(); | 751 intptr_t next_slot = StackSize() + env->CountArgsPushed(); |
| 752 RegisterSet* regs = instruction->locs()->live_registers(); | 752 RegisterSet* regs = instruction->locs()->live_registers(); |
| 753 intptr_t fpu_reg_slots[kNumberOfFpuRegisters]; | 753 intptr_t fpu_reg_slots[kNumberOfFpuRegisters]; |
| 754 intptr_t cpu_reg_slots[kNumberOfCpuRegisters]; | 754 intptr_t cpu_reg_slots[kNumberOfCpuRegisters]; |
| 755 const intptr_t kFpuRegisterSpillFactor = kFpuRegisterSize / kWordSize; | 755 const intptr_t kFpuRegisterSpillFactor = kFpuRegisterSize / kWordSize; |
| 756 // FPU registers are spilled first from highest to lowest register number. | 756 // FPU registers are spilled first from highest to lowest register number. |
| 757 for (intptr_t i = kNumberOfFpuRegisters - 1; i >= 0; --i) { | 757 for (intptr_t i = kNumberOfFpuRegisters - 1; i >= 0; --i) { |
| 758 FpuRegister reg = static_cast<FpuRegister>(i); | 758 FpuRegister reg = static_cast<FpuRegister>(i); |
| 759 if (regs->ContainsFpuRegister(reg)) { | 759 if (regs->ContainsFpuRegister(reg)) { |
| 760 // We use the lowest address (thus highest index) to identify a | 760 // We use the lowest address (thus highest index) to identify a |
| 761 // multi-word spill slot. | 761 // multi-word spill slot. |
| (...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1588 const Array& res = Array::Handle( | 1588 const Array& res = Array::Handle( |
| 1589 Array::New(inline_id_to_function_.length(), Heap::kOld)); | 1589 Array::New(inline_id_to_function_.length(), Heap::kOld)); |
| 1590 for (intptr_t i = 0; i < inline_id_to_function_.length(); i++) { | 1590 for (intptr_t i = 0; i < inline_id_to_function_.length(); i++) { |
| 1591 res.SetAt(i, *inline_id_to_function_[i]); | 1591 res.SetAt(i, *inline_id_to_function_[i]); |
| 1592 } | 1592 } |
| 1593 return res.raw(); | 1593 return res.raw(); |
| 1594 } | 1594 } |
| 1595 | 1595 |
| 1596 | 1596 |
| 1597 } // namespace dart | 1597 } // namespace dart |
| OLD | NEW |