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

Unified Diff: src/compiler/simplified-lowering.cc

Issue 1761823002: [compiler] Introduce StringEqualStub and StringNotEqualStub. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address feedback. 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
« no previous file with comments | « src/compiler/simplified-lowering.h ('k') | src/crankshaft/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/simplified-lowering.cc
diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc
index b7c81f435d6b75c869e441b2d2b743a51d937935..e4251acceb7e4979e04bfc53aced6a08b0a4f96d 100644
--- a/src/compiler/simplified-lowering.cc
+++ b/src/compiler/simplified-lowering.cc
@@ -294,6 +294,10 @@ class RepresentationSelector {
return NodeOutputInfo(MachineRepresentation::kTagged, Type::Any());
}
+ static NodeOutputInfo BoolTagged() {
+ return NodeOutputInfo(MachineRepresentation::kTagged, Type::Boolean());
+ }
+
static NodeOutputInfo NumberTagged() {
return NodeOutputInfo(MachineRepresentation::kTagged, Type::Number());
}
@@ -1139,8 +1143,20 @@ class RepresentationSelector {
break;
}
case IrOpcode::kStringEqual: {
- VisitBinop(node, UseInfo::AnyTagged(), NodeOutputInfo::Bool());
- if (lower()) lowering->DoStringEqual(node);
+ VisitBinop(node, UseInfo::AnyTagged(), NodeOutputInfo::BoolTagged());
+ if (lower()) {
+ // StringEqual(x, y) => Call(StringEqualStub, x, y, no-context)
+ Operator::Properties properties = node->op()->properties();
+ Callable callable = CodeFactory::StringEqual(jsgraph_->isolate());
+ CallDescriptor::Flags flags = CallDescriptor::kNoFlags;
+ CallDescriptor* desc = Linkage::GetStubCallDescriptor(
+ jsgraph_->isolate(), jsgraph_->zone(), callable.descriptor(), 0,
+ flags, properties);
+ node->InsertInput(jsgraph_->zone(), 0,
+ jsgraph_->HeapConstant(callable.code()));
+ node->InsertInput(jsgraph_->zone(), 3, jsgraph_->NoContextConstant());
+ NodeProperties::ChangeOp(node, jsgraph_->common()->Call(desc));
+ }
break;
}
case IrOpcode::kStringLessThan: {
@@ -1890,16 +1906,6 @@ void ReplaceEffectUses(Node* node, Node* replacement) {
} // namespace
-void SimplifiedLowering::DoStringEqual(Node* node) {
- Node* comparison = StringComparison(node);
- ReplaceEffectUses(node, comparison);
- node->ReplaceInput(0, comparison);
- node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL));
- node->TrimInputCount(2);
- NodeProperties::ChangeOp(node, machine()->WordEqual());
-}
-
-
void SimplifiedLowering::DoStringLessThan(Node* node) {
Node* comparison = StringComparison(node);
ReplaceEffectUses(node, comparison);
« no previous file with comments | « src/compiler/simplified-lowering.h ('k') | src/crankshaft/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698