2016-11-10 10:36:40 +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.
|
|
|
|
|
|
|
|
// Flags: --allow-natives-syntax
|
|
|
|
|
|
|
|
var v = 0;
|
|
|
|
function foo(a) {
|
|
|
|
v = a;
|
|
|
|
}
|
2016-11-10 16:00:43 +00:00
|
|
|
this.x = 0;
|
|
|
|
delete x;
|
2016-11-10 10:36:40 +00:00
|
|
|
|
2019-06-17 16:13:52 +00:00
|
|
|
%PrepareFunctionForOptimization(foo);
|
2016-11-16 12:02:06 +00:00
|
|
|
foo();
|
|
|
|
foo();
|
2016-11-10 10:36:40 +00:00
|
|
|
%OptimizeFunctionOnNextCall(foo);
|
2016-11-16 12:02:06 +00:00
|
|
|
foo();
|
|
|
|
assertEquals(undefined, v);
|
2016-11-10 10:36:40 +00:00
|
|
|
|
|
|
|
Object.freeze(this);
|
|
|
|
|
2019-06-17 16:13:52 +00:00
|
|
|
%PrepareFunctionForOptimization(foo);
|
2016-11-10 10:36:40 +00:00
|
|
|
foo(4);
|
|
|
|
foo(5);
|
|
|
|
%OptimizeFunctionOnNextCall(foo);
|
|
|
|
foo(6);
|
2016-11-16 12:02:06 +00:00
|
|
|
assertEquals(undefined, v);
|