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

Unified Diff: src/code-factory.cc

Issue 2647493002: [ic] Clean up handler boilerplate (Closed)
Patch Set: rebased Created 3 years, 11 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/code-factory.h ('k') | src/code-stubs.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 2c7dcef349a367464201c3aa12469c2f21b1f48b..018aa86ed244a6b5bc91f39df9c08adbbbf4233c 100644
--- a/src/code-factory.cc
+++ b/src/code-factory.cc
@@ -34,6 +34,16 @@ Callable CodeFactory::LoadIC(Isolate* isolate) {
}
// static
+Callable CodeFactory::LoadICProtoArray(Isolate* isolate,
+ bool throw_if_nonexistent) {
+ return Callable(
+ throw_if_nonexistent
+ ? isolate->builtins()->LoadICProtoArrayThrowIfNonexistent()
+ : isolate->builtins()->LoadICProtoArray(),
+ LoadICProtoArrayDescriptor(isolate));
+}
+
+// static
Callable CodeFactory::ApiGetter(Isolate* isolate) {
CallApiGetterStub stub(isolate);
return make_callable(stub);
@@ -76,12 +86,6 @@ Callable CodeFactory::KeyedLoadICInOptimizedCode(Isolate* isolate) {
}
// static
-Callable CodeFactory::KeyedLoadIC_Megamorphic(Isolate* isolate) {
- return Callable(isolate->builtins()->KeyedLoadIC_Megamorphic_TF(),
- LoadWithVectorDescriptor(isolate));
-}
-
-// static
Callable CodeFactory::CallIC(Isolate* isolate, ConvertReceiverMode mode,
TailCallMode tail_call_mode) {
CallICTrampolineStub stub(isolate, CallICState(mode, tail_call_mode));
@@ -133,11 +137,10 @@ Callable CodeFactory::KeyedStoreICInOptimizedCode(Isolate* isolate,
// static
Callable CodeFactory::KeyedStoreIC_Megamorphic(Isolate* isolate,
LanguageMode language_mode) {
- return Callable(
- language_mode == STRICT
- ? isolate->builtins()->KeyedStoreIC_Megamorphic_Strict_TF()
- : isolate->builtins()->KeyedStoreIC_Megamorphic_TF(),
- StoreWithVectorDescriptor(isolate));
+ return Callable(language_mode == STRICT
+ ? isolate->builtins()->KeyedStoreIC_Megamorphic_Strict()
+ : isolate->builtins()->KeyedStoreIC_Megamorphic(),
+ StoreWithVectorDescriptor(isolate));
}
// static
@@ -159,36 +162,6 @@ Callable CodeFactory::GetProperty(Isolate* isolate) {
}
// static
-Callable CodeFactory::ToBoolean(Isolate* isolate) {
- return Callable(isolate->builtins()->ToBoolean(),
- TypeConversionDescriptor(isolate));
-}
-
-// static
-Callable CodeFactory::ToNumber(Isolate* isolate) {
- return Callable(isolate->builtins()->ToNumber(),
- TypeConversionDescriptor(isolate));
-}
-
-// static
-Callable CodeFactory::NonNumberToNumber(Isolate* isolate) {
- return Callable(isolate->builtins()->NonNumberToNumber(),
- TypeConversionDescriptor(isolate));
-}
-
-// static
-Callable CodeFactory::StringToNumber(Isolate* isolate) {
- return Callable(isolate->builtins()->StringToNumber(),
- TypeConversionDescriptor(isolate));
-}
-
-// static
-Callable CodeFactory::ToName(Isolate* isolate) {
- return Callable(isolate->builtins()->ToName(),
- TypeConversionDescriptor(isolate));
-}
-
-// static
Callable CodeFactory::NonPrimitiveToPrimitive(Isolate* isolate,
ToPrimitiveHint hint) {
return Callable(isolate->builtins()->NonPrimitiveToPrimitive(hint),
@@ -254,19 +227,37 @@ TFS_BUILTIN(StrictEqual)
TFS_BUILTIN(StrictNotEqual)
TFS_BUILTIN(CreateIterResultObject)
TFS_BUILTIN(HasProperty)
+TFS_BUILTIN(NonNumberToNumber)
+TFS_BUILTIN(StringToNumber)
+TFS_BUILTIN(ToBoolean)
TFS_BUILTIN(ToInteger)
TFS_BUILTIN(ToLength)
+TFS_BUILTIN(ToName)
+TFS_BUILTIN(ToNumber)
TFS_BUILTIN(ToObject)
TFS_BUILTIN(Typeof)
TFS_BUILTIN(InstanceOf)
TFS_BUILTIN(OrdinaryHasInstance)
-TFS_BUILTIN(ForInFilter)
+TFS_BUILTIN(CopyFastSmiOrObjectElements)
+TFS_BUILTIN(GrowFastDoubleElements)
+TFS_BUILTIN(GrowFastSmiOrObjectElements)
TFS_BUILTIN(NewUnmappedArgumentsElements)
TFS_BUILTIN(NewRestParameterElements)
-TFS_BUILTIN(PromiseHandleReject)
+TFS_BUILTIN(FastCloneRegExp)
+TFS_BUILTIN(FastNewClosure)
+TFS_BUILTIN(FastNewObject)
+TFS_BUILTIN(ForInFilter)
TFS_BUILTIN(GetSuperConstructor)
+TFS_BUILTIN(KeyedLoadIC_Megamorphic)
+TFS_BUILTIN(PromiseHandleReject)
TFS_BUILTIN(StringCharAt)
TFS_BUILTIN(StringCharCodeAt)
+TFS_BUILTIN(StringEqual)
+TFS_BUILTIN(StringNotEqual)
+TFS_BUILTIN(StringLessThan)
+TFS_BUILTIN(StringLessThanOrEqual)
+TFS_BUILTIN(StringGreaterThan)
+TFS_BUILTIN(StringGreaterThanOrEqual)
#undef TFS_BUILTIN
@@ -302,42 +293,6 @@ Callable CodeFactory::StringCompare(Isolate* isolate, Token::Value token) {
}
// static
-Callable CodeFactory::StringEqual(Isolate* isolate) {
- return Callable(isolate->builtins()->StringEqual(),
- CompareDescriptor(isolate));
-}
-
-// static
-Callable CodeFactory::StringNotEqual(Isolate* isolate) {
- return Callable(isolate->builtins()->StringNotEqual(),
- CompareDescriptor(isolate));
-}
-
-// static
-Callable CodeFactory::StringLessThan(Isolate* isolate) {
- return Callable(isolate->builtins()->StringLessThan(),
- CompareDescriptor(isolate));
-}
-
-// static
-Callable CodeFactory::StringLessThanOrEqual(Isolate* isolate) {
- return Callable(isolate->builtins()->StringLessThanOrEqual(),
- CompareDescriptor(isolate));
-}
-
-// static
-Callable CodeFactory::StringGreaterThan(Isolate* isolate) {
- return Callable(isolate->builtins()->StringGreaterThan(),
- CompareDescriptor(isolate));
-}
-
-// static
-Callable CodeFactory::StringGreaterThanOrEqual(Isolate* isolate) {
- return Callable(isolate->builtins()->StringGreaterThanOrEqual(),
- CompareDescriptor(isolate));
-}
-
-// static
Callable CodeFactory::SubString(Isolate* isolate) {
SubStringStub stub(isolate);
return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor());
@@ -350,12 +305,6 @@ Callable CodeFactory::ResumeGenerator(Isolate* isolate) {
}
// static
-Callable CodeFactory::FastCloneRegExp(Isolate* isolate) {
- return Callable(isolate->builtins()->FastCloneRegExp(),
- FastCloneRegExpDescriptor(isolate));
-}
-
-// static
Callable CodeFactory::FastCloneShallowArray(
Isolate* isolate, AllocationSiteMode allocation_mode) {
return Callable(isolate->builtins()->NewCloneShallowArray(allocation_mode),
@@ -376,18 +325,6 @@ Callable CodeFactory::FastNewFunctionContext(Isolate* isolate,
}
// static
-Callable CodeFactory::FastNewClosure(Isolate* isolate) {
- return Callable(isolate->builtins()->FastNewClosure(),
- FastNewClosureDescriptor(isolate));
-}
-
-// static
-Callable CodeFactory::FastNewObject(Isolate* isolate) {
- return Callable(isolate->builtins()->FastNewObject(),
- FastNewObjectDescriptor(isolate));
-}
-
-// static
Callable CodeFactory::FastNewRestParameter(Isolate* isolate,
bool skip_stub_frame) {
FastNewRestParameterStub stub(isolate, skip_stub_frame);
@@ -409,24 +346,6 @@ Callable CodeFactory::FastNewStrictArguments(Isolate* isolate,
}
// static
-Callable CodeFactory::CopyFastSmiOrObjectElements(Isolate* isolate) {
- return Callable(isolate->builtins()->CopyFastSmiOrObjectElements(),
- CopyFastSmiOrObjectElementsDescriptor(isolate));
-}
-
-// static
-Callable CodeFactory::GrowFastDoubleElements(Isolate* isolate) {
- return Callable(isolate->builtins()->GrowFastDoubleElements(),
- GrowArrayElementsDescriptor(isolate));
-}
-
-// static
-Callable CodeFactory::GrowFastSmiOrObjectElements(Isolate* isolate) {
- return Callable(isolate->builtins()->GrowFastSmiOrObjectElements(),
- GrowArrayElementsDescriptor(isolate));
-}
-
-// static
Callable CodeFactory::AllocateHeapNumber(Isolate* isolate) {
AllocateHeapNumberStub stub(isolate);
return make_callable(stub);
« no previous file with comments | « src/code-factory.h ('k') | src/code-stubs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698