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
This commit is contained in:
whesse@chromium.org 2010-06-24 14:22:25 +00:00
parent d0a9f76261
commit 667c5e84a1

View File

@ -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());
}