| 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_NATIVE_ENTRY(LinkedHashMap_allocate, 1) { | |
| 17 const TypeArguments& type_arguments = | |
| 18 TypeArguments::CheckedHandle(arguments->NativeArgAt(0)); | |
| 19 const LinkedHashMap& map = | |
| 20 LinkedHashMap::Handle(LinkedHashMap::NewDefault()); | |
| 21 map.SetTypeArguments(type_arguments); | |
| 22 return map.raw(); | |
| 23 } | |
| 24 | |
| 25 | |
| 26 DEFINE_NATIVE_ENTRY(LinkedHashMap_getIndex, 1) { | 16 DEFINE_NATIVE_ENTRY(LinkedHashMap_getIndex, 1) { |
| 27 const LinkedHashMap& map = | 17 const LinkedHashMap& map = |
| 28 LinkedHashMap::CheckedHandle(arguments->NativeArgAt(0)); | 18 LinkedHashMap::CheckedHandle(arguments->NativeArgAt(0)); |
| 29 return map.index(); | 19 return map.index(); |
| 30 } | 20 } |
| 31 | 21 |
| 32 | 22 |
| 33 DEFINE_NATIVE_ENTRY(LinkedHashMap_setIndex, 2) { | 23 DEFINE_NATIVE_ENTRY(LinkedHashMap_setIndex, 2) { |
| 34 const LinkedHashMap& map = | 24 const LinkedHashMap& map = |
| 35 LinkedHashMap::CheckedHandle(arguments->NativeArgAt(0)); | 25 LinkedHashMap::CheckedHandle(arguments->NativeArgAt(0)); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 DEFINE_NATIVE_ENTRY(LinkedHashMap_setUsedData, 2) { | 91 DEFINE_NATIVE_ENTRY(LinkedHashMap_setUsedData, 2) { |
| 102 const LinkedHashMap& map = | 92 const LinkedHashMap& map = |
| 103 LinkedHashMap::CheckedHandle(arguments->NativeArgAt(0)); | 93 LinkedHashMap::CheckedHandle(arguments->NativeArgAt(0)); |
| 104 const Smi& usedData = | 94 const Smi& usedData = |
| 105 Smi::CheckedHandle(arguments->NativeArgAt(1)); | 95 Smi::CheckedHandle(arguments->NativeArgAt(1)); |
| 106 map.SetUsedData(usedData.Value()); | 96 map.SetUsedData(usedData.Value()); |
| 107 return Object::null(); | 97 return Object::null(); |
| 108 } | 98 } |
| 109 | 99 |
| 110 } // namespace dart | 100 } // namespace dart |
| OLD | NEW |