summaryrefslogtreecommitdiff
path: root/deps/v8/test/mjsunit/regress/regress-crbug-345715.js
blob: 8f974473f26a2328fd90ecd2a5b09a5c00f71581 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// 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

a = {
  y: 1.5
};
a.y = 0;
b = a.y;
c = {
  y: {}
};

function f() {
  return 1;
}

function g() {
  var e = {y: b};
  var d = {x: f()};
  var d = {x: f()};
  return [e, d];
};
%PrepareFunctionForOptimization(g);
g();
g();
%OptimizeFunctionOnNextCall(g);
assertEquals(1, g()[1].x);