From: whesse@chromium.org Date: Thu, 24 Jun 2010 14:22:25 +0000 (+0000) Subject: Port optimization of comparison with a trivial LHS from ia32 to x64. X-Git-Tag: upstream/4.7.83~21583 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=667c5e84a1c9890589c6972c6bd50067e915bed6;p=platform%2Fupstream%2Fv8.git Port optimization of comparison with a trivial LHS from ia32 to x64. Review URL: http://codereview.chromium.org/2868028 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4943 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/x64/codegen-x64.cc b/src/x64/codegen-x64.cc index 105ac3d..2854785 100644 --- a/src/x64/codegen-x64.cc +++ b/src/x64/codegen-x64.cc @@ -3855,8 +3855,17 @@ void CodeGenerator::VisitCompareOperation(CompareOperation* node) { default: UNREACHABLE(); } - Load(left); - Load(right); + + if (left->IsTrivial()) { + Load(right); + Result right_result = frame_->Pop(); + frame_->Push(left); + frame_->Push(&right_result); + } else { + Load(left); + Load(right); + } + Comparison(node, cc, strict, destination()); }