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 // TODO(jochen): Remove this after the setting is turned on globally. | 5 // TODO(jochen): Remove this after the setting is turned on globally. |
6 #define V8_IMMINENT_DEPRECATION_WARNINGS | 6 #define V8_IMMINENT_DEPRECATION_WARNINGS |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/ast/ast.h" | 10 #include "src/ast/ast.h" |
(...skipping 1761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1772 } | 1772 } |
1773 CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum)); | 1773 CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum)); |
1774 } | 1774 } |
1775 } | 1775 } |
1776 CHECK_SKIP(); | 1776 CHECK_SKIP(); |
1777 } | 1777 } |
1778 CHECK_FUNC_TYPES_END | 1778 CHECK_FUNC_TYPES_END |
1779 } | 1779 } |
1780 | 1780 |
1781 | 1781 |
| 1782 TEST(NegativeDouble) { |
| 1783 CHECK_FUNC_TYPES_BEGIN( |
| 1784 "function bar() { var x = -123.2; }\n" |
| 1785 "function foo() { bar(); }") { |
| 1786 CHECK_EXPR(FunctionLiteral, FUNC_V_TYPE) { |
| 1787 CHECK_EXPR(Assignment, Bounds(cache.kAsmDouble)) { |
| 1788 CHECK_VAR(x, Bounds(cache.kAsmDouble)); |
| 1789 CHECK_EXPR(Literal, Bounds(cache.kAsmDouble)); |
| 1790 } |
| 1791 } |
| 1792 CHECK_SKIP(); |
| 1793 } |
| 1794 CHECK_FUNC_TYPES_END |
| 1795 } |
| 1796 |
| 1797 |
| 1798 TEST(NegativeInteger) { |
| 1799 CHECK_FUNC_TYPES_BEGIN( |
| 1800 "function bar() { var x = -123; }\n" |
| 1801 "function foo() { bar(); }") { |
| 1802 CHECK_EXPR(FunctionLiteral, FUNC_V_TYPE) { |
| 1803 CHECK_EXPR(Assignment, Bounds(cache.kAsmInt)) { |
| 1804 CHECK_VAR(x, Bounds(cache.kAsmInt)); |
| 1805 CHECK_EXPR(Literal, Bounds(cache.kAsmSigned)); |
| 1806 } |
| 1807 } |
| 1808 CHECK_SKIP(); |
| 1809 } |
| 1810 CHECK_FUNC_TYPES_END |
| 1811 } |
| 1812 |
| 1813 |
1782 TEST(TypeConsistency) { | 1814 TEST(TypeConsistency) { |
1783 v8::V8::Initialize(); | 1815 v8::V8::Initialize(); |
1784 TypeCache cache; | 1816 TypeCache cache; |
1785 // Check the consistency of each of the main Asm.js types. | 1817 // Check the consistency of each of the main Asm.js types. |
1786 CHECK(cache.kAsmFixnum->Is(cache.kAsmFixnum)); | 1818 CHECK(cache.kAsmFixnum->Is(cache.kAsmFixnum)); |
1787 CHECK(cache.kAsmFixnum->Is(cache.kAsmSigned)); | 1819 CHECK(cache.kAsmFixnum->Is(cache.kAsmSigned)); |
1788 CHECK(cache.kAsmFixnum->Is(cache.kAsmUnsigned)); | 1820 CHECK(cache.kAsmFixnum->Is(cache.kAsmUnsigned)); |
1789 CHECK(cache.kAsmFixnum->Is(cache.kAsmInt)); | 1821 CHECK(cache.kAsmFixnum->Is(cache.kAsmInt)); |
1790 CHECK(!cache.kAsmFixnum->Is(cache.kAsmFloat)); | 1822 CHECK(!cache.kAsmFixnum->Is(cache.kAsmFloat)); |
1791 CHECK(!cache.kAsmFixnum->Is(cache.kAsmDouble)); | 1823 CHECK(!cache.kAsmFixnum->Is(cache.kAsmDouble)); |
(...skipping 26 matching lines...) Expand all Loading... |
1818 CHECK(!cache.kAsmFloat->Is(cache.kAsmFixnum)); | 1850 CHECK(!cache.kAsmFloat->Is(cache.kAsmFixnum)); |
1819 CHECK(!cache.kAsmFloat->Is(cache.kAsmDouble)); | 1851 CHECK(!cache.kAsmFloat->Is(cache.kAsmDouble)); |
1820 | 1852 |
1821 CHECK(cache.kAsmDouble->Is(cache.kAsmDouble)); | 1853 CHECK(cache.kAsmDouble->Is(cache.kAsmDouble)); |
1822 CHECK(!cache.kAsmDouble->Is(cache.kAsmInt)); | 1854 CHECK(!cache.kAsmDouble->Is(cache.kAsmInt)); |
1823 CHECK(!cache.kAsmDouble->Is(cache.kAsmUnsigned)); | 1855 CHECK(!cache.kAsmDouble->Is(cache.kAsmUnsigned)); |
1824 CHECK(!cache.kAsmDouble->Is(cache.kAsmSigned)); | 1856 CHECK(!cache.kAsmDouble->Is(cache.kAsmSigned)); |
1825 CHECK(!cache.kAsmDouble->Is(cache.kAsmFixnum)); | 1857 CHECK(!cache.kAsmDouble->Is(cache.kAsmFixnum)); |
1826 CHECK(!cache.kAsmDouble->Is(cache.kAsmFloat)); | 1858 CHECK(!cache.kAsmDouble->Is(cache.kAsmFloat)); |
1827 } | 1859 } |
OLD | NEW |