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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 DCHECK(allocated_double_registers_ == NULL); | 103 DCHECK(allocated_double_registers_ == NULL); |
104 allocated_double_registers_ = regs; | 104 allocated_double_registers_ = regs; |
105 } | 105 } |
106 | 106 |
107 bool DidAllocateDoubleRegisters() { | 107 bool DidAllocateDoubleRegisters() { |
108 return !allocated_double_registers_->IsEmpty(); | 108 return !allocated_double_registers_->IsEmpty(); |
109 } | 109 } |
110 | 110 |
111 int AlignSavedCalleeRegisterSlots() { | 111 int AlignSavedCalleeRegisterSlots() { |
112 DCHECK_EQ(0, spilled_callee_register_slot_count_); | 112 DCHECK_EQ(0, spilled_callee_register_slot_count_); |
113 int frame_slot_count_before = frame_slot_count_; | 113 int delta = frame_slot_count_ & 1; |
114 frame_slot_count_ = RoundUp(frame_slot_count_, 2); | 114 frame_slot_count_ += delta; |
115 return frame_slot_count_before - frame_slot_count_; | 115 return delta; |
116 } | 116 } |
117 | 117 |
118 void AllocateSavedCalleeRegisterSlots(int count) { | 118 void AllocateSavedCalleeRegisterSlots(int count) { |
119 frame_slot_count_ += count; | 119 frame_slot_count_ += count; |
120 spilled_callee_register_slot_count_ += count; | 120 spilled_callee_register_slot_count_ += count; |
121 } | 121 } |
122 | 122 |
123 int AllocateSpillSlot(int width) { | 123 int AllocateSpillSlot(int width) { |
124 DCHECK_EQ(0, spilled_callee_register_slot_count_); | 124 DCHECK_EQ(0, spilled_callee_register_slot_count_); |
125 int frame_slot_count_before = frame_slot_count_; | 125 int frame_slot_count_before = frame_slot_count_; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 int offset_; // Encodes SP or FP in the low order bit. | 182 int offset_; // Encodes SP or FP in the low order bit. |
183 | 183 |
184 static const int kFromSp = 1; | 184 static const int kFromSp = 1; |
185 static const int kFromFp = 0; | 185 static const int kFromFp = 0; |
186 }; | 186 }; |
187 } | 187 } |
188 } | 188 } |
189 } // namespace v8::internal::compiler | 189 } // namespace v8::internal::compiler |
190 | 190 |
191 #endif // V8_COMPILER_FRAME_H_ | 191 #endif // V8_COMPILER_FRAME_H_ |
OLD | NEW |