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

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

Issue 2208553002: Simplify reload error reporting (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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.h" 5 #include "vm/isolate.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "include/dart_native_api.h" 8 #include "include/dart_native_api.h"
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "platform/text_buffer.h" 10 #include "platform/text_buffer.h"
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 return MessageHandler::kShutdown; 653 return MessageHandler::kShutdown;
654 } 654 }
655 } 655 }
656 } 656 }
657 return MessageHandler::kError; 657 return MessageHandler::kError;
658 } 658 }
659 659
660 660
661 MessageHandler::MessageStatus IsolateMessageHandler::ProcessUnhandledException( 661 MessageHandler::MessageStatus IsolateMessageHandler::ProcessUnhandledException(
662 const Error& result) { 662 const Error& result) {
663 NOT_IN_PRODUCT(
664 if (I->IsReloading()) {
665 I->ReportReloadError(result);
666 return kOK;
667 }
668 )
669 // Generate the error and stacktrace strings for the error message. 663 // Generate the error and stacktrace strings for the error message.
670 String& exc_str = String::Handle(T->zone()); 664 String& exc_str = String::Handle(T->zone());
671 String& stacktrace_str = String::Handle(T->zone()); 665 String& stacktrace_str = String::Handle(T->zone());
672 if (result.IsUnhandledException()) { 666 if (result.IsUnhandledException()) {
673 Zone* zone = T->zone(); 667 Zone* zone = T->zone();
674 const UnhandledException& uhe = UnhandledException::Cast(result); 668 const UnhandledException& uhe = UnhandledException::Cast(result);
675 const Instance& exception = Instance::Handle(zone, uhe.exception()); 669 const Instance& exception = Instance::Handle(zone, uhe.exception());
676 Object& tmp = Object::Handle(zone); 670 Object& tmp = Object::Handle(zone);
677 tmp = DartLibraryCalls::ToString(exception); 671 tmp = DartLibraryCalls::ToString(exception);
678 if (!tmp.IsString()) { 672 if (!tmp.IsString()) {
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
1082 return !ServiceIsolate::IsServiceIsolateDescendant(this) && 1076 return !ServiceIsolate::IsServiceIsolateDescendant(this) &&
1083 is_runnable() && !IsReloading() && (no_reload_scope_depth_ == 0) && 1077 is_runnable() && !IsReloading() && (no_reload_scope_depth_ == 0) &&
1084 IsolateCreationEnabled(); 1078 IsolateCreationEnabled();
1085 #else 1079 #else
1086 return false; 1080 return false;
1087 #endif 1081 #endif
1088 } 1082 }
1089 1083
1090 1084
1091 #ifndef PRODUCT 1085 #ifndef PRODUCT
1092 void Isolate::ReportReloadError(const Error& error) {
1093 ASSERT(IsReloading());
1094 reload_context_->AbortReload(error);
1095 }
1096
1097
1098 bool Isolate::ReloadSources(JSONStream* js, 1086 bool Isolate::ReloadSources(JSONStream* js,
1099 bool force_reload, 1087 bool force_reload,
1100 bool dont_delete_reload_context) { 1088 bool dont_delete_reload_context) {
1101 ASSERT(!IsReloading()); 1089 ASSERT(!IsReloading());
1102 has_attempted_reload_ = true; 1090 has_attempted_reload_ = true;
1103 reload_context_ = new IsolateReloadContext(this, js); 1091 reload_context_ = new IsolateReloadContext(this, js);
1104 reload_context_->Reload(force_reload); 1092 reload_context_->Reload(force_reload);
1105 bool success = !reload_context_->reload_aborted(); 1093 bool success = !reload_context_->reload_aborted();
1106 if (!dont_delete_reload_context) { 1094 if (!dont_delete_reload_context) {
1107 DeleteReloadContext(); 1095 DeleteReloadContext();
(...skipping 1789 matching lines...) Expand 10 before | Expand all | Expand 10 after
2897 void IsolateSpawnState::DecrementSpawnCount() { 2885 void IsolateSpawnState::DecrementSpawnCount() {
2898 ASSERT(spawn_count_monitor_ != NULL); 2886 ASSERT(spawn_count_monitor_ != NULL);
2899 ASSERT(spawn_count_ != NULL); 2887 ASSERT(spawn_count_ != NULL);
2900 MonitorLocker ml(spawn_count_monitor_); 2888 MonitorLocker ml(spawn_count_monitor_);
2901 ASSERT(*spawn_count_ > 0); 2889 ASSERT(*spawn_count_ > 0);
2902 *spawn_count_ = *spawn_count_ - 1; 2890 *spawn_count_ = *spawn_count_ - 1;
2903 ml.Notify(); 2891 ml.Notify();
2904 } 2892 }
2905 2893
2906 } // namespace dart 2894 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/isolate.h ('k') | runtime/vm/isolate_reload.h » ('j') | runtime/vm/unit_test.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698