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 11006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11017 } | 11017 } |
11018 | 11018 |
11019 // Create a private key for this library. It is based on the hash of the | 11019 // Create a private key for this library. It is based on the hash of the |
11020 // library URI and the sequence number of the library to guarantee unique | 11020 // library URI and the sequence number of the library to guarantee unique |
11021 // private keys without having to verify. | 11021 // private keys without having to verify. |
11022 void Library::AllocatePrivateKey() const { | 11022 void Library::AllocatePrivateKey() const { |
11023 Thread* thread = Thread::Current(); | 11023 Thread* thread = Thread::Current(); |
11024 Zone* zone = thread->zone(); | 11024 Zone* zone = thread->zone(); |
11025 Isolate* isolate = thread->isolate(); | 11025 Isolate* isolate = thread->isolate(); |
11026 | 11026 |
11027 #if !defined(PRODUCT) | 11027 #if !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME) |
11028 if (FLAG_support_reload && isolate->IsReloading()) { | 11028 if (FLAG_support_reload && isolate->IsReloading()) { |
11029 // When reloading, we need to make sure we use the original private key | 11029 // When reloading, we need to make sure we use the original private key |
11030 // if this library previously existed. | 11030 // if this library previously existed. |
11031 IsolateReloadContext* reload_context = isolate->reload_context(); | 11031 IsolateReloadContext* reload_context = isolate->reload_context(); |
11032 const String& original_key = | 11032 const String& original_key = |
11033 String::Handle(reload_context->FindLibraryPrivateKey(*this)); | 11033 String::Handle(reload_context->FindLibraryPrivateKey(*this)); |
11034 if (!original_key.IsNull()) { | 11034 if (!original_key.IsNull()) { |
11035 StorePointer(&raw_ptr()->private_key_, original_key.raw()); | 11035 StorePointer(&raw_ptr()->private_key_, original_key.raw()); |
11036 return; | 11036 return; |
11037 } | 11037 } |
11038 } | 11038 } |
11039 #endif // !defined(PRODUCT) | 11039 #endif // !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME) |
11040 | 11040 |
11041 // Format of the private key is: "@<sequence number><6 digits of hash> | 11041 // Format of the private key is: "@<sequence number><6 digits of hash> |
11042 const intptr_t hash_mask = 0x7FFFF; | 11042 const intptr_t hash_mask = 0x7FFFF; |
11043 | 11043 |
11044 const String& url = String::Handle(zone, this->url()); | 11044 const String& url = String::Handle(zone, this->url()); |
11045 intptr_t hash_value = url.Hash() & hash_mask; | 11045 intptr_t hash_value = url.Hash() & hash_mask; |
11046 | 11046 |
11047 const GrowableObjectArray& libs = | 11047 const GrowableObjectArray& libs = |
11048 GrowableObjectArray::Handle(zone, isolate->object_store()->libraries()); | 11048 GrowableObjectArray::Handle(zone, isolate->object_store()->libraries()); |
11049 intptr_t sequence_value = libs.Length(); | 11049 intptr_t sequence_value = libs.Length(); |
(...skipping 11389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
22439 } | 22439 } |
22440 return UserTag::null(); | 22440 return UserTag::null(); |
22441 } | 22441 } |
22442 | 22442 |
22443 const char* UserTag::ToCString() const { | 22443 const char* UserTag::ToCString() const { |
22444 const String& tag_label = String::Handle(label()); | 22444 const String& tag_label = String::Handle(label()); |
22445 return tag_label.ToCString(); | 22445 return tag_label.ToCString(); |
22446 } | 22446 } |
22447 | 22447 |
22448 } // namespace dart | 22448 } // namespace dart |
OLD | NEW |