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 5021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5032 } | 5032 } |
5033 | 5033 |
5034 | 5034 |
5035 TEST(li_macro) { | 5035 TEST(li_macro) { |
5036 CcTest::InitializeVM(); | 5036 CcTest::InitializeVM(); |
5037 | 5037 |
5038 uint64_t inputs[] = { | 5038 uint64_t inputs[] = { |
5039 0x0000000000000000, 0x000000000000ffff, 0x00000000ffffffff, | 5039 0x0000000000000000, 0x000000000000ffff, 0x00000000ffffffff, |
5040 0x0000ffffffffffff, 0xffffffffffffffff, 0xffff000000000000, | 5040 0x0000ffffffffffff, 0xffffffffffffffff, 0xffff000000000000, |
5041 0xffffffff00000000, 0xffffffffffff0000, 0xffff0000ffff0000, | 5041 0xffffffff00000000, 0xffffffffffff0000, 0xffff0000ffff0000, |
5042 0x0000ffffffff0000, 0x0000ffff0000ffff, | 5042 0x0000ffffffff0000, 0x0000ffff0000ffff, 0x00007fffffffffff, |
| 5043 0x7fffffffffffffff, 0x000000007fffffff, 0x00007fff7fffffff, |
5043 }; | 5044 }; |
5044 | 5045 |
5045 size_t nr_test_cases = sizeof(inputs) / sizeof(inputs[0]); | 5046 size_t nr_test_cases = sizeof(inputs) / sizeof(inputs[0]); |
5046 for (size_t i = 0; i < nr_test_cases; ++i) { | 5047 for (size_t i = 0; i < nr_test_cases; ++i) { |
5047 uint64_t res = run_li_macro(inputs[i], OPTIMIZE_SIZE); | 5048 uint64_t res = run_li_macro(inputs[i], OPTIMIZE_SIZE); |
5048 CHECK_EQ(inputs[i], res); | 5049 CHECK_EQ(inputs[i], res); |
5049 res = run_li_macro(inputs[i], CONSTANT_SIZE); | 5050 res = run_li_macro(inputs[i], CONSTANT_SIZE); |
5050 CHECK_EQ(inputs[i], res); | 5051 CHECK_EQ(inputs[i], res); |
5051 if (is_int48(inputs[i])) { | 5052 if (is_int48(inputs[i])) { |
5052 res = run_li_macro(inputs[i], ADDRESS_LOAD); | 5053 res = run_li_macro(inputs[i], ADDRESS_LOAD); |
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5872 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 5873 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
5873 F2 f = FUNCTION_CAST<F2>(code->entry()); | 5874 F2 f = FUNCTION_CAST<F2>(code->entry()); |
5874 | 5875 |
5875 int64_t res = reinterpret_cast<int64_t>( | 5876 int64_t res = reinterpret_cast<int64_t>( |
5876 CALL_GENERATED_CODE(isolate, f, 42, 42, 0, 0, 0)); | 5877 CALL_GENERATED_CODE(isolate, f, 42, 42, 0, 0, 0)); |
5877 CHECK_EQ(res, 0); | 5878 CHECK_EQ(res, 0); |
5878 } | 5879 } |
5879 | 5880 |
5880 | 5881 |
5881 #undef __ | 5882 #undef __ |
OLD | NEW |