Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(307)

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

Issue 1284893002: Reland: [turbofan] Various fixes to allow unboxed doubles as arguments in registers and on the stac… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/arm64/code-generator-arm64.cc ('k') | src/compiler/ia32/code-generator-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 9
10 namespace v8 { 10 namespace v8 {
11 namespace internal { 11 namespace internal {
12 namespace compiler { 12 namespace compiler {
13 13
14 // Collects the spill slot requirements and the allocated general and double 14 // Collects the spill slot requirements and the allocated general and double
15 // registers for a compiled function. Frames are usually populated by the 15 // registers for a compiled function. Frames are usually populated by the
16 // register allocator and are used by Linkage to generate code for the prologue 16 // register allocator and are used by Linkage to generate code for the prologue
17 // and epilogue to compiled code. 17 // and epilogue to compiled code.
18 class Frame : public ZoneObject { 18 class Frame : public ZoneObject {
19 public: 19 public:
20 Frame() 20 Frame()
21 : register_save_area_size_(0), 21 : register_save_area_size_(0),
22 spill_slot_count_(0), 22 spill_slot_count_(0),
23 osr_stack_slot_count_(0), 23 osr_stack_slot_count_(0),
24 allocated_registers_(NULL), 24 allocated_registers_(NULL),
25 allocated_double_registers_(NULL) {} 25 allocated_double_registers_(NULL),
26 pc_on_stack_(true) {}
26 27
27 inline int GetSpillSlotCount() { return spill_slot_count_; } 28 inline int GetSpillSlotCount() { return spill_slot_count_; }
28 29
29 void SetAllocatedRegisters(BitVector* regs) { 30 void SetAllocatedRegisters(BitVector* regs) {
30 DCHECK(allocated_registers_ == NULL); 31 DCHECK(allocated_registers_ == NULL);
31 allocated_registers_ = regs; 32 allocated_registers_ = regs;
32 } 33 }
33 34
34 void SetAllocatedDoubleRegisters(BitVector* regs) { 35 void SetAllocatedDoubleRegisters(BitVector* regs) {
35 DCHECK(allocated_double_registers_ == NULL); 36 DCHECK(allocated_double_registers_ == NULL);
(...skipping 28 matching lines...) Expand all
64 spill_slot_count_ |= 1; 65 spill_slot_count_ |= 1;
65 } 66 }
66 return spill_slot_count_++; 67 return spill_slot_count_++;
67 } 68 }
68 69
69 void ReserveSpillSlots(size_t slot_count) { 70 void ReserveSpillSlots(size_t slot_count) {
70 DCHECK_EQ(0, spill_slot_count_); // can only reserve before allocation. 71 DCHECK_EQ(0, spill_slot_count_); // can only reserve before allocation.
71 spill_slot_count_ = static_cast<int>(slot_count); 72 spill_slot_count_ = static_cast<int>(slot_count);
72 } 73 }
73 74
75 void SetPCOnStack(bool val) { pc_on_stack_ = val; }
76
77 int PCOnStackSize() { return pc_on_stack_ ? kRegisterSize : 0; }
78
74 private: 79 private:
75 int register_save_area_size_; 80 int register_save_area_size_;
76 int spill_slot_count_; 81 int spill_slot_count_;
77 int osr_stack_slot_count_; 82 int osr_stack_slot_count_;
78 BitVector* allocated_registers_; 83 BitVector* allocated_registers_;
79 BitVector* allocated_double_registers_; 84 BitVector* allocated_double_registers_;
85 bool pc_on_stack_;
80 86
81 DISALLOW_COPY_AND_ASSIGN(Frame); 87 DISALLOW_COPY_AND_ASSIGN(Frame);
82 }; 88 };
83 89
84 90
85 // Represents an offset from either the stack pointer or frame pointer. 91 // Represents an offset from either the stack pointer or frame pointer.
86 class FrameOffset { 92 class FrameOffset {
87 public: 93 public:
88 inline bool from_stack_pointer() { return (offset_ & 1) == kFromSp; } 94 inline bool from_stack_pointer() { return (offset_ & 1) == kFromSp; }
89 inline bool from_frame_pointer() { return (offset_ & 1) == kFromFp; } 95 inline bool from_frame_pointer() { return (offset_ & 1) == kFromFp; }
(...skipping 15 matching lines...) Expand all
105 int offset_; // Encodes SP or FP in the low order bit. 111 int offset_; // Encodes SP or FP in the low order bit.
106 112
107 static const int kFromSp = 1; 113 static const int kFromSp = 1;
108 static const int kFromFp = 0; 114 static const int kFromFp = 0;
109 }; 115 };
110 } 116 }
111 } 117 }
112 } // namespace v8::internal::compiler 118 } // namespace v8::internal::compiler
113 119
114 #endif // V8_COMPILER_FRAME_H_ 120 #endif // V8_COMPILER_FRAME_H_
OLDNEW
« no previous file with comments | « src/compiler/arm64/code-generator-arm64.cc ('k') | src/compiler/ia32/code-generator-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698