2019-03-12 09:01:49 +01:00
|
|
|
// Copyright 2018 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.
|
|
|
|
|
2022-09-21 13:28:42 +02:00
|
|
|
// Flags: --allow-natives-syntax --noalways-turbofan
|
2019-03-12 09:01:49 +01:00
|
|
|
|
|
|
|
global = 1;
|
|
|
|
|
|
|
|
function boom(value) {
|
|
|
|
return global;
|
|
|
|
}
|
|
|
|
|
2019-03-15 18:35:06 +05:30
|
|
|
%PrepareFunctionForOptimization(boom);
|
2019-03-12 09:01:49 +01:00
|
|
|
assertEquals(1, boom());
|
|
|
|
assertEquals(1, boom());
|
2021-09-17 14:34:02 +02:00
|
|
|
%DisableOptimizationFinalization();
|
2019-03-12 09:01:49 +01:00
|
|
|
%OptimizeFunctionOnNextCall(boom, "concurrent");
|
|
|
|
assertEquals(1, boom());
|
|
|
|
|
2021-09-17 14:34:02 +02:00
|
|
|
%WaitForBackgroundOptimization();
|
2019-03-12 09:01:49 +01:00
|
|
|
delete this.global;
|
2021-09-17 14:34:02 +02:00
|
|
|
%FinalizeOptimization();
|
2019-03-12 09:01:49 +01:00
|
|
|
|
|
|
|
// boom should be deoptimized because the global property cell has changed.
|
2022-11-22 09:57:37 -05:00
|
|
|
assertUnoptimized(boom);
|
2019-03-12 09:01:49 +01:00
|
|
|
|
|
|
|
assertThrows(boom);
|