| 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/runtime_entry.h" | 9 #include "vm/runtime_entry.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 saved_libraries_(GrowableObjectArray::null()), | 466 saved_libraries_(GrowableObjectArray::null()), |
| 467 root_url_prefix_(String::null()), | 467 root_url_prefix_(String::null()), |
| 468 old_root_url_prefix_(String::null()) { | 468 old_root_url_prefix_(String::null()) { |
| 469 // NOTE: DO NOT ALLOCATE ANY RAW OBJECTS HERE. The IsolateReloadContext is not | 469 // NOTE: DO NOT ALLOCATE ANY RAW OBJECTS HERE. The IsolateReloadContext is not |
| 470 // associated with the isolate yet and if a GC is triggered here the raw | 470 // associated with the isolate yet and if a GC is triggered here the raw |
| 471 // objects will not be properly accounted for. | 471 // objects will not be properly accounted for. |
| 472 ASSERT(zone_ != NULL); | 472 ASSERT(zone_ != NULL); |
| 473 } | 473 } |
| 474 | 474 |
| 475 | 475 |
| 476 IsolateReloadContext::~IsolateReloadContext() {} | 476 IsolateReloadContext::~IsolateReloadContext() { |
| 477 ASSERT(saved_class_table_ == NULL); |
| 478 } |
| 477 | 479 |
| 478 | 480 |
| 479 void IsolateReloadContext::ReportError(const Error& error) { | 481 void IsolateReloadContext::ReportError(const Error& error) { |
| 480 if (FLAG_trace_reload) { | 482 if (FLAG_trace_reload) { |
| 481 THR_Print("ISO-RELOAD: Error: %s\n", error.ToErrorCString()); | 483 THR_Print("ISO-RELOAD: Error: %s\n", error.ToErrorCString()); |
| 482 } | 484 } |
| 483 ServiceEvent service_event(I, ServiceEvent::kIsolateReload); | 485 ServiceEvent service_event(I, ServiceEvent::kIsolateReload); |
| 484 service_event.set_reload_error(&error); | 486 service_event.set_reload_error(&error); |
| 485 Service::HandleEvent(&service_event); | 487 Service::HandleEvent(&service_event); |
| 486 } | 488 } |
| (...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1142 TIMELINE_SCOPE(Commit); | 1144 TIMELINE_SCOPE(Commit); |
| 1143 TIR_Print("---- COMMITTING RELOAD\n"); | 1145 TIR_Print("---- COMMITTING RELOAD\n"); |
| 1144 | 1146 |
| 1145 // Note that the object heap contains before and after instances | 1147 // Note that the object heap contains before and after instances |
| 1146 // used for morphing. It is therefore important that morphing takes | 1148 // used for morphing. It is therefore important that morphing takes |
| 1147 // place prior to any heap walking. | 1149 // place prior to any heap walking. |
| 1148 // So please keep this code at the top of Commit(). | 1150 // So please keep this code at the top of Commit(). |
| 1149 if (HasInstanceMorphers()) { | 1151 if (HasInstanceMorphers()) { |
| 1150 // Perform shape shifting of instances if necessary. | 1152 // Perform shape shifting of instances if necessary. |
| 1151 MorphInstances(); | 1153 MorphInstances(); |
| 1154 } else { |
| 1155 free(saved_class_table_); |
| 1156 saved_class_table_ = NULL; |
| 1152 } | 1157 } |
| 1153 | 1158 |
| 1154 #ifdef DEBUG | 1159 #ifdef DEBUG |
| 1155 VerifyMaps(); | 1160 VerifyMaps(); |
| 1156 #endif | 1161 #endif |
| 1157 | 1162 |
| 1158 { | 1163 { |
| 1159 TIMELINE_SCOPE(CopyStaticFieldsAndPatchFieldsAndFunctions); | 1164 TIMELINE_SCOPE(CopyStaticFieldsAndPatchFieldsAndFunctions); |
| 1160 // Copy static field values from the old classes to the new classes. | 1165 // Copy static field values from the old classes to the new classes. |
| 1161 // Patch fields and functions in the old classes so that they retain | 1166 // Patch fields and functions in the old classes so that they retain |
| (...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1898 ASSERT(!super_cls.IsNull()); | 1903 ASSERT(!super_cls.IsNull()); |
| 1899 super_cls.AddDirectSubclass(cls); | 1904 super_cls.AddDirectSubclass(cls); |
| 1900 } | 1905 } |
| 1901 } | 1906 } |
| 1902 } | 1907 } |
| 1903 } | 1908 } |
| 1904 | 1909 |
| 1905 #endif // !PRODUCT | 1910 #endif // !PRODUCT |
| 1906 | 1911 |
| 1907 } // namespace dart | 1912 } // namespace dart |
| OLD | NEW |