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

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

Issue 1765823002: [compiler] Introduce code stubs for string relational comparisons. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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
Index: src/crankshaft/x64/lithium-codegen-x64.cc
diff --git a/src/crankshaft/x64/lithium-codegen-x64.cc b/src/crankshaft/x64/lithium-codegen-x64.cc
index f8dd6662d315a27e1e2c2fecd00e9663627bd7b5..27578e7a1e5129171a39e673a8f862ee3b882339 100644
--- a/src/crankshaft/x64/lithium-codegen-x64.cc
+++ b/src/crankshaft/x64/lithium-codegen-x64.cc
@@ -2318,17 +2318,10 @@ void LCodeGen::DoStringCompareAndBranch(LStringCompareAndBranch* instr) {
DCHECK(ToRegister(instr->left()).is(rdx));
DCHECK(ToRegister(instr->right()).is(rax));
- if (Token::IsOrderedRelationalCompareOp(instr->op())) {
- Handle<Code> code = CodeFactory::StringCompare(isolate()).code();
- CallCode(code, RelocInfo::CODE_TARGET, instr);
- __ testp(rax, rax);
- } else {
- Handle<Code> code = CodeFactory::StringEqual(isolate()).code();
- CallCode(code, RelocInfo::CODE_TARGET, instr);
- __ CompareRoot(rax, Heap::kTrueValueRootIndex);
- }
-
- EmitBranch(instr, TokenToCondition(instr->op(), false));
+ Handle<Code> code = CodeFactory::StringCompare(isolate(), instr->op()).code();
+ CallCode(code, RelocInfo::CODE_TARGET, instr);
+ __ CompareRoot(rax, Heap::kTrueValueRootIndex);
+ EmitBranch(instr, equal);
}

Powered by Google App Engine
This is Rietveld 408576698