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

Unified Diff: src/code-factory.cc

Issue 2372113004: [turbofan] JSGenericLowering mostly uses builtins instead of code stubs now (Closed)
Patch Set: Ross' comments Created 4 years, 2 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/builtins/x87/builtins-x87.cc ('k') | src/code-stub-assembler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-factory.cc
diff --git a/src/code-factory.cc b/src/code-factory.cc
index 67ef612ca9243ff5e90f8ccbb036baf932b2b12d..e84e04ea5ac18e48807550c11098ef30814e9ebe 100644
--- a/src/code-factory.cc
+++ b/src/code-factory.cc
@@ -154,12 +154,6 @@ Callable CodeFactory::BinaryOpIC(Isolate* isolate, Token::Value op) {
}
// static
-Callable CodeFactory::InstanceOf(Isolate* isolate) {
- InstanceOfStub stub(isolate);
- return make_callable(stub);
-}
-
-// static
Callable CodeFactory::GetProperty(Isolate* isolate) {
GetPropertyStub stub(isolate);
return make_callable(stub);
@@ -190,36 +184,12 @@ Callable CodeFactory::StringToNumber(Isolate* isolate) {
}
// static
-Callable CodeFactory::ToString(Isolate* isolate) {
- return Callable(isolate->builtins()->ToString(),
- TypeConversionDescriptor(isolate));
-}
-
-// static
Callable CodeFactory::ToName(Isolate* isolate) {
return Callable(isolate->builtins()->ToName(),
TypeConversionDescriptor(isolate));
}
// static
-Callable CodeFactory::ToInteger(Isolate* isolate) {
- ToIntegerStub stub(isolate);
- return make_callable(stub);
-}
-
-// static
-Callable CodeFactory::ToLength(Isolate* isolate) {
- ToLengthStub stub(isolate);
- return make_callable(stub);
-}
-
-// static
-Callable CodeFactory::ToObject(Isolate* isolate) {
- ToObjectStub stub(isolate);
- return make_callable(stub);
-}
-
-// static
Callable CodeFactory::NonPrimitiveToPrimitive(Isolate* isolate,
ToPrimitiveHint hint) {
return Callable(isolate->builtins()->NonPrimitiveToPrimitive(hint),
@@ -251,71 +221,45 @@ Callable CodeFactory::RegExpExec(Isolate* isolate) {
return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor());
}
-// static
-Callable CodeFactory::Add(Isolate* isolate) {
- AddStub stub(isolate);
- return make_callable(stub);
-}
-
-// static
-Callable CodeFactory::Subtract(Isolate* isolate) {
- SubtractStub stub(isolate);
- return make_callable(stub);
-}
-
-// static
-Callable CodeFactory::Multiply(Isolate* isolate) {
- MultiplyStub stub(isolate);
- return make_callable(stub);
-}
-
-// static
-Callable CodeFactory::Divide(Isolate* isolate) {
- DivideStub stub(isolate);
- return make_callable(stub);
-}
-
-// static
-Callable CodeFactory::Modulus(Isolate* isolate) {
- ModulusStub stub(isolate);
- return make_callable(stub);
-}
-
-// static
-Callable CodeFactory::ShiftRight(Isolate* isolate) {
- ShiftRightStub stub(isolate);
- return make_callable(stub);
-}
-
-// static
-Callable CodeFactory::ShiftRightLogical(Isolate* isolate) {
- ShiftRightLogicalStub stub(isolate);
- return make_callable(stub);
-}
-
-// static
-Callable CodeFactory::ShiftLeft(Isolate* isolate) {
- ShiftLeftStub stub(isolate);
- return make_callable(stub);
-}
-
-// static
-Callable CodeFactory::BitwiseAnd(Isolate* isolate) {
- BitwiseAndStub stub(isolate);
- return make_callable(stub);
-}
+#define DECLARE_TFS(Name, Kind, Extra, InterfaceDescriptor) \
+ typedef InterfaceDescriptor##Descriptor Name##Descriptor;
+BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, DECLARE_TFS,
+ IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN)
+#undef DECLARE_TFS
-// static
-Callable CodeFactory::BitwiseOr(Isolate* isolate) {
- BitwiseOrStub stub(isolate);
- return make_callable(stub);
-}
+#define TFS_BUILTIN(Name) \
+ Callable CodeFactory::Name(Isolate* isolate) { \
+ Handle<Code> code(isolate->builtins()->Name()); \
+ return Callable(code, Name##Descriptor(isolate)); \
+ }
-// static
-Callable CodeFactory::BitwiseXor(Isolate* isolate) {
- BitwiseXorStub stub(isolate);
- return make_callable(stub);
-}
+TFS_BUILTIN(ToString)
+TFS_BUILTIN(Add)
+TFS_BUILTIN(Subtract)
+TFS_BUILTIN(Multiply)
+TFS_BUILTIN(Divide)
+TFS_BUILTIN(Modulus)
+TFS_BUILTIN(BitwiseAnd)
+TFS_BUILTIN(BitwiseOr)
+TFS_BUILTIN(BitwiseXor)
+TFS_BUILTIN(ShiftLeft)
+TFS_BUILTIN(ShiftRight)
+TFS_BUILTIN(ShiftRightLogical)
+TFS_BUILTIN(LessThan)
+TFS_BUILTIN(LessThanOrEqual)
+TFS_BUILTIN(GreaterThan)
+TFS_BUILTIN(GreaterThanOrEqual)
+TFS_BUILTIN(Equal)
+TFS_BUILTIN(NotEqual)
+TFS_BUILTIN(StrictEqual)
+TFS_BUILTIN(StrictNotEqual)
+TFS_BUILTIN(HasProperty)
+TFS_BUILTIN(ToInteger)
+TFS_BUILTIN(ToLength)
+TFS_BUILTIN(ToObject)
+TFS_BUILTIN(Typeof)
+TFS_BUILTIN(InstanceOf)
+TFS_BUILTIN(ForInFilter)
// static
Callable CodeFactory::Inc(Isolate* isolate) {
@@ -330,54 +274,6 @@ Callable CodeFactory::Dec(Isolate* isolate) {
}
// static
-Callable CodeFactory::LessThan(Isolate* isolate) {
- LessThanStub stub(isolate);
- return make_callable(stub);
-}
-
-// static
-Callable CodeFactory::LessThanOrEqual(Isolate* isolate) {
- LessThanOrEqualStub stub(isolate);
- return make_callable(stub);
-}
-
-// static
-Callable CodeFactory::GreaterThan(Isolate* isolate) {
- GreaterThanStub stub(isolate);
- return make_callable(stub);
-}
-
-// static
-Callable CodeFactory::GreaterThanOrEqual(Isolate* isolate) {
- GreaterThanOrEqualStub stub(isolate);
- return make_callable(stub);
-}
-
-// static
-Callable CodeFactory::Equal(Isolate* isolate) {
- EqualStub stub(isolate);
- return make_callable(stub);
-}
-
-// static
-Callable CodeFactory::NotEqual(Isolate* isolate) {
- NotEqualStub stub(isolate);
- return make_callable(stub);
-}
-
-// static
-Callable CodeFactory::StrictEqual(Isolate* isolate) {
- StrictEqualStub stub(isolate);
- return make_callable(stub);
-}
-
-// static
-Callable CodeFactory::StrictNotEqual(Isolate* isolate) {
- StrictNotEqualStub stub(isolate);
- return make_callable(stub);
-}
-
-// static
Callable CodeFactory::StringAdd(Isolate* isolate, StringAddFlags flags,
PretenureFlag pretenure_flag) {
StringAddStub stub(isolate, flags, pretenure_flag);
@@ -457,12 +353,6 @@ Callable CodeFactory::ResumeGenerator(Isolate* isolate) {
}
// static
-Callable CodeFactory::Typeof(Isolate* isolate) {
- TypeofStub stub(isolate);
- return make_callable(stub);
-}
-
-// static
Callable CodeFactory::FastCloneRegExp(Isolate* isolate) {
FastCloneRegExpStub stub(isolate);
return make_callable(stub);
@@ -585,18 +475,6 @@ Callable CodeFactory::ConstructFunction(Isolate* isolate) {
}
// static
-Callable CodeFactory::HasProperty(Isolate* isolate) {
- HasPropertyStub stub(isolate);
- return make_callable(stub);
-}
-
-// static
-Callable CodeFactory::ForInFilter(Isolate* isolate) {
- ForInFilterStub stub(isolate);
- return make_callable(stub);
-}
-
-// static
Callable CodeFactory::InterpreterPushArgsAndCall(Isolate* isolate,
TailCallMode tail_call_mode,
CallableType function_type) {
« no previous file with comments | « src/builtins/x87/builtins-x87.cc ('k') | src/code-stub-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698