[mjsunit] Fix elements-kind test to not call %NeverOptimizeFunction

test/mjsunit/elements-kind.js calls %NeverOptimizeFunction followed by
%OptimizeFunctionOnNextCall later. If NeverOptimize marker is set, the
funciton would not be optimized even when requested through
%OptimizeFunctionOnNextCall

Change-Id: I37307fee7afd083953699026a82bbf12c85581ac
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1533865
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60503}
This commit is contained in:
Mythri A 2019-03-27 15:37:54 +00:00 committed by Commit Bot
parent 800616151e
commit 71bf27628f

View File

@ -25,7 +25,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --allow-natives-syntax --expose-gc --nostress-opt --typed-array-max-size-in-heap=2048
// Flags: --allow-natives-syntax --expose-gc --nostress-opt
var elements_kind = {
fast_smi_only : 'fast smi only elements',
@ -202,7 +202,6 @@ function construct_objects() {
// Test crankshafted transition SMI->DOUBLE.
%EnsureFeedbackVectorForFunction(convert_to_double);
%NeverOptimizeFunction(convert_to_double);
function convert_to_double(array) {
array[1] = 2.5;
assertKind(elements_kind.fast_double, array);
@ -215,7 +214,6 @@ smis = construct_smis();
convert_to_double(smis);
// Test crankshafted transitions SMI->FAST and DOUBLE->FAST.
%EnsureFeedbackVectorForFunction(convert_to_fast);
%NeverOptimizeFunction(convert_to_fast);
function convert_to_fast(array) {
array[1] = "two";
assertKind(elements_kind.fast, array);
@ -233,7 +231,6 @@ convert_to_fast(doubles);
// Test transition chain SMI->DOUBLE->FAST (crankshafted function will
// transition to FAST directly).
%EnsureFeedbackVectorForFunction(convert_mixed);
%NeverOptimizeFunction(convert_mixed);
function convert_mixed(array, value, kind) {
array[1] = value;
assertKind(kind, array);