Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(286)

Side by Side Diff: runtime/vm/object.cc

Issue 2068813002: Ensure the url provided to a library has a computed hash code (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« runtime/vm/isolate_reload.cc ('K') | « runtime/vm/isolate_reload.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 10346 matching lines...) Expand 10 before | Expand all | Expand 10 after
10357 Heap::kOld); 10357 Heap::kOld);
10358 return reinterpret_cast<RawLibrary*>(raw); 10358 return reinterpret_cast<RawLibrary*>(raw);
10359 } 10359 }
10360 10360
10361 10361
10362 RawLibrary* Library::NewLibraryHelper(const String& url, 10362 RawLibrary* Library::NewLibraryHelper(const String& url,
10363 bool import_core_lib) { 10363 bool import_core_lib) {
10364 Thread* thread = Thread::Current(); 10364 Thread* thread = Thread::Current();
10365 Zone* zone = thread->zone(); 10365 Zone* zone = thread->zone();
10366 ASSERT(thread->IsMutatorThread()); 10366 ASSERT(thread->IsMutatorThread());
10367 // Force the url to have a hash code.
10368 url.Hash();
10367 const Library& result = Library::Handle(zone, Library::New()); 10369 const Library& result = Library::Handle(zone, Library::New());
10368 result.StorePointer(&result.raw_ptr()->name_, Symbols::Empty().raw()); 10370 result.StorePointer(&result.raw_ptr()->name_, Symbols::Empty().raw());
10369 result.StorePointer(&result.raw_ptr()->url_, url.raw()); 10371 result.StorePointer(&result.raw_ptr()->url_, url.raw());
10370 result.StorePointer(&result.raw_ptr()->resolved_names_, 10372 result.StorePointer(&result.raw_ptr()->resolved_names_,
10371 Object::empty_array().raw()); 10373 Object::empty_array().raw());
10372 result.StorePointer(&result.raw_ptr()->exported_names_, 10374 result.StorePointer(&result.raw_ptr()->exported_names_,
10373 Array::null()); 10375 Array::null());
10374 result.StorePointer(&result.raw_ptr()->dictionary_, 10376 result.StorePointer(&result.raw_ptr()->dictionary_,
10375 Object::empty_array().raw()); 10377 Object::empty_array().raw());
10376 result.StorePointer(&result.raw_ptr()->metadata_, 10378 result.StorePointer(&result.raw_ptr()->metadata_,
(...skipping 12289 matching lines...) Expand 10 before | Expand all | Expand 10 after
22666 return UserTag::null(); 22668 return UserTag::null();
22667 } 22669 }
22668 22670
22669 22671
22670 const char* UserTag::ToCString() const { 22672 const char* UserTag::ToCString() const {
22671 const String& tag_label = String::Handle(label()); 22673 const String& tag_label = String::Handle(label());
22672 return tag_label.ToCString(); 22674 return tag_label.ToCString();
22673 } 22675 }
22674 22676
22675 } // namespace dart 22677 } // namespace dart
OLDNEW
« runtime/vm/isolate_reload.cc ('K') | « runtime/vm/isolate_reload.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698