Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1633)

Side by Side Diff: runtime/vm/object.cc

Issue 2083103002: Remove some uses of STL map. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/hash_table_test.cc ('k') | runtime/vm/precompiler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « runtime/vm/hash_table_test.cc ('k') | runtime/vm/precompiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698