17028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.org// Copyright 2012 the V8 project authors. All rights reserved.
27028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.org// Redistribution and use in source and binary forms, with or without
37028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.org// modification, are permitted provided that the following conditions are
47028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.org// met:
57028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.org//
67028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.org//     * Redistributions of source code must retain the above copyright
77028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.org//       notice, this list of conditions and the following disclaimer.
87028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.org//     * Redistributions in binary form must reproduce the above
97028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.org//       copyright notice, this list of conditions and the following
107028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.org//       disclaimer in the documentation and/or other materials provided
117028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.org//       with the distribution.
127028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.org//     * Neither the name of Google Inc. nor the names of its
137028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.org//       contributors may be used to endorse or promote products derived
147028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.org//       from this software without specific prior written permission.
157028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.org//
167028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.org// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
177028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.org// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
187028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.org// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
197028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.org// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
207028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.org// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
217028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.org// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
227028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.org// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
237028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.org// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
247028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.org// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
257028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.org// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
267028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.org// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
277028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.org
287028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.orgfunction poly(x) {
297028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.org  return x.foo;
307028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.org}
317028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.org
327028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.orgvar one = {foo: 0};
337028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.orgvar two = {foo: 0, bar: 1};
347028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.orgvar three = {bar: 0};
357028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.orgthree.__proto__ = {};
367028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.orgthree.__proto__.__proto__ = {};
377028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.orgthree.__proto__.__proto__.__proto__ = {};
387028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.orgthree.__proto__.__proto__.__proto__.__proto__ = {};
397028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.orgthree.__proto__.__proto__.__proto__.__proto__.__proto__ = {};
407028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.org
417028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.orgfor (var i = 0; i < 1e6; i++) {
427028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.org  poly(one);
437028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.org  poly(two);
447028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.org  poly(three);
457028c05c1c71b9d5c5fe1bca01f2461d17a2dda7mmassi@chromium.org}
46