2016-12-02 15:07:02 +00:00
|
|
|
// Copyright 2016 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.
|
|
|
|
|
2017-04-28 13:33:43 +00:00
|
|
|
// Flags: --allow-natives-syntax --opt
|
2016-12-02 15:07:02 +00:00
|
|
|
|
|
|
|
function load(o) { return o.x; }
|
|
|
|
|
|
|
|
for (var x = 0; x < 1000; ++x) {
|
|
|
|
load({x});
|
|
|
|
load({x});
|
2017-01-27 10:13:53 +00:00
|
|
|
%OptimizeFunctionOnNextCall(load);
|
2016-12-02 15:07:02 +00:00
|
|
|
try { load(); } catch (e) { }
|
|
|
|
}
|
|
|
|
|
|
|
|
assertOptimized(load);
|
|
|
|
|
|
|
|
|
|
|
|
function store(o) { o.x = -1; }
|
|
|
|
|
|
|
|
for (var x = 0; x < 1000; ++x) {
|
|
|
|
store({x});
|
|
|
|
store({x});
|
2017-01-27 10:13:53 +00:00
|
|
|
%OptimizeFunctionOnNextCall(store);
|
2016-12-02 15:07:02 +00:00
|
|
|
try { store(); } catch (e) { }
|
|
|
|
}
|
|
|
|
|
|
|
|
assertOptimized(store);
|