| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 spill_slot_count_ += static_cast<int>(slot_count); | 116 spill_slot_count_ += static_cast<int>(slot_count); |
| 117 frame_slot_count_ += static_cast<int>(slot_count); | 117 frame_slot_count_ += static_cast<int>(slot_count); |
| 118 return frame_slot_count_ - 1; | 118 return frame_slot_count_ - 1; |
| 119 } | 119 } |
| 120 | 120 |
| 121 static const int kContextSlot = 2 + StandardFrameConstants::kCPSlotCount; | 121 static const int kContextSlot = 2 + StandardFrameConstants::kCPSlotCount; |
| 122 static const int kJSFunctionSlot = 3 + StandardFrameConstants::kCPSlotCount; | 122 static const int kJSFunctionSlot = 3 + StandardFrameConstants::kCPSlotCount; |
| 123 | 123 |
| 124 private: | 124 private: |
| 125 int AllocateAlignedFrameSlot(int width) { | 125 int AllocateAlignedFrameSlot(int width) { |
| 126 DCHECK(width == 4 || width == 8); | 126 DCHECK(width == 4 || width == 8 || width == 16); |
| 127 // Skip one slot if necessary. | 127 if (kPointerSize == 4) { |
| 128 if (width > kPointerSize) { | 128 // Skip one slot if necessary. |
| 129 DCHECK(width == kPointerSize * 2); | 129 if (width > kPointerSize) { |
| 130 frame_slot_count_++; | 130 frame_slot_count_++; |
| 131 frame_slot_count_ |= 1; | 131 frame_slot_count_ |= 1; |
| 132 // 2 extra slots if width == 16. |
| 133 frame_slot_count_ += (width & 16) / 8; |
| 134 } |
| 135 } else { |
| 136 // No alignment when slots are 8 bytes. |
| 137 DCHECK_EQ(8, kPointerSize); |
| 138 // 1 extra slot if width == 16. |
| 139 frame_slot_count_ += (width & 16) / 16; |
| 132 } | 140 } |
| 133 return frame_slot_count_++; | 141 return frame_slot_count_++; |
| 134 } | 142 } |
| 135 | 143 |
| 136 private: | 144 private: |
| 137 int frame_slot_count_; | 145 int frame_slot_count_; |
| 138 int spill_slot_count_; | 146 int spill_slot_count_; |
| 139 BitVector* allocated_registers_; | 147 BitVector* allocated_registers_; |
| 140 BitVector* allocated_double_registers_; | 148 BitVector* allocated_double_registers_; |
| 141 | 149 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 const Frame* const frame_; | 222 const Frame* const frame_; |
| 215 bool access_frame_with_fp_; | 223 bool access_frame_with_fp_; |
| 216 int sp_delta_; | 224 int sp_delta_; |
| 217 bool has_frame_; | 225 bool has_frame_; |
| 218 }; | 226 }; |
| 219 } // namespace compiler | 227 } // namespace compiler |
| 220 } // namespace internal | 228 } // namespace internal |
| 221 } // namespace v8 | 229 } // namespace v8 |
| 222 | 230 |
| 223 #endif // V8_COMPILER_FRAME_H_ | 231 #endif // V8_COMPILER_FRAME_H_ |
| OLD | NEW |