| 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 #include "src/asmjs/asm-types.h" | 5 #include "src/asmjs/asm-types.h" |
| 6 | 6 |
| 7 #include <unordered_map> | 7 #include <unordered_map> |
| 8 #include <unordered_set> | 8 #include <unordered_set> |
| 9 | 9 |
| 10 #include "src/base/macros.h" | 10 #include "src/base/macros.h" |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 for (size_t jj = 0; jj < arraysize(test_types); ++jj) { | 259 for (size_t jj = 0; jj < arraysize(test_types); ++jj) { |
| 260 EXPECT_EQ(ii == jj, test_types[ii]->IsExactly(test_types[jj])) | 260 EXPECT_EQ(ii == jj, test_types[ii]->IsExactly(test_types[jj])) |
| 261 << test_types[ii]->Name() | 261 << test_types[ii]->Name() |
| 262 << ((ii == jj) ? " is not exactly " : " is exactly ") | 262 << ((ii == jj) ? " is not exactly " : " is exactly ") |
| 263 << test_types[jj]->Name(); | 263 << test_types[jj]->Name(); |
| 264 } | 264 } |
| 265 } | 265 } |
| 266 } | 266 } |
| 267 | 267 |
| 268 bool FunctionsWithSameSignature(AsmType* a, AsmType* b) { | 268 bool FunctionsWithSameSignature(AsmType* a, AsmType* b) { |
| 269 if (auto* func_a = a->AsFunctionType()) { | 269 if (a->AsFunctionType()) { |
| 270 if (auto* func_b = b->AsFunctionType()) { | 270 if (b->AsFunctionType()) { |
| 271 return a->IsA(b); | 271 return a->IsA(b); |
| 272 } | 272 } |
| 273 } | 273 } |
| 274 return false; | 274 return false; |
| 275 } | 275 } |
| 276 | 276 |
| 277 TEST_F(AsmTypeTest, IsA) { | 277 TEST_F(AsmTypeTest, IsA) { |
| 278 Type* test_types[] = { | 278 Type* test_types[] = { |
| 279 #define CREATE(CamelName, string_name, number, parent_types) Type::CamelName(), | 279 #define CREATE(CamelName, string_name, number, parent_types) Type::CamelName(), |
| 280 FOR_EACH_ASM_VALUE_TYPE_LIST(CREATE) | 280 FOR_EACH_ASM_VALUE_TYPE_LIST(CREATE) |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 714 for (size_t ii = 0; ii < arraysize(test_types); ++ii) { | 714 for (size_t ii = 0; ii < arraysize(test_types); ++ii) { |
| 715 EXPECT_EQ(StoreTypeForType(test_types[ii]), test_types[ii]->StoreType()) | 715 EXPECT_EQ(StoreTypeForType(test_types[ii]), test_types[ii]->StoreType()) |
| 716 << test_types[ii]->Name(); | 716 << test_types[ii]->Name(); |
| 717 } | 717 } |
| 718 } | 718 } |
| 719 | 719 |
| 720 } // namespace | 720 } // namespace |
| 721 } // namespace wasm | 721 } // namespace wasm |
| 722 } // namespace internal | 722 } // namespace internal |
| 723 } // namespace v8 | 723 } // namespace v8 |
| OLD | NEW |