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

Unified Diff: src/x64/lithium-codegen-x64.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, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ia32/lithium-ia32.cc ('k') | src/x64/lithium-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/lithium-codegen-x64.cc
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc
index b42e660d21090ca4e33f64b20651467cd2b044df..adbe64cb27fbec70d31ffd9029f2e0afd4572252 100644
--- a/src/x64/lithium-codegen-x64.cc
+++ b/src/x64/lithium-codegen-x64.cc
@@ -2074,16 +2074,32 @@ void LCodeGen::DoCmpIDAndBranch(LCmpIDAndBranch* instr) {
int32_t value;
if (right->IsConstantOperand()) {
value = ToInteger32(LConstantOperand::cast(right));
- __ cmpl(ToRegister(left), Immediate(value));
+ if (instr->hydrogen_value()->representation().IsSmi()) {
+ __ Cmp(ToRegister(left), Smi::FromInt(value));
+ } else {
+ __ cmpl(ToRegister(left), Immediate(value));
+ }
} else if (left->IsConstantOperand()) {
value = ToInteger32(LConstantOperand::cast(left));
- if (right->IsRegister()) {
+ if (instr->hydrogen_value()->representation().IsSmi()) {
+ if (right->IsRegister()) {
+ __ Cmp(ToRegister(right), Smi::FromInt(value));
+ } else {
+ __ Cmp(ToOperand(right), Smi::FromInt(value));
+ }
+ } else if (right->IsRegister()) {
__ cmpl(ToRegister(right), Immediate(value));
} else {
__ cmpl(ToOperand(right), Immediate(value));
}
// We transposed the operands. Reverse the condition.
cc = ReverseCondition(cc);
+ } else if (instr->hydrogen_value()->representation().IsSmi()) {
+ if (right->IsRegister()) {
+ __ cmpq(ToRegister(left), ToRegister(right));
+ } else {
+ __ cmpq(ToRegister(left), ToOperand(right));
+ }
} else {
if (right->IsRegister()) {
__ cmpl(ToRegister(left), ToRegister(right));
« no previous file with comments | « src/ia32/lithium-ia32.cc ('k') | src/x64/lithium-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698