Index: test/mjsunit/compiler/to-fast-properties.js |
diff --git a/test/mjsunit/regress/regress-331444.js b/test/mjsunit/compiler/to-fast-properties.js |
similarity index 80% |
copy from test/mjsunit/regress/regress-331444.js |
copy to test/mjsunit/compiler/to-fast-properties.js |
index c78d6fb71b7c455abfcd1450d80b5c8a6dcb6e38..26829d95e9bcb94049b3b464ec47c33ca529255e 100644 |
--- a/test/mjsunit/regress/regress-331444.js |
+++ b/test/mjsunit/compiler/to-fast-properties.js |
@@ -25,20 +25,19 @@ |
// (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: --expose-gc |
+// This test requires OSR or --stress-runs=3 to optimize the top level script. |
-function boom() { |
- var args = []; |
- for (var i = 0; i < 125000; i++) |
- args.push(i); |
- return Array.apply(Array, args); |
-} |
-var array = boom(); |
-function fib(n) { |
- var f0 = 0, f1 = 1; |
- for (; n > 0; n = n - 1) { |
- f0 + f1; |
- f0 = array; |
+for (var i = 0; i < 3; i++) { |
+ // HToFastProperties is used for top-level object literals that have |
+ // function property. |
+ var obj = { |
+ index: function() { return i; }, |
+ x: 0 |
+ } |
+ var n = 10000; |
+ // Loop to hit OSR. |
+ for (var j = 0; j < n; j++) { |
+ obj.x += i; |
} |
+ assertEquals(obj.index() * n, obj.x); |
} |
-fib(12); |