| OLD | NEW |
| 1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 for (var i = 0; i < exec_state.frameCount(); i++) { | 42 for (var i = 0; i < exec_state.frameCount(); i++) { |
| 43 var frame = exec_state.frame(i); | 43 var frame = exec_state.frame(i); |
| 44 // All frames except the bottom one has normal variables a and b. | 44 // All frames except the bottom one has normal variables a and b. |
| 45 if (i < exec_state.frameCount() - 1) { | 45 if (i < exec_state.frameCount() - 1) { |
| 46 assertEquals('a', frame.localName(0)); | 46 assertEquals('a', frame.localName(0)); |
| 47 assertEquals('b', frame.localName(1)); | 47 assertEquals('b', frame.localName(1)); |
| 48 assertEquals(i * 2 + 1, frame.localValue(0).value()); | 48 assertEquals(i * 2 + 1, frame.localValue(0).value()); |
| 49 assertEquals(i * 2 + 2, frame.localValue(1).value()); | 49 assertEquals(i * 2 + 2, frame.localValue(1).value()); |
| 50 } | 50 } |
| 51 | 51 |
| 52 // Check the frame function. |
| 53 switch (i) { |
| 54 case 0: assertEquals(h, frame.func().value()); break; |
| 55 case 1: assertEquals(g3, frame.func().value()); break; |
| 56 case 2: assertEquals(g2, frame.func().value()); break; |
| 57 case 3: assertEquals(g1, frame.func().value()); break; |
| 58 case 4: assertEquals(f, frame.func().value()); break; |
| 59 case 5: break; |
| 60 default: assertUnreachable(); |
| 61 } |
| 62 |
| 52 // When function f is optimized (2 means YES, see runtime.cc) we | 63 // When function f is optimized (2 means YES, see runtime.cc) we |
| 53 // expect an optimized frame for f with g1, g2 and g3 inlined. | 64 // expect an optimized frame for f with g1, g2 and g3 inlined. |
| 54 if (%GetOptimizationStatus(f) == 2) { | 65 if (%GetOptimizationStatus(f) == 2) { |
| 55 if (i == 1 || i == 2 || i == 3) { | 66 if (i == 1 || i == 2 || i == 3) { |
| 56 assertTrue(frame.isOptimizedFrame()); | 67 assertTrue(frame.isOptimizedFrame()); |
| 57 assertTrue(frame.isInlinedFrame()); | 68 assertTrue(frame.isInlinedFrame()); |
| 58 } else if (i == 4) { | 69 } else if (i == 4) { |
| 59 assertTrue(frame.isOptimizedFrame()); | 70 assertTrue(frame.isOptimizedFrame()); |
| 60 assertFalse(frame.isInlinedFrame()); | 71 assertFalse(frame.isInlinedFrame()); |
| 61 } else { | 72 } else { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 g1(a, b); | 121 g1(a, b); |
| 111 }; | 122 }; |
| 112 | 123 |
| 113 f(11, 12); | 124 f(11, 12); |
| 114 | 125 |
| 115 // Make sure that the debug event listener vas invoked. | 126 // Make sure that the debug event listener vas invoked. |
| 116 assertFalse(exception, "exception in listener " + exception) | 127 assertFalse(exception, "exception in listener " + exception) |
| 117 assertTrue(listenerComplete); | 128 assertTrue(listenerComplete); |
| 118 | 129 |
| 119 Debug.setListener(null); | 130 Debug.setListener(null); |
| OLD | NEW |