Index: src/interpreter/bytecode-array-builder.cc |
diff --git a/src/interpreter/bytecode-array-builder.cc b/src/interpreter/bytecode-array-builder.cc |
index cf8918abb93d757bc279b420bb4baef093a1213c..1ce19f901f4ed46c0474f538e9c3e5debf9ad330 100644 |
--- a/src/interpreter/bytecode-array-builder.cc |
+++ b/src/interpreter/bytecode-array-builder.cc |
@@ -241,6 +241,35 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::LoadGlobal(int slot_index) { |
return *this; |
} |
+ |
+BytecodeArrayBuilder& BytecodeArrayBuilder::StoreGlobal( |
+ int slot_index, LanguageMode language_mode) { |
+ if (!is_sloppy(language_mode)) { |
+ UNIMPLEMENTED(); |
+ } |
+ DCHECK(slot_index >= 0); |
+ if (FitsInIdx8Operand(slot_index)) { |
+ Output(Bytecode::kStaGlobal, static_cast<uint8_t>(slot_index)); |
+ } else { |
+ UNIMPLEMENTED(); |
+ } |
+ return *this; |
+} |
+ |
+ |
+BytecodeArrayBuilder& BytecodeArrayBuilder::LoadContextSlot(Register context, |
+ int slot_index) { |
+ DCHECK(slot_index >= 0); |
+ if (FitsInIdx8Operand(slot_index)) { |
+ Output(Bytecode::kLdaContextSlot, context.ToOperand(), |
+ static_cast<uint8_t>(slot_index)); |
+ } else { |
+ UNIMPLEMENTED(); |
+ } |
+ return *this; |
+} |
+ |
+ |
BytecodeArrayBuilder& BytecodeArrayBuilder::LoadNamedProperty( |
Register object, int feedback_slot, LanguageMode language_mode) { |
Bytecode bytecode = BytecodeForLoadIC(language_mode); |
@@ -542,7 +571,9 @@ bool BytecodeArrayBuilder::OperandIsValid(Bytecode bytecode, int operand_index, |
return static_cast<uint8_t>(operand_value) == operand_value; |
case OperandType::kReg8: { |
Register reg = Register::FromOperand(static_cast<uint8_t>(operand_value)); |
- if (reg.is_parameter()) { |
+ if (reg.is_function_context()) { |
+ return true; |
+ } else if (reg.is_parameter()) { |
int parameter_index = reg.ToParameterIndex(parameter_count_); |
return parameter_index >= 0 && parameter_index < parameter_count_; |
} else { |