diff options
author | Gaming4JC <g4jc@hyperbola.info> | 2019-12-14 09:22:32 -0500 |
---|---|---|
committer | Gaming4JC <g4jc@hyperbola.info> | 2019-12-17 06:25:28 -0500 |
commit | 580dfb2afbef15764b56714f3eb690a67f0af9c1 (patch) | |
tree | 7f60e914b45f30a9e4e585b884cd5ca2d5827055 /js/src/jit/BaselineCompiler.cpp | |
parent | ef44324d916b89b95fa0ea77a3d91eafb4359bf8 (diff) | |
download | UXP-580dfb2afbef15764b56714f3eb690a67f0af9c1.tar UXP-580dfb2afbef15764b56714f3eb690a67f0af9c1.tar.gz UXP-580dfb2afbef15764b56714f3eb690a67f0af9c1.tar.lz UXP-580dfb2afbef15764b56714f3eb690a67f0af9c1.tar.xz UXP-580dfb2afbef15764b56714f3eb690a67f0af9c1.zip |
Bug 1331092 - Part 8: Support JSOP_TOASYNCITER in JIT.
Tag #1287
Diffstat (limited to 'js/src/jit/BaselineCompiler.cpp')
-rw-r--r-- | js/src/jit/BaselineCompiler.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/js/src/jit/BaselineCompiler.cpp b/js/src/jit/BaselineCompiler.cpp index 4f4ca8b89..d254b9826 100644 --- a/js/src/jit/BaselineCompiler.cpp +++ b/js/src/jit/BaselineCompiler.cpp @@ -3931,6 +3931,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"); |