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

Unified Diff: src/compiler/js-generic-lowering.cc

Issue 2529463002: [Turbofan]: generic lowering can use a constant vector (Closed)
Patch Set: Add verifier code. Created 4 years, 1 month 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/compiler/bytecode-graph-builder.cc ('k') | src/compiler/js-operator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-generic-lowering.cc
diff --git a/src/compiler/js-generic-lowering.cc b/src/compiler/js-generic-lowering.cc
index 4a205bce23ffce82a52d3457c86bd42b57a1225e..96b24cf1a67945810b5f81a754005c645ee8db1f 100644
--- a/src/compiler/js-generic-lowering.cc
+++ b/src/compiler/js-generic-lowering.cc
@@ -153,76 +153,37 @@ void JSGenericLowering::LowerJSTypeOf(Node* node) {
void JSGenericLowering::LowerJSLoadProperty(Node* node) {
- Node* closure = NodeProperties::GetValueInput(node, 2);
- Node* effect = NodeProperties::GetEffectInput(node);
- Node* control = NodeProperties::GetControlInput(node);
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
const PropertyAccess& p = PropertyAccessOf(node->op());
Callable callable = CodeFactory::KeyedLoadICInOptimizedCode(isolate());
- // Load the type feedback vector from the closure.
- Node* literals = effect = graph()->NewNode(
- machine()->Load(MachineType::AnyTagged()), closure,
- jsgraph()->IntPtrConstant(JSFunction::kLiteralsOffset - kHeapObjectTag),
- effect, control);
- Node* vector = effect = graph()->NewNode(
- machine()->Load(MachineType::AnyTagged()), literals,
- jsgraph()->IntPtrConstant(LiteralsArray::kFeedbackVectorOffset -
- kHeapObjectTag),
- effect, control);
+ Node* vector = jsgraph()->HeapConstant(p.feedback().vector());
node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index()));
- node->ReplaceInput(3, vector);
- node->ReplaceInput(6, effect);
+ node->InsertInput(zone(), 3, vector);
ReplaceWithStubCall(node, callable, flags);
}
void JSGenericLowering::LowerJSLoadNamed(Node* node) {
- Node* closure = NodeProperties::GetValueInput(node, 1);
- Node* effect = NodeProperties::GetEffectInput(node);
- Node* control = NodeProperties::GetControlInput(node);
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
NamedAccess const& p = NamedAccessOf(node->op());
Callable callable = CodeFactory::LoadICInOptimizedCode(isolate());
- // Load the type feedback vector from the closure.
- Node* literals = effect = graph()->NewNode(
- machine()->Load(MachineType::AnyTagged()), closure,
- jsgraph()->IntPtrConstant(JSFunction::kLiteralsOffset - kHeapObjectTag),
- effect, control);
- Node* vector = effect = graph()->NewNode(
- machine()->Load(MachineType::AnyTagged()), literals,
- jsgraph()->IntPtrConstant(LiteralsArray::kFeedbackVectorOffset -
- kHeapObjectTag),
- effect, control);
+ Node* vector = jsgraph()->HeapConstant(p.feedback().vector());
node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name()));
node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index()));
- node->ReplaceInput(3, vector);
- node->ReplaceInput(6, effect);
+ node->InsertInput(zone(), 3, vector);
ReplaceWithStubCall(node, callable, flags);
}
void JSGenericLowering::LowerJSLoadGlobal(Node* node) {
- Node* closure = NodeProperties::GetValueInput(node, 0);
- Node* effect = NodeProperties::GetEffectInput(node);
- Node* control = NodeProperties::GetControlInput(node);
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
const LoadGlobalParameters& p = LoadGlobalParametersOf(node->op());
Callable callable =
CodeFactory::LoadGlobalICInOptimizedCode(isolate(), p.typeof_mode());
- // Load the type feedback vector from the closure.
- Node* literals = effect = graph()->NewNode(
- machine()->Load(MachineType::AnyTagged()), closure,
- jsgraph()->IntPtrConstant(JSFunction::kLiteralsOffset - kHeapObjectTag),
- effect, control);
- Node* vector = effect = graph()->NewNode(
- machine()->Load(MachineType::AnyTagged()), literals,
- jsgraph()->IntPtrConstant(LiteralsArray::kFeedbackVectorOffset -
- kHeapObjectTag),
- effect, control);
+ Node* vector = jsgraph()->HeapConstant(p.feedback().vector());
node->InsertInput(zone(), 0, jsgraph()->HeapConstant(p.name()));
node->InsertInput(zone(), 1, jsgraph()->SmiConstant(p.feedback().index()));
- node->ReplaceInput(2, vector);
- node->ReplaceInput(5, effect);
+ node->InsertInput(zone(), 2, vector);
ReplaceWithStubCall(node, callable, flags);
}
@@ -231,33 +192,20 @@ void JSGenericLowering::LowerJSStoreProperty(Node* node) {
Node* receiver = NodeProperties::GetValueInput(node, 0);
Node* key = NodeProperties::GetValueInput(node, 1);
Node* value = NodeProperties::GetValueInput(node, 2);
- Node* closure = NodeProperties::GetValueInput(node, 3);
- Node* effect = NodeProperties::GetEffectInput(node);
- Node* control = NodeProperties::GetControlInput(node);
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
PropertyAccess const& p = PropertyAccessOf(node->op());
LanguageMode language_mode = p.language_mode();
Callable callable =
CodeFactory::KeyedStoreICInOptimizedCode(isolate(), language_mode);
- // Load the type feedback vector from the closure.
- Node* literals = effect = graph()->NewNode(
- machine()->Load(MachineType::AnyTagged()), closure,
- jsgraph()->IntPtrConstant(JSFunction::kLiteralsOffset - kHeapObjectTag),
- effect, control);
- Node* vector = effect = graph()->NewNode(
- machine()->Load(MachineType::AnyTagged()), literals,
- jsgraph()->IntPtrConstant(LiteralsArray::kFeedbackVectorOffset -
- kHeapObjectTag),
- effect, control);
+ Node* vector = jsgraph()->HeapConstant(p.feedback().vector());
typedef StoreWithVectorDescriptor Descriptor;
- node->InsertInputs(zone(), 0, 1);
+ node->InsertInputs(zone(), 0, 2);
node->ReplaceInput(Descriptor::kReceiver, receiver);
node->ReplaceInput(Descriptor::kName, key);
node->ReplaceInput(Descriptor::kValue, value);
node->ReplaceInput(Descriptor::kSlot,
jsgraph()->SmiConstant(p.feedback().index()));
node->ReplaceInput(Descriptor::kVector, vector);
- node->ReplaceInput(7, effect);
ReplaceWithStubCall(node, callable, flags);
}
@@ -265,39 +213,25 @@ void JSGenericLowering::LowerJSStoreProperty(Node* node) {
void JSGenericLowering::LowerJSStoreNamed(Node* node) {
Node* receiver = NodeProperties::GetValueInput(node, 0);
Node* value = NodeProperties::GetValueInput(node, 1);
- Node* closure = NodeProperties::GetValueInput(node, 2);
- Node* effect = NodeProperties::GetEffectInput(node);
- Node* control = NodeProperties::GetControlInput(node);
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
NamedAccess const& p = NamedAccessOf(node->op());
Callable callable =
CodeFactory::StoreICInOptimizedCode(isolate(), p.language_mode());
- // Load the type feedback vector from the closure.
- Node* literals = effect = graph()->NewNode(
- machine()->Load(MachineType::AnyTagged()), closure,
- jsgraph()->IntPtrConstant(JSFunction::kLiteralsOffset - kHeapObjectTag),
- effect, control);
- Node* vector = effect = graph()->NewNode(
- machine()->Load(MachineType::AnyTagged()), literals,
- jsgraph()->IntPtrConstant(LiteralsArray::kFeedbackVectorOffset -
- kHeapObjectTag),
- effect, control);
+ Node* vector = jsgraph()->HeapConstant(p.feedback().vector());
typedef StoreWithVectorDescriptor Descriptor;
- node->InsertInputs(zone(), 0, 2);
+ node->InsertInputs(zone(), 0, 3);
node->ReplaceInput(Descriptor::kReceiver, receiver);
node->ReplaceInput(Descriptor::kName, jsgraph()->HeapConstant(p.name()));
node->ReplaceInput(Descriptor::kValue, value);
node->ReplaceInput(Descriptor::kSlot,
jsgraph()->SmiConstant(p.feedback().index()));
node->ReplaceInput(Descriptor::kVector, vector);
- node->ReplaceInput(7, effect);
ReplaceWithStubCall(node, callable, flags);
}
void JSGenericLowering::LowerJSStoreGlobal(Node* node) {
Node* value = NodeProperties::GetValueInput(node, 0);
- Node* closure = NodeProperties::GetValueInput(node, 1);
Node* context = NodeProperties::GetContextInput(node);
Node* effect = NodeProperties::GetEffectInput(node);
Node* control = NodeProperties::GetControlInput(node);
@@ -305,16 +239,7 @@ void JSGenericLowering::LowerJSStoreGlobal(Node* node) {
const StoreGlobalParameters& p = StoreGlobalParametersOf(node->op());
Callable callable =
CodeFactory::StoreICInOptimizedCode(isolate(), p.language_mode());
- // Load the type feedback vector from the closure.
- Node* literals = effect = graph()->NewNode(
- machine()->Load(MachineType::AnyTagged()), closure,
- jsgraph()->IntPtrConstant(JSFunction::kLiteralsOffset - kHeapObjectTag),
- effect, control);
- Node* vector = effect = graph()->NewNode(
- machine()->Load(MachineType::AnyTagged()), literals,
- jsgraph()->IntPtrConstant(LiteralsArray::kFeedbackVectorOffset -
- kHeapObjectTag),
- effect, control);
+ Node* vector = jsgraph()->HeapConstant(p.feedback().vector());
// Load global object from the context.
Node* native_context = effect =
graph()->NewNode(machine()->Load(MachineType::AnyTagged()), context,
@@ -326,7 +251,7 @@ void JSGenericLowering::LowerJSStoreGlobal(Node* node) {
jsgraph()->IntPtrConstant(Context::SlotOffset(Context::EXTENSION_INDEX)),
effect, control);
typedef StoreWithVectorDescriptor Descriptor;
- node->InsertInputs(zone(), 0, 3);
+ node->InsertInputs(zone(), 0, 4);
node->ReplaceInput(Descriptor::kReceiver, global);
node->ReplaceInput(Descriptor::kName, jsgraph()->HeapConstant(p.name()));
node->ReplaceInput(Descriptor::kValue, value);
« no previous file with comments | « src/compiler/bytecode-graph-builder.cc ('k') | src/compiler/js-operator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698