Index: src/interpreter/bytecode-array-builder.cc |
diff --git a/src/interpreter/bytecode-array-builder.cc b/src/interpreter/bytecode-array-builder.cc |
index 6f506446ec6bd4fbe9f4f7280098bc22d7bdb7f6..c0ff19ac77f2c413ed245ef796db19eb6811fe75 100644 |
--- a/src/interpreter/bytecode-array-builder.cc |
+++ b/src/interpreter/bytecode-array-builder.cc |
@@ -477,12 +477,20 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::StoreGlobal( |
return *this; |
} |
-BytecodeArrayBuilder& BytecodeArrayBuilder::LoadContextSlot(Register context, |
- int slot_index, |
- int depth) { |
+BytecodeArrayBuilder& BytecodeArrayBuilder::LoadContextSlot( |
+ Register context, int slot_index, int depth, |
+ ContextSlotMutability mutability) { |
if (context.is_current_context() && depth == 0) { |
- OutputLdaCurrentContextSlot(slot_index); |
+ if (mutability == kImmutableSlot) { |
+ OutputLdaImmutableCurrentContextSlot(slot_index); |
+ } else { |
+ DCHECK_EQ(kMutableSlot, mutability); |
+ OutputLdaCurrentContextSlot(slot_index); |
+ } |
+ } else if (mutability == kImmutableSlot) { |
+ OutputLdaImmutableContextSlot(context, slot_index, depth); |
} else { |
+ DCHECK_EQ(mutability, kMutableSlot); |
OutputLdaContextSlot(context, slot_index, depth); |
} |
return *this; |