summaryrefslogtreecommitdiffstats
path: root/js/src/jit/BaselineCompiler.cpp
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-19 15:59:22 +0100
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-19 15:59:22 +0100
commite3f1d0d10638e46e3a22cf8363c03922200cb158 (patch)
tree4f62ebdc97e6083dd53b12a0f62510ed7e4fa913 /js/src/jit/BaselineCompiler.cpp
parentf67a2b88d7e8780f4ae81419338004b6fd781567 (diff)
downloadUXP-e3f1d0d10638e46e3a22cf8363c03922200cb158.tar
UXP-e3f1d0d10638e46e3a22cf8363c03922200cb158.tar.gz
UXP-e3f1d0d10638e46e3a22cf8363c03922200cb158.tar.lz
UXP-e3f1d0d10638e46e3a22cf8363c03922200cb158.tar.xz
UXP-e3f1d0d10638e46e3a22cf8363c03922200cb158.zip
Part 3: Support JSOP_SETFUNNAME in Baseline and Ion
Issue #87
Diffstat (limited to 'js/src/jit/BaselineCompiler.cpp')
-rw-r--r--js/src/jit/BaselineCompiler.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/js/src/jit/BaselineCompiler.cpp b/js/src/jit/BaselineCompiler.cpp
index c58367aa3..4dcc10b61 100644
--- a/js/src/jit/BaselineCompiler.cpp
+++ b/js/src/jit/BaselineCompiler.cpp
@@ -9,6 +9,8 @@
#include "mozilla/Casting.h"
#include "mozilla/SizePrintfMacros.h"
+#include "jsfun.h"
+
#include "jit/BaselineIC.h"
#include "jit/BaselineJIT.h"
#include "jit/FixedList.h"
@@ -1681,6 +1683,29 @@ BaselineCompiler::emit_JSOP_LAMBDA_ARROW()
return true;
}
+typedef bool (*SetFunNameFn)(JSContext*, HandleFunction, HandleValue, FunctionPrefixKind);
+static const VMFunction SetFunNameInfo =
+ FunctionInfo<SetFunNameFn>(js::SetFunctionNameIfNoOwnName, "SetFunName");
+
+bool
+BaselineCompiler::emit_JSOP_SETFUNNAME()
+{
+ frame.popRegsAndSync(2);
+
+ frame.push(R0);
+ frame.syncStack(0);
+
+ FunctionPrefixKind prefixKind = FunctionPrefixKind(GET_UINT8(pc));
+ masm.unboxObject(R0, R0.scratchReg());
+
+ prepareVMCall();
+
+ pushArg(Imm32(int32_t(prefixKind)));
+ pushArg(R1);
+ pushArg(R0.scratchReg());
+ return callVM(SetFunNameInfo);
+}
+
void
BaselineCompiler::storeValue(const StackValue* source, const Address& dest,
const ValueOperand& scratch)