OLD | NEW |
(Empty) | |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 3 // |
| 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions |
| 6 // are met: |
| 7 // 1. Redistributions of source code must retain the above copyright |
| 8 // notice, this list of conditions and the following disclaimer. |
| 9 // 2. Redistributions in binary form must reproduce the above copyright |
| 10 // notice, this list of conditions and the following disclaimer in the |
| 11 // documentation and/or other materials provided with the distribution. |
| 12 // |
| 13 // THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND AN
Y |
| 14 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 15 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 16 // DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR AN
Y |
| 17 // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 18 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 19 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND O
N |
| 20 // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 21 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 22 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 23 |
| 24 description( |
| 25 "Tests that if you alias the arguments in a very small function, arguments simpl
ification still works even if you OSR exit." |
| 26 ); |
| 27 |
| 28 function foo() { |
| 29 var args = arguments; |
| 30 return args[0] + args[1] + args[2]; |
| 31 } |
| 32 |
| 33 var result = ""; |
| 34 for (var i = 0; i < 300; ++i) { |
| 35 var a; |
| 36 if (i < 200) |
| 37 a = i; |
| 38 else |
| 39 a = "hello"; |
| 40 var b = i + 1; |
| 41 var c = i + 3; |
| 42 result += foo(a, b, c); |
| 43 } |
| 44 |
| 45 shouldBe("result", "\"4710131619222528313437404346495255586164677073767982858891
94971001031061091121151181211241271301331361391421451481511541571601631661691721
75178181184187190193196199202205208211214217220223226229232235238241244247250253
25625926226526827127427728028328628929229529830130430731031331631932232532833133
43373403433463493523553583613643673703733763793823853883913943974004034064094124
15418421424427430433436439442445448451454457460463466469472475478481484487490493
49649950250550851151451752052352652953253553854154454755055355655956256556857157
4577580583586589592595598601hello201203hello202204hello203205hello204206hello205
207hello206208hello207209hello208210hello209211hello210212hello211213hello212214
hello213215hello214216hello215217hello216218hello217219hello218220hello219221hel
lo220222hello221223hello222224hello223225hello224226hello225227hello226228hello2
27229hello228230hello229231hello230232hello231233hello232234hello233235hello2342
36hello235237hello236238hello237239hello238240hello239241hello240242hello241243h
ello242244hello243245hello244246hello245247hello246248hello247249hello248250hell
o249251hello250252hello251253hello252254hello253255hello254256hello255257hello25
6258hello257259hello258260hello259261hello260262hello261263hello262264hello26326
5hello264266hello265267hello266268hello267269hello268270hello269271hello270272he
llo271273hello272274hello273275hello274276hello275277hello276278hello277279hello
278280hello279281hello280282hello281283hello282284hello283285hello284286hello285
287hello286288hello287289hello288290hello289291hello290292hello291293hello292294
hello293295hello294296hello295297hello296298hello297299hello298300hello299301hel
lo300302\""); |
OLD | NEW |