Commit a52b4cdf authored by Michael Stanton's avatar Michael Stanton Committed by Commit Bot

Revert "[ICs] Eliminate trampoline ICs in TurboFan generic lowering"

This reverts commit 7d699b93.

Reason for revert: Actually we like the trampolines. Slight reduction in code size, and prevents spanning the icache.

Original change's description:
> [ICs] Eliminate trampoline ICs in TurboFan generic lowering
> 
> Trampoline ICs differ from normal ICs only in that they
> load the feedback vector from the stack instead of accepting it
> as an argument. We created them for FullCodeGen, where you always
> have the feedback vector on the stack, and can reduce the amount
> of code required to invoke an ICs by hiding the stack load down
> in the trampoline IC.
> 
> Now the concept isn't really necessary, and we can achieve a
> nice cleanup of our idea-space by removing it. The first step is
> to remove their usage in TurboFan.
> 
> Bug: v8:7199
> Change-Id: I08aefa5de199b1f19adea261b7086a84338c0805
> Reviewed-on: https://chromium-review.googlesource.com/822193
> Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
> Commit-Queue: Michael Stanton <mvstanton@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#50038}

TBR=mvstanton@chromium.org,tebbi@chromium.org

Change-Id: I63dcd98b799739d1d6ea55508b1ea5cfad9e3292
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7199
Reviewed-on: https://chromium-review.googlesource.com/822420Reviewed-by: 's avatarMichael Stanton <mvstanton@chromium.org>
Commit-Queue: Michael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50063}
parent 8ff8c110
......@@ -135,56 +135,97 @@ void JSGenericLowering::LowerJSStrictEqual(Node* node) {
void JSGenericLowering::LowerJSLoadProperty(Node* node) {
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
const PropertyAccess& p = PropertyAccessOf(node->op());
Node* frame_state = NodeProperties::GetFrameStateInput(node);
Node* outer_state = frame_state->InputAt(kFrameStateOuterStateInput);
node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index()));
Callable callable = Builtins::CallableFor(isolate(), Builtins::kKeyedLoadIC);
Node* vector = jsgraph()->HeapConstant(p.feedback().vector());
node->InsertInput(zone(), 3, vector);
ReplaceWithStubCall(node, callable, flags);
if (outer_state->opcode() != IrOpcode::kFrameState) {
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kKeyedLoadICTrampoline);
ReplaceWithStubCall(node, callable, flags);
} else {
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kKeyedLoadIC);
Node* vector = jsgraph()->HeapConstant(p.feedback().vector());
node->InsertInput(zone(), 3, vector);
ReplaceWithStubCall(node, callable, flags);
}
}
void JSGenericLowering::LowerJSLoadNamed(Node* node) {
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
NamedAccess const& p = NamedAccessOf(node->op());
Node* frame_state = NodeProperties::GetFrameStateInput(node);
Node* outer_state = frame_state->InputAt(kFrameStateOuterStateInput);
node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name()));
node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index()));
Callable callable = Builtins::CallableFor(isolate(), Builtins::kLoadIC);
Node* vector = jsgraph()->HeapConstant(p.feedback().vector());
node->InsertInput(zone(), 3, vector);
ReplaceWithStubCall(node, callable, flags);
if (outer_state->opcode() != IrOpcode::kFrameState) {
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kLoadICTrampoline);
ReplaceWithStubCall(node, callable, flags);
} else {
Callable callable = Builtins::CallableFor(isolate(), Builtins::kLoadIC);
Node* vector = jsgraph()->HeapConstant(p.feedback().vector());
node->InsertInput(zone(), 3, vector);
ReplaceWithStubCall(node, callable, flags);
}
}
void JSGenericLowering::LowerJSLoadGlobal(Node* node) {
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
const LoadGlobalParameters& p = LoadGlobalParametersOf(node->op());
Node* frame_state = NodeProperties::GetFrameStateInput(node);
Node* outer_state = frame_state->InputAt(kFrameStateOuterStateInput);
node->InsertInput(zone(), 0, jsgraph()->HeapConstant(p.name()));
node->InsertInput(zone(), 1, jsgraph()->SmiConstant(p.feedback().index()));
Callable callable =
CodeFactory::LoadGlobalICInOptimizedCode(isolate(), p.typeof_mode());
Node* vector = jsgraph()->HeapConstant(p.feedback().vector());
node->InsertInput(zone(), 2, vector);
ReplaceWithStubCall(node, callable, flags);
if (outer_state->opcode() != IrOpcode::kFrameState) {
Callable callable = CodeFactory::LoadGlobalIC(isolate(), p.typeof_mode());
ReplaceWithStubCall(node, callable, flags);
} else {
Callable callable =
CodeFactory::LoadGlobalICInOptimizedCode(isolate(), p.typeof_mode());
Node* vector = jsgraph()->HeapConstant(p.feedback().vector());
node->InsertInput(zone(), 2, vector);
ReplaceWithStubCall(node, callable, flags);
}
}
void JSGenericLowering::LowerJSStoreProperty(Node* node) {
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
PropertyAccess const& p = PropertyAccessOf(node->op());
Node* frame_state = NodeProperties::GetFrameStateInput(node);
Node* outer_state = frame_state->InputAt(kFrameStateOuterStateInput);
node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.feedback().index()));
Callable callable = Builtins::CallableFor(isolate(), Builtins::kKeyedStoreIC);
Node* vector = jsgraph()->HeapConstant(p.feedback().vector());
node->InsertInput(zone(), 4, vector);
ReplaceWithStubCall(node, callable, flags);
if (outer_state->opcode() != IrOpcode::kFrameState) {
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kKeyedStoreICTrampoline);
ReplaceWithStubCall(node, callable, flags);
} else {
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kKeyedStoreIC);
Node* vector = jsgraph()->HeapConstant(p.feedback().vector());
node->InsertInput(zone(), 4, vector);
ReplaceWithStubCall(node, callable, flags);
}
}
void JSGenericLowering::LowerJSStoreNamed(Node* node) {
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
NamedAccess const& p = NamedAccessOf(node->op());
Node* frame_state = NodeProperties::GetFrameStateInput(node);
Node* outer_state = frame_state->InputAt(kFrameStateOuterStateInput);
node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name()));
node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.feedback().index()));
Callable callable = Builtins::CallableFor(isolate(), Builtins::kStoreIC);
Node* vector = jsgraph()->HeapConstant(p.feedback().vector());
node->InsertInput(zone(), 4, vector);
ReplaceWithStubCall(node, callable, flags);
if (outer_state->opcode() != IrOpcode::kFrameState) {
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kStoreICTrampoline);
ReplaceWithStubCall(node, callable, flags);
} else {
Callable callable = Builtins::CallableFor(isolate(), Builtins::kStoreIC);
Node* vector = jsgraph()->HeapConstant(p.feedback().vector());
node->InsertInput(zone(), 4, vector);
ReplaceWithStubCall(node, callable, flags);
}
}
void JSGenericLowering::LowerJSStoreNamedOwn(Node* node) {
......
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