// Copyright 2020 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 --turboprop --dynamic-map-checks --opt// Flags: --no-always-optfunctionload(obj){returnobj.x;}varo={x:10,y:20};varo1={x:10,y:20,z:30};%PrepareFunctionForOptimization(load);// polymorphic with same handlerload(o);load(o1);%OptimizeFunctionOnNextCall(load);load(o);load(o1);assertOptimized(load);varo2={y:10,x:20};// deopts but stays optimizedload(o2);assertOptimized(load);// deopts and discard code on wrong handlerload(o2);assertUnoptimized(load);