Bug 1519795: Adjust CallInfo::newTarget to allow inlining polymorphic construct-calls of native functions. r=jandem
authorAndré Bargull <andre.bargull@gmail.com>
Mon, 14 Jan 2019 01:52:12 -0800
changeset 511109 1d0d0fed3608b845bde92823eb157cd8ce611d21
parent 511108 704b7807054c98b4024270cabadc5dee3124b918
child 511110 6362baa5cb54a12724396665790d982c84516c90
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1519795
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 1519795: Adjust CallInfo::newTarget to allow inlining polymorphic construct-calls of native functions. r=jandem
js/src/jit/IonBuilder.cpp
--- a/js/src/jit/IonBuilder.cpp
+++ b/js/src/jit/IonBuilder.cpp
@@ -4791,16 +4791,20 @@ AbortReasonOr<Ok> IonBuilder::inlineCall
     CallInfo inlineInfo(alloc(), pc, callInfo.constructing(),
                         callInfo.ignoresReturnValue());
     if (!inlineInfo.init(callInfo)) {
       return abort(AbortReason::Alloc);
     }
     inlineInfo.popCallStack(inlineBlock);
     inlineInfo.setFun(funcDef);
 
+    if (callInfo.constructing() && callInfo.getNewTarget() == callInfo.fun()) {
+      inlineInfo.setNewTarget(funcDef);
+    }
+
     if (maybeCache) {
       // Assign the 'this' value a TypeSet specialized to the groups that
       // can generate this inlining target.
       MOZ_ASSERT(callInfo.thisArg() == maybeCache->value());
       TemporaryTypeSet* thisTypes =
           maybeCache->propTable()->buildTypeSetForFunction(alloc(), target);
       if (!thisTypes) {
         return abort(AbortReason::Alloc);