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

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

Issue 15664005: 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/ia32/lithium-codegen-ia32.h ('k') | src/x64/lithium-codegen-x64.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 Register tmp = EnsureTempRegister(); 299 Register tmp = EnsureTempRegister();
300 Operand dst = cgen_->ToOperand(destination); 300 Operand dst = cgen_->ToOperand(destination);
301 __ mov(tmp, src); 301 __ mov(tmp, src);
302 __ mov(dst, tmp); 302 __ mov(dst, tmp);
303 } 303 }
304 304
305 } else if (source->IsConstantOperand()) { 305 } else if (source->IsConstantOperand()) {
306 LConstantOperand* constant_source = LConstantOperand::cast(source); 306 LConstantOperand* constant_source = LConstantOperand::cast(source);
307 if (destination->IsRegister()) { 307 if (destination->IsRegister()) {
308 Register dst = cgen_->ToRegister(destination); 308 Register dst = cgen_->ToRegister(destination);
309 if (cgen_->IsInteger32(constant_source)) { 309 if (cgen_->IsSmi(constant_source)) {
310 __ Set(dst, cgen_->ToSmiImmediate(constant_source));
311 } else if (cgen_->IsInteger32(constant_source)) {
310 __ Set(dst, cgen_->ToInteger32Immediate(constant_source)); 312 __ Set(dst, cgen_->ToInteger32Immediate(constant_source));
311 } else { 313 } else {
312 __ LoadObject(dst, cgen_->ToHandle(constant_source)); 314 __ LoadObject(dst, cgen_->ToHandle(constant_source));
313 } 315 }
314 } else { 316 } else {
315 ASSERT(destination->IsStackSlot()); 317 ASSERT(destination->IsStackSlot());
316 Operand dst = cgen_->ToOperand(destination); 318 Operand dst = cgen_->ToOperand(destination);
317 if (cgen_->IsInteger32(constant_source)) { 319 if (cgen_->IsSmi(constant_source)) {
320 __ Set(dst, cgen_->ToSmiImmediate(constant_source));
321 } else if (cgen_->IsInteger32(constant_source)) {
318 __ Set(dst, cgen_->ToInteger32Immediate(constant_source)); 322 __ Set(dst, cgen_->ToInteger32Immediate(constant_source));
319 } else { 323 } else {
320 Register tmp = EnsureTempRegister(); 324 Register tmp = EnsureTempRegister();
321 __ LoadObject(tmp, cgen_->ToHandle(constant_source)); 325 __ LoadObject(tmp, cgen_->ToHandle(constant_source));
322 __ mov(dst, tmp); 326 __ mov(dst, tmp);
323 } 327 }
324 } 328 }
325 329
326 } else if (source->IsDoubleRegister()) { 330 } else if (source->IsDoubleRegister()) {
327 if (CpuFeatures::IsSupported(SSE2)) { 331 if (CpuFeatures::IsSupported(SSE2)) {
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 } else if (destination->IsRegister()) { 519 } else if (destination->IsRegister()) {
516 source_uses_[destination->index()] = CountSourceUses(destination); 520 source_uses_[destination->index()] = CountSourceUses(destination);
517 } 521 }
518 } 522 }
519 523
520 #undef __ 524 #undef __
521 525
522 } } // namespace v8::internal 526 } } // namespace v8::internal
523 527
524 #endif // V8_TARGET_ARCH_IA32 528 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/lithium-codegen-ia32.h ('k') | src/x64/lithium-codegen-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698