| 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/cpu.h" | 10 #include "vm/cpu.h" |
| (...skipping 2085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2096 return name.Hash(); | 2096 return name.Hash(); |
| 2097 } | 2097 } |
| 2098 }; | 2098 }; |
| 2099 typedef UnorderedHashSet<ClassFunctionsTraits> ClassFunctionsSet; | 2099 typedef UnorderedHashSet<ClassFunctionsTraits> ClassFunctionsSet; |
| 2100 | 2100 |
| 2101 | 2101 |
| 2102 void Class::SetFunctions(const Array& value) const { | 2102 void Class::SetFunctions(const Array& value) const { |
| 2103 ASSERT(!value.IsNull()); | 2103 ASSERT(!value.IsNull()); |
| 2104 StorePointer(&raw_ptr()->functions_, value.raw()); | 2104 StorePointer(&raw_ptr()->functions_, value.raw()); |
| 2105 const intptr_t len = value.Length(); | 2105 const intptr_t len = value.Length(); |
| 2106 ClassFunctionsSet set(HashTables::New<ClassFunctionsSet>(len)); | 2106 ClassFunctionsSet set(HashTables::New<ClassFunctionsSet>(len, Heap::kOld)); |
| 2107 if (len >= kFunctionLookupHashTreshold) { | 2107 if (len >= kFunctionLookupHashTreshold) { |
| 2108 Function& func = Function::Handle(); | 2108 Function& func = Function::Handle(); |
| 2109 for (intptr_t i = 0; i < len; ++i) { | 2109 for (intptr_t i = 0; i < len; ++i) { |
| 2110 func ^= value.At(i); | 2110 func ^= value.At(i); |
| 2111 // Verify that all the functions in the array have this class as owner. | 2111 // Verify that all the functions in the array have this class as owner. |
| 2112 ASSERT(func.Owner() == raw()); | 2112 ASSERT(func.Owner() == raw()); |
| 2113 set.Insert(func); | 2113 set.Insert(func); |
| 2114 } | 2114 } |
| 2115 } | 2115 } |
| 2116 StorePointer(&raw_ptr()->functions_hash_table_, set.Release().raw()); | 2116 StorePointer(&raw_ptr()->functions_hash_table_, set.Release().raw()); |
| (...skipping 19373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 21490 return tag_label.ToCString(); | 21490 return tag_label.ToCString(); |
| 21491 } | 21491 } |
| 21492 | 21492 |
| 21493 | 21493 |
| 21494 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 21494 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
| 21495 Instance::PrintJSONImpl(stream, ref); | 21495 Instance::PrintJSONImpl(stream, ref); |
| 21496 } | 21496 } |
| 21497 | 21497 |
| 21498 | 21498 |
| 21499 } // namespace dart | 21499 } // namespace dart |
| OLD | NEW |