| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 | 169 |
| 170 // Verify that map transitions don't confuse us. | 170 // Verify that map transitions don't confuse us. |
| 171 create_func_smi = function() { return [,,,,,,5]; } | 171 create_func_smi = function() { return [,,,,,,5]; } |
| 172 create_func_double = function() { return [,,,,,,5.5]; } | 172 create_func_double = function() { return [,,,,,,5.5]; } |
| 173 create_func_fast = function() { return [,,,,,,true]; } | 173 create_func_fast = function() { return [,,,,,,true]; } |
| 174 | 174 |
| 175 var cf = [create_func_smi, | 175 var cf = [create_func_smi, |
| 176 create_func_double, | 176 create_func_double, |
| 177 create_func_fast]; | 177 create_func_fast]; |
| 178 | 178 |
| 179 for(var c = 0; c < 3; c++) { | 179 for(var c = 0; c < cf.length; c++) { |
| 180 base_getter_test(cf[c]); | 180 base_getter_test(cf[c]); |
| 181 } | 181 } |
| 182 | 182 |
| 183 // A special test for LoadKeyedHoleMode. Ensure that optimized is generated | 183 // A special test for LoadKeyedHoleMode. Ensure that optimized is generated |
| 184 // which sets ALLOW_RETURN_HOLE, then add a setter on the prototype that should | 184 // which sets ALLOW_RETURN_HOLE, then add a setter on the prototype that should |
| 185 // cause the function to deoptimize. | 185 // cause the function to deoptimize. |
| 186 | 186 |
| 187 var a = [3.5,,,3.5]; | 187 var a = [3.5,,,3.5]; |
| 188 fun = function(a) { return a[0] + 5.5; } | 188 fun = function(a) { return a[0] + 5.5; } |
| 189 fun(a); | 189 fun(a); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 212 optimize(fun); | 212 optimize(fun); |
| 213 fun(a); | 213 fun(a); |
| 214 assertOptimized(fun); | 214 assertOptimized(fun); |
| 215 | 215 |
| 216 var calls = 0; | 216 var calls = 0; |
| 217 delete a[0]; | 217 delete a[0]; |
| 218 ap.__defineGetter__(0, function() { calls++; return 0; }); | 218 ap.__defineGetter__(0, function() { calls++; return 0; }); |
| 219 fun(a); | 219 fun(a); |
| 220 assertEquals(1, calls); | 220 assertEquals(1, calls); |
| 221 assertUnoptimized(fun); | 221 assertUnoptimized(fun); |
| OLD | NEW |