diff --git a/js/src/vm/Interpreter.cpp b/js/src/vm/Interpreter.cpp index 623aac1b1b5..af26f8929bb 100644 --- a/js/src/vm/Interpreter.cpp +++ b/js/src/vm/Interpreter.cpp @@ -1650,7 +1650,6 @@ CASE(EnableInterruptsPseudoOpcode) /* Various 1-byte no-ops. */ CASE(JSOP_NOP) CASE(JSOP_UNUSED2) -CASE(JSOP_UNUSED52) CASE(JSOP_UNUSED83) CASE(JSOP_UNUSED92) CASE(JSOP_UNUSED103) @@ -3559,6 +3558,24 @@ CASE(JSOP_CLASSHERITAGE) } END_CASE(JSOP_CLASSHERITAGE) +CASE(JSOP_FUNWITHPROTO) +{ + RootedObject &proto = rootObject1; + proto = ®S.sp[-1].toObject(); + + /* Load the specified function object literal. */ + RootedFunction &fun = rootFunction0; + fun = script->getFunction(GET_UINT32_INDEX(REGS.pc)); + + JSObject *obj = CloneFunctionObjectIfNotSingleton(cx, fun, REGS.fp()->scopeChain(), + proto, GenericObject); + if (!obj) + goto error; + + REGS.sp[-1].setObject(*obj); +} +END_CASE(JSOP_FUNWITHPROTO) + DEFAULT() { char numBuf[12]; diff --git a/js/src/vm/Opcodes.h b/js/src/vm/Opcodes.h index 80168ac22c1..0d112064e10 100644 --- a/js/src/vm/Opcodes.h +++ b/js/src/vm/Opcodes.h @@ -489,7 +489,14 @@ * Stack: heritage => objProto, funcProto */ \ macro(JSOP_CLASSHERITAGE, 51, "classheritage", NULL, 1, 1, 2, JOF_BYTE) \ - macro(JSOP_UNUSED52, 52, "unused52", NULL, 1, 0, 0, JOF_BYTE) \ + /* + * Pushes a clone of a function with a given [[Prototype]] onto the stack. + * Category: Statements + * Type: Function + * Operands: uint32_t funcIndex + * Stack: proto => obj + */ \ + macro(JSOP_FUNWITHPROTO, 52, "funwithproto", NULL, 5, 1, 1, JOF_OBJECT) \ \ /* * Pops the top of stack value, pushes property of it onto the stack. diff --git a/js/src/vm/Xdr.h b/js/src/vm/Xdr.h index 1ca43c63da1..879c899f5ff 100644 --- a/js/src/vm/Xdr.h +++ b/js/src/vm/Xdr.h @@ -29,7 +29,7 @@ namespace js { * * https://developer.mozilla.org/en-US/docs/SpiderMonkey/Internals/Bytecode */ -static const uint32_t XDR_BYTECODE_VERSION_SUBTRAHEND = 253; +static const uint32_t XDR_BYTECODE_VERSION_SUBTRAHEND = 254; static const uint32_t XDR_BYTECODE_VERSION = uint32_t(0xb973c0de - XDR_BYTECODE_VERSION_SUBTRAHEND);