172204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org// Copyright 2012 the V8 project authors. All rights reserved.
272204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org// Redistribution and use in source and binary forms, with or without
372204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org// modification, are permitted provided that the following conditions are
472204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org// met:
572204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org//
672204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org//     * Redistributions of source code must retain the above copyright
772204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org//       notice, this list of conditions and the following disclaimer.
872204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org//     * Redistributions in binary form must reproduce the above
972204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org//       copyright notice, this list of conditions and the following
1072204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org//       disclaimer in the documentation and/or other materials provided
1172204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org//       with the distribution.
1272204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org//     * Neither the name of Google Inc. nor the names of its
1372204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org//       contributors may be used to endorse or promote products derived
1472204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org//       from this software without specific prior written permission.
1572204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org//
1672204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1772204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1872204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1972204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2072204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2172204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2272204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2372204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2472204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2572204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2672204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2772204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org
2872204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org// Flags: --nocrankshaft
2972204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org
3072204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org(function(){
3172204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org  var f = function(arg) {
3272204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org    arg = 2;
3372204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org    return arguments[0];
3472204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org  };
3572204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org  for (var i = 0; i < 50000; i++) {
3672204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org    assertSame(2, f(1));
3772204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org  }
3872204d59e7fb1b8a0e9012e1fac5ef160351e8e4danno@chromium.org})();
39