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

Side by Side Diff: src/arm/lithium-gap-resolver-arm.cc

Issue 10701054: Enable stub generation using Hydrogen/Lithium (again) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 8 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 ASSERT(moves_[index].destination()->Equals(moves_[root_index_].source())); 164 ASSERT(moves_[index].destination()->Equals(moves_[root_index_].source()));
165 ASSERT(!in_cycle_); 165 ASSERT(!in_cycle_);
166 in_cycle_ = true; 166 in_cycle_ = true;
167 LOperand* source = moves_[index].source(); 167 LOperand* source = moves_[index].source();
168 saved_destination_ = moves_[index].destination(); 168 saved_destination_ = moves_[index].destination();
169 if (source->IsRegister()) { 169 if (source->IsRegister()) {
170 __ mov(kSavedValueRegister, cgen_->ToRegister(source)); 170 __ mov(kSavedValueRegister, cgen_->ToRegister(source));
171 } else if (source->IsStackSlot()) { 171 } else if (source->IsStackSlot()) {
172 __ ldr(kSavedValueRegister, cgen_->ToMemOperand(source)); 172 __ ldr(kSavedValueRegister, cgen_->ToMemOperand(source));
173 } else if (source->IsDoubleRegister()) { 173 } else if (source->IsDoubleRegister()) {
174 ASSERT(CpuFeatures::IsSupported(VFP2));
Jakob Kummerow 2012/11/28 16:28:22 nit: not needed
danno 2012/11/30 16:23:24 Done.
175 CpuFeatures::Scope scope(VFP2);
174 __ vmov(kScratchDoubleReg, cgen_->ToDoubleRegister(source)); 176 __ vmov(kScratchDoubleReg, cgen_->ToDoubleRegister(source));
175 } else if (source->IsDoubleStackSlot()) { 177 } else if (source->IsDoubleStackSlot()) {
178 ASSERT(CpuFeatures::IsSupported(VFP2));
Jakob Kummerow 2012/11/28 16:28:22 nit: not needed
danno 2012/11/30 16:23:24 Done.
179 CpuFeatures::Scope scope(VFP2);
176 __ vldr(kScratchDoubleReg, cgen_->ToMemOperand(source)); 180 __ vldr(kScratchDoubleReg, cgen_->ToMemOperand(source));
177 } else { 181 } else {
178 UNREACHABLE(); 182 UNREACHABLE();
179 } 183 }
180 // This move will be done by restoring the saved value to the destination. 184 // This move will be done by restoring the saved value to the destination.
181 moves_[index].Eliminate(); 185 moves_[index].Eliminate();
182 } 186 }
183 187
184 188
185 void LGapResolver::RestoreValue() { 189 void LGapResolver::RestoreValue() {
186 ASSERT(in_cycle_); 190 ASSERT(in_cycle_);
187 ASSERT(saved_destination_ != NULL); 191 ASSERT(saved_destination_ != NULL);
188 192
189 // Spilled value is in kSavedValueRegister or kSavedDoubleValueRegister. 193 // Spilled value is in kSavedValueRegister or kSavedDoubleValueRegister.
190 if (saved_destination_->IsRegister()) { 194 if (saved_destination_->IsRegister()) {
191 __ mov(cgen_->ToRegister(saved_destination_), kSavedValueRegister); 195 __ mov(cgen_->ToRegister(saved_destination_), kSavedValueRegister);
192 } else if (saved_destination_->IsStackSlot()) { 196 } else if (saved_destination_->IsStackSlot()) {
193 __ str(kSavedValueRegister, cgen_->ToMemOperand(saved_destination_)); 197 __ str(kSavedValueRegister, cgen_->ToMemOperand(saved_destination_));
194 } else if (saved_destination_->IsDoubleRegister()) { 198 } else if (saved_destination_->IsDoubleRegister()) {
199 ASSERT(CpuFeatures::IsSupported(VFP2));
Jakob Kummerow 2012/11/28 16:28:22 nit: not needed
danno 2012/11/30 16:23:24 Done.
200 CpuFeatures::Scope scope(VFP2);
195 __ vmov(cgen_->ToDoubleRegister(saved_destination_), kScratchDoubleReg); 201 __ vmov(cgen_->ToDoubleRegister(saved_destination_), kScratchDoubleReg);
196 } else if (saved_destination_->IsDoubleStackSlot()) { 202 } else if (saved_destination_->IsDoubleStackSlot()) {
203 ASSERT(CpuFeatures::IsSupported(VFP2));
Jakob Kummerow 2012/11/28 16:28:22 nit: not needed
danno 2012/11/30 16:23:24 Done.
204 CpuFeatures::Scope scope(VFP2);
197 __ vstr(kScratchDoubleReg, cgen_->ToMemOperand(saved_destination_)); 205 __ vstr(kScratchDoubleReg, cgen_->ToMemOperand(saved_destination_));
198 } else { 206 } else {
199 UNREACHABLE(); 207 UNREACHABLE();
200 } 208 }
201 209
202 in_cycle_ = false; 210 in_cycle_ = false;
203 saved_destination_ = NULL; 211 saved_destination_ = NULL;
204 } 212 }
205 213
206 214
(...skipping 15 matching lines...) Expand all
222 230
223 } else if (source->IsStackSlot()) { 231 } else if (source->IsStackSlot()) {
224 MemOperand source_operand = cgen_->ToMemOperand(source); 232 MemOperand source_operand = cgen_->ToMemOperand(source);
225 if (destination->IsRegister()) { 233 if (destination->IsRegister()) {
226 __ ldr(cgen_->ToRegister(destination), source_operand); 234 __ ldr(cgen_->ToRegister(destination), source_operand);
227 } else { 235 } else {
228 ASSERT(destination->IsStackSlot()); 236 ASSERT(destination->IsStackSlot());
229 MemOperand destination_operand = cgen_->ToMemOperand(destination); 237 MemOperand destination_operand = cgen_->ToMemOperand(destination);
230 if (in_cycle_) { 238 if (in_cycle_) {
231 if (!destination_operand.OffsetIsUint12Encodable()) { 239 if (!destination_operand.OffsetIsUint12Encodable()) {
232 // ip is overwritten while saving the value to the destination. 240 ASSERT(CpuFeatures::IsSupported(VFP2));
Jakob Kummerow 2012/11/28 16:28:22 nit: not needed
danno 2012/11/30 16:23:24 Done.
241 CpuFeatures::Scope scope(VFP2);
242 // ip is overwritten while saving the value to the destination.
233 // Therefore we can't use ip. It is OK if the read from the source 243 // Therefore we can't use ip. It is OK if the read from the source
234 // destroys ip, since that happens before the value is read. 244 // destroys ip, since that happens before the value is read.
235 __ vldr(kScratchDoubleReg.low(), source_operand); 245 __ vldr(kScratchDoubleReg.low(), source_operand);
236 __ vstr(kScratchDoubleReg.low(), destination_operand); 246 __ vstr(kScratchDoubleReg.low(), destination_operand);
237 } else { 247 } else {
238 __ ldr(ip, source_operand); 248 __ ldr(ip, source_operand);
239 __ str(ip, destination_operand); 249 __ str(ip, destination_operand);
240 } 250 }
241 } else { 251 } else {
242 __ ldr(kSavedValueRegister, source_operand); 252 __ ldr(kSavedValueRegister, source_operand);
(...skipping 17 matching lines...) Expand all
260 __ mov(kSavedValueRegister, 270 __ mov(kSavedValueRegister,
261 Operand(cgen_->ToInteger32(constant_source))); 271 Operand(cgen_->ToInteger32(constant_source)));
262 } else { 272 } else {
263 __ LoadObject(kSavedValueRegister, 273 __ LoadObject(kSavedValueRegister,
264 cgen_->ToHandle(constant_source)); 274 cgen_->ToHandle(constant_source));
265 } 275 }
266 __ str(kSavedValueRegister, cgen_->ToMemOperand(destination)); 276 __ str(kSavedValueRegister, cgen_->ToMemOperand(destination));
267 } 277 }
268 278
269 } else if (source->IsDoubleRegister()) { 279 } else if (source->IsDoubleRegister()) {
270 DoubleRegister source_register = cgen_->ToDoubleRegister(source); 280 ASSERT(CpuFeatures::IsSupported(VFP2));
Jakob Kummerow 2012/11/28 16:28:22 nit: not needed
danno 2012/11/30 16:23:24 Done.
281 CpuFeatures::Scope scope(VFP2);
282 DwVfpRegister source_register = cgen_->ToDoubleRegister(source);
271 if (destination->IsDoubleRegister()) { 283 if (destination->IsDoubleRegister()) {
272 __ vmov(cgen_->ToDoubleRegister(destination), source_register); 284 __ vmov(cgen_->ToDoubleRegister(destination), source_register);
273 } else { 285 } else {
274 ASSERT(destination->IsDoubleStackSlot()); 286 ASSERT(destination->IsDoubleStackSlot());
275 __ vstr(source_register, cgen_->ToMemOperand(destination)); 287 __ vstr(source_register, cgen_->ToMemOperand(destination));
276 } 288 }
277 289
278 } else if (source->IsDoubleStackSlot()) { 290 } else if (source->IsDoubleStackSlot()) {
279 MemOperand source_operand = cgen_->ToMemOperand(source); 291 ASSERT(CpuFeatures::IsSupported(VFP2));
Jakob Kummerow 2012/11/28 16:28:22 nit: not needed
danno 2012/11/30 16:23:24 Done.
292 CpuFeatures::Scope scope(VFP2);
293 MemOperand source_operand = cgen_->ToMemOperand(source);
280 if (destination->IsDoubleRegister()) { 294 if (destination->IsDoubleRegister()) {
281 __ vldr(cgen_->ToDoubleRegister(destination), source_operand); 295 __ vldr(cgen_->ToDoubleRegister(destination), source_operand);
282 } else { 296 } else {
283 ASSERT(destination->IsDoubleStackSlot()); 297 ASSERT(destination->IsDoubleStackSlot());
284 MemOperand destination_operand = cgen_->ToMemOperand(destination); 298 MemOperand destination_operand = cgen_->ToMemOperand(destination);
285 if (in_cycle_) { 299 if (in_cycle_) {
286 // kSavedDoubleValueRegister was used to break the cycle, 300 // kSavedDoubleValueRegister was used to break the cycle,
287 // but kSavedValueRegister is free. 301 // but kSavedValueRegister is free.
288 MemOperand source_high_operand = 302 MemOperand source_high_operand =
289 cgen_->ToHighMemOperand(source); 303 cgen_->ToHighMemOperand(source);
(...skipping 12 matching lines...) Expand all
302 UNREACHABLE(); 316 UNREACHABLE();
303 } 317 }
304 318
305 moves_[index].Eliminate(); 319 moves_[index].Eliminate();
306 } 320 }
307 321
308 322
309 #undef __ 323 #undef __
310 324
311 } } // namespace v8::internal 325 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698