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