| 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/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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 | 250 |
| 251 // Ensure all functions on the stack have unoptimized code. | 251 // Ensure all functions on the stack have unoptimized code. |
| 252 EnsuredUnoptimizedCodeForStack(); | 252 EnsuredUnoptimizedCodeForStack(); |
| 253 // Deoptimize all code that had optimizing decisions that are dependent on | 253 // Deoptimize all code that had optimizing decisions that are dependent on |
| 254 // assumptions from field guards or CHA or deferred library prefixes. | 254 // assumptions from field guards or CHA or deferred library prefixes. |
| 255 // TODO(johnmccutchan): Deoptimizing dependent code here (before the reload) | 255 // TODO(johnmccutchan): Deoptimizing dependent code here (before the reload) |
| 256 // is paranoid. This likely can be moved to the commit phase. | 256 // is paranoid. This likely can be moved to the commit phase. |
| 257 DeoptimizeDependentCode(); | 257 DeoptimizeDependentCode(); |
| 258 Checkpoint(); | 258 Checkpoint(); |
| 259 | 259 |
| 260 // Block class finalization attempts when calling into the library | |
| 261 // tag handler. | |
| 262 I->BlockClassFinalization(); | |
| 263 Object& result = Object::Handle(thread->zone()); | 260 Object& result = Object::Handle(thread->zone()); |
| 264 { | 261 { |
| 265 TransitionVMToNative transition(thread); | 262 TransitionVMToNative transition(thread); |
| 266 Api::Scope api_scope(thread); | 263 Api::Scope api_scope(thread); |
| 267 | 264 |
| 268 Dart_Handle retval = | 265 Dart_Handle retval = |
| 269 (I->library_tag_handler())(Dart_kScriptTag, | 266 (I->library_tag_handler())(Dart_kScriptTag, |
| 270 Api::NewHandle(thread, Library::null()), | 267 Api::NewHandle(thread, Library::null()), |
| 271 Api::NewHandle(thread, root_lib_url.raw())); | 268 Api::NewHandle(thread, root_lib_url.raw())); |
| 272 result = Api::UnwrapHandle(retval); | 269 result = Api::UnwrapHandle(retval); |
| 273 } | 270 } |
| 274 I->UnblockClassFinalization(); | |
| 275 if (result.IsError()) { | 271 if (result.IsError()) { |
| 276 ReportError(Error::Cast(result)); | 272 ReportError(Error::Cast(result)); |
| 277 } | 273 } |
| 278 } | 274 } |
| 279 | 275 |
| 280 | 276 |
| 281 void IsolateReloadContext::RegisterClass(const Class& new_cls) { | 277 void IsolateReloadContext::RegisterClass(const Class& new_cls) { |
| 282 const Class& old_cls = Class::Handle(OldClassOrNull(new_cls)); | 278 const Class& old_cls = Class::Handle(OldClassOrNull(new_cls)); |
| 283 if (old_cls.IsNull()) { | 279 if (old_cls.IsNull()) { |
| 284 Isolate::Current()->class_table()->Register(new_cls); | 280 Isolate::Current()->class_table()->Register(new_cls); |
| (...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1186 ASSERT(!super_cls.IsNull()); | 1182 ASSERT(!super_cls.IsNull()); |
| 1187 super_cls.AddDirectSubclass(cls); | 1183 super_cls.AddDirectSubclass(cls); |
| 1188 } | 1184 } |
| 1189 } | 1185 } |
| 1190 } | 1186 } |
| 1191 } | 1187 } |
| 1192 | 1188 |
| 1193 #endif // !PRODUCT | 1189 #endif // !PRODUCT |
| 1194 | 1190 |
| 1195 } // namespace dart | 1191 } // namespace dart |
| OLD | NEW |