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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 + (i * 2 + 1) / 100, | 48 assertEquals(i * 2 + 1 + (i * 2 + 1) / 100, |
49 frame.localValue(0).value()); | 49 frame.localValue(0).value()); |
50 assertEquals(i * 2 + 2 + (i * 2 + 2) / 100, | 50 assertEquals(i * 2 + 2 + (i * 2 + 2) / 100, |
51 frame.localValue(1).value()); | 51 frame.localValue(1).value()); |
52 } | 52 } |
53 | 53 |
| 54 // Check the frame function. |
| 55 switch (i) { |
| 56 case 0: assertEquals(h, frame.func().value()); break; |
| 57 case 1: assertEquals(g3, frame.func().value()); break; |
| 58 case 2: assertEquals(g2, frame.func().value()); break; |
| 59 case 3: assertEquals(g1, frame.func().value()); break; |
| 60 case 4: assertEquals(f, frame.func().value()); break; |
| 61 case 5: break; |
| 62 default: assertUnreachable(); |
| 63 } |
| 64 |
54 // When function f is optimized (2 means YES, see runtime.cc) we | 65 // When function f is optimized (2 means YES, see runtime.cc) we |
55 // expect an optimized frame for f with g1, g2 and g3 inlined. | 66 // expect an optimized frame for f with g1, g2 and g3 inlined. |
56 if (%GetOptimizationStatus(f) == 2) { | 67 if (%GetOptimizationStatus(f) == 2) { |
57 if (i == 1 || i == 2 || i == 3) { | 68 if (i == 1 || i == 2 || i == 3) { |
58 assertTrue(frame.isOptimizedFrame()); | 69 assertTrue(frame.isOptimizedFrame()); |
59 assertTrue(frame.isInlinedFrame()); | 70 assertTrue(frame.isInlinedFrame()); |
60 } else if (i == 4) { | 71 } else if (i == 4) { |
61 assertTrue(frame.isOptimizedFrame()); | 72 assertTrue(frame.isOptimizedFrame()); |
62 assertFalse(frame.isInlinedFrame()); | 73 assertFalse(frame.isInlinedFrame()); |
63 } else { | 74 } else { |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 g1(a, b); | 134 g1(a, b); |
124 }; | 135 }; |
125 | 136 |
126 f(11.11, 12.12); | 137 f(11.11, 12.12); |
127 | 138 |
128 // Make sure that the debug event listener vas invoked. | 139 // Make sure that the debug event listener vas invoked. |
129 assertFalse(exception, "exception in listener " + exception) | 140 assertFalse(exception, "exception in listener " + exception) |
130 assertTrue(listenerComplete); | 141 assertTrue(listenerComplete); |
131 | 142 |
132 Debug.setListener(null); | 143 Debug.setListener(null); |
OLD | NEW |