Bug 1541404 part 9 - Implement JSOP_DOUBLE in BaselineInterpreterCodeGen. r=tcampbell
authorJan de Mooij <jdemooij@mozilla.com>
Thu, 11 Apr 2019 13:22:08 +0000
changeset 469257 647b1f56c40383a0ed4e168a5218fdde6ee45382
parent 469256 b1b702b25f5387d419eea9d6c0351d478090d5d0
child 469258 e4b6aa9c2fc4281c677a9f1eb35eb70500cbc64e
push id112776
push usershindli@mozilla.com
push dateFri, 12 Apr 2019 16:20:17 +0000
treeherdermozilla-inbound@b4501ced5619 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstcampbell
bugs1541404
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1541404 part 9 - Implement JSOP_DOUBLE in BaselineInterpreterCodeGen. r=tcampbell Differential Revision: https://phabricator.services.mozilla.com/D27034
js/src/jit/BaselineCompiler.cpp
--- a/js/src/jit/BaselineCompiler.cpp
+++ b/js/src/jit/BaselineCompiler.cpp
@@ -403,16 +403,24 @@ static void LoadInt32OperandSignExtendTo
 
 static void LoadUint24Operand(MacroAssembler& masm, Register pc, size_t offset,
                               Register dest) {
   // Load the opcode and operand, then left shift to discard the opcode.
   masm.load32(Address(pc, offset), dest);
   masm.rshift32(Imm32(8), dest);
 }
 
+static void LoadInlineValueOperand(MacroAssembler& masm, Register pc,
+                                   ValueOperand dest) {
+  // Note: the Value might be unaligned but as above we rely on all our
+  // platforms having appropriate support for unaligned accesses (except for
+  // floating point instructions on ARM).
+  masm.loadValue(Address(pc, sizeof(jsbytecode)), dest);
+}
+
 template <>
 void BaselineCompilerCodeGen::loadScript(Register dest) {
   masm.movePtr(ImmGCPtr(handler.script()), dest);
 }
 
 template <>
 void BaselineInterpreterCodeGen::loadScript(Register dest) {
   masm.loadPtr(frame.addressOfInterpreterScript(), dest);
@@ -2166,17 +2174,19 @@ bool BaselineCodeGen<Handler>::emit_JSOP
 template <>
 bool BaselineCompilerCodeGen::emit_JSOP_DOUBLE() {
   frame.push(GET_INLINE_VALUE(handler.pc()));
   return true;
 }
 
 template <>
 bool BaselineInterpreterCodeGen::emit_JSOP_DOUBLE() {
-  MOZ_CRASH("NYI: interpreter JSOP_DOUBLE");
+  LoadInlineValueOperand(masm, PCRegAtStart, R0);
+  frame.push(R0);
+  return true;
 }
 
 template <>
 bool BaselineCompilerCodeGen::emit_JSOP_BIGINT() {
   frame.push(handler.script()->getConst(GET_UINT32_INDEX(handler.pc())));
   return true;
 }