Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
deps: update ChakraCore to chakra-core/ChakraCore@eebca86f88
Browse files Browse the repository at this point in the history
[MERGE #5547 @meg-gupta] OS#15997192: Disable strict valuetype assert for hoistable syms

Merge pull request #5547 from meg-gupta:disableassert

The assert says that for a hoistable value, if its valuetype is primitive in the loop landing pad, it should be atleast LikelyPrimitive inside the loop.
This assert does not hold true in a few cases when we force specialize syms in the loop landing pad.
Ex :

  landingPad:
    a = v1;
    b = v1;
  loop :
    b = v2; // forces float conversion in landing pad
    c = a;
  jump loop

During force specializing in loop landing pad of b, both a and b have the same valueinfo, so they transition to a DefiniteFloat.
This takes b to definite float in the loop landing pad but not inside the loop.
We do not have a way to force Specialize a in the loop, we cannot assume force specializing b again in the loop will update the valueInfo of a,
because they may have different value numbers in the loop. Since we don't have a way to lookup values by valueNumber, there is no easy way to fix this gap currently.

Added test to keep track of this gap.

Reviewed-By: chakrabot <chakrabot@users.noreply.github.com>
  • Loading branch information
Meghana Gupta authored and kfarnung committed Aug 4, 2018
1 parent 5ca8f1c commit 4742c06
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
6 changes: 2 additions & 4 deletions deps/chakrashim/core/lib/Backend/GlobOpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14323,10 +14323,8 @@ GlobOpt::OptIsInvariant(Sym *sym, BasicBlock *block, Loop *loop, Value *srcVal,
return false;
}

// If the loopHeadVal is primitive, the current value should be as well. This really should be
// srcVal->GetValueInfo()->IsPrimitive() instead of IsLikelyPrimitive, but this stronger assertion
// doesn't hold in some cases when this method is called out of the array code.
Assert((!loopHeadVal->GetValueInfo()->IsPrimitive()) || srcVal->GetValueInfo()->IsLikelyPrimitive());
// Disabling this assert, because it does not hold true when we force specialize in the loop landing pad
//Assert((!loopHeadVal->GetValueInfo()->IsPrimitive()) || srcVal->GetValueInfo()->IsLikelyPrimitive());

return true;
}
Expand Down
6 changes: 6 additions & 0 deletions deps/chakrashim/core/test/Optimizer/rlexe.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1568,4 +1568,10 @@
<compile-flags>-maxinterpretcount:1 -maxsimplejitruncount:1 -off:aggressiveinttypespec</compile-flags>
</default>
</test>
<test>
<default>
<files>valuetypegap.js</files>
<compile-flags>-maxinterpretcount:1 -maxsimplejitruncount:1 -force:inline</compile-flags>
</default>
</test>
</regress-exe>
20 changes: 20 additions & 0 deletions deps/chakrashim/core/test/Optimizer/valuetypegap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------

function test0() {
function leaf() {
}
(function (argMath6, argMath7) {
do {
}
while (argMath6 * (argMath7 /= test0));
}(leaf, leaf));
}

test0();
test0();
test0();
test0();
print("Passed\n");

0 comments on commit 4742c06

Please sign in to comment.