| 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 DEFINE_FLAG(bool, use_compact_hash, true, "Use compact hash map and set."); |
| 18 | 18 |
| 19 DEFINE_NATIVE_ENTRY(LinkedHashMap_allocate, 1) { | 19 DEFINE_NATIVE_ENTRY(LinkedHashMap_allocate, 1) { |
| 20 const TypeArguments& type_arguments = | 20 const TypeArguments& type_arguments = |
| 21 TypeArguments::CheckedHandle(arguments->NativeArgAt(0)); | 21 TypeArguments::CheckedHandle(arguments->NativeArgAt(0)); |
| 22 const LinkedHashMap& map = | 22 const LinkedHashMap& map = |
| 23 LinkedHashMap::Handle(LinkedHashMap::New()); | 23 LinkedHashMap::Handle(LinkedHashMap::New()); |
| 24 map.SetTypeArguments(type_arguments); | 24 map.SetTypeArguments(type_arguments); |
| 25 return map.raw(); | 25 return map.raw(); |
| 26 } | 26 } |
| 27 | 27 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 return Bool::Get(FLAG_use_internal_hash_map).raw(); | 95 return Bool::Get(FLAG_use_internal_hash_map).raw(); |
| 96 } | 96 } |
| 97 | 97 |
| 98 | 98 |
| 99 DEFINE_NATIVE_ENTRY(LinkedHashMap_useCompact, 0) { | 99 DEFINE_NATIVE_ENTRY(LinkedHashMap_useCompact, 0) { |
| 100 ASSERT(!(FLAG_use_internal_hash_map && FLAG_use_compact_hash)); | 100 ASSERT(!(FLAG_use_internal_hash_map && FLAG_use_compact_hash)); |
| 101 return Bool::Get(FLAG_use_compact_hash).raw(); | 101 return Bool::Get(FLAG_use_compact_hash).raw(); |
| 102 } | 102 } |
| 103 | 103 |
| 104 } // namespace dart | 104 } // namespace dart |
| OLD | NEW |