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

Unified Diff: src/code-factory.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/code-factory.cc
diff --git a/src/code-factory.cc b/src/code-factory.cc
index 79b2ea004c2e074f3385a3efa86d9d00d2642844..a9edead438dd016395cad7f3b5a3bc4aeba70980 100644
--- a/src/code-factory.cc
+++ b/src/code-factory.cc
@@ -237,11 +237,28 @@ Callable CodeFactory::StringAdd(Isolate* isolate, StringAddFlags flags,
return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor());
}
-
// static
-Callable CodeFactory::StringCompare(Isolate* isolate) {
- StringCompareStub stub(isolate);
- return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor());
+Callable CodeFactory::StringCompare(Isolate* isolate, Token::Value token) {
+ switch (token) {
+ case Token::EQ:
+ case Token::EQ_STRICT:
+ return StringEqual(isolate);
+ case Token::NE:
+ case Token::NE_STRICT:
+ return StringNotEqual(isolate);
+ case Token::LT:
+ return StringLessThan(isolate);
+ case Token::GT:
+ return StringGreaterThan(isolate);
+ case Token::LTE:
+ return StringLessThanOrEqual(isolate);
+ case Token::GTE:
+ return StringGreaterThanOrEqual(isolate);
+ default:
+ break;
+ }
+ UNREACHABLE();
+ return StringEqual(isolate);
}
// static
@@ -257,6 +274,30 @@ Callable CodeFactory::StringNotEqual(Isolate* isolate) {
}
// static
+Callable CodeFactory::StringLessThan(Isolate* isolate) {
+ StringLessThanStub stub(isolate);
+ return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor());
+}
+
+// static
+Callable CodeFactory::StringLessThanOrEqual(Isolate* isolate) {
+ StringLessThanOrEqualStub stub(isolate);
+ return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor());
+}
+
+// static
+Callable CodeFactory::StringGreaterThan(Isolate* isolate) {
+ StringGreaterThanStub stub(isolate);
+ return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor());
+}
+
+// static
+Callable CodeFactory::StringGreaterThanOrEqual(Isolate* isolate) {
+ StringGreaterThanOrEqualStub stub(isolate);
+ return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor());
+}
+
+// static
Callable CodeFactory::SubString(Isolate* isolate) {
SubStringStub stub(isolate);
return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor());
« no previous file with comments | « src/code-factory.h ('k') | src/code-stubs.h » ('j') | src/compiler/code-stub-assembler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698