| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 13 matching lines...) Expand all Loading... |
| 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | 27 |
| 28 // Flags: --allow-natives-syntax | 28 // Flags: --allow-natives-syntax |
| 29 | 29 |
| 30 // Test stack traces with method calls. | 30 // Test stack traces with method calls. |
| 31 function Hest() {} | 31 function Hest() {} |
| 32 function Svin() {} | 32 function Svin() {} |
| 33 | 33 |
| 34 Svin.prototype.two = function() { /* xxxxxxx */ o.three(); } | 34 Svin.prototype.two = function() { /* xxxxxxx */ o.three(); }; |
| 35 | 35 |
| 36 Hest.prototype.one = function(x) { x.two(); } | 36 Hest.prototype.one = function(x) { x.two(); }; |
| 37 | 37 |
| 38 Hest.prototype.three = function() { if (v == 42) throw new Error("urg"); } | 38 Hest.prototype.three = function() { if (v == 42) throw new Error("urg"); }; |
| 39 | 39 |
| 40 var o = new Hest(); | 40 var o = new Hest(); |
| 41 var s = new Svin(); | 41 var s = new Svin(); |
| 42 var v = 0; | 42 var v = 0; |
| 43 | 43 |
| 44 for (var i = 0; i < 5; i++) { | 44 for (var i = 0; i < 5; i++) { |
| 45 o.one(s); | 45 o.one(s); |
| 46 } | 46 } |
| 47 %OptimizeFunctionOnNextCall(Hest.prototype.one); | 47 %OptimizeFunctionOnNextCall(Hest.prototype.one); |
| 48 %OptimizeFunctionOnNextCall(Hest.prototype.three); | 48 %OptimizeFunctionOnNextCall(Hest.prototype.three); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 60 assertTrue(p3 != -1); | 60 assertTrue(p3 != -1); |
| 61 assertTrue(p2 != -1); | 61 assertTrue(p2 != -1); |
| 62 assertTrue(p1 != -1); | 62 assertTrue(p1 != -1); |
| 63 assertTrue(p3 < p2); | 63 assertTrue(p3 < p2); |
| 64 assertTrue(p2 < p1); | 64 assertTrue(p2 < p1); |
| 65 assertTrue(stack.indexOf("38:56") != -1); | 65 assertTrue(stack.indexOf("38:56") != -1); |
| 66 assertTrue(stack.indexOf("34:51") != -1); | 66 assertTrue(stack.indexOf("34:51") != -1); |
| 67 assertTrue(stack.indexOf("36:38") != -1); | 67 assertTrue(stack.indexOf("36:38") != -1); |
| 68 assertTrue(stack.indexOf("54:5") != -1); | 68 assertTrue(stack.indexOf("54:5") != -1); |
| 69 } | 69 } |
| OLD | NEW |