Index: src/interpreter/bytecode-array-builder.cc |
diff --git a/src/interpreter/bytecode-array-builder.cc b/src/interpreter/bytecode-array-builder.cc |
index 9fb47ac8f89af5b5973e0e8e3d2669f16d840ceb..6f506446ec6bd4fbe9f4f7280098bc22d7bdb7f6 100644 |
--- a/src/interpreter/bytecode-array-builder.cc |
+++ b/src/interpreter/bytecode-array-builder.cc |
@@ -448,6 +448,14 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::MoveRegister(Register from, |
BytecodeArrayBuilder& BytecodeArrayBuilder::LoadGlobal( |
const Handle<String> name, int feedback_slot, TypeofMode typeof_mode) { |
size_t name_index = GetConstantPoolEntry(name); |
+ // Ensure that typeof mode is in sync with the IC slot kind if the function |
+ // literal is available (not a unit test case). |
+ // TODO(ishell): check only in debug mode. |
+ if (literal_) { |
+ FeedbackVectorSlot slot = TypeFeedbackVector::ToSlot(feedback_slot); |
+ CHECK_EQ(GetTypeofModeFromICKind(feedback_vector_spec()->GetKind(slot)), |
+ typeof_mode); |
+ } |
if (typeof_mode == INSIDE_TYPEOF) { |
OutputLdaGlobalInsideTypeof(name_index, feedback_slot); |
} else { |