| 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/become.h" | 10 #include "vm/become.h" |
| (...skipping 10305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10316 | 10316 |
| 10317 | 10317 |
| 10318 static RawArray* NewDictionary(intptr_t initial_size) { | 10318 static RawArray* NewDictionary(intptr_t initial_size) { |
| 10319 const Array& dict = Array::Handle(Array::New(initial_size + 1, Heap::kOld)); | 10319 const Array& dict = Array::Handle(Array::New(initial_size + 1, Heap::kOld)); |
| 10320 // The last element of the dictionary specifies the number of in use slots. | 10320 // The last element of the dictionary specifies the number of in use slots. |
| 10321 dict.SetAt(initial_size, Smi::Handle(Smi::New(0))); | 10321 dict.SetAt(initial_size, Smi::Handle(Smi::New(0))); |
| 10322 return dict.raw(); | 10322 return dict.raw(); |
| 10323 } | 10323 } |
| 10324 | 10324 |
| 10325 | 10325 |
| 10326 void Library::InitResolvedNamesCache(intptr_t size, | 10326 void Library::InitResolvedNamesCache(intptr_t size) const { |
| 10327 SnapshotReader* reader) const { | |
| 10328 ASSERT(Thread::Current()->IsMutatorThread()); | 10327 ASSERT(Thread::Current()->IsMutatorThread()); |
| 10329 if (reader == NULL) { | 10328 StorePointer(&raw_ptr()->resolved_names_, |
| 10330 StorePointer(&raw_ptr()->resolved_names_, | 10329 HashTables::New<ResolvedNamesMap>(size)); |
| 10331 HashTables::New<ResolvedNamesMap>(size)); | |
| 10332 } else { | |
| 10333 intptr_t len = ResolvedNamesMap::ArrayLengthForNumOccupied(size); | |
| 10334 *reader->ArrayHandle() ^= reader->NewArray(len); | |
| 10335 StorePointer(&raw_ptr()->resolved_names_, | |
| 10336 HashTables::New<ResolvedNamesMap>(*reader->ArrayHandle())); | |
| 10337 } | |
| 10338 } | 10330 } |
| 10339 | 10331 |
| 10340 | 10332 |
| 10341 void Library::AllocateExportedNamesCache() const { | 10333 void Library::AllocateExportedNamesCache() const { |
| 10342 StorePointer(&raw_ptr()->exported_names_, | 10334 StorePointer(&raw_ptr()->exported_names_, |
| 10343 HashTables::New<ResolvedNamesMap>(16)); | 10335 HashTables::New<ResolvedNamesMap>(16)); |
| 10344 } | 10336 } |
| 10345 | 10337 |
| 10346 | 10338 |
| 10347 void Library::InitExportedNamesCache() const { | 10339 void Library::InitExportedNamesCache() const { |
| (...skipping 12263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 22611 return UserTag::null(); | 22603 return UserTag::null(); |
| 22612 } | 22604 } |
| 22613 | 22605 |
| 22614 | 22606 |
| 22615 const char* UserTag::ToCString() const { | 22607 const char* UserTag::ToCString() const { |
| 22616 const String& tag_label = String::Handle(label()); | 22608 const String& tag_label = String::Handle(label()); |
| 22617 return tag_label.ToCString(); | 22609 return tag_label.ToCString(); |
| 22618 } | 22610 } |
| 22619 | 22611 |
| 22620 } // namespace dart | 22612 } // namespace dart |
| OLD | NEW |