Index: src/compiler/bytecode-graph-builder.cc |
diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc |
index 3de472f322fbdaa2552cd309879f79309e744882..52a532e74822f36b8cf0bd0cccef0bdabe58057f 100644 |
--- a/src/compiler/bytecode-graph-builder.cc |
+++ b/src/compiler/bytecode-graph-builder.cc |
@@ -626,10 +626,13 @@ void BytecodeGraphBuilder::VisitMov() { |
} |
Node* BytecodeGraphBuilder::BuildLoadGlobal(TypeofMode typeof_mode) { |
- Handle<Name> name = |
- Handle<Name>::cast(bytecode_iterator().GetConstantForIndexOperand(0)); |
VectorSlotPair feedback = |
- CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(1)); |
+ CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(0)); |
+ Handle<TypeFeedbackMetadata> metadata( |
+ frame_state_function_info()->shared_info()->feedback_metadata()); |
+ DCHECK_EQ(FeedbackVectorSlotKind::LOAD_GLOBAL_IC, |
+ metadata->GetKind(feedback.slot())); |
+ Handle<Name> name(metadata->GetName(feedback.slot())); |
const Operator* op = javascript()->LoadGlobal(name, feedback, typeof_mode); |
return NewNode(op, GetFunctionClosure()); |
} |
@@ -643,7 +646,7 @@ void BytecodeGraphBuilder::VisitLdaGlobal() { |
void BytecodeGraphBuilder::VisitLdrGlobal() { |
FrameStateBeforeAndAfter states(this); |
Node* node = BuildLoadGlobal(TypeofMode::NOT_INSIDE_TYPEOF); |
- environment()->BindRegister(bytecode_iterator().GetRegisterOperand(2), node, |
+ environment()->BindRegister(bytecode_iterator().GetRegisterOperand(1), node, |
&states); |
} |