Chromium Code Reviews

Side by Side Diff: src/compiler/frame.cc

Issue 1843143002: [turbofan] CodeGenerator: Frame setup refactoring (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 #include "src/compiler/frame.h" 5 #include "src/compiler/frame.h"
6 6
7 #include "src/compiler/linkage.h" 7 #include "src/compiler/linkage.h"
8 #include "src/compiler/register-allocator.h" 8 #include "src/compiler/register-allocator.h"
9 #include "src/macro-assembler.h" 9 #include "src/macro-assembler.h"
10 10
11 namespace v8 { 11 namespace v8 {
12 namespace internal { 12 namespace internal {
13 namespace compiler { 13 namespace compiler {
14 14
15 Frame::Frame(int fixed_frame_size_in_slots, const CallDescriptor* descriptor) 15 Frame::Frame(int fixed_frame_size_in_slots, const CallDescriptor* descriptor)
16 : frame_slot_count_(fixed_frame_size_in_slots), 16 : frame_slot_count_(fixed_frame_size_in_slots),
17 callee_saved_slot_count_(0), 17 callee_saved_slot_count_(0),
18 spill_slot_count_(0), 18 spill_slot_count_(0),
19 stack_shrink_slots_(0),
19 allocated_registers_(nullptr), 20 allocated_registers_(nullptr),
20 allocated_double_registers_(nullptr) {} 21 allocated_double_registers_(nullptr) {}
21 22
22 int Frame::AlignFrame(int alignment) { 23 int Frame::AlignFrame(int alignment) {
23 DCHECK_EQ(0, callee_saved_slot_count_); 24 DCHECK_EQ(0, callee_saved_slot_count_);
24 int alignment_slots = alignment / kPointerSize; 25 int alignment_slots = alignment / kPointerSize;
25 int delta = alignment_slots - (frame_slot_count_ & (alignment_slots - 1)); 26 int delta = alignment_slots - (frame_slot_count_ & (alignment_slots - 1));
26 if (delta != alignment_slots) { 27 if (delta != alignment_slots) {
27 frame_slot_count_ += delta; 28 frame_slot_count_ += delta;
28 if (spill_slot_count_ != 0) { 29 if (spill_slot_count_ != 0) {
(...skipping 25 matching lines...)
54 // No frame. Retrieve all parameters relative to stack pointer. 55 // No frame. Retrieve all parameters relative to stack pointer.
55 int sp_offset = frame_offset + GetSPToFPOffset(); 56 int sp_offset = frame_offset + GetSPToFPOffset();
56 return FrameOffset::FromStackPointer(sp_offset); 57 return FrameOffset::FromStackPointer(sp_offset);
57 } 58 }
58 } 59 }
59 60
60 61
61 } // namespace compiler 62 } // namespace compiler
62 } // namespace internal 63 } // namespace internal
63 } // namespace v8 64 } // namespace v8
OLDNEW

Powered by Google App Engine