OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Flags: --type-profile --turbo | 5 // Flags: --type-profile --turbo --allow-natives-syntax |
6 | 6 |
7 function test(param) { | 7 function test(param) { |
8 var my_var1 = param; | 8 var my_var1 = param; |
9 var my_var2 = 17; | 9 var my_var2 = 17; |
10 } | 10 } |
11 | 11 |
| 12 %PrintTypeProfile(test); |
| 13 |
12 test({}); | 14 test({}); |
13 test(123); | 15 test(123); |
14 test('hello'); | 16 test('hello'); |
15 test(123); | 17 test(123); |
| 18 %PrintTypeProfile(test); |
| 19 |
16 test(undefined); | 20 test(undefined); |
17 test('hello'); | 21 test('hello'); |
18 test({x: 12}); | 22 test({x: 12}); |
19 test({x: 12}); | 23 test({x: 12}); |
20 | 24 |
| 25 %PrintTypeProfile(test); |
| 26 |
21 class MyClass { | 27 class MyClass { |
22 constructor() {} | 28 constructor() {} |
23 } | 29 } |
24 | 30 |
25 | 31 |
26 function testConstructorNames(param) { | 32 function testConstructorNames(param) { |
27 var my_var = param; | 33 var my_var = param; |
28 } | 34 } |
29 | 35 |
30 testConstructorNames(new MyClass()); | 36 testConstructorNames(new MyClass()); |
31 testConstructorNames({}); | 37 testConstructorNames({}); |
32 testConstructorNames(2); | 38 testConstructorNames(2); |
33 | 39 |
34 throw "throw otherwise test fails with --stress-opt"; | 40 throw "throw otherwise test fails with --stress-opt"; |
OLD | NEW |