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 10 matching lines...) Expand all Loading... |
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
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: --expose-debug-as debug --allow-natives-syntax | 28 // Flags: --expose-debug-as debug --allow-natives-syntax |
29 // Flags: --parallel-recompilation-delay=300 | 29 // Flags: --parallel-recompilation-delay=300 |
30 | 30 |
| 31 if (!%IsParallelRecompilationSupported()) { |
| 32 print("Parallel recompilation is disabled. Skipping this test."); |
| 33 quit(); |
| 34 } |
| 35 |
31 Debug = debug.Debug | 36 Debug = debug.Debug |
32 | 37 |
33 function foo() { | 38 function foo() { |
34 var x = 1; | 39 var x = 1; |
35 return x; | 40 return x; |
36 } | 41 } |
37 | 42 |
38 function bar() { | 43 function bar() { |
39 var x = 2; | 44 var x = 2; |
40 return x; | 45 return x; |
41 } | 46 } |
42 | 47 |
43 foo(); | 48 foo(); |
44 // Mark and trigger parallel optimization. | 49 // Mark and trigger parallel optimization. |
45 %OptimizeFunctionOnNextCall(foo, "parallel"); | 50 %OptimizeFunctionOnNextCall(foo, "parallel"); |
46 foo(); | 51 foo(); |
47 | 52 |
48 // Set break points on an unrelated function. This clears both optimized | 53 // Set break points on an unrelated function. This clears both optimized |
49 // and (shared) unoptimized code on foo, and sets both to lazy-compile builtin. | 54 // and (shared) unoptimized code on foo, and sets both to lazy-compile builtin. |
50 // Clear the break point immediately after to deactivate the debugger. | 55 // Clear the break point immediately after to deactivate the debugger. |
51 Debug.setBreakPoint(bar, 0, 0); | 56 Debug.setBreakPoint(bar, 0, 0); |
52 Debug.clearAllBreakPoints(); | 57 Debug.clearAllBreakPoints(); |
53 | 58 |
54 // Install optimized code when parallel optimization finishes. | 59 // Install optimized code when parallel optimization finishes. |
55 // This needs to be able to deal with shared code being a builtin. | 60 // This needs to be able to deal with shared code being a builtin. |
56 assertUnoptimized(foo, "sync"); | 61 assertUnoptimized(foo, "sync"); |
57 | 62 |
OLD | NEW |