| Index: src/interpreter/bytecode-array-builder.cc
|
| diff --git a/src/interpreter/bytecode-array-builder.cc b/src/interpreter/bytecode-array-builder.cc
|
| index 78b5e1e76927762f6309150af6886b866669bf1b..75f0afcdac51d7e307ad4573789d3ddaf43768f2 100644
|
| --- a/src/interpreter/bytecode-array-builder.cc
|
| +++ b/src/interpreter/bytecode-array-builder.cc
|
| @@ -223,6 +223,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 (FitsInIdxOperand(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 (FitsInIdxOperand(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) {
|
| if (!is_sloppy(language_mode)) {
|
| @@ -535,7 +564,9 @@ bool BytecodeArrayBuilder::OperandIsValid(Bytecode bytecode, int operand_index,
|
| return static_cast<uint8_t>(operand_value) == operand_value;
|
| case OperandType::kReg: {
|
| 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 {
|
|
|