Commit 79786f4c authored by Mike Stanton's avatar Mike Stanton Committed by Commit Bot

[TurboFan] Eliminating heap reads from the graph builder

This CL eliminates managed heap reads from the ByteCodeGraphBuilder
from constants. These reads and serializations are made at serialization
time.

Bug: v8:7790
Change-Id: I5c59ea1f097d11f48994f41ac296cfc64121db25
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1746477
Commit-Queue: Michael Stanton <mvstanton@chromium.org>
Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63169}
parent 8070f963
This diff is collapsed.
...@@ -103,8 +103,10 @@ Reduction JSHeapCopyReducer::Reduce(Node* node) { ...@@ -103,8 +103,10 @@ Reduction JSHeapCopyReducer::Reduce(Node* node) {
} }
case IrOpcode::kJSLoadNamed: case IrOpcode::kJSLoadNamed:
case IrOpcode::kJSStoreNamed: { case IrOpcode::kJSStoreNamed: {
NamedAccess const& p = NamedAccessOf(node->op()); if (!FLAG_concurrent_inlining) {
NameRef(broker(), p.name()); NamedAccess const& p = NamedAccessOf(node->op());
NameRef(broker(), p.name());
}
break; break;
} }
case IrOpcode::kStoreField: case IrOpcode::kStoreField:
......
...@@ -70,8 +70,6 @@ namespace compiler { ...@@ -70,8 +70,6 @@ namespace compiler {
V(ForInNext) \ V(ForInNext) \
V(ForInStep) \ V(ForInStep) \
V(Inc) \ V(Inc) \
V(LdaLookupSlot) \
V(LdaLookupSlotInsideTypeof) \
V(LogicalNot) \ V(LogicalNot) \
V(Mod) \ V(Mod) \
V(ModSmi) \ V(ModSmi) \
...@@ -85,7 +83,6 @@ namespace compiler { ...@@ -85,7 +83,6 @@ namespace compiler {
V(ShiftRightLogical) \ V(ShiftRightLogical) \
V(ShiftRightLogicalSmi) \ V(ShiftRightLogicalSmi) \
V(ShiftRightSmi) \ V(ShiftRightSmi) \
V(StaLookupSlot) \
V(Sub) \ V(Sub) \
V(SubSmi) \ V(SubSmi) \
V(TestEqual) \ V(TestEqual) \
...@@ -134,10 +131,7 @@ namespace compiler { ...@@ -134,10 +131,7 @@ namespace compiler {
#define IGNORED_BYTECODE_LIST(V) \ #define IGNORED_BYTECODE_LIST(V) \
V(CallNoFeedback) \ V(CallNoFeedback) \
V(IncBlockCounter) \ V(IncBlockCounter) \
V(LdaNamedPropertyNoFeedback) \
V(StackCheck) \ V(StackCheck) \
V(StaNamedPropertyNoFeedback) \
V(ThrowReferenceErrorIfHole) \
V(ThrowSuperAlreadyCalledIfNotHole) \ V(ThrowSuperAlreadyCalledIfNotHole) \
V(ThrowSuperNotCalledIfHole) V(ThrowSuperNotCalledIfHole)
...@@ -184,7 +178,10 @@ namespace compiler { ...@@ -184,7 +178,10 @@ namespace compiler {
V(LdaLookupContextSlotInsideTypeof) \ V(LdaLookupContextSlotInsideTypeof) \
V(LdaLookupGlobalSlot) \ V(LdaLookupGlobalSlot) \
V(LdaLookupGlobalSlotInsideTypeof) \ V(LdaLookupGlobalSlotInsideTypeof) \
V(LdaLookupSlot) \
V(LdaLookupSlotInsideTypeof) \
V(LdaNamedProperty) \ V(LdaNamedProperty) \
V(LdaNamedPropertyNoFeedback) \
V(LdaNull) \ V(LdaNull) \
V(Ldar) \ V(Ldar) \
V(LdaSmi) \ V(LdaSmi) \
...@@ -201,14 +198,17 @@ namespace compiler { ...@@ -201,14 +198,17 @@ namespace compiler {
V(StaGlobal) \ V(StaGlobal) \
V(StaInArrayLiteral) \ V(StaInArrayLiteral) \
V(StaKeyedProperty) \ V(StaKeyedProperty) \
V(StaLookupSlot) \
V(StaModuleVariable) \ V(StaModuleVariable) \
V(StaNamedOwnProperty) \ V(StaNamedOwnProperty) \
V(StaNamedProperty) \ V(StaNamedProperty) \
V(StaNamedPropertyNoFeedback) \
V(Star) \ V(Star) \
V(SwitchOnGeneratorState) \ V(SwitchOnGeneratorState) \
V(SwitchOnSmiNoFeedback) \ V(SwitchOnSmiNoFeedback) \
V(TestIn) \ V(TestIn) \
V(TestInstanceOf) \ V(TestInstanceOf) \
V(ThrowReferenceErrorIfHole) \
CLEAR_ACCUMULATOR_LIST(V) \ CLEAR_ACCUMULATOR_LIST(V) \
CLEAR_ENVIRONMENT_LIST(V) \ CLEAR_ENVIRONMENT_LIST(V) \
CONDITIONAL_JUMPS_LIST(V) \ CONDITIONAL_JUMPS_LIST(V) \
...@@ -1106,9 +1106,10 @@ void SerializerForBackgroundCompilation::VisitInvokeIntrinsic( ...@@ -1106,9 +1106,10 @@ void SerializerForBackgroundCompilation::VisitInvokeIntrinsic(
void SerializerForBackgroundCompilation::VisitLdaConstant( void SerializerForBackgroundCompilation::VisitLdaConstant(
BytecodeArrayIterator* iterator) { BytecodeArrayIterator* iterator) {
ObjectRef object(
broker(), iterator->GetConstantForIndexOperand(0, broker()->isolate()));
environment()->accumulator_hints().Clear(); environment()->accumulator_hints().Clear();
environment()->accumulator_hints().AddConstant( environment()->accumulator_hints().AddConstant(object.object());
iterator->GetConstantForIndexOperand(0, broker()->isolate()));
} }
void SerializerForBackgroundCompilation::VisitPushContext( void SerializerForBackgroundCompilation::VisitPushContext(
...@@ -1235,6 +1236,13 @@ void SerializerForBackgroundCompilation::VisitStaModuleVariable( ...@@ -1235,6 +1236,13 @@ void SerializerForBackgroundCompilation::VisitStaModuleVariable(
Context::EXTENSION_INDEX, depth, kSerializeSlot); Context::EXTENSION_INDEX, depth, kSerializeSlot);
} }
void SerializerForBackgroundCompilation::VisitStaLookupSlot(
BytecodeArrayIterator* iterator) {
ObjectRef(broker(),
iterator->GetConstantForIndexOperand(0, broker()->isolate()));
environment()->accumulator_hints().Clear();
}
void SerializerForBackgroundCompilation::VisitStaContextSlot( void SerializerForBackgroundCompilation::VisitStaContextSlot(
BytecodeArrayIterator* iterator) { BytecodeArrayIterator* iterator) {
const int slot = iterator->GetIndexOperand(1); const int slot = iterator->GetIndexOperand(1);
...@@ -2046,7 +2054,8 @@ SerializerForBackgroundCompilation::ProcessFeedbackForGlobalAccess( ...@@ -2046,7 +2054,8 @@ SerializerForBackgroundCompilation::ProcessFeedbackForGlobalAccess(
void SerializerForBackgroundCompilation::VisitLdaGlobal( void SerializerForBackgroundCompilation::VisitLdaGlobal(
BytecodeArrayIterator* iterator) { BytecodeArrayIterator* iterator) {
FeedbackSlot slot = iterator->GetSlotOperand(1); FeedbackSlot slot = iterator->GetSlotOperand(1);
NameRef(broker(),
iterator->GetConstantForIndexOperand(0, broker()->isolate()));
environment()->accumulator_hints().Clear(); environment()->accumulator_hints().Clear();
GlobalAccessFeedback const* feedback = ProcessFeedbackForGlobalAccess(slot); GlobalAccessFeedback const* feedback = ProcessFeedbackForGlobalAccess(slot);
if (feedback != nullptr) { if (feedback != nullptr) {
...@@ -2063,6 +2072,20 @@ void SerializerForBackgroundCompilation::VisitLdaGlobalInsideTypeof( ...@@ -2063,6 +2072,20 @@ void SerializerForBackgroundCompilation::VisitLdaGlobalInsideTypeof(
VisitLdaGlobal(iterator); VisitLdaGlobal(iterator);
} }
void SerializerForBackgroundCompilation::VisitLdaLookupSlot(
BytecodeArrayIterator* iterator) {
ObjectRef(broker(),
iterator->GetConstantForIndexOperand(0, broker()->isolate()));
environment()->accumulator_hints().Clear();
}
void SerializerForBackgroundCompilation::VisitLdaLookupSlotInsideTypeof(
BytecodeArrayIterator* iterator) {
ObjectRef(broker(),
iterator->GetConstantForIndexOperand(0, broker()->isolate()));
environment()->accumulator_hints().Clear();
}
void SerializerForBackgroundCompilation::ProcessCheckContextExtensions( void SerializerForBackgroundCompilation::ProcessCheckContextExtensions(
int depth) { int depth) {
// for BytecodeGraphBuilder::CheckContextExtensions. // for BytecodeGraphBuilder::CheckContextExtensions.
...@@ -2092,6 +2115,8 @@ void SerializerForBackgroundCompilation::VisitLdaLookupGlobalSlotInsideTypeof( ...@@ -2092,6 +2115,8 @@ void SerializerForBackgroundCompilation::VisitLdaLookupGlobalSlotInsideTypeof(
void SerializerForBackgroundCompilation::VisitStaGlobal( void SerializerForBackgroundCompilation::VisitStaGlobal(
BytecodeArrayIterator* iterator) { BytecodeArrayIterator* iterator) {
NameRef(broker(),
iterator->GetConstantForIndexOperand(0, broker()->isolate()));
FeedbackSlot slot = iterator->GetSlotOperand(1); FeedbackSlot slot = iterator->GetSlotOperand(1);
ProcessFeedbackForGlobalAccess(slot); ProcessFeedbackForGlobalAccess(slot);
} }
...@@ -2100,6 +2125,8 @@ void SerializerForBackgroundCompilation::ProcessLdaLookupContextSlot( ...@@ -2100,6 +2125,8 @@ void SerializerForBackgroundCompilation::ProcessLdaLookupContextSlot(
BytecodeArrayIterator* iterator) { BytecodeArrayIterator* iterator) {
const int slot_index = iterator->GetIndexOperand(1); const int slot_index = iterator->GetIndexOperand(1);
const int depth = iterator->GetUnsignedImmediateOperand(2); const int depth = iterator->GetUnsignedImmediateOperand(2);
NameRef(broker(),
iterator->GetConstantForIndexOperand(0, broker()->isolate()));
ProcessCheckContextExtensions(depth); ProcessCheckContextExtensions(depth);
Hints& context_hints = environment()->current_context_hints(); Hints& context_hints = environment()->current_context_hints();
environment()->accumulator_hints().Clear(); environment()->accumulator_hints().Clear();
...@@ -2397,10 +2424,10 @@ void SerializerForBackgroundCompilation::ProcessNamedPropertyAccess( ...@@ -2397,10 +2424,10 @@ void SerializerForBackgroundCompilation::ProcessNamedPropertyAccess(
BytecodeArrayIterator* iterator, AccessMode mode) { BytecodeArrayIterator* iterator, AccessMode mode) {
Hints const& receiver = Hints const& receiver =
environment()->register_hints(iterator->GetRegisterOperand(0)); environment()->register_hints(iterator->GetRegisterOperand(0));
Handle<Name> name = Handle<Name>::cast( NameRef name(broker(),
iterator->GetConstantForIndexOperand(1, broker()->isolate())); iterator->GetConstantForIndexOperand(1, broker()->isolate()));
FeedbackSlot slot = iterator->GetSlotOperand(2); FeedbackSlot slot = iterator->GetSlotOperand(2);
ProcessNamedPropertyAccess(receiver, NameRef(broker(), name), slot, mode); ProcessNamedPropertyAccess(receiver, name, slot, mode);
} }
void SerializerForBackgroundCompilation::VisitLdaNamedProperty( void SerializerForBackgroundCompilation::VisitLdaNamedProperty(
...@@ -2408,11 +2435,23 @@ void SerializerForBackgroundCompilation::VisitLdaNamedProperty( ...@@ -2408,11 +2435,23 @@ void SerializerForBackgroundCompilation::VisitLdaNamedProperty(
ProcessNamedPropertyAccess(iterator, AccessMode::kLoad); ProcessNamedPropertyAccess(iterator, AccessMode::kLoad);
} }
void SerializerForBackgroundCompilation::VisitLdaNamedPropertyNoFeedback(
BytecodeArrayIterator* iterator) {
NameRef(broker(),
iterator->GetConstantForIndexOperand(1, broker()->isolate()));
}
void SerializerForBackgroundCompilation::VisitStaNamedProperty( void SerializerForBackgroundCompilation::VisitStaNamedProperty(
BytecodeArrayIterator* iterator) { BytecodeArrayIterator* iterator) {
ProcessNamedPropertyAccess(iterator, AccessMode::kStore); ProcessNamedPropertyAccess(iterator, AccessMode::kStore);
} }
void SerializerForBackgroundCompilation::VisitStaNamedPropertyNoFeedback(
BytecodeArrayIterator* iterator) {
NameRef(broker(),
iterator->GetConstantForIndexOperand(1, broker()->isolate()));
}
void SerializerForBackgroundCompilation::VisitStaNamedOwnProperty( void SerializerForBackgroundCompilation::VisitStaNamedOwnProperty(
BytecodeArrayIterator* iterator) { BytecodeArrayIterator* iterator) {
ProcessNamedPropertyAccess(iterator, AccessMode::kStoreInLiteral); ProcessNamedPropertyAccess(iterator, AccessMode::kStoreInLiteral);
...@@ -2507,6 +2546,12 @@ void SerializerForBackgroundCompilation::VisitTestInstanceOf( ...@@ -2507,6 +2546,12 @@ void SerializerForBackgroundCompilation::VisitTestInstanceOf(
if (walk_prototypes) ProcessHintsForHasInPrototypeChain(lhs); if (walk_prototypes) ProcessHintsForHasInPrototypeChain(lhs);
} }
void SerializerForBackgroundCompilation::VisitThrowReferenceErrorIfHole(
BytecodeArrayIterator* iterator) {
ObjectRef(broker(),
iterator->GetConstantForIndexOperand(0, broker()->isolate()));
}
void SerializerForBackgroundCompilation::VisitStaKeyedProperty( void SerializerForBackgroundCompilation::VisitStaKeyedProperty(
BytecodeArrayIterator* iterator) { BytecodeArrayIterator* iterator) {
Hints const& receiver = Hints const& receiver =
......
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