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

Side by Side Diff: src/ia32/lithium-codegen-ia32.cc

Issue 16134003: Support Smi in CompareIDAndBranch (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments 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/hydrogen-instructions.cc ('k') | src/ia32/lithium-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 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 2287 matching lines...) Expand 10 before | Expand all | Expand 10 after
2298 EmitGoto(next_block); 2298 EmitGoto(next_block);
2299 } else { 2299 } else {
2300 if (instr->is_double()) { 2300 if (instr->is_double()) {
2301 CpuFeatureScope scope(masm(), SSE2); 2301 CpuFeatureScope scope(masm(), SSE2);
2302 // Don't base result on EFLAGS when a NaN is involved. Instead 2302 // Don't base result on EFLAGS when a NaN is involved. Instead
2303 // jump to the false block. 2303 // jump to the false block.
2304 __ ucomisd(ToDoubleRegister(left), ToDoubleRegister(right)); 2304 __ ucomisd(ToDoubleRegister(left), ToDoubleRegister(right));
2305 __ j(parity_even, chunk_->GetAssemblyLabel(false_block)); 2305 __ j(parity_even, chunk_->GetAssemblyLabel(false_block));
2306 } else { 2306 } else {
2307 if (right->IsConstantOperand()) { 2307 if (right->IsConstantOperand()) {
2308 __ cmp(ToRegister(left), ToInteger32Immediate(right)); 2308 int32_t const_value = ToInteger32(LConstantOperand::cast(right));
2309 if (instr->hydrogen_value()->representation().IsSmi()) {
2310 __ cmp(ToOperand(left), Immediate(Smi::FromInt(const_value)));
2311 } else {
2312 __ cmp(ToOperand(left), Immediate(const_value));
2313 }
2309 } else if (left->IsConstantOperand()) { 2314 } else if (left->IsConstantOperand()) {
2310 __ cmp(ToOperand(right), ToInteger32Immediate(left)); 2315 int32_t const_value = ToInteger32(LConstantOperand::cast(left));
2316 if (instr->hydrogen_value()->representation().IsSmi()) {
2317 __ cmp(ToOperand(right), Immediate(Smi::FromInt(const_value)));
2318 } else {
2319 __ cmp(ToOperand(right), Immediate(const_value));
2320 }
2311 // We transposed the operands. Reverse the condition. 2321 // We transposed the operands. Reverse the condition.
2312 cc = ReverseCondition(cc); 2322 cc = ReverseCondition(cc);
2313 } else { 2323 } else {
2314 __ cmp(ToRegister(left), ToOperand(right)); 2324 __ cmp(ToRegister(left), ToOperand(right));
2315 } 2325 }
2316 } 2326 }
2317 EmitBranch(true_block, false_block, cc); 2327 EmitBranch(true_block, false_block, cc);
2318 } 2328 }
2319 } 2329 }
2320 2330
(...skipping 4242 matching lines...) Expand 10 before | Expand all | Expand 10 after
6563 FixedArray::kHeaderSize - kPointerSize)); 6573 FixedArray::kHeaderSize - kPointerSize));
6564 __ bind(&done); 6574 __ bind(&done);
6565 } 6575 }
6566 6576
6567 6577
6568 #undef __ 6578 #undef __
6569 6579
6570 } } // namespace v8::internal 6580 } } // namespace v8::internal
6571 6581
6572 #endif // V8_TARGET_ARCH_IA32 6582 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.cc ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698