| 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 | |
| 110 void AllocateSavedCalleeRegisterSlots(int count) { | 101 void AllocateSavedCalleeRegisterSlots(int count) { |
| 111 frame_slot_count_ += count; | 102 frame_slot_count_ += count; |
| 112 } | 103 } |
| 113 | 104 |
| 114 int AllocateSpillSlot(int width) { | 105 int AllocateSpillSlot(int width) { |
| 115 int frame_slot_count_before = frame_slot_count_; | 106 int frame_slot_count_before = frame_slot_count_; |
| 116 int slot = AllocateAlignedFrameSlot(width); | 107 int slot = AllocateAlignedFrameSlot(width); |
| 117 spill_slot_count_ += (frame_slot_count_ - frame_slot_count_before); | 108 spill_slot_count_ += (frame_slot_count_ - frame_slot_count_before); |
| 118 return slot; | 109 return slot; |
| 119 } | 110 } |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 const Frame* const frame_; | 214 const Frame* const frame_; |
| 224 bool access_frame_with_fp_; | 215 bool access_frame_with_fp_; |
| 225 int sp_delta_; | 216 int sp_delta_; |
| 226 bool has_frame_; | 217 bool has_frame_; |
| 227 }; | 218 }; |
| 228 } // namespace compiler | 219 } // namespace compiler |
| 229 } // namespace internal | 220 } // namespace internal |
| 230 } // namespace v8 | 221 } // namespace v8 |
| 231 | 222 |
| 232 #endif // V8_COMPILER_FRAME_H_ | 223 #endif // V8_COMPILER_FRAME_H_ |
| OLD | NEW |