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

Side by Side Diff: runtime/vm/isolate_reload.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
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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/isolate_reload.h" 5 #include "vm/isolate_reload.h"
6 6
7 #include "vm/become.h" 7 #include "vm/become.h"
8 #include "vm/code_generator.h" 8 #include "vm/code_generator.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/dart_api_impl.h" 10 #include "vm/dart_api_impl.h"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 return IsSameLibrary(a_lib, b_lib); 159 return IsSameLibrary(a_lib, b_lib);
160 } 160 }
161 161
162 162
163 bool IsolateReloadContext::IsSameLibrary( 163 bool IsolateReloadContext::IsSameLibrary(
164 const Library& a_lib, const Library& b_lib) { 164 const Library& a_lib, const Library& b_lib) {
165 const String& a_lib_url = 165 const String& a_lib_url =
166 String::Handle(a_lib.IsNull() ? String::null() : a_lib.url()); 166 String::Handle(a_lib.IsNull() ? String::null() : a_lib.url());
167 const String& b_lib_url = 167 const String& b_lib_url =
168 String::Handle(b_lib.IsNull() ? String::null() : b_lib.url()); 168 String::Handle(b_lib.IsNull() ? String::null() : b_lib.url());
169
siva 2016/06/14 21:00:43 blank line?
Cutch 2016/06/14 21:27:49 Done.
169 return a_lib_url.Equals(b_lib_url); 170 return a_lib_url.Equals(b_lib_url);
170 } 171 }
171 172
172 173
173 IsolateReloadContext::IsolateReloadContext(Isolate* isolate, bool test_mode) 174 IsolateReloadContext::IsolateReloadContext(Isolate* isolate, bool test_mode)
174 : start_time_micros_(OS::GetCurrentMonotonicMicros()), 175 : start_time_micros_(OS::GetCurrentMonotonicMicros()),
175 isolate_(isolate), 176 isolate_(isolate),
176 test_mode_(test_mode), 177 test_mode_(test_mode),
177 has_error_(false), 178 has_error_(false),
178 saved_num_cids_(-1), 179 saved_num_cids_(-1),
(...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after
1043 return old.private_key(); 1044 return old.private_key();
1044 } 1045 }
1045 1046
1046 1047
1047 RawLibrary* IsolateReloadContext::OldLibraryOrNull( 1048 RawLibrary* IsolateReloadContext::OldLibraryOrNull(
1048 const Library& replacement_or_new) { 1049 const Library& replacement_or_new) {
1049 UnorderedHashSet<LibraryMapTraits> 1050 UnorderedHashSet<LibraryMapTraits>
1050 old_libraries_set(old_libraries_set_storage_); 1051 old_libraries_set(old_libraries_set_storage_);
1051 Library& lib = Library::Handle(); 1052 Library& lib = Library::Handle();
1052 lib ^= old_libraries_set.GetOrNull(replacement_or_new); 1053 lib ^= old_libraries_set.GetOrNull(replacement_or_new);
1053 old_libraries_set_storage_ = old_libraries_set.Release().raw(); 1054 old_libraries_set.Release();
1054 return lib.raw(); 1055 return lib.raw();
1055 } 1056 }
1056 1057
1057 1058
1058 void IsolateReloadContext::BuildLibraryMapping() { 1059 void IsolateReloadContext::BuildLibraryMapping() {
1059 const GrowableObjectArray& libs = 1060 const GrowableObjectArray& libs =
1060 GrowableObjectArray::Handle(object_store()->libraries()); 1061 GrowableObjectArray::Handle(object_store()->libraries());
1061 1062
1062 Library& replacement_or_new = Library::Handle(); 1063 Library& replacement_or_new = Library::Handle();
1063 Library& old = Library::Handle(); 1064 Library& old = Library::Handle();
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
1156 ASSERT(!super_cls.IsNull()); 1157 ASSERT(!super_cls.IsNull());
1157 super_cls.AddDirectSubclass(cls); 1158 super_cls.AddDirectSubclass(cls);
1158 } 1159 }
1159 } 1160 }
1160 } 1161 }
1161 } 1162 }
1162 1163
1163 #endif // !PRODUCT 1164 #endif // !PRODUCT
1164 1165
1165 } // namespace dart 1166 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698