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
...@@ -168,7 +168,7 @@ class BytecodeGraphBuilder { ...@@ -168,7 +168,7 @@ class BytecodeGraphBuilder {
void PrepareFrameState(Node* node, OutputFrameStateCombine combine); void PrepareFrameState(Node* node, OutputFrameStateCombine combine);
void BuildCreateArguments(CreateArgumentsType type); void BuildCreateArguments(CreateArgumentsType type);
Node* BuildLoadGlobal(Handle<Name> name, uint32_t feedback_slot_index, Node* BuildLoadGlobal(NameRef name, uint32_t feedback_slot_index,
TypeofMode typeof_mode); TypeofMode typeof_mode);
enum class StoreMode { enum class StoreMode {
...@@ -1340,8 +1340,9 @@ void BytecodeGraphBuilder::VisitLdaSmi() { ...@@ -1340,8 +1340,9 @@ void BytecodeGraphBuilder::VisitLdaSmi() {
} }
void BytecodeGraphBuilder::VisitLdaConstant() { void BytecodeGraphBuilder::VisitLdaConstant() {
Node* node = jsgraph()->Constant( ObjectRef object(
bytecode_iterator().GetConstantForIndexOperand(0, isolate())); broker(), bytecode_iterator().GetConstantForIndexOperand(0, isolate()));
Node* node = jsgraph()->Constant(object);
environment()->BindAccumulator(node); environment()->BindAccumulator(node);
} }
...@@ -1387,19 +1388,20 @@ void BytecodeGraphBuilder::VisitMov() { ...@@ -1387,19 +1388,20 @@ void BytecodeGraphBuilder::VisitMov() {
environment()->BindRegister(bytecode_iterator().GetRegisterOperand(1), value); environment()->BindRegister(bytecode_iterator().GetRegisterOperand(1), value);
} }
Node* BytecodeGraphBuilder::BuildLoadGlobal(Handle<Name> name, Node* BytecodeGraphBuilder::BuildLoadGlobal(NameRef name,
uint32_t feedback_slot_index, uint32_t feedback_slot_index,
TypeofMode typeof_mode) { TypeofMode typeof_mode) {
VectorSlotPair feedback = CreateVectorSlotPair(feedback_slot_index); VectorSlotPair feedback = CreateVectorSlotPair(feedback_slot_index);
DCHECK( DCHECK(
IsLoadGlobalICKind(feedback_vector().object()->GetKind(feedback.slot()))); IsLoadGlobalICKind(feedback_vector().object()->GetKind(feedback.slot())));
const Operator* op = javascript()->LoadGlobal(name, feedback, typeof_mode); const Operator* op =
javascript()->LoadGlobal(name.object(), feedback, typeof_mode);
return NewNode(op); return NewNode(op);
} }
void BytecodeGraphBuilder::VisitLdaGlobal() { void BytecodeGraphBuilder::VisitLdaGlobal() {
PrepareEagerCheckpoint(); PrepareEagerCheckpoint();
Handle<Name> name = Handle<Name>::cast( NameRef name(broker(),
bytecode_iterator().GetConstantForIndexOperand(0, isolate())); bytecode_iterator().GetConstantForIndexOperand(0, isolate()));
uint32_t feedback_slot_index = bytecode_iterator().GetIndexOperand(1); uint32_t feedback_slot_index = bytecode_iterator().GetIndexOperand(1);
Node* node = Node* node =
...@@ -1409,7 +1411,7 @@ void BytecodeGraphBuilder::VisitLdaGlobal() { ...@@ -1409,7 +1411,7 @@ void BytecodeGraphBuilder::VisitLdaGlobal() {
void BytecodeGraphBuilder::VisitLdaGlobalInsideTypeof() { void BytecodeGraphBuilder::VisitLdaGlobalInsideTypeof() {
PrepareEagerCheckpoint(); PrepareEagerCheckpoint();
Handle<Name> name = Handle<Name>::cast( NameRef name(broker(),
bytecode_iterator().GetConstantForIndexOperand(0, isolate())); bytecode_iterator().GetConstantForIndexOperand(0, isolate()));
uint32_t feedback_slot_index = bytecode_iterator().GetIndexOperand(1); uint32_t feedback_slot_index = bytecode_iterator().GetIndexOperand(1);
Node* node = Node* node =
...@@ -1419,7 +1421,7 @@ void BytecodeGraphBuilder::VisitLdaGlobalInsideTypeof() { ...@@ -1419,7 +1421,7 @@ void BytecodeGraphBuilder::VisitLdaGlobalInsideTypeof() {
void BytecodeGraphBuilder::VisitStaGlobal() { void BytecodeGraphBuilder::VisitStaGlobal() {
PrepareEagerCheckpoint(); PrepareEagerCheckpoint();
Handle<Name> name = Handle<Name>::cast( NameRef name(broker(),
bytecode_iterator().GetConstantForIndexOperand(0, isolate())); bytecode_iterator().GetConstantForIndexOperand(0, isolate()));
VectorSlotPair feedback = VectorSlotPair feedback =
CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(1)); CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(1));
...@@ -1427,7 +1429,8 @@ void BytecodeGraphBuilder::VisitStaGlobal() { ...@@ -1427,7 +1429,8 @@ void BytecodeGraphBuilder::VisitStaGlobal() {
LanguageMode language_mode = LanguageMode language_mode =
feedback.vector()->GetLanguageMode(feedback.slot()); feedback.vector()->GetLanguageMode(feedback.slot());
const Operator* op = javascript()->StoreGlobal(language_mode, name, feedback); const Operator* op =
javascript()->StoreGlobal(language_mode, name.object(), feedback);
Node* node = NewNode(op, value); Node* node = NewNode(op, value);
environment()->RecordAfterState(node, Environment::kAttachFrameState); environment()->RecordAfterState(node, Environment::kAttachFrameState);
} }
...@@ -1545,8 +1548,8 @@ void BytecodeGraphBuilder::VisitStaCurrentContextSlot() { ...@@ -1545,8 +1548,8 @@ void BytecodeGraphBuilder::VisitStaCurrentContextSlot() {
void BytecodeGraphBuilder::BuildLdaLookupSlot(TypeofMode typeof_mode) { void BytecodeGraphBuilder::BuildLdaLookupSlot(TypeofMode typeof_mode) {
PrepareEagerCheckpoint(); PrepareEagerCheckpoint();
Node* name = jsgraph()->Constant( Node* name = jsgraph()->Constant(ObjectRef(
bytecode_iterator().GetConstantForIndexOperand(0, isolate())); broker(), bytecode_iterator().GetConstantForIndexOperand(0, isolate())));
const Operator* op = const Operator* op =
javascript()->CallRuntime(typeof_mode == TypeofMode::NOT_INSIDE_TYPEOF javascript()->CallRuntime(typeof_mode == TypeofMode::NOT_INSIDE_TYPEOF
? Runtime::kLoadLookupSlot ? Runtime::kLoadLookupSlot
...@@ -1630,8 +1633,9 @@ void BytecodeGraphBuilder::BuildLdaLookupContextSlot(TypeofMode typeof_mode) { ...@@ -1630,8 +1633,9 @@ void BytecodeGraphBuilder::BuildLdaLookupContextSlot(TypeofMode typeof_mode) {
// Slow path, do a runtime load lookup. // Slow path, do a runtime load lookup.
set_environment(slow_environment); set_environment(slow_environment);
{ {
Node* name = jsgraph()->Constant( Node* name = jsgraph()->Constant(ObjectRef(
bytecode_iterator().GetConstantForIndexOperand(0, isolate())); broker(),
bytecode_iterator().GetConstantForIndexOperand(0, isolate())));
const Operator* op = const Operator* op =
javascript()->CallRuntime(typeof_mode == TypeofMode::NOT_INSIDE_TYPEOF javascript()->CallRuntime(typeof_mode == TypeofMode::NOT_INSIDE_TYPEOF
...@@ -1666,7 +1670,7 @@ void BytecodeGraphBuilder::BuildLdaLookupGlobalSlot(TypeofMode typeof_mode) { ...@@ -1666,7 +1670,7 @@ void BytecodeGraphBuilder::BuildLdaLookupGlobalSlot(TypeofMode typeof_mode) {
// Fast path, do a global load. // Fast path, do a global load.
{ {
PrepareEagerCheckpoint(); PrepareEagerCheckpoint();
Handle<Name> name = Handle<Name>::cast( NameRef name(broker(),
bytecode_iterator().GetConstantForIndexOperand(0, isolate())); bytecode_iterator().GetConstantForIndexOperand(0, isolate()));
uint32_t feedback_slot_index = bytecode_iterator().GetIndexOperand(1); uint32_t feedback_slot_index = bytecode_iterator().GetIndexOperand(1);
Node* node = BuildLoadGlobal(name, feedback_slot_index, typeof_mode); Node* node = BuildLoadGlobal(name, feedback_slot_index, typeof_mode);
...@@ -1682,8 +1686,9 @@ void BytecodeGraphBuilder::BuildLdaLookupGlobalSlot(TypeofMode typeof_mode) { ...@@ -1682,8 +1686,9 @@ void BytecodeGraphBuilder::BuildLdaLookupGlobalSlot(TypeofMode typeof_mode) {
// Slow path, do a runtime load lookup. // Slow path, do a runtime load lookup.
set_environment(slow_environment); set_environment(slow_environment);
{ {
Node* name = jsgraph()->Constant( Node* name = jsgraph()->Constant(NameRef(
bytecode_iterator().GetConstantForIndexOperand(0, isolate())); broker(),
bytecode_iterator().GetConstantForIndexOperand(0, isolate())));
const Operator* op = const Operator* op =
javascript()->CallRuntime(typeof_mode == TypeofMode::NOT_INSIDE_TYPEOF javascript()->CallRuntime(typeof_mode == TypeofMode::NOT_INSIDE_TYPEOF
...@@ -1712,8 +1717,8 @@ void BytecodeGraphBuilder::VisitLdaLookupGlobalSlotInsideTypeof() { ...@@ -1712,8 +1717,8 @@ void BytecodeGraphBuilder::VisitLdaLookupGlobalSlotInsideTypeof() {
void BytecodeGraphBuilder::VisitStaLookupSlot() { void BytecodeGraphBuilder::VisitStaLookupSlot() {
PrepareEagerCheckpoint(); PrepareEagerCheckpoint();
Node* value = environment()->LookupAccumulator(); Node* value = environment()->LookupAccumulator();
Node* name = jsgraph()->Constant( Node* name = jsgraph()->Constant(ObjectRef(
bytecode_iterator().GetConstantForIndexOperand(0, isolate())); broker(), bytecode_iterator().GetConstantForIndexOperand(0, isolate())));
int bytecode_flags = bytecode_iterator().GetFlagOperand(1); int bytecode_flags = bytecode_iterator().GetFlagOperand(1);
LanguageMode language_mode = static_cast<LanguageMode>( LanguageMode language_mode = static_cast<LanguageMode>(
interpreter::StoreLookupSlotFlags::LanguageModeBit::decode( interpreter::StoreLookupSlotFlags::LanguageModeBit::decode(
...@@ -1737,11 +1742,11 @@ void BytecodeGraphBuilder::VisitLdaNamedProperty() { ...@@ -1737,11 +1742,11 @@ void BytecodeGraphBuilder::VisitLdaNamedProperty() {
PrepareEagerCheckpoint(); PrepareEagerCheckpoint();
Node* object = Node* object =
environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0));
Handle<Name> name = Handle<Name>::cast( NameRef name(broker(),
bytecode_iterator().GetConstantForIndexOperand(1, isolate())); bytecode_iterator().GetConstantForIndexOperand(1, isolate()));
VectorSlotPair feedback = VectorSlotPair feedback =
CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(2)); CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(2));
const Operator* op = javascript()->LoadNamed(name, feedback); const Operator* op = javascript()->LoadNamed(name.object(), feedback);
JSTypeHintLowering::LoweringResult lowering = JSTypeHintLowering::LoweringResult lowering =
TryBuildSimplifiedLoadNamed(op, object, feedback.slot()); TryBuildSimplifiedLoadNamed(op, object, feedback.slot());
...@@ -1761,9 +1766,9 @@ void BytecodeGraphBuilder::VisitLdaNamedPropertyNoFeedback() { ...@@ -1761,9 +1766,9 @@ void BytecodeGraphBuilder::VisitLdaNamedPropertyNoFeedback() {
PrepareEagerCheckpoint(); PrepareEagerCheckpoint();
Node* object = Node* object =
environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0));
Handle<Name> name = Handle<Name>::cast( NameRef name(broker(),
bytecode_iterator().GetConstantForIndexOperand(1, isolate())); bytecode_iterator().GetConstantForIndexOperand(1, isolate()));
const Operator* op = javascript()->LoadNamed(name, VectorSlotPair()); const Operator* op = javascript()->LoadNamed(name.object(), VectorSlotPair());
Node* node = NewNode(op, object); Node* node = NewNode(op, object);
environment()->BindAccumulator(node, Environment::kAttachFrameState); environment()->BindAccumulator(node, Environment::kAttachFrameState);
} }
...@@ -1796,7 +1801,7 @@ void BytecodeGraphBuilder::BuildNamedStore(StoreMode store_mode) { ...@@ -1796,7 +1801,7 @@ void BytecodeGraphBuilder::BuildNamedStore(StoreMode store_mode) {
Node* value = environment()->LookupAccumulator(); Node* value = environment()->LookupAccumulator();
Node* object = Node* object =
environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0));
Handle<Name> name = Handle<Name>::cast( NameRef name(broker(),
bytecode_iterator().GetConstantForIndexOperand(1, isolate())); bytecode_iterator().GetConstantForIndexOperand(1, isolate()));
VectorSlotPair feedback = VectorSlotPair feedback =
CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(2)); CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(2));
...@@ -1805,12 +1810,12 @@ void BytecodeGraphBuilder::BuildNamedStore(StoreMode store_mode) { ...@@ -1805,12 +1810,12 @@ void BytecodeGraphBuilder::BuildNamedStore(StoreMode store_mode) {
if (store_mode == StoreMode::kOwn) { if (store_mode == StoreMode::kOwn) {
DCHECK_EQ(FeedbackSlotKind::kStoreOwnNamed, DCHECK_EQ(FeedbackSlotKind::kStoreOwnNamed,
feedback.vector()->GetKind(feedback.slot())); feedback.vector()->GetKind(feedback.slot()));
op = javascript()->StoreNamedOwn(name, feedback); op = javascript()->StoreNamedOwn(name.object(), feedback);
} else { } else {
DCHECK_EQ(StoreMode::kNormal, store_mode); DCHECK_EQ(StoreMode::kNormal, store_mode);
LanguageMode language_mode = LanguageMode language_mode =
feedback.vector()->GetLanguageMode(feedback.slot()); feedback.vector()->GetLanguageMode(feedback.slot());
op = javascript()->StoreNamed(language_mode, name, feedback); op = javascript()->StoreNamed(language_mode, name.object(), feedback);
} }
JSTypeHintLowering::LoweringResult lowering = JSTypeHintLowering::LoweringResult lowering =
...@@ -1836,12 +1841,12 @@ void BytecodeGraphBuilder::VisitStaNamedPropertyNoFeedback() { ...@@ -1836,12 +1841,12 @@ void BytecodeGraphBuilder::VisitStaNamedPropertyNoFeedback() {
Node* value = environment()->LookupAccumulator(); Node* value = environment()->LookupAccumulator();
Node* object = Node* object =
environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0));
Handle<Name> name = Handle<Name>::cast( NameRef name(broker(),
bytecode_iterator().GetConstantForIndexOperand(1, isolate())); bytecode_iterator().GetConstantForIndexOperand(1, isolate()));
LanguageMode language_mode = LanguageMode language_mode =
static_cast<LanguageMode>(bytecode_iterator().GetFlagOperand(2)); static_cast<LanguageMode>(bytecode_iterator().GetFlagOperand(2));
const Operator* op = const Operator* op =
javascript()->StoreNamed(language_mode, name, VectorSlotPair()); javascript()->StoreNamed(language_mode, name.object(), VectorSlotPair());
Node* node = NewNode(op, object, value); Node* node = NewNode(op, object, value);
environment()->RecordAfterState(node, Environment::kAttachFrameState); environment()->RecordAfterState(node, Environment::kAttachFrameState);
} }
...@@ -2572,8 +2577,8 @@ void BytecodeGraphBuilder::VisitThrowReferenceErrorIfHole() { ...@@ -2572,8 +2577,8 @@ void BytecodeGraphBuilder::VisitThrowReferenceErrorIfHole() {
Node* accumulator = environment()->LookupAccumulator(); Node* accumulator = environment()->LookupAccumulator();
Node* check_for_hole = NewNode(simplified()->ReferenceEqual(), accumulator, Node* check_for_hole = NewNode(simplified()->ReferenceEqual(), accumulator,
jsgraph()->TheHoleConstant()); jsgraph()->TheHoleConstant());
Node* name = jsgraph()->Constant( Node* name = jsgraph()->Constant(ObjectRef(
bytecode_iterator().GetConstantForIndexOperand(0, isolate())); broker(), bytecode_iterator().GetConstantForIndexOperand(0, isolate())));
BuildHoleCheckAndThrow(check_for_hole, BuildHoleCheckAndThrow(check_for_hole,
Runtime::kThrowAccessedUninitializedVariable, name); Runtime::kThrowAccessedUninitializedVariable, name);
} }
......
...@@ -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: {
if (!FLAG_concurrent_inlining) {
NamedAccess const& p = NamedAccessOf(node->op()); NamedAccess const& p = NamedAccessOf(node->op());
NameRef(broker(), p.name()); 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