| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_ARM64_LITHIUM_GAP_RESOLVER_ARM64_H_ | 5 #ifndef V8_ARM64_LITHIUM_GAP_RESOLVER_ARM64_H_ |
| 6 #define V8_ARM64_LITHIUM_GAP_RESOLVER_ARM64_H_ | 6 #define V8_ARM64_LITHIUM_GAP_RESOLVER_ARM64_H_ |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/lithium.h" | 10 #include "src/lithium.h" |
| 11 #include "src/arm64/delayed-masm-arm64.h" |
| 11 | 12 |
| 12 namespace v8 { | 13 namespace v8 { |
| 13 namespace internal { | 14 namespace internal { |
| 14 | 15 |
| 15 class LCodeGen; | 16 class LCodeGen; |
| 16 class LGapResolver; | 17 class LGapResolver; |
| 17 | 18 |
| 18 class LGapResolver BASE_EMBEDDED { | 19 class LGapResolver BASE_EMBEDDED { |
| 19 public: | 20 public: |
| 20 explicit LGapResolver(LCodeGen* owner); | 21 explicit LGapResolver(LCodeGen* owner); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 36 void BreakCycle(int index); | 37 void BreakCycle(int index); |
| 37 | 38 |
| 38 // After a cycle has been resolved, restore the value from the scratch | 39 // After a cycle has been resolved, restore the value from the scratch |
| 39 // register to its proper destination. | 40 // register to its proper destination. |
| 40 void RestoreValue(); | 41 void RestoreValue(); |
| 41 | 42 |
| 42 // Emit a move and remove it from the move graph. | 43 // Emit a move and remove it from the move graph. |
| 43 void EmitMove(int index); | 44 void EmitMove(int index); |
| 44 | 45 |
| 45 // Emit a move from one stack slot to another. | 46 // Emit a move from one stack slot to another. |
| 46 void EmitStackSlotMove(int index); | 47 void EmitStackSlotMove(int index) { |
| 48 masm_.StackSlotMove(moves_[index].source(), moves_[index].destination()); |
| 49 } |
| 47 | 50 |
| 48 // Verify the move list before performing moves. | 51 // Verify the move list before performing moves. |
| 49 void Verify(); | 52 void Verify(); |
| 50 | 53 |
| 54 // Registers used to solve cycles. |
| 55 const Register& SavedValueRegister() { |
| 56 ASSERT(!masm_.ScratchRegister().IsAllocatable()); |
| 57 return masm_.ScratchRegister(); |
| 58 } |
| 59 const FPRegister& SavedFPValueRegister() { |
| 60 // We use the Crankshaft floating-point scratch register to break a cycle |
| 61 // involving double values as the MacroAssembler will not need it for the |
| 62 // operations performed by the gap resolver. |
| 63 ASSERT(!crankshaft_fp_scratch.IsAllocatable()); |
| 64 return crankshaft_fp_scratch; |
| 65 } |
| 66 |
| 51 LCodeGen* cgen_; | 67 LCodeGen* cgen_; |
| 68 DelayedMasm masm_; |
| 52 | 69 |
| 53 // List of moves not yet resolved. | 70 // List of moves not yet resolved. |
| 54 ZoneList<LMoveOperands> moves_; | 71 ZoneList<LMoveOperands> moves_; |
| 55 | 72 |
| 56 int root_index_; | 73 int root_index_; |
| 57 bool in_cycle_; | 74 bool in_cycle_; |
| 58 LOperand* saved_destination_; | 75 LOperand* saved_destination_; |
| 59 | |
| 60 // We use the root register as a scratch in a few places. When that happens, | |
| 61 // this flag is set to indicate that it needs to be restored. | |
| 62 bool need_to_restore_root_; | |
| 63 }; | 76 }; |
| 64 | 77 |
| 65 } } // namespace v8::internal | 78 } } // namespace v8::internal |
| 66 | 79 |
| 67 #endif // V8_ARM64_LITHIUM_GAP_RESOLVER_ARM64_H_ | 80 #endif // V8_ARM64_LITHIUM_GAP_RESOLVER_ARM64_H_ |
| OLD | NEW |