2014-02-25 09:55:02 +00:00
|
|
|
// 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
|
|
|
|
|
2019-06-12 14:00:50 +00:00
|
|
|
a = {
|
|
|
|
y: 1.5
|
|
|
|
};
|
2014-02-25 09:55:02 +00:00
|
|
|
a.y = 0;
|
|
|
|
b = a.y;
|
2019-06-12 14:00:50 +00:00
|
|
|
c = {
|
|
|
|
y: {}
|
|
|
|
};
|
2014-02-25 09:55:02 +00:00
|
|
|
|
|
|
|
function f() {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
function g() {
|
|
|
|
var e = {y: b};
|
2019-06-12 14:00:50 +00:00
|
|
|
var d = {x: f()};
|
|
|
|
var d = {x: f()};
|
2014-02-25 09:55:02 +00:00
|
|
|
return [e, d];
|
2019-06-12 14:00:50 +00:00
|
|
|
};
|
|
|
|
%PrepareFunctionForOptimization(g);
|
2014-02-25 09:55:02 +00:00
|
|
|
g();
|
|
|
|
g();
|
|
|
|
%OptimizeFunctionOnNextCall(g);
|
|
|
|
assertEquals(1, g()[1].x);
|