OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 | 125 |
126 // Check that %_IsConstructCall returns correct value when inlined | 126 // Check that %_IsConstructCall returns correct value when inlined |
127 var NON_CONSTRUCT_MARKER = {}; | 127 var NON_CONSTRUCT_MARKER = {}; |
128 var CONSTRUCT_MARKER = {}; | 128 var CONSTRUCT_MARKER = {}; |
129 function baz(x) { | 129 function baz(x) { |
130 return (!%_IsConstructCall()) ? NON_CONSTRUCT_MARKER : CONSTRUCT_MARKER; | 130 return (!%_IsConstructCall()) ? NON_CONSTRUCT_MARKER : CONSTRUCT_MARKER; |
131 } | 131 } |
132 | 132 |
133 function bar(x, y, z) { | 133 function bar(x, y, z) { |
134 var non_construct = baz(0); /* baz should be inlined */ | 134 var non_construct = baz(0); /* baz should be inlined */ |
135 assertEquals(non_construct, NON_CONSTRUCT_MARKER); | 135 assertSame(non_construct, NON_CONSTRUCT_MARKER); |
136 var non_construct = baz(); /* baz should be inlined */ | 136 var non_construct = baz(); /* baz should be inlined */ |
137 assertEquals(non_construct, NON_CONSTRUCT_MARKER); | 137 assertSame(non_construct, NON_CONSTRUCT_MARKER); |
138 var non_construct = baz(0, 0); /* baz should be inlined */ | 138 var non_construct = baz(0, 0); /* baz should be inlined */ |
139 assertEquals(non_construct, NON_CONSTRUCT_MARKER); | 139 assertSame(non_construct, NON_CONSTRUCT_MARKER); |
140 var construct = new baz(0); | 140 var construct = new baz(0); |
141 assertEquals(construct, CONSTRUCT_MARKER); | 141 assertSame(construct, CONSTRUCT_MARKER); |
142 } | 142 } |
143 | 143 |
144 invoke(bar, [1, 2, 3]); | 144 invoke(bar, [1, 2, 3]); |
OLD | NEW |