| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_COMPILER_FRAME_H_ | 5 #ifndef V8_COMPILER_FRAME_H_ |
| 6 #define V8_COMPILER_FRAME_H_ | 6 #define V8_COMPILER_FRAME_H_ |
| 7 | 7 |
| 8 #include "src/bit-vector.h" | 8 #include "src/bit-vector.h" |
| 9 #include "src/frames.h" | 9 #include "src/frames.h" |
| 10 | 10 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 91 |
| 92 void SetAllocatedDoubleRegisters(BitVector* regs) { | 92 void SetAllocatedDoubleRegisters(BitVector* regs) { |
| 93 DCHECK(allocated_double_registers_ == nullptr); | 93 DCHECK(allocated_double_registers_ == nullptr); |
| 94 allocated_double_registers_ = regs; | 94 allocated_double_registers_ = regs; |
| 95 } | 95 } |
| 96 | 96 |
| 97 bool DidAllocateDoubleRegisters() const { | 97 bool DidAllocateDoubleRegisters() const { |
| 98 return !allocated_double_registers_->IsEmpty(); | 98 return !allocated_double_registers_->IsEmpty(); |
| 99 } | 99 } |
| 100 | 100 |
| 101 void AlignSavedCalleeRegisterSlots(int alignment = kDoubleSize) { |
| 102 int alignment_slots = alignment / kPointerSize; |
| 103 int delta = alignment_slots - (frame_slot_count_ & (alignment_slots - 1)); |
| 104 if (delta != alignment_slots) { |
| 105 frame_slot_count_ += delta; |
| 106 } |
| 107 spill_slot_count_ += delta; |
| 108 } |
| 109 |
| 101 void AllocateSavedCalleeRegisterSlots(int count) { | 110 void AllocateSavedCalleeRegisterSlots(int count) { |
| 102 frame_slot_count_ += count; | 111 frame_slot_count_ += count; |
| 103 } | 112 } |
| 104 | 113 |
| 105 int AllocateSpillSlot(int width) { | 114 int AllocateSpillSlot(int width) { |
| 106 int frame_slot_count_before = frame_slot_count_; | 115 int frame_slot_count_before = frame_slot_count_; |
| 107 int slot = AllocateAlignedFrameSlot(width); | 116 int slot = AllocateAlignedFrameSlot(width); |
| 108 spill_slot_count_ += (frame_slot_count_ - frame_slot_count_before); | 117 spill_slot_count_ += (frame_slot_count_ - frame_slot_count_before); |
| 109 return slot; | 118 return slot; |
| 110 } | 119 } |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 const Frame* const frame_; | 223 const Frame* const frame_; |
| 215 bool access_frame_with_fp_; | 224 bool access_frame_with_fp_; |
| 216 int sp_delta_; | 225 int sp_delta_; |
| 217 bool has_frame_; | 226 bool has_frame_; |
| 218 }; | 227 }; |
| 219 } // namespace compiler | 228 } // namespace compiler |
| 220 } // namespace internal | 229 } // namespace internal |
| 221 } // namespace v8 | 230 } // namespace v8 |
| 222 | 231 |
| 223 #endif // V8_COMPILER_FRAME_H_ | 232 #endif // V8_COMPILER_FRAME_H_ |
| OLD | NEW |