Bug 1522068 - Baseline-compile JSOP_SETINTRINSIC. r=evilpie
authorJan de Mooij <jdemooij@mozilla.com>
Fri, 25 Jan 2019 10:59:37 +0000
changeset 515424 4694d772971d6dce45e4c47dde6b25c770b11d59
parent 515423 84b052018ef87384a065ac9d92aa6e070fbc626b
child 515425 1fd047e0fbb371be6fc04ca4e3f377af09dbc2f3
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersevilpie
bugs1522068
milestone66.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 1522068 - Baseline-compile JSOP_SETINTRINSIC. r=evilpie Differential Revision: https://phabricator.services.mozilla.com/D17497
js/src/jit/BaselineCompiler.cpp
js/src/jit/BaselineCompiler.h
--- a/js/src/jit/BaselineCompiler.cpp
+++ b/js/src/jit/BaselineCompiler.cpp
@@ -3167,16 +3167,34 @@ bool BaselineCodeGen<Handler>::emit_JSOP
   if (!emitNextIC()) {
     return false;
   }
 
   frame.push(R0);
   return true;
 }
 
+typedef bool (*SetIntrinsicFn)(JSContext*, JSScript*, jsbytecode*, HandleValue);
+static const VMFunction SetIntrinsicInfo = FunctionInfo<SetIntrinsicFn>(
+    SetIntrinsicOperation, "SetIntrinsicOperation");
+
+template <typename Handler>
+bool BaselineCodeGen<Handler>::emit_JSOP_SETINTRINSIC() {
+  frame.syncStack(0);
+  masm.loadValue(frame.addressOfStackValue(-1), R0);
+
+  prepareVMCall();
+
+  pushArg(R0);
+  pushBytecodePCArg();
+  pushScriptArg();
+
+  return callVM(SetIntrinsicInfo);
+}
+
 typedef bool (*DefVarFn)(JSContext*, HandleObject, HandleScript, jsbytecode*);
 static const VMFunction DefVarInfo =
     FunctionInfo<DefVarFn>(DefVarOperation, "DefVarOperation");
 
 template <typename Handler>
 bool BaselineCodeGen<Handler>::emit_JSOP_DEFVAR() {
   frame.syncStack(0);
 
@@ -5770,24 +5788,22 @@ MethodStatus BaselineCompiler::emitBody(
     if (MOZ_UNLIKELY(compileDebugInstrumentation()) && !emitDebugTrap()) {
       return Method_Error;
     }
 
     switch (op) {
       // ===== NOT Yet Implemented =====
       case JSOP_FORCEINTERPRETER:
         // Intentionally not implemented.
-      case JSOP_SETINTRINSIC:
-        // Run-once opcode during self-hosting initialization.
       case JSOP_UNUSED71:
       case JSOP_UNUSED151:
       case JSOP_LIMIT:
         // === !! WARNING WARNING WARNING !! ===
-        // Do you really want to sacrifice performance by not implementing
-        // this operation in the BaselineCompiler?
+        // DO NOT add new ops to this list! All bytecode ops MUST have Baseline
+        // support. Follow-up bugs are not acceptable.
         JitSpew(JitSpew_BaselineAbort, "Unhandled op: %s", CodeName[op]);
         return Method_CantCompile;
 
 #define EMIT_OP(OP)                                            \
   case OP:                                                     \
     if (MOZ_UNLIKELY(!this->emit_##OP())) return Method_Error; \
     break;
         OPCODE_LIST(EMIT_OP)
--- a/js/src/jit/BaselineCompiler.h
+++ b/js/src/jit/BaselineCompiler.h
@@ -134,16 +134,17 @@ namespace jit {
   _(JSOP_GETBOUNDNAME)          \
   _(JSOP_GETALIASEDVAR)         \
   _(JSOP_SETALIASEDVAR)         \
   _(JSOP_GETNAME)               \
   _(JSOP_BINDNAME)              \
   _(JSOP_DELNAME)               \
   _(JSOP_GETIMPORT)             \
   _(JSOP_GETINTRINSIC)          \
+  _(JSOP_SETINTRINSIC)          \
   _(JSOP_BINDVAR)               \
   _(JSOP_DEFVAR)                \
   _(JSOP_DEFCONST)              \
   _(JSOP_DEFLET)                \
   _(JSOP_DEFFUN)                \
   _(JSOP_GETLOCAL)              \
   _(JSOP_SETLOCAL)              \
   _(JSOP_GETARG)                \