Bug 1331092 - Part 8: Support JSOP_TOASYNCITER in JIT.

Tag #1287
This commit is contained in:
Gaming4JC 2019-12-14 09:22:32 -05:00 committed by Roy Tam
commit 06b3cb6ccd
12 changed files with 92 additions and 0 deletions

View file

@ -3937,6 +3937,28 @@ BaselineCompiler::emit_JSOP_TOASYNCGEN()
return true;
}
typedef JSObject* (*ToAsyncIterFn)(JSContext*, HandleObject);
static const VMFunction ToAsyncIterInfo =
FunctionInfo<ToAsyncIterFn>(js::CreateAsyncFromSyncIterator, "ToAsyncIter");
bool
BaselineCompiler::emit_JSOP_TOASYNCITER()
{
frame.syncStack(0);
masm.unboxObject(frame.addressOfStackValue(frame.peek(-1)), R0.scratchReg());
prepareVMCall();
pushArg(R0.scratchReg());
if (!callVM(ToAsyncIterInfo))
return false;
masm.tagValue(JSVAL_TYPE_OBJECT, ReturnReg, R0);
frame.pop();
frame.push(R0);
return true;
}
typedef bool (*ThrowObjectCoercibleFn)(JSContext*, HandleValue);
static const VMFunction ThrowObjectCoercibleInfo =
FunctionInfo<ThrowObjectCoercibleFn>(ThrowObjectCoercible, "ThrowObjectCoercible");