| OLD | NEW |
| 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/bit_vector.h" | 8 #include "vm/bit_vector.h" |
| 9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 jsobj.AddProperty("type", "ReasonForCancelling"); | 222 jsobj.AddProperty("type", "ReasonForCancelling"); |
| 223 jsobj.AddProperty("class", from_); | 223 jsobj.AddProperty("class", from_); |
| 224 const String& message = String::Handle(ToString()); | 224 const String& message = String::Handle(ToString()); |
| 225 jsobj.AddProperty("message", message.ToCString()); | 225 jsobj.AddProperty("message", message.ToCString()); |
| 226 } | 226 } |
| 227 | 227 |
| 228 | 228 |
| 229 RawError* IsolateReloadContext::error() const { | 229 RawError* IsolateReloadContext::error() const { |
| 230 ASSERT(reload_aborted()); | 230 ASSERT(reload_aborted()); |
| 231 // Report the first error to the surroundings. | 231 // Report the first error to the surroundings. |
| 232 const Error& error = | 232 return reasons_to_cancel_reload_.At(0)->ToError(); |
| 233 Error::Handle(reasons_to_cancel_reload_.At(0)->ToError()); | |
| 234 return error.raw(); | |
| 235 } | 233 } |
| 236 | 234 |
| 237 | 235 |
| 238 class ScriptUrlSetTraits { | 236 class ScriptUrlSetTraits { |
| 239 public: | 237 public: |
| 240 static bool ReportStats() { return false; } | 238 static bool ReportStats() { return false; } |
| 241 static const char* Name() { return "ScriptUrlSetTraits"; } | 239 static const char* Name() { return "ScriptUrlSetTraits"; } |
| 242 | 240 |
| 243 static bool IsMatch(const Object& a, const Object& b) { | 241 static bool IsMatch(const Object& a, const Object& b) { |
| 244 if (!a.IsString() || !b.IsString()) { | 242 if (!a.IsString() || !b.IsString()) { |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 | 336 |
| 339 bool IsolateReloadContext::IsSameClass(const Class& a, const Class& b) { | 337 bool IsolateReloadContext::IsSameClass(const Class& a, const Class& b) { |
| 340 if (a.is_patch() != b.is_patch()) { | 338 if (a.is_patch() != b.is_patch()) { |
| 341 // TODO(johnmccutchan): Should we just check the class kind bits? | 339 // TODO(johnmccutchan): Should we just check the class kind bits? |
| 342 return false; | 340 return false; |
| 343 } | 341 } |
| 344 | 342 |
| 345 // TODO(turnidge): We need to look at generic type arguments for | 343 // TODO(turnidge): We need to look at generic type arguments for |
| 346 // synthetic mixin classes. Their names are not necessarily unique | 344 // synthetic mixin classes. Their names are not necessarily unique |
| 347 // currently. | 345 // currently. |
| 348 const String& a_name = String::Handle(Class::Cast(a).Name()); | 346 const String& a_name = String::Handle(a.Name()); |
| 349 const String& b_name = String::Handle(Class::Cast(b).Name()); | 347 const String& b_name = String::Handle(b.Name()); |
| 350 | 348 |
| 351 if (!a_name.Equals(b_name)) { | 349 if (!a_name.Equals(b_name)) { |
| 352 return false; | 350 return false; |
| 353 } | 351 } |
| 354 | 352 |
| 355 const Library& a_lib = Library::Handle(Class::Cast(a).library()); | 353 const Library& a_lib = Library::Handle(a.library()); |
| 356 const Library& b_lib = Library::Handle(Class::Cast(b).library()); | 354 const Library& b_lib = Library::Handle(b.library()); |
| 357 return IsSameLibrary(a_lib, b_lib); | 355 return IsSameLibrary(a_lib, b_lib); |
| 358 } | 356 } |
| 359 | 357 |
| 360 | 358 |
| 361 bool IsolateReloadContext::IsSameLibrary( | 359 bool IsolateReloadContext::IsSameLibrary( |
| 362 const Library& a_lib, const Library& b_lib) { | 360 const Library& a_lib, const Library& b_lib) { |
| 363 const String& a_lib_url = | 361 const String& a_lib_url = |
| 364 String::Handle(a_lib.IsNull() ? String::null() : a_lib.url()); | 362 String::Handle(a_lib.IsNull() ? String::null() : a_lib.url()); |
| 365 const String& b_lib_url = | 363 const String& b_lib_url = |
| 366 String::Handle(b_lib.IsNull() ? String::null() : b_lib.url()); | 364 String::Handle(b_lib.IsNull() ? String::null() : b_lib.url()); |
| (...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1679 ASSERT(!super_cls.IsNull()); | 1677 ASSERT(!super_cls.IsNull()); |
| 1680 super_cls.AddDirectSubclass(cls); | 1678 super_cls.AddDirectSubclass(cls); |
| 1681 } | 1679 } |
| 1682 } | 1680 } |
| 1683 } | 1681 } |
| 1684 } | 1682 } |
| 1685 | 1683 |
| 1686 #endif // !PRODUCT | 1684 #endif // !PRODUCT |
| 1687 | 1685 |
| 1688 } // namespace dart | 1686 } // namespace dart |
| OLD | NEW |