diff options
author | Gaming4JC <g4jc@hyperbola.info> | 2019-12-14 09:13:04 -0500 |
---|---|---|
committer | Gaming4JC <g4jc@hyperbola.info> | 2019-12-17 06:25:27 -0500 |
commit | bbd1fef7840d97801307f9ace021b52d94c5f61f (patch) | |
tree | 129d13b0e9b84264e1ceb2e4bf1e8d096abfc0e0 /js/src/jit/BaselineCompiler.cpp | |
parent | 8e2f6a75990b2eb0df4c5e5af46162b8b1013a04 (diff) | |
download | UXP-bbd1fef7840d97801307f9ace021b52d94c5f61f.tar UXP-bbd1fef7840d97801307f9ace021b52d94c5f61f.tar.gz UXP-bbd1fef7840d97801307f9ace021b52d94c5f61f.tar.lz UXP-bbd1fef7840d97801307f9ace021b52d94c5f61f.tar.xz UXP-bbd1fef7840d97801307f9ace021b52d94c5f61f.zip |
Bug 1331092 - Part 6: Support JSOP_TOASYNCGEN in JIT.
Tag #1287
Diffstat (limited to 'js/src/jit/BaselineCompiler.cpp')
-rw-r--r-- | js/src/jit/BaselineCompiler.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/js/src/jit/BaselineCompiler.cpp b/js/src/jit/BaselineCompiler.cpp index 52c3eccef..4f4ca8b89 100644 --- a/js/src/jit/BaselineCompiler.cpp +++ b/js/src/jit/BaselineCompiler.cpp @@ -25,6 +25,7 @@ #include "jit/VMFunctions.h" #include "js/UniquePtr.h" #include "vm/AsyncFunction.h" +#include "vm/AsyncIteration.h" #include "vm/EnvironmentObject.h" #include "vm/Interpreter.h" #include "vm/TraceLogging.h" @@ -3908,6 +3909,28 @@ BaselineCompiler::emit_JSOP_TOASYNC() return true; } +typedef JSObject* (*ToAsyncGenFn)(JSContext*, HandleFunction); +static const VMFunction ToAsyncGenInfo = + FunctionInfo<ToAsyncGenFn>(js::WrapAsyncGenerator, "ToAsyncGen"); + +bool +BaselineCompiler::emit_JSOP_TOASYNCGEN() +{ + frame.syncStack(0); + masm.unboxObject(frame.addressOfStackValue(frame.peek(-1)), R0.scratchReg()); + + prepareVMCall(); + pushArg(R0.scratchReg()); + + if (!callVM(ToAsyncGenInfo)) + 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"); |