104921a8093ce8bbec34084bd742b7aa3d299be15ager@chromium.org// Copyright 2011 the V8 project authors. All rights reserved. 204921a8093ce8bbec34084bd742b7aa3d299be15ager@chromium.org// Redistribution and use in source and binary forms, with or without 304921a8093ce8bbec34084bd742b7aa3d299be15ager@chromium.org// modification, are permitted provided that the following conditions are 404921a8093ce8bbec34084bd742b7aa3d299be15ager@chromium.org// met: 504921a8093ce8bbec34084bd742b7aa3d299be15ager@chromium.org// 604921a8093ce8bbec34084bd742b7aa3d299be15ager@chromium.org// * Redistributions of source code must retain the above copyright 704921a8093ce8bbec34084bd742b7aa3d299be15ager@chromium.org// notice, this list of conditions and the following disclaimer. 804921a8093ce8bbec34084bd742b7aa3d299be15ager@chromium.org// * Redistributions in binary form must reproduce the above 904921a8093ce8bbec34084bd742b7aa3d299be15ager@chromium.org// copyright notice, this list of conditions and the following 1004921a8093ce8bbec34084bd742b7aa3d299be15ager@chromium.org// disclaimer in the documentation and/or other materials provided 1104921a8093ce8bbec34084bd742b7aa3d299be15ager@chromium.org// with the distribution. 1204921a8093ce8bbec34084bd742b7aa3d299be15ager@chromium.org// * Neither the name of Google Inc. nor the names of its 1304921a8093ce8bbec34084bd742b7aa3d299be15ager@chromium.org// contributors may be used to endorse or promote products derived 1404921a8093ce8bbec34084bd742b7aa3d299be15ager@chromium.org// from this software without specific prior written permission. 1504921a8093ce8bbec34084bd742b7aa3d299be15ager@chromium.org// 1604921a8093ce8bbec34084bd742b7aa3d299be15ager@chromium.org// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1704921a8093ce8bbec34084bd742b7aa3d299be15ager@chromium.org// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1804921a8093ce8bbec34084bd742b7aa3d299be15ager@chromium.org// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 1904921a8093ce8bbec34084bd742b7aa3d299be15ager@chromium.org// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 2004921a8093ce8bbec34084bd742b7aa3d299be15ager@chromium.org// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2104921a8093ce8bbec34084bd742b7aa3d299be15ager@chromium.org// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 2204921a8093ce8bbec34084bd742b7aa3d299be15ager@chromium.org// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2304921a8093ce8bbec34084bd742b7aa3d299be15ager@chromium.org// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2404921a8093ce8bbec34084bd742b7aa3d299be15ager@chromium.org// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2504921a8093ce8bbec34084bd742b7aa3d299be15ager@chromium.org// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 2604921a8093ce8bbec34084bd742b7aa3d299be15ager@chromium.org// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2704921a8093ce8bbec34084bd742b7aa3d299be15ager@chromium.org 2804921a8093ce8bbec34084bd742b7aa3d299be15ager@chromium.org// Check that arguments access ICs correctly handle non-JSObject 2904921a8093ce8bbec34084bd742b7aa3d299be15ager@chromium.org// receivers. 3004921a8093ce8bbec34084bd742b7aa3d299be15ager@chromium.orgfunction f(array) { return array[0]; } 3104921a8093ce8bbec34084bd742b7aa3d299be15ager@chromium.orgfunction args(a) { return arguments; } 3204921a8093ce8bbec34084bd742b7aa3d299be15ager@chromium.org// Put the keyed load in f into the keyed-load-arguments state. 3304921a8093ce8bbec34084bd742b7aa3d299be15ager@chromium.orgfor (var i = 0; i < 10; i++) { 3404921a8093ce8bbec34084bd742b7aa3d299be15ager@chromium.org f(args(1)); 3504921a8093ce8bbec34084bd742b7aa3d299be15ager@chromium.org} 3604921a8093ce8bbec34084bd742b7aa3d299be15ager@chromium.orgf('123'); 37