Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Side by Side Diff: test/mjsunit/debug-evaluate-locals-optimized-double.js

Issue 10239003: Remove unwarranted assumptions about inlining from a debugger test. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « test/mjsunit/debug-evaluate-locals-optimized.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 { locals: {a3: 7.07, b3: 8.08}, args: { names: ["i", "x3", "y3", "z3"], 49 { locals: {a3: 7.07, b3: 8.08}, args: { names: ["i", "x3", "y3", "z3"],
50 values: [3, 9.09, 10.10, undefined] } 50 values: [3, 9.09, 10.10, undefined] }
51 }, 51 },
52 { locals: {a4: 9.09, b4: 10.10}, args: { names: ["i", "x4", "y4"], values: [4, 11.11, 12.12] } } 52 { locals: {a4: 9.09, b4: 10.10}, args: { names: ["i", "x4", "y4"], values: [4, 11.11, 12.12] } }
53 ]; 53 ];
54 54
55 function arraySum(arr) { 55 function arraySum(arr) {
56 return arr.reduce(function (a, b) { return a + b; }, 0); 56 return arr.reduce(function (a, b) { return a + b; }, 0);
57 } 57 }
58 58
59 function isCurrentlyOptimized(fun) {
60 // See runtime.cc.
61 return (%GetOptimizationStatus(fun) & 1) != 0;
62 }
63
59 function listener(event, exec_state, event_data, data) { 64 function listener(event, exec_state, event_data, data) {
60 try { 65 try {
61 if (event == Debug.DebugEvent.Break) 66 if (event == Debug.DebugEvent.Break)
62 { 67 {
63 assertEquals(6, exec_state.frameCount()); 68 assertEquals(6, exec_state.frameCount());
64 69
65 for (var i = 0; i < exec_state.frameCount(); i++) { 70 for (var i = 0; i < exec_state.frameCount(); i++) {
66 var frame = exec_state.frame(i); 71 var frame = exec_state.frame(i);
67 if (i < exec_state.frameCount() - 1) { 72 if (i < exec_state.frameCount() - 1) {
68 var expected_args = expected[i].args; 73 var expected_args = expected[i].args;
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 146
142 // Check for construct call. 147 // Check for construct call.
143 if (i == 4) { 148 if (i == 4) {
144 assertEquals(testingConstructCall, frame.isConstructCall()); 149 assertEquals(testingConstructCall, frame.isConstructCall());
145 } else if (i == 2) { 150 } else if (i == 2) {
146 assertTrue(frame.isConstructCall()); 151 assertTrue(frame.isConstructCall());
147 } else { 152 } else {
148 assertFalse(frame.isConstructCall()); 153 assertFalse(frame.isConstructCall());
149 } 154 }
150 155
151 // When function f is optimized (1 means YES, see runtime.cc) we 156 if (i > 4) {
152 // expect an optimized frame for f with g1, g2 and g3 inlined. 157 assertFalse(frame.isOptimizedFrame());
153 if (%GetOptimizationStatus(f) == 1) { 158 assertFalse(frame.isInlinedFrame());
154 if (i == 1 || i == 2 || i == 3) {
155 assertTrue(frame.isOptimizedFrame());
156 assertTrue(frame.isInlinedFrame());
157 assertEquals(4 - i, frame.inlinedFrameIndex());
158 } else if (i == 4) {
159 assertTrue(frame.isOptimizedFrame());
160 assertFalse(frame.isInlinedFrame());
161 } else {
162 assertFalse(frame.isOptimizedFrame());
163 assertFalse(frame.isInlinedFrame());
164 }
165 } 159 }
166 } 160 }
167 161
162 // When function f is optimized we expect an optimized frame for f. We
163 // can't say whether or not the top 3 frames (g1, g2 and g3) are
164 // optimized and inlined.
165 var frame4 = exec_state.frame(4);
166
167 if (isCurrentlyOptimized(f)) {
168 assertTrue(frame4.isOptimizedFrame());
169 assertFalse(frame4.isInlinedFrame());
170 }
171
168 // Indicate that all was processed. 172 // Indicate that all was processed.
169 listenerComplete = true; 173 listenerComplete = true;
170 } 174 }
171 } catch (e) { 175 } catch (e) {
172 exception = e.toString() + e.stack; 176 exception = e.toString() + e.stack;
173 }; 177 };
174 }; 178 };
175 179
176 for (var i = 0; i < 4; i++) f(input.length - 1, 11.11, 12.12); 180 for (var i = 0; i < 4; i++) f(input.length - 1, 11.11, 12.12);
177 %OptimizeFunctionOnNextCall(f); 181 %OptimizeFunctionOnNextCall(f);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 new f(input.length - 1, 11.11, 12.12, ""); 233 new f(input.length - 1, 11.11, 12.12, "");
230 234
231 // Make sure that the debug event listener was invoked. 235 // Make sure that the debug event listener was invoked.
232 assertFalse(exception, "exception in listener " + exception) 236 assertFalse(exception, "exception in listener " + exception)
233 assertTrue(listenerComplete); 237 assertTrue(listenerComplete);
234 238
235 //Throw away type information for next run. 239 //Throw away type information for next run.
236 gc(); 240 gc();
237 241
238 Debug.setListener(null); 242 Debug.setListener(null);
OLDNEW
« no previous file with comments | « test/mjsunit/debug-evaluate-locals-optimized.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698