Index: src/interpreter/bytecode-array-builder.cc |
diff --git a/src/interpreter/bytecode-array-builder.cc b/src/interpreter/bytecode-array-builder.cc |
index d105ea6a15451000b4387e0e6c48c5241a0351f7..f7efb103063c921ab10dd8bbea7296065ef63452 100644 |
--- a/src/interpreter/bytecode-array-builder.cc |
+++ b/src/interpreter/bytecode-array-builder.cc |
@@ -444,9 +444,18 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::StoreKeyedProperty( |
BytecodeArrayBuilder& BytecodeArrayBuilder::CreateClosure( |
- PretenureFlag tenured) { |
+ Handle<SharedFunctionInfo> shared_info, PretenureFlag tenured) { |
+ size_t entry = GetConstantPoolEntry(shared_info); |
DCHECK(FitsInImm8Operand(tenured)); |
- Output(Bytecode::kCreateClosure, static_cast<uint8_t>(tenured)); |
+ if (FitsInIdx8Operand(entry)) { |
+ Output(Bytecode::kCreateClosure, static_cast<uint8_t>(entry), |
+ static_cast<uint8_t>(tenured)); |
+ } else if (FitsInIdx16Operand(entry)) { |
+ Output(Bytecode::kCreateClosureWide, static_cast<uint16_t>(entry), |
+ static_cast<uint8_t>(tenured)); |
+ } else { |
+ UNIMPLEMENTED(); |
+ } |
return *this; |
} |