Index: src/full-codegen/full-codegen.cc |
diff --git a/src/full-codegen/full-codegen.cc b/src/full-codegen/full-codegen.cc |
index df89250dea1ebd94dbea3a193aa3d8c651d7f1c7..11c8e02f7b58ec35726357e6369df94b5e06d565 100644 |
--- a/src/full-codegen/full-codegen.cc |
+++ b/src/full-codegen/full-codegen.cc |
@@ -485,8 +485,12 @@ void FullCodeGenerator::EmitGlobalVariableLoad(VariableProxy* proxy, |
DCHECK(var->IsUnallocated()); |
__ Move(LoadDescriptor::NameRegister(), var->name()); |
- EmitLoadSlot(LoadGlobalDescriptor::SlotRegister(), |
- proxy->VariableFeedbackSlot()); |
+ FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
+ // Ensure that typeof mode is in sync with the IC slot kind. |
+ DCHECK_EQ(GetTypeofModeFromICKind(feedback_vector_spec()->GetKind(slot)), |
+ typeof_mode); |
+ |
+ EmitLoadSlot(LoadGlobalDescriptor::SlotRegister(), slot); |
Handle<Code> code = CodeFactory::LoadGlobalIC(isolate(), typeof_mode).code(); |
__ Call(code, RelocInfo::CODE_TARGET); |
RestoreContext(); |