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 21589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
21600 // May waste some bits on 64-bit, to ensure consistency with non-Smi case. | 21600 // May waste some bits on 64-bit, to ensure consistency with non-Smi case. |
21601 return static_cast<uword>(Smi::Cast(hash_code).AsTruncatedUint32Value()); | 21601 return static_cast<uword>(Smi::Cast(hash_code).AsTruncatedUint32Value()); |
21602 } else if (hash_code.IsInteger()) { | 21602 } else if (hash_code.IsInteger()) { |
21603 return static_cast<uword>( | 21603 return static_cast<uword>( |
21604 Integer::Cast(hash_code).AsTruncatedUint32Value()); | 21604 Integer::Cast(hash_code).AsTruncatedUint32Value()); |
21605 } else { | 21605 } else { |
21606 return 0; | 21606 return 0; |
21607 } | 21607 } |
21608 } | 21608 } |
21609 }; | 21609 }; |
21610 typedef EnumIndexHashMap<DefaultHashTraits> EnumIndexDefaultMap; | |
21611 | 21610 |
21612 | 21611 |
21613 RawLinkedHashMap* LinkedHashMap::NewDefault(Heap::Space space) { | 21612 RawLinkedHashMap* LinkedHashMap::NewDefault(Heap::Space space) { |
21614 const Array& data = Array::Handle(Array::New(kInitialIndexSize, space)); | 21613 const Array& data = Array::Handle(Array::New(kInitialIndexSize, space)); |
21615 const TypedData& index = TypedData::Handle(TypedData::New( | 21614 const TypedData& index = TypedData::Handle(TypedData::New( |
21616 kTypedDataUint32ArrayCid, kInitialIndexSize, space)); | 21615 kTypedDataUint32ArrayCid, kInitialIndexSize, space)); |
21617 // On 32-bit, the top bits are wasted to avoid Mint allocation. | 21616 // On 32-bit, the top bits are wasted to avoid Mint allocation. |
21618 static const intptr_t kAvailableBits = (kSmiBits >= 32) ? 32 : kSmiBits; | 21617 static const intptr_t kAvailableBits = (kSmiBits >= 32) ? 32 : kSmiBits; |
21619 static const intptr_t kInitialHashMask = | 21618 static const intptr_t kInitialHashMask = |
21620 (1 << (kAvailableBits - kInitialIndexBits)) - 1; | 21619 (1 << (kAvailableBits - kInitialIndexBits)) - 1; |
(...skipping 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
22668 return UserTag::null(); | 22667 return UserTag::null(); |
22669 } | 22668 } |
22670 | 22669 |
22671 | 22670 |
22672 const char* UserTag::ToCString() const { | 22671 const char* UserTag::ToCString() const { |
22673 const String& tag_label = String::Handle(label()); | 22672 const String& tag_label = String::Handle(label()); |
22674 return tag_label.ToCString(); | 22673 return tag_label.ToCString(); |
22675 } | 22674 } |
22676 | 22675 |
22677 } // namespace dart | 22676 } // namespace dart |
OLD | NEW |