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

Side by Side Diff: runtime/vm/isolate_reload.cc

Issue 2759933005: Fix recent reload flakes (Closed)
Patch Set: Created 3 years, 9 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/service.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/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 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 627
628 Dart_Handle retval = (I->library_tag_handler())( 628 Dart_Handle retval = (I->library_tag_handler())(
629 Dart_kScriptTag, Api::NewHandle(thread, packages_url.raw()), 629 Dart_kScriptTag, Api::NewHandle(thread, packages_url.raw()),
630 Api::NewHandle(thread, root_lib_url.raw())); 630 Api::NewHandle(thread, root_lib_url.raw()));
631 result = Api::UnwrapHandle(retval); 631 result = Api::UnwrapHandle(retval);
632 } 632 }
633 // 633 //
634 // WEIRD CONTROL FLOW ENDS. 634 // WEIRD CONTROL FLOW ENDS.
635 TIR_Print("---- EXITED TAG HANDLER\n"); 635 TIR_Print("---- EXITED TAG HANDLER\n");
636 636
637 // Re-enable the background compiler. Do this before propagating any errors.
638 BackgroundCompiler::Enable();
639
637 if (result.IsUnwindError()) { 640 if (result.IsUnwindError()) {
638 if (thread->top_exit_frame_info() == 0) { 641 if (thread->top_exit_frame_info() == 0) {
639 // We can only propagate errors when there are Dart frames on the stack. 642 // We can only propagate errors when there are Dart frames on the stack.
640 // In this case there are no Dart frames on the stack and we set the 643 // In this case there are no Dart frames on the stack and we set the
641 // thread's sticky error. This error will be returned to the message 644 // thread's sticky error. This error will be returned to the message
642 // handler. 645 // handler.
643 thread->set_sticky_error(Error::Cast(result)); 646 thread->set_sticky_error(Error::Cast(result));
644 } else { 647 } else {
645 // If the tag handler returns with an UnwindError error, propagate it and 648 // If the tag handler returns with an UnwindError error, propagate it and
646 // give up. 649 // give up.
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 if (!reload_finalized_) { 720 if (!reload_finalized_) {
718 Rollback(); 721 Rollback();
719 } 722 }
720 CommonFinalizeTail(); 723 CommonFinalizeTail();
721 } 724 }
722 725
723 726
724 void IsolateReloadContext::CommonFinalizeTail() { 727 void IsolateReloadContext::CommonFinalizeTail() {
725 ReportOnJSON(js_); 728 ReportOnJSON(js_);
726 reload_finalized_ = true; 729 reload_finalized_ = true;
727 // As a final step, re-enable the background compiler.
728 BackgroundCompiler::Enable();
729 } 730 }
730 731
731 732
732 void IsolateReloadContext::ReportOnJSON(JSONStream* stream) { 733 void IsolateReloadContext::ReportOnJSON(JSONStream* stream) {
733 JSONObject jsobj(stream); 734 JSONObject jsobj(stream);
734 jsobj.AddProperty("type", "ReloadReport"); 735 jsobj.AddProperty("type", "ReloadReport");
735 jsobj.AddProperty("success", reload_skipped_ || !HasReasonsForCancelling()); 736 jsobj.AddProperty("success", reload_skipped_ || !HasReasonsForCancelling());
736 { 737 {
737 JSONObject details(&jsobj, "details"); 738 JSONObject details(&jsobj, "details");
738 if (reload_skipped_) { 739 if (reload_skipped_) {
(...skipping 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after
1894 ASSERT(!super_cls.IsNull()); 1895 ASSERT(!super_cls.IsNull());
1895 super_cls.AddDirectSubclass(cls); 1896 super_cls.AddDirectSubclass(cls);
1896 } 1897 }
1897 } 1898 }
1898 } 1899 }
1899 } 1900 }
1900 1901
1901 #endif // !PRODUCT 1902 #endif // !PRODUCT
1902 1903
1903 } // namespace dart 1904 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698