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

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

Issue 1355983003: X87: [stubs] Refactor StringCompareStub and use it for HStringCompareAndBranch. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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/x87/interface-descriptors-x87.cc ('k') | src/x87/lithium-x87.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x87/lithium-codegen-x87.cc
diff --git a/src/x87/lithium-codegen-x87.cc b/src/x87/lithium-codegen-x87.cc
index 111a281278e7cb0670ac02c3d002530044095ce9..24f62fb14ae8a17f8b9ffd70e025ac4b69d761de 100644
--- a/src/x87/lithium-codegen-x87.cc
+++ b/src/x87/lithium-codegen-x87.cc
@@ -1372,11 +1372,6 @@ void LCodeGen::DoCallStub(LCallStub* instr) {
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
break;
}
- case CodeStub::StringCompare: {
- StringCompareStub stub(isolate());
- CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
- break;
- }
default:
UNREACHABLE();
}
@@ -2724,16 +2719,15 @@ static Condition ComputeCompareCondition(Token::Value op) {
void LCodeGen::DoStringCompareAndBranch(LStringCompareAndBranch* instr) {
- Token::Value op = instr->op();
-
- Handle<Code> ic =
- CodeFactory::CompareIC(isolate(), op, Strength::WEAK).code();
- CallCode(ic, RelocInfo::CODE_TARGET, instr);
+ DCHECK(ToRegister(instr->context()).is(esi));
+ DCHECK(ToRegister(instr->left()).is(edx));
+ DCHECK(ToRegister(instr->right()).is(eax));
- Condition condition = ComputeCompareCondition(op);
- __ test(eax, Operand(eax));
+ Handle<Code> code = CodeFactory::StringCompare(isolate()).code();
+ CallCode(code, RelocInfo::CODE_TARGET, instr);
+ __ test(eax, eax);
- EmitBranch(instr, condition);
+ EmitBranch(instr, ComputeCompareCondition(instr->op()));
}
« no previous file with comments | « src/x87/interface-descriptors-x87.cc ('k') | src/x87/lithium-x87.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698