OLD | NEW |
---|---|
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 11 matching lines...) Expand all Loading... | |
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: --allow-natives-syntax --inline-accessors --max-opt-count=100 | 28 // Flags: --allow-natives-syntax --inline-accessors --max-opt-count=100 |
29 | 29 |
30 var accessorCallCount, setterArgument, setterValue, obj, forceDeopt; | 30 var accessorCallCount, setterArgument, setterValue, obj, forceDeopt; |
31 | 31 |
32 // TODO(mvstanton): use this code as a template to be able to test deoptimizatio n. | |
Hannes Payer (out of office)
2013/04/18 11:14:39
linewidth 80
mvstanton
2013/04/18 13:39:26
Thx, I was able to remove the TODO. As it turns ou
| |
33 | |
32 // ----------------------------------------------------------------------------- | 34 // ----------------------------------------------------------------------------- |
33 // Helpers for testing inlining of getters. | 35 // Helpers for testing inlining of getters. |
34 | 36 |
35 function TestInlinedGetter(context, obj, expected) { | 37 function TestInlinedGetter(context, obj, expected) { |
36 forceDeopt = { deopt: 0 }; | 38 forceDeopt = { deopt: 0 }; |
37 accessorCallCount = 0; | 39 accessorCallCount = 0; |
38 | 40 |
39 assertEquals(expected, context(obj)); | 41 assertEquals(expected, context(obj)); |
40 assertEquals(1, accessorCallCount); | 42 assertEquals(1, accessorCallCount); |
41 | 43 |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
359 forceDeopt.deopt; | 361 forceDeopt.deopt; |
360 if (accessorCallCount == 4) { 123 in null; } | 362 if (accessorCallCount == 4) { 123 in null; } |
361 setterValue = value; | 363 setterValue = value; |
362 } | 364 } |
363 | 365 |
364 function ConstrS7() { } | 366 function ConstrS7() { } |
365 obj = Object.defineProperty(new ConstrS7(), "setterProperty", { set: setter7 }); | 367 obj = Object.defineProperty(new ConstrS7(), "setterProperty", { set: setter7 }); |
366 TestSetterInAllContexts(setter7, obj, true); | 368 TestSetterInAllContexts(setter7, obj, true); |
367 obj = Object.create(obj); | 369 obj = Object.create(obj); |
368 TestSetterInAllContexts(setter7, obj, true); | 370 TestSetterInAllContexts(setter7, obj, true); |
OLD | NEW |