OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/ast/ast.h" | 7 #include "src/ast/ast.h" |
8 #include "src/ast/ast-expression-visitor.h" | 8 #include "src/ast/ast-expression-visitor.h" |
9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
10 #include "src/parsing/parser.h" | 10 #include "src/parsing/parser.h" |
11 #include "src/parsing/rewriter.h" | 11 #include "src/parsing/rewriter.h" |
12 #include "src/type-cache.h" | 12 #include "src/type-cache.h" |
13 #include "src/typing-asm.h" | 13 #include "src/typing-asm.h" |
14 #include "test/cctest/cctest.h" | 14 #include "test/cctest/cctest.h" |
15 #include "test/cctest/expression-type-collector.h" | 15 #include "test/cctest/expression-type-collector.h" |
16 #include "test/cctest/expression-type-collector-macros.h" | 16 #include "test/cctest/expression-type-collector-macros.h" |
17 | 17 |
18 // Macros for function types. | 18 // Macros for function types. |
19 #define FUNC_BARE_TYPE Bounds(Type::Function(zone)) | 19 #define FUNC_BARE_TYPE Bounds(Type::Function()) |
20 #define FUNC_V_TYPE Bounds(Type::Function(Type::Undefined(zone), zone)) | 20 #define FUNC_V_TYPE Bounds(Type::Function(Type::Undefined(), zone)) |
21 #define FUNC_I_TYPE Bounds(Type::Function(cache.kAsmSigned, zone)) | 21 #define FUNC_I_TYPE Bounds(Type::Function(cache.kAsmSigned, zone)) |
22 #define FUNC_F_TYPE Bounds(Type::Function(cache.kAsmFloat, zone)) | 22 #define FUNC_F_TYPE Bounds(Type::Function(cache.kAsmFloat, zone)) |
23 #define FUNC_D_TYPE Bounds(Type::Function(cache.kAsmDouble, zone)) | 23 #define FUNC_D_TYPE Bounds(Type::Function(cache.kAsmDouble, zone)) |
24 #define FUNC_D2D_TYPE \ | 24 #define FUNC_D2D_TYPE \ |
25 Bounds(Type::Function(cache.kAsmDouble, cache.kAsmDouble, zone)) | 25 Bounds(Type::Function(cache.kAsmDouble, cache.kAsmDouble, zone)) |
26 #define FUNC_N2F_TYPE \ | 26 #define FUNC_N2F_TYPE \ |
27 Bounds(Type::Function(cache.kAsmFloat, Type::Number(zone), zone)) | 27 Bounds(Type::Function(cache.kAsmFloat, Type::Number(), zone)) |
28 #define FUNC_I2I_TYPE \ | 28 #define FUNC_I2I_TYPE \ |
29 Bounds(Type::Function(cache.kAsmSigned, cache.kAsmInt, zone)) | 29 Bounds(Type::Function(cache.kAsmSigned, cache.kAsmInt, zone)) |
30 #define FUNC_II2D_TYPE \ | 30 #define FUNC_II2D_TYPE \ |
31 Bounds(Type::Function(cache.kAsmDouble, cache.kAsmInt, cache.kAsmInt, zone)) | 31 Bounds(Type::Function(cache.kAsmDouble, cache.kAsmInt, cache.kAsmInt, zone)) |
32 #define FUNC_II2I_TYPE \ | 32 #define FUNC_II2I_TYPE \ |
33 Bounds(Type::Function(cache.kAsmSigned, cache.kAsmInt, cache.kAsmInt, zone)) | 33 Bounds(Type::Function(cache.kAsmSigned, cache.kAsmInt, cache.kAsmInt, zone)) |
34 #define FUNC_DD2D_TYPE \ | 34 #define FUNC_DD2D_TYPE \ |
35 Bounds(Type::Function(cache.kAsmDouble, cache.kAsmDouble, cache.kAsmDouble, \ | 35 Bounds(Type::Function(cache.kAsmDouble, cache.kAsmDouble, cache.kAsmDouble, \ |
36 zone)) | 36 zone)) |
37 #define FUNC_NN2N_TYPE \ | 37 #define FUNC_NN2N_TYPE \ |
38 Bounds(Type::Function(Type::Number(zone), Type::Number(zone), \ | 38 Bounds(Type::Function(Type::Number(), Type::Number(), Type::Number(), zone)) |
39 Type::Number(zone), zone)) | |
40 #define FUNC_N2N_TYPE \ | 39 #define FUNC_N2N_TYPE \ |
41 Bounds(Type::Function(Type::Number(zone), Type::Number(zone), zone)) | 40 Bounds(Type::Function(Type::Number(), Type::Number(), zone)) |
42 | 41 |
43 // Macros for array types. | 42 // Macros for array types. |
44 #define FLOAT64_ARRAY_TYPE Bounds(Type::Array(cache.kAsmDouble, zone)) | 43 #define FLOAT64_ARRAY_TYPE Bounds(Type::Array(cache.kAsmDouble, zone)) |
45 #define FUNC_I2I_ARRAY_TYPE \ | 44 #define FUNC_I2I_ARRAY_TYPE \ |
46 Bounds(Type::Array(Type::Function(cache.kAsmSigned, cache.kAsmInt, zone), \ | 45 Bounds(Type::Array(Type::Function(cache.kAsmSigned, cache.kAsmInt, zone), \ |
47 zone)) | 46 zone)) |
48 | 47 |
49 using namespace v8::internal; | 48 using namespace v8::internal; |
50 | 49 |
51 namespace { | 50 namespace { |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum)); | 258 CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum)); |
260 } | 259 } |
261 CHECK_EXPR(Literal, Bounds(cache.kAsmDouble)); | 260 CHECK_EXPR(Literal, Bounds(cache.kAsmDouble)); |
262 } | 261 } |
263 } | 262 } |
264 } | 263 } |
265 CHECK_EXPR(Literal, Bounds(cache.kAsmDouble)); | 264 CHECK_EXPR(Literal, Bounds(cache.kAsmDouble)); |
266 } | 265 } |
267 } | 266 } |
268 // "use asm"; | 267 // "use asm"; |
269 CHECK_EXPR(Literal, Bounds(Type::String(zone))); | 268 CHECK_EXPR(Literal, Bounds(Type::String())); |
270 // var exp = stdlib.Math.exp; | 269 // var exp = stdlib.Math.exp; |
271 CHECK_EXPR(Assignment, FUNC_D2D_TYPE) { | 270 CHECK_EXPR(Assignment, FUNC_D2D_TYPE) { |
272 CHECK_VAR(exp, FUNC_D2D_TYPE); | 271 CHECK_VAR(exp, FUNC_D2D_TYPE); |
273 CHECK_EXPR(Property, FUNC_D2D_TYPE) { | 272 CHECK_EXPR(Property, FUNC_D2D_TYPE) { |
274 CHECK_EXPR(Property, Bounds::Unbounded()) { | 273 CHECK_EXPR(Property, Bounds::Unbounded()) { |
275 CHECK_VAR(stdlib, Bounds::Unbounded()); | 274 CHECK_VAR(stdlib, Bounds::Unbounded()); |
276 CHECK_EXPR(Literal, Bounds::Unbounded()); | 275 CHECK_EXPR(Literal, Bounds::Unbounded()); |
277 } | 276 } |
278 CHECK_EXPR(Literal, Bounds::Unbounded()); | 277 CHECK_EXPR(Literal, Bounds::Unbounded()); |
279 } | 278 } |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 Zone* zone = handles.main_zone(); \ | 511 Zone* zone = handles.main_zone(); \ |
513 ZoneVector<ExpressionTypeEntry> types(zone); \ | 512 ZoneVector<ExpressionTypeEntry> types(zone); \ |
514 CHECK_EQ("", Validate(zone, test_function, &types)); \ | 513 CHECK_EQ("", Validate(zone, test_function, &types)); \ |
515 TypeCache cache; \ | 514 TypeCache cache; \ |
516 \ | 515 \ |
517 CHECK_TYPES_BEGIN { \ | 516 CHECK_TYPES_BEGIN { \ |
518 /* Module. */ \ | 517 /* Module. */ \ |
519 CHECK_EXPR(FunctionLiteral, Bounds::Unbounded()) { | 518 CHECK_EXPR(FunctionLiteral, Bounds::Unbounded()) { |
520 #define CHECK_FUNC_TYPES_END_1() \ | 519 #define CHECK_FUNC_TYPES_END_1() \ |
521 /* "use asm"; */ \ | 520 /* "use asm"; */ \ |
522 CHECK_EXPR(Literal, Bounds(Type::String(zone))); \ | 521 CHECK_EXPR(Literal, Bounds(Type::String())); \ |
523 /* stdlib shortcuts. */ \ | 522 /* stdlib shortcuts. */ \ |
524 CheckStdlibShortcuts1(zone, types, index, depth, cache); \ | 523 CheckStdlibShortcuts1(zone, types, index, depth, cache); \ |
525 CheckStdlibShortcuts2(zone, types, index, depth, cache); | 524 CheckStdlibShortcuts2(zone, types, index, depth, cache); |
526 | 525 |
527 | |
528 #define CHECK_FUNC_TYPES_END_2() \ | 526 #define CHECK_FUNC_TYPES_END_2() \ |
529 /* return { foo: foo }; */ \ | 527 /* return { foo: foo }; */ \ |
530 CHECK_EXPR(ObjectLiteral, Bounds::Unbounded()) { \ | 528 CHECK_EXPR(ObjectLiteral, Bounds::Unbounded()) { \ |
531 CHECK_VAR(foo, FUNC_V_TYPE); \ | 529 CHECK_VAR(foo, FUNC_V_TYPE); \ |
532 } \ | 530 } \ |
533 } \ | 531 } \ |
534 } \ | 532 } \ |
535 CHECK_TYPES_END | 533 CHECK_TYPES_END |
536 | 534 |
537 | 535 |
(...skipping 20 matching lines...) Expand all Loading... |
558 CHECK_FUNC_TYPES_END | 556 CHECK_FUNC_TYPES_END |
559 } | 557 } |
560 | 558 |
561 | 559 |
562 TEST(ReturnVoid) { | 560 TEST(ReturnVoid) { |
563 CHECK_FUNC_TYPES_BEGIN( | 561 CHECK_FUNC_TYPES_BEGIN( |
564 "function bar() { return; }\n" | 562 "function bar() { return; }\n" |
565 "function foo() { bar(); }") { | 563 "function foo() { bar(); }") { |
566 CHECK_EXPR(FunctionLiteral, FUNC_V_TYPE) { | 564 CHECK_EXPR(FunctionLiteral, FUNC_V_TYPE) { |
567 // return undefined; | 565 // return undefined; |
568 CHECK_EXPR(Literal, Bounds(Type::Undefined(zone))); | 566 CHECK_EXPR(Literal, Bounds(Type::Undefined())); |
569 } | 567 } |
570 CHECK_EXPR(FunctionLiteral, FUNC_V_TYPE) { | 568 CHECK_EXPR(FunctionLiteral, FUNC_V_TYPE) { |
571 CHECK_EXPR(Call, Bounds(Type::Undefined(zone))) { | 569 CHECK_EXPR(Call, Bounds(Type::Undefined())) { |
572 CHECK_VAR(bar, FUNC_V_TYPE); | 570 CHECK_VAR(bar, FUNC_V_TYPE); |
573 } | 571 } |
574 } | 572 } |
575 } | 573 } |
576 CHECK_FUNC_TYPES_END | 574 CHECK_FUNC_TYPES_END |
577 } | 575 } |
578 | 576 |
579 | 577 |
580 TEST(EmptyBody) { | 578 TEST(EmptyBody) { |
581 CHECK_FUNC_TYPES_BEGIN( | 579 CHECK_FUNC_TYPES_BEGIN( |
582 "function bar() { }\n" | 580 "function bar() { }\n" |
583 "function foo() { bar(); }") { | 581 "function foo() { bar(); }") { |
584 CHECK_EXPR(FunctionLiteral, FUNC_V_TYPE); | 582 CHECK_EXPR(FunctionLiteral, FUNC_V_TYPE); |
585 CHECK_EXPR(FunctionLiteral, FUNC_V_TYPE) { | 583 CHECK_EXPR(FunctionLiteral, FUNC_V_TYPE) { |
586 CHECK_EXPR(Call, Bounds(Type::Undefined(zone))) { | 584 CHECK_EXPR(Call, Bounds(Type::Undefined())) { |
587 CHECK_VAR(bar, FUNC_V_TYPE); | 585 CHECK_VAR(bar, FUNC_V_TYPE); |
588 } | 586 } |
589 } | 587 } |
590 } | 588 } |
591 CHECK_FUNC_TYPES_END | 589 CHECK_FUNC_TYPES_END |
592 } | 590 } |
593 | 591 |
594 | 592 |
595 TEST(DoesNothing) { | 593 TEST(DoesNothing) { |
596 CHECK_FUNC_TYPES_BEGIN( | 594 CHECK_FUNC_TYPES_BEGIN( |
597 "function bar() { var x = 1.0; }\n" | 595 "function bar() { var x = 1.0; }\n" |
598 "function foo() { bar(); }") { | 596 "function foo() { bar(); }") { |
599 CHECK_EXPR(FunctionLiteral, FUNC_V_TYPE) { | 597 CHECK_EXPR(FunctionLiteral, FUNC_V_TYPE) { |
600 CHECK_EXPR(Assignment, Bounds(cache.kAsmDouble)) { | 598 CHECK_EXPR(Assignment, Bounds(cache.kAsmDouble)) { |
601 CHECK_VAR(x, Bounds(cache.kAsmDouble)); | 599 CHECK_VAR(x, Bounds(cache.kAsmDouble)); |
602 CHECK_EXPR(Literal, Bounds(cache.kAsmDouble)); | 600 CHECK_EXPR(Literal, Bounds(cache.kAsmDouble)); |
603 } | 601 } |
604 } | 602 } |
605 CHECK_EXPR(FunctionLiteral, FUNC_V_TYPE) { | 603 CHECK_EXPR(FunctionLiteral, FUNC_V_TYPE) { |
606 CHECK_EXPR(Call, Bounds(Type::Undefined(zone))) { | 604 CHECK_EXPR(Call, Bounds(Type::Undefined())) { |
607 CHECK_VAR(bar, FUNC_V_TYPE); | 605 CHECK_VAR(bar, FUNC_V_TYPE); |
608 } | 606 } |
609 } | 607 } |
610 } | 608 } |
611 CHECK_FUNC_TYPES_END | 609 CHECK_FUNC_TYPES_END |
612 } | 610 } |
613 | 611 |
614 | 612 |
615 TEST(ReturnInt32Literal) { | 613 TEST(ReturnInt32Literal) { |
616 CHECK_FUNC_TYPES_BEGIN( | 614 CHECK_FUNC_TYPES_BEGIN( |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1060 CHECK_EXPR(FunctionLiteral, FUNC_I_TYPE) { | 1058 CHECK_EXPR(FunctionLiteral, FUNC_I_TYPE) { |
1061 CHECK_EXPR(Assignment, Bounds(cache.kAsmInt)) { | 1059 CHECK_EXPR(Assignment, Bounds(cache.kAsmInt)) { |
1062 CHECK_VAR(x, Bounds(cache.kAsmInt)); | 1060 CHECK_VAR(x, Bounds(cache.kAsmInt)); |
1063 CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum)); | 1061 CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum)); |
1064 } | 1062 } |
1065 CHECK_EXPR(Assignment, Bounds(cache.kAsmInt)) { | 1063 CHECK_EXPR(Assignment, Bounds(cache.kAsmInt)) { |
1066 CHECK_VAR(y, Bounds(cache.kAsmInt)); | 1064 CHECK_VAR(y, Bounds(cache.kAsmInt)); |
1067 CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum)); | 1065 CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum)); |
1068 } | 1066 } |
1069 CHECK_EXPR(BinaryOperation, Bounds(cache.kAsmSigned)) { | 1067 CHECK_EXPR(BinaryOperation, Bounds(cache.kAsmSigned)) { |
1070 CHECK_EXPR(BinaryOperation, Bounds(Type::None(zone), Type::Any(zone))) { | 1068 CHECK_EXPR(BinaryOperation, Bounds(Type::None(), Type::Any())) { |
1071 CHECK_EXPR(BinaryOperation, Bounds(cache.kAsmUnsigned)) { | 1069 CHECK_EXPR(BinaryOperation, Bounds(cache.kAsmUnsigned)) { |
1072 CHECK_VAR(x, Bounds(cache.kAsmInt)); | 1070 CHECK_VAR(x, Bounds(cache.kAsmInt)); |
1073 CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum)); | 1071 CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum)); |
1074 } | 1072 } |
1075 CHECK_EXPR(BinaryOperation, Bounds(cache.kAsmUnsigned)) { | 1073 CHECK_EXPR(BinaryOperation, Bounds(cache.kAsmUnsigned)) { |
1076 CHECK_VAR(y, Bounds(cache.kAsmInt)); | 1074 CHECK_VAR(y, Bounds(cache.kAsmInt)); |
1077 CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum)); | 1075 CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum)); |
1078 } | 1076 } |
1079 } | 1077 } |
1080 CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum)); | 1078 CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum)); |
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1735 CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum)); | 1733 CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum)); |
1736 } | 1734 } |
1737 } | 1735 } |
1738 CHECK_EXPR(FunctionLiteral, FUNC_V_TYPE) { | 1736 CHECK_EXPR(FunctionLiteral, FUNC_V_TYPE) { |
1739 CHECK_EXPR(Call, Bounds(cache.kAsmSigned)) { | 1737 CHECK_EXPR(Call, Bounds(cache.kAsmSigned)) { |
1740 CHECK_VAR(bar, FUNC_I_TYPE); | 1738 CHECK_VAR(bar, FUNC_I_TYPE); |
1741 } | 1739 } |
1742 } | 1740 } |
1743 } | 1741 } |
1744 CHECK_FUNC_TYPES_END_1() | 1742 CHECK_FUNC_TYPES_END_1() |
1745 CHECK_EXPR(Assignment, Bounds(Type::Any(zone))) { | 1743 CHECK_EXPR(Assignment, Bounds(Type::Any())) { |
1746 CHECK_VAR(baz, Bounds(Type::Any(zone))); | 1744 CHECK_VAR(baz, Bounds(Type::Any())); |
1747 CHECK_EXPR(Property, Bounds(Type::Any(zone))) { | 1745 CHECK_EXPR(Property, Bounds(Type::Any())) { |
1748 CHECK_VAR(foreign, Bounds::Unbounded()); | 1746 CHECK_VAR(foreign, Bounds::Unbounded()); |
1749 CHECK_EXPR(Literal, Bounds::Unbounded()); | 1747 CHECK_EXPR(Literal, Bounds::Unbounded()); |
1750 } | 1748 } |
1751 } | 1749 } |
1752 CHECK_FUNC_TYPES_END_2() | 1750 CHECK_FUNC_TYPES_END_2() |
1753 } | 1751 } |
1754 | 1752 |
1755 | 1753 |
1756 TEST(BadExports) { | 1754 TEST(BadExports) { |
1757 HARNESS_PREAMBLE() | 1755 HARNESS_PREAMBLE() |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2003 CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum)); | 2001 CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum)); |
2004 } | 2002 } |
2005 } | 2003 } |
2006 CHECK_EXPR(Assignment, Bounds(cache.kAsmInt)) { | 2004 CHECK_EXPR(Assignment, Bounds(cache.kAsmInt)) { |
2007 CHECK_VAR(.switch_tag, Bounds(cache.kAsmInt)); | 2005 CHECK_VAR(.switch_tag, Bounds(cache.kAsmInt)); |
2008 CHECK_EXPR(BinaryOperation, Bounds(cache.kAsmSigned)) { | 2006 CHECK_EXPR(BinaryOperation, Bounds(cache.kAsmSigned)) { |
2009 CHECK_VAR(x, Bounds(cache.kAsmInt)); | 2007 CHECK_VAR(x, Bounds(cache.kAsmInt)); |
2010 CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum)); | 2008 CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum)); |
2011 } | 2009 } |
2012 } | 2010 } |
2013 CHECK_EXPR(Literal, Bounds(Type::Undefined(zone))); | 2011 CHECK_EXPR(Literal, Bounds(Type::Undefined())); |
2014 CHECK_VAR(.switch_tag, Bounds(cache.kAsmSigned)); | 2012 CHECK_VAR(.switch_tag, Bounds(cache.kAsmSigned)); |
2015 // case 1: return 23; | 2013 // case 1: return 23; |
2016 CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum)); | 2014 CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum)); |
2017 CHECK_EXPR(Literal, Bounds(cache.kAsmSigned)); | 2015 CHECK_EXPR(Literal, Bounds(cache.kAsmSigned)); |
2018 // case 2: return 43; | 2016 // case 2: return 43; |
2019 CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum)); | 2017 CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum)); |
2020 CHECK_EXPR(Literal, Bounds(cache.kAsmSigned)); | 2018 CHECK_EXPR(Literal, Bounds(cache.kAsmSigned)); |
2021 // default: return 66; | 2019 // default: return 66; |
2022 CHECK_EXPR(Literal, Bounds(cache.kAsmSigned)); | 2020 CHECK_EXPR(Literal, Bounds(cache.kAsmSigned)); |
2023 // return 0; | 2021 // return 0; |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2147 CHECK_VAR(fdouble, Bounds(cache.kAsmDouble)); | 2145 CHECK_VAR(fdouble, Bounds(cache.kAsmDouble)); |
2148 CHECK_EXPR(BinaryOperation, Bounds(cache.kAsmSigned)) { | 2146 CHECK_EXPR(BinaryOperation, Bounds(cache.kAsmSigned)) { |
2149 CHECK_VAR(fint, Bounds(cache.kAsmInt)); | 2147 CHECK_VAR(fint, Bounds(cache.kAsmInt)); |
2150 CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum)); | 2148 CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum)); |
2151 } | 2149 } |
2152 } | 2150 } |
2153 CHECK_EXPR(Literal, Bounds(cache.kAsmDouble)); | 2151 CHECK_EXPR(Literal, Bounds(cache.kAsmDouble)); |
2154 } | 2152 } |
2155 } | 2153 } |
2156 // "use asm"; | 2154 // "use asm"; |
2157 CHECK_EXPR(Literal, Bounds(Type::String(zone))); | 2155 CHECK_EXPR(Literal, Bounds(Type::String())); |
2158 // var func = foreign.foo; | 2156 // var func = foreign.foo; |
2159 CHECK_EXPR(Assignment, Bounds(Type::Any(zone))) { | 2157 CHECK_EXPR(Assignment, Bounds(Type::Any())) { |
2160 CHECK_VAR(ffunc, Bounds(Type::Any(zone))); | 2158 CHECK_VAR(ffunc, Bounds(Type::Any())); |
2161 CHECK_EXPR(Property, Bounds(Type::Any(zone))) { | 2159 CHECK_EXPR(Property, Bounds(Type::Any())) { |
2162 CHECK_VAR(foreign, Bounds::Unbounded()); | 2160 CHECK_VAR(foreign, Bounds::Unbounded()); |
2163 CHECK_EXPR(Literal, Bounds::Unbounded()); | 2161 CHECK_EXPR(Literal, Bounds::Unbounded()); |
2164 } | 2162 } |
2165 } | 2163 } |
2166 // var fint = foreign.bar | 0; | 2164 // var fint = foreign.bar | 0; |
2167 CHECK_EXPR(Assignment, Bounds(cache.kAsmInt)) { | 2165 CHECK_EXPR(Assignment, Bounds(cache.kAsmInt)) { |
2168 CHECK_VAR(fint, Bounds(cache.kAsmInt)); | 2166 CHECK_VAR(fint, Bounds(cache.kAsmInt)); |
2169 CHECK_EXPR(BinaryOperation, Bounds(cache.kAsmSigned)) { | 2167 CHECK_EXPR(BinaryOperation, Bounds(cache.kAsmSigned)) { |
2170 CHECK_EXPR(Property, Bounds(Type::Number(zone))) { | 2168 CHECK_EXPR(Property, Bounds(Type::Number())) { |
2171 CHECK_VAR(foreign, Bounds::Unbounded()); | 2169 CHECK_VAR(foreign, Bounds::Unbounded()); |
2172 CHECK_EXPR(Literal, Bounds::Unbounded()); | 2170 CHECK_EXPR(Literal, Bounds::Unbounded()); |
2173 } | 2171 } |
2174 CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum)); | 2172 CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum)); |
2175 } | 2173 } |
2176 } | 2174 } |
2177 // var fdouble = +foreign.baz; | 2175 // var fdouble = +foreign.baz; |
2178 CHECK_EXPR(Assignment, Bounds(cache.kAsmDouble)) { | 2176 CHECK_EXPR(Assignment, Bounds(cache.kAsmDouble)) { |
2179 CHECK_VAR(fdouble, Bounds(cache.kAsmDouble)); | 2177 CHECK_VAR(fdouble, Bounds(cache.kAsmDouble)); |
2180 CHECK_EXPR(BinaryOperation, Bounds(cache.kAsmDouble)) { | 2178 CHECK_EXPR(BinaryOperation, Bounds(cache.kAsmDouble)) { |
2181 CHECK_EXPR(Property, Bounds(Type::Number(zone))) { | 2179 CHECK_EXPR(Property, Bounds(Type::Number())) { |
2182 CHECK_VAR(foreign, Bounds::Unbounded()); | 2180 CHECK_VAR(foreign, Bounds::Unbounded()); |
2183 CHECK_EXPR(Literal, Bounds::Unbounded()); | 2181 CHECK_EXPR(Literal, Bounds::Unbounded()); |
2184 } | 2182 } |
2185 CHECK_EXPR(Literal, Bounds(cache.kAsmDouble)); | 2183 CHECK_EXPR(Literal, Bounds(cache.kAsmDouble)); |
2186 } | 2184 } |
2187 } | 2185 } |
2188 // return { testFunc1: test1, testFunc2: test2 }; | 2186 // return { testFunc1: test1, testFunc2: test2 }; |
2189 CHECK_EXPR(ObjectLiteral, Bounds::Unbounded()) { | 2187 CHECK_EXPR(ObjectLiteral, Bounds::Unbounded()) { |
2190 CHECK_VAR(test1, FUNC_I_TYPE); | 2188 CHECK_VAR(test1, FUNC_I_TYPE); |
2191 CHECK_VAR(test2, FUNC_D_TYPE); | 2189 CHECK_VAR(test2, FUNC_D_TYPE); |
2192 } | 2190 } |
2193 } | 2191 } |
2194 } | 2192 } |
2195 CHECK_TYPES_END | 2193 CHECK_TYPES_END |
2196 } | 2194 } |
OLD | NEW |