Commit db53680d authored by Igor Sheludko's avatar Igor Sheludko Committed by Commit Bot

[ic] Generate FCG-specific IC dispatchers as tail calls to optimized-code specific ones.

... instead of inlining the dispatchers' code. This should reduce the size of the generated
builtins code.

BUG=

Change-Id: Ia3f68ea8b398f049bad87f6ce93c818f0af4674f
Reviewed-on: https://chromium-review.googlesource.com/447938Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43542}
parent 12963af7
......@@ -29,12 +29,11 @@ IC_BUILTIN(LoadICTrampoline)
IC_BUILTIN(LoadField)
IC_BUILTIN(KeyedLoadICTrampoline)
IC_BUILTIN(KeyedLoadIC_Megamorphic)
IC_BUILTIN(StoreIC)
IC_BUILTIN(StoreICTrampoline)
IC_BUILTIN_PARAM(StoreICStrict, StoreIC, /* no param */)
IC_BUILTIN_PARAM(StoreICStrictTrampoline, StoreICTrampoline, /* no param */)
IC_BUILTIN_PARAM(StoreIC, StoreIC, SLOPPY)
IC_BUILTIN_PARAM(StoreICTrampoline, StoreICTrampoline, SLOPPY)
IC_BUILTIN_PARAM(StoreICStrict, StoreIC, STRICT)
IC_BUILTIN_PARAM(StoreICStrictTrampoline, StoreICTrampoline, STRICT)
IC_BUILTIN_PARAM(KeyedStoreIC, KeyedStoreIC, SLOPPY)
IC_BUILTIN_PARAM(KeyedStoreICTrampoline, KeyedStoreICTrampoline, SLOPPY)
IC_BUILTIN_PARAM(KeyedStoreICStrict, KeyedStoreIC, STRICT)
......
......@@ -2072,8 +2072,8 @@ void AccessorAssembler::GenerateLoadICTrampoline() {
Node* context = Parameter(Descriptor::kContext);
Node* vector = LoadFeedbackVectorForStub();
LoadICParameters p(context, receiver, name, slot, vector);
LoadIC(&p);
Callable callable = CodeFactory::LoadICInOptimizedCode(isolate());
TailCallStub(callable, context, receiver, name, slot, vector);
}
void AccessorAssembler::GenerateLoadICProtoArray(
......@@ -2135,8 +2135,9 @@ void AccessorAssembler::GenerateLoadGlobalICTrampoline(TypeofMode typeof_mode) {
Node* context = Parameter(Descriptor::kContext);
Node* vector = LoadFeedbackVectorForStub();
LoadICParameters p(context, nullptr, name, slot, vector);
LoadGlobalIC(&p, typeof_mode);
Callable callable =
CodeFactory::LoadGlobalICInOptimizedCode(isolate(), typeof_mode);
TailCallStub(callable, context, name, slot, vector);
}
void AccessorAssembler::GenerateKeyedLoadIC() {
......@@ -2161,8 +2162,8 @@ void AccessorAssembler::GenerateKeyedLoadICTrampoline() {
Node* context = Parameter(Descriptor::kContext);
Node* vector = LoadFeedbackVectorForStub();
LoadICParameters p(context, receiver, name, slot, vector);
KeyedLoadIC(&p);
Callable callable = CodeFactory::KeyedLoadICInOptimizedCode(isolate());
TailCallStub(callable, context, receiver, name, slot, vector);
}
void AccessorAssembler::GenerateKeyedLoadIC_Megamorphic() {
......@@ -2178,7 +2179,7 @@ void AccessorAssembler::GenerateKeyedLoadIC_Megamorphic() {
KeyedLoadICGeneric(&p);
}
void AccessorAssembler::GenerateStoreIC() {
void AccessorAssembler::GenerateStoreIC(LanguageMode language_mode) {
typedef StoreWithVectorDescriptor Descriptor;
Node* receiver = Parameter(Descriptor::kReceiver);
......@@ -2189,10 +2190,11 @@ void AccessorAssembler::GenerateStoreIC() {
Node* context = Parameter(Descriptor::kContext);
StoreICParameters p(context, receiver, name, value, slot, vector);
// Current StoreIC dispatcher does not depend on the language mode.
StoreIC(&p);
}
void AccessorAssembler::GenerateStoreICTrampoline() {
void AccessorAssembler::GenerateStoreICTrampoline(LanguageMode language_mode) {
typedef StoreDescriptor Descriptor;
Node* receiver = Parameter(Descriptor::kReceiver);
......@@ -2202,8 +2204,9 @@ void AccessorAssembler::GenerateStoreICTrampoline() {
Node* context = Parameter(Descriptor::kContext);
Node* vector = LoadFeedbackVectorForStub();
StoreICParameters p(context, receiver, name, value, slot, vector);
StoreIC(&p);
Callable callable =
CodeFactory::StoreICInOptimizedCode(isolate(), language_mode);
TailCallStub(callable, context, receiver, name, value, slot, vector);
}
void AccessorAssembler::GenerateKeyedStoreIC(LanguageMode language_mode) {
......@@ -2231,8 +2234,9 @@ void AccessorAssembler::GenerateKeyedStoreICTrampoline(
Node* context = Parameter(Descriptor::kContext);
Node* vector = LoadFeedbackVectorForStub();
StoreICParameters p(context, receiver, name, value, slot, vector);
KeyedStoreIC(&p, language_mode);
Callable callable =
CodeFactory::KeyedStoreICInOptimizedCode(isolate(), language_mode);
TailCallStub(callable, context, receiver, name, value, slot, vector);
}
} // namespace internal
......
......@@ -30,8 +30,8 @@ class AccessorAssembler : public CodeStubAssembler {
void GenerateKeyedLoadIC();
void GenerateKeyedLoadICTrampoline();
void GenerateKeyedLoadIC_Megamorphic();
void GenerateStoreIC();
void GenerateStoreICTrampoline();
void GenerateStoreIC(LanguageMode language_mode);
void GenerateStoreICTrampoline(LanguageMode language_mode);
void GenerateLoadICProtoArray(bool throw_reference_error_if_nonexistent);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment