OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/object.h" | 5 #include "vm/object.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
10 #include "vm/become.h" | 10 #include "vm/become.h" |
(...skipping 4536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4547 hash += hash << 10; | 4547 hash += hash << 10; |
4548 hash ^= hash >> 6; // Logical shift, unsigned hash. | 4548 hash ^= hash >> 6; // Logical shift, unsigned hash. |
4549 return hash; | 4549 return hash; |
4550 } | 4550 } |
4551 | 4551 |
4552 | 4552 |
4553 static uint32_t FinalizeHash(uint32_t hash, intptr_t hashbits) { | 4553 static uint32_t FinalizeHash(uint32_t hash, intptr_t hashbits) { |
4554 hash += hash << 3; | 4554 hash += hash << 3; |
4555 hash ^= hash >> 11; // Logical shift, unsigned hash. | 4555 hash ^= hash >> 11; // Logical shift, unsigned hash. |
4556 hash += hash << 15; | 4556 hash += hash << 15; |
4557 hash &= ((static_cast<intptr_t>(1) << hashbits) - 1); | 4557 hash &= ((static_cast<uintptr_t>(1) << hashbits) - 1); |
4558 return (hash == 0) ? 1 : hash; | 4558 return (hash == 0) ? 1 : hash; |
4559 } | 4559 } |
4560 | 4560 |
4561 | 4561 |
4562 intptr_t TypeArguments::ComputeHash() const { | 4562 intptr_t TypeArguments::ComputeHash() const { |
4563 if (IsNull()) return 0; | 4563 if (IsNull()) return 0; |
4564 const intptr_t num_types = Length(); | 4564 const intptr_t num_types = Length(); |
4565 if (IsRaw(0, num_types)) return 0; | 4565 if (IsRaw(0, num_types)) return 0; |
4566 uint32_t result = 0; | 4566 uint32_t result = 0; |
4567 AbstractType& type = AbstractType::Handle(); | 4567 AbstractType& type = AbstractType::Handle(); |
(...skipping 18213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
22781 return UserTag::null(); | 22781 return UserTag::null(); |
22782 } | 22782 } |
22783 | 22783 |
22784 | 22784 |
22785 const char* UserTag::ToCString() const { | 22785 const char* UserTag::ToCString() const { |
22786 const String& tag_label = String::Handle(label()); | 22786 const String& tag_label = String::Handle(label()); |
22787 return tag_label.ToCString(); | 22787 return tag_label.ToCString(); |
22788 } | 22788 } |
22789 | 22789 |
22790 } // namespace dart | 22790 } // namespace dart |
OLD | NEW |