зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1314055 - Part 2: Support JSOP_TOASYNC in Baseline. r=jandem
This commit is contained in:
Родитель
679dffd17a
Коммит
5e0d25b1c2
|
@ -22,6 +22,7 @@
|
|||
#include "jit/SharedICHelpers.h"
|
||||
#include "jit/VMFunctions.h"
|
||||
#include "js/UniquePtr.h"
|
||||
#include "vm/AsyncFunction.h"
|
||||
#include "vm/EnvironmentObject.h"
|
||||
#include "vm/Interpreter.h"
|
||||
#include "vm/TraceLogging.h"
|
||||
|
@ -3807,6 +3808,27 @@ BaselineCompiler::emit_JSOP_TOID()
|
|||
return true;
|
||||
}
|
||||
|
||||
typedef JSObject* (*ToAsyncFn)(JSContext*, HandleFunction);
|
||||
static const VMFunction ToAsyncInfo = FunctionInfo<ToAsyncFn>(js::WrapAsyncFunction, "ToAsync");
|
||||
|
||||
bool
|
||||
BaselineCompiler::emit_JSOP_TOASYNC()
|
||||
{
|
||||
frame.syncStack(0);
|
||||
masm.unboxObject(frame.addressOfStackValue(frame.peek(-1)), R0.scratchReg());
|
||||
|
||||
prepareVMCall();
|
||||
pushArg(R0.scratchReg());
|
||||
|
||||
if (!callVM(ToAsyncInfo))
|
||||
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");
|
||||
|
|
|
@ -193,6 +193,7 @@ namespace jit {
|
|||
_(JSOP_ARGUMENTS) \
|
||||
_(JSOP_RUNONCE) \
|
||||
_(JSOP_REST) \
|
||||
_(JSOP_TOASYNC) \
|
||||
_(JSOP_TOID) \
|
||||
_(JSOP_TOSTRING) \
|
||||
_(JSOP_TABLESWITCH) \
|
||||
|
|
Загрузка…
Ссылка в новой задаче