14acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org// Copyright 2011 the V8 project authors. All rights reserved. 24acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org// Redistribution and use in source and binary forms, with or without 34acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org// modification, are permitted provided that the following conditions are 44acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org// met: 54acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org// 64acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org// * Redistributions of source code must retain the above copyright 74acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org// notice, this list of conditions and the following disclaimer. 84acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org// * Redistributions in binary form must reproduce the above 94acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org// copyright notice, this list of conditions and the following 104acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org// disclaimer in the documentation and/or other materials provided 114acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org// with the distribution. 124acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org// * Neither the name of Google Inc. nor the names of its 134acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org// contributors may be used to endorse or promote products derived 144acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org// from this software without specific prior written permission. 154acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org// 164acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 174acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 184acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 194acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 204acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 214acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 224acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 234acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 244acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 254acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 264acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 274acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org 284acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org// Flags: --allow-natives-syntax 294acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org 304acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.orgvar f = { 314acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org apply: function(a, b) {} 324acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org}; 334acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org 344acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.orgfunction test(a) { 354acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org f.apply(this, arguments); 364acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org} 374acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org 384acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org// Initialize ICs. 394acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.orgtest(1); 404acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.orgtest(1); 414acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org 424acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org%OptimizeFunctionOnNextCall(test); 434acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org 444acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.org// Kaboom! 454acdc2c8d4caecf7606db8af710366c1d6e28fe5whesse@chromium.orgtest(1); 46