OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 "platform/assert.h" | 5 #include "platform/assert.h" |
6 | 6 |
7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
8 #include "vm/bootstrap_natives.h" | 8 #include "vm/bootstrap_natives.h" |
9 #include "vm/exceptions.h" | 9 #include "vm/exceptions.h" |
10 #include "vm/flags.h" | 10 #include "vm/flags.h" |
11 #include "vm/native_entry.h" | 11 #include "vm/native_entry.h" |
12 #include "vm/object.h" | 12 #include "vm/object.h" |
13 | 13 |
14 namespace dart { | 14 namespace dart { |
15 | 15 |
16 DEFINE_FLAG(bool, use_internal_hash_map, false, "Use internal hash map."); | 16 DEFINE_FLAG(bool, use_internal_hash_map, false, "Use internal hash map."); |
| 17 DEFINE_FLAG(bool, use_compact_hash, false, "Use compact hash map and set."); |
17 | 18 |
18 DEFINE_NATIVE_ENTRY(LinkedHashMap_allocate, 1) { | 19 DEFINE_NATIVE_ENTRY(LinkedHashMap_allocate, 1) { |
19 const TypeArguments& type_arguments = | 20 const TypeArguments& type_arguments = |
20 TypeArguments::CheckedHandle(arguments->NativeArgAt(0)); | 21 TypeArguments::CheckedHandle(arguments->NativeArgAt(0)); |
21 const LinkedHashMap& map = | 22 const LinkedHashMap& map = |
22 LinkedHashMap::Handle(LinkedHashMap::New()); | 23 LinkedHashMap::Handle(LinkedHashMap::New()); |
23 map.SetTypeArguments(type_arguments); | 24 map.SetTypeArguments(type_arguments); |
24 return map.raw(); | 25 return map.raw(); |
25 } | 26 } |
26 | 27 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 84 |
84 DEFINE_NATIVE_ENTRY(LinkedHashMap_getModMark, 2) { | 85 DEFINE_NATIVE_ENTRY(LinkedHashMap_getModMark, 2) { |
85 const LinkedHashMap& map = | 86 const LinkedHashMap& map = |
86 LinkedHashMap::CheckedHandle(arguments->NativeArgAt(0)); | 87 LinkedHashMap::CheckedHandle(arguments->NativeArgAt(0)); |
87 GET_NON_NULL_NATIVE_ARGUMENT(Bool, create, arguments->NativeArgAt(1)); | 88 GET_NON_NULL_NATIVE_ARGUMENT(Bool, create, arguments->NativeArgAt(1)); |
88 return map.GetModificationMark(create.value()); | 89 return map.GetModificationMark(create.value()); |
89 } | 90 } |
90 | 91 |
91 | 92 |
92 DEFINE_NATIVE_ENTRY(LinkedHashMap_useInternal, 0) { | 93 DEFINE_NATIVE_ENTRY(LinkedHashMap_useInternal, 0) { |
| 94 ASSERT(!(FLAG_use_internal_hash_map && FLAG_use_compact_hash)); |
93 return Bool::Get(FLAG_use_internal_hash_map).raw(); | 95 return Bool::Get(FLAG_use_internal_hash_map).raw(); |
94 } | 96 } |
95 | 97 |
| 98 |
| 99 DEFINE_NATIVE_ENTRY(LinkedHashMap_useCompact, 0) { |
| 100 ASSERT(!(FLAG_use_internal_hash_map && FLAG_use_compact_hash)); |
| 101 return Bool::Get(FLAG_use_compact_hash).raw(); |
| 102 } |
| 103 |
96 } // namespace dart | 104 } // namespace dart |
OLD | NEW |