d2d99e084a
Reason for revert:
Mac gc stress failures:
https://build.chromium.org/p/client.v8/builders/V8%20Mac%20GC%20Stress/builds/11195
There's also this flake, but maybe unrelated:
https://build.chromium.org/p/client.v8/builders/V8%20Win64/builds/15422
Original issue's description:
> [tests] Make assertOptimized()/assertUnoptimized() great again.
>
> The mentioned asserts did not work properly with interpreted and turbofanned functions.
>
> To fix this issue %GetOptimizationStatus() now returns a set of flags instead of a single value.
>
> This CL also adds more helper functions to mjsunit, like isNeverOptimize(), isAlwaysOptimize(),
> isOptimized(fun), etc.
>
> BUG=v8:5890
>
> Review-Url: https://codereview.chromium.org/2654733004
> Cr-Commit-Position: refs/heads/master@{#42703}
> Committed: d1ddec7857
TBR=mstarzinger@chromium.org,ishell@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:5890
Review-Url: https://codereview.chromium.org/2655223003
Cr-Commit-Position: refs/heads/master@{#42704}
43 lines
1.2 KiB
JavaScript
43 lines
1.2 KiB
JavaScript
// Copyright 2014 the V8 project authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
// Flags: --allow-natives-syntax
|
|
|
|
var v = 0;
|
|
|
|
// Test that elements setters/getters on prototype chain set after the fact are
|
|
// property detected and don't lead to overzealous optimization.
|
|
var my_array_proto = {};
|
|
my_array_proto.__proto__ = [].__proto__;
|
|
|
|
function push_wrapper_2(array, value) {
|
|
array.push(value);
|
|
}
|
|
array = [];
|
|
array.__proto__ = my_array_proto;
|
|
push_wrapper_2(array, 66);
|
|
assertEquals(1, array.length);
|
|
assertEquals(0, v);
|
|
assertEquals(66, array[0]);
|
|
push_wrapper_2(array, 77);
|
|
assertEquals(2, array.length);
|
|
assertEquals(0, v);
|
|
assertEquals(77, array[1]);
|
|
%OptimizeFunctionOnNextCall(push_wrapper_2);
|
|
push_wrapper_2(array, 88);
|
|
assertEquals(3, array.length);
|
|
assertEquals(0, v);
|
|
assertEquals(88, array[2]);
|
|
assertOptimized(push_wrapper_2);
|
|
// Defining accessor should deopt optimized push.
|
|
Object.defineProperty(my_array_proto, "3", {
|
|
get: function() { return "get " + v; },
|
|
set: function(value) { v += value; }
|
|
});
|
|
assertUnoptimized(push_wrapper_2);
|
|
push_wrapper_2(array, 99);
|
|
assertEquals(4, array.length);
|
|
assertEquals(99, v);
|
|
assertEquals("get 99", array[3]);
|