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

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

Issue 16146005: MIPS: Update the gap resolver to support Smi constants. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | no next file » | 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 // 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 } else { 245 } else {
246 __ lw(kLithiumScratchReg, source_operand); 246 __ lw(kLithiumScratchReg, source_operand);
247 __ sw(kLithiumScratchReg, destination_operand); 247 __ sw(kLithiumScratchReg, destination_operand);
248 } 248 }
249 } 249 }
250 250
251 } else if (source->IsConstantOperand()) { 251 } else if (source->IsConstantOperand()) {
252 LConstantOperand* constant_source = LConstantOperand::cast(source); 252 LConstantOperand* constant_source = LConstantOperand::cast(source);
253 if (destination->IsRegister()) { 253 if (destination->IsRegister()) {
254 Register dst = cgen_->ToRegister(destination); 254 Register dst = cgen_->ToRegister(destination);
255 if (cgen_->IsInteger32(constant_source)) { 255 if (cgen_->IsSmi(constant_source)) {
256 __ li(dst, Operand(cgen_->ToSmi(constant_source)));
257 } else if (cgen_->IsInteger32(constant_source)) {
256 __ li(dst, Operand(cgen_->ToInteger32(constant_source))); 258 __ li(dst, Operand(cgen_->ToInteger32(constant_source)));
257 } else { 259 } else {
258 __ LoadObject(dst, cgen_->ToHandle(constant_source)); 260 __ LoadObject(dst, cgen_->ToHandle(constant_source));
259 } 261 }
260 } else { 262 } else {
261 ASSERT(destination->IsStackSlot()); 263 ASSERT(destination->IsStackSlot());
262 ASSERT(!in_cycle_); // Constant moves happen after all cycles are gone. 264 ASSERT(!in_cycle_); // Constant moves happen after all cycles are gone.
263 if (cgen_->IsInteger32(constant_source)) { 265 if (cgen_->IsSmi(constant_source)) {
266 __ li(kLithiumScratchReg, Operand(cgen_->ToSmi(constant_source)));
267 } else if (cgen_->IsInteger32(constant_source)) {
264 __ li(kLithiumScratchReg, 268 __ li(kLithiumScratchReg,
265 Operand(cgen_->ToInteger32(constant_source))); 269 Operand(cgen_->ToInteger32(constant_source)));
266 } else { 270 } else {
267 __ LoadObject(kLithiumScratchReg, 271 __ LoadObject(kLithiumScratchReg,
268 cgen_->ToHandle(constant_source)); 272 cgen_->ToHandle(constant_source));
269 } 273 }
270 __ sw(kLithiumScratchReg, cgen_->ToMemOperand(destination)); 274 __ sw(kLithiumScratchReg, cgen_->ToMemOperand(destination));
271 } 275 }
272 276
273 } else if (source->IsDoubleRegister()) { 277 } else if (source->IsDoubleRegister()) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 UNREACHABLE(); 311 UNREACHABLE();
308 } 312 }
309 313
310 moves_[index].Eliminate(); 314 moves_[index].Eliminate();
311 } 315 }
312 316
313 317
314 #undef __ 318 #undef __
315 319
316 } } // namespace v8::internal 320 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698