OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 28 matching lines...) Expand all Loading... |
39 var x = 1; | 39 var x = 1; |
40 return x; | 40 return x; |
41 } | 41 } |
42 | 42 |
43 function bar() { | 43 function bar() { |
44 var x = 2; | 44 var x = 2; |
45 return x; | 45 return x; |
46 } | 46 } |
47 | 47 |
48 foo(); | 48 foo(); |
| 49 %BaselineFunctionOnNextCall(foo); |
| 50 foo(); |
49 // Mark and kick off recompilation. | 51 // Mark and kick off recompilation. |
50 %OptimizeFunctionOnNextCall(foo, "concurrent"); | 52 %OptimizeFunctionOnNextCall(foo, "concurrent"); |
51 foo(); | 53 foo(); |
52 | 54 |
53 // Set break points on an unrelated function. This clears both optimized | 55 // Set break points on an unrelated function. This clears both optimized |
54 // and (shared) unoptimized code on foo, and sets both to lazy-compile builtin. | 56 // and (shared) unoptimized code on foo, and sets both to lazy-compile builtin. |
55 // Clear the break point immediately after to deactivate the debugger. | 57 // Clear the break point immediately after to deactivate the debugger. |
56 // Do all of this after compile graph has been created. | 58 // Do all of this after compile graph has been created. |
57 Debug.setListener(function(){}); | 59 Debug.setListener(function(){}); |
58 Debug.setBreakPoint(bar, 0, 0); | 60 Debug.setBreakPoint(bar, 0, 0); |
59 Debug.clearAllBreakPoints(); | 61 Debug.clearAllBreakPoints(); |
60 Debug.setListener(null); | 62 Debug.setListener(null); |
61 | 63 |
62 // At this point, concurrent recompilation is still blocked. | 64 // At this point, concurrent recompilation is still blocked. |
63 assertUnoptimized(foo, "no sync"); | 65 assertUnoptimized(foo, "no sync"); |
64 // Let concurrent recompilation proceed. | 66 // Let concurrent recompilation proceed. |
65 %UnblockConcurrentRecompilation(); | 67 %UnblockConcurrentRecompilation(); |
66 | 68 |
67 // Install optimized code when concurrent optimization finishes. | 69 // Install optimized code when concurrent optimization finishes. |
68 // This needs to be able to deal with shared code being a builtin. | 70 // This needs to be able to deal with shared code being a builtin. |
69 assertUnoptimized(foo, "sync"); | 71 assertUnoptimized(foo, "sync"); |
OLD | NEW |