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

Side by Side Diff: src/macro-assembler.h

Issue 1155703006: Revert of Embedded constant pools. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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/lithium.cc ('k') | src/mips/assembler-mips.h » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_MACRO_ASSEMBLER_H_ 5 #ifndef V8_MACRO_ASSEMBLER_H_
6 #define V8_MACRO_ASSEMBLER_H_ 6 #define V8_MACRO_ASSEMBLER_H_
7 7
8 8
9 // Helper types to make boolean flag easier to read at call-site. 9 // Helper types to make boolean flag easier to read at call-site.
10 enum InvokeFlag { 10 enum InvokeFlag {
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 StackFrame::Type type_; 128 StackFrame::Type type_;
129 bool old_has_frame_; 129 bool old_has_frame_;
130 }; 130 };
131 131
132 class FrameAndConstantPoolScope { 132 class FrameAndConstantPoolScope {
133 public: 133 public:
134 FrameAndConstantPoolScope(MacroAssembler* masm, StackFrame::Type type) 134 FrameAndConstantPoolScope(MacroAssembler* masm, StackFrame::Type type)
135 : masm_(masm), 135 : masm_(masm),
136 type_(type), 136 type_(type),
137 old_has_frame_(masm->has_frame()), 137 old_has_frame_(masm->has_frame()),
138 old_constant_pool_available_(FLAG_enable_embedded_constant_pool && 138 old_constant_pool_available_(FLAG_enable_ool_constant_pool &&
139 masm->is_constant_pool_available()) { 139 masm->is_ool_constant_pool_available()) {
140 masm->set_has_frame(true); 140 masm->set_has_frame(true);
141 if (FLAG_enable_embedded_constant_pool) { 141 if (FLAG_enable_ool_constant_pool) {
142 masm->set_constant_pool_available(true); 142 masm->set_ool_constant_pool_available(true);
143 } 143 }
144 if (type_ != StackFrame::MANUAL && type_ != StackFrame::NONE) { 144 if (type_ != StackFrame::MANUAL && type_ != StackFrame::NONE) {
145 masm->EnterFrame(type, !old_constant_pool_available_); 145 masm->EnterFrame(type, !old_constant_pool_available_);
146 } 146 }
147 } 147 }
148 148
149 ~FrameAndConstantPoolScope() { 149 ~FrameAndConstantPoolScope() {
150 masm_->LeaveFrame(type_); 150 masm_->LeaveFrame(type_);
151 masm_->set_has_frame(old_has_frame_); 151 masm_->set_has_frame(old_has_frame_);
152 if (FLAG_enable_embedded_constant_pool) { 152 if (FLAG_enable_ool_constant_pool) {
153 masm_->set_constant_pool_available(old_constant_pool_available_); 153 masm_->set_ool_constant_pool_available(old_constant_pool_available_);
154 } 154 }
155 } 155 }
156 156
157 // Normally we generate the leave-frame code when this object goes 157 // Normally we generate the leave-frame code when this object goes
158 // out of scope. Sometimes we may need to generate the code somewhere else 158 // out of scope. Sometimes we may need to generate the code somewhere else
159 // in addition. Calling this will achieve that, but the object stays in 159 // in addition. Calling this will achieve that, but the object stays in
160 // scope, the MacroAssembler is still marked as being in a frame scope, and 160 // scope, the MacroAssembler is still marked as being in a frame scope, and
161 // the code will be generated again when it goes out of scope. 161 // the code will be generated again when it goes out of scope.
162 void GenerateLeaveFrame() { 162 void GenerateLeaveFrame() {
163 DCHECK(type_ != StackFrame::MANUAL && type_ != StackFrame::NONE); 163 DCHECK(type_ != StackFrame::MANUAL && type_ != StackFrame::NONE);
164 masm_->LeaveFrame(type_); 164 masm_->LeaveFrame(type_);
165 } 165 }
166 166
167 private: 167 private:
168 MacroAssembler* masm_; 168 MacroAssembler* masm_;
169 StackFrame::Type type_; 169 StackFrame::Type type_;
170 bool old_has_frame_; 170 bool old_has_frame_;
171 bool old_constant_pool_available_; 171 bool old_constant_pool_available_;
172 172
173 DISALLOW_IMPLICIT_CONSTRUCTORS(FrameAndConstantPoolScope); 173 DISALLOW_IMPLICIT_CONSTRUCTORS(FrameAndConstantPoolScope);
174 }; 174 };
175 175
176 // Class for scoping the the unavailability of constant pool access. 176 // Class for scoping the the unavailability of constant pool access.
177 class ConstantPoolUnavailableScope { 177 class ConstantPoolUnavailableScope {
178 public: 178 public:
179 explicit ConstantPoolUnavailableScope(MacroAssembler* masm) 179 explicit ConstantPoolUnavailableScope(MacroAssembler* masm)
180 : masm_(masm), 180 : masm_(masm),
181 old_constant_pool_available_(FLAG_enable_embedded_constant_pool && 181 old_constant_pool_available_(FLAG_enable_ool_constant_pool &&
182 masm->is_constant_pool_available()) { 182 masm->is_ool_constant_pool_available()) {
183 if (FLAG_enable_embedded_constant_pool) { 183 if (FLAG_enable_ool_constant_pool) {
184 masm_->set_constant_pool_available(false); 184 masm_->set_ool_constant_pool_available(false);
185 } 185 }
186 } 186 }
187 ~ConstantPoolUnavailableScope() { 187 ~ConstantPoolUnavailableScope() {
188 if (FLAG_enable_embedded_constant_pool) { 188 if (FLAG_enable_ool_constant_pool) {
189 masm_->set_constant_pool_available(old_constant_pool_available_); 189 masm_->set_ool_constant_pool_available(old_constant_pool_available_);
190 } 190 }
191 } 191 }
192 192
193 private: 193 private:
194 MacroAssembler* masm_; 194 MacroAssembler* masm_;
195 int old_constant_pool_available_; 195 int old_constant_pool_available_;
196 196
197 DISALLOW_IMPLICIT_CONSTRUCTORS(ConstantPoolUnavailableScope); 197 DISALLOW_IMPLICIT_CONSTRUCTORS(ConstantPoolUnavailableScope);
198 }; 198 };
199 199
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 return ExternalReference::old_space_allocation_limit_address(isolate); 262 return ExternalReference::old_space_allocation_limit_address(isolate);
263 } 263 }
264 return ExternalReference::new_space_allocation_limit_address(isolate); 264 return ExternalReference::new_space_allocation_limit_address(isolate);
265 } 265 }
266 }; 266 };
267 267
268 268
269 } } // namespace v8::internal 269 } } // namespace v8::internal
270 270
271 #endif // V8_MACRO_ASSEMBLER_H_ 271 #endif // V8_MACRO_ASSEMBLER_H_
OLDNEW
« no previous file with comments | « src/lithium.cc ('k') | src/mips/assembler-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698