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

Unified Diff: src/x64/lithium-codegen-x64.cc

Issue 21014004: Add equality type parameter to HCompareObjectAndBranch (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 7 years, 5 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/mips/lithium-mips.cc ('k') | src/x64/lithium-x64.h » ('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 7f0ed3dbaeaafe00f3924c307a96a6e431d4d7d9..852a288190308e18633295b24d60ea58b8e1f9a0 100644
--- a/src/x64/lithium-codegen-x64.cc
+++ b/src/x64/lithium-codegen-x64.cc
@@ -2023,6 +2023,9 @@ inline Condition LCodeGen::TokenToCondition(Token::Value op, bool is_unsigned) {
case Token::EQ_STRICT:
cond = equal;
break;
+ case Token::NE:
+ cond = not_equal;
+ break;
case Token::LT:
cond = is_unsigned ? below : less;
break;
@@ -2105,7 +2108,7 @@ void LCodeGen::DoCompareNumericAndBranch(LCompareNumericAndBranch* instr) {
}
-void LCodeGen::DoCmpObjectEqAndBranch(LCmpObjectEqAndBranch* instr) {
+void LCodeGen::DoCmpObjectAndBranch(LCmpObjectAndBranch* instr) {
Register left = ToRegister(instr->left());
if (instr->right()->IsConstantOperand()) {
@@ -2115,7 +2118,11 @@ void LCodeGen::DoCmpObjectEqAndBranch(LCmpObjectEqAndBranch* instr) {
Register right = ToRegister(instr->right());
__ cmpq(left, right);
}
- EmitBranch(instr, equal);
+ if (instr->hydrogen()->is_equal()) {
+ EmitBranch(instr, equal);
+ } else {
+ EmitBranch(instr, not_equal);
+ }
}
« no previous file with comments | « src/mips/lithium-mips.cc ('k') | src/x64/lithium-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698