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

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

Issue 2223913002: Add an API for setting the sticky error (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: asiva review 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
« no previous file with comments | « runtime/vm/isolate.h ('k') | runtime/vm/service_test.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) 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 1495 matching lines...) Expand 10 before | Expand all | Expand 10 after
1506 if (!error.IsNull() && !error.IsUnwindError()) { 1506 if (!error.IsNull() && !error.IsUnwindError()) {
1507 OS::PrintErr("in ShutdownIsolate: %s\n", error.ToErrorCString()); 1507 OS::PrintErr("in ShutdownIsolate: %s\n", error.ToErrorCString());
1508 } 1508 }
1509 Dart::RunShutdownCallback(); 1509 Dart::RunShutdownCallback();
1510 } 1510 }
1511 // Shut the isolate down. 1511 // Shut the isolate down.
1512 Dart::ShutdownIsolate(isolate); 1512 Dart::ShutdownIsolate(isolate);
1513 } 1513 }
1514 1514
1515 1515
1516 void Isolate::SetStickyError(RawError* sticky_error) {
1517 ASSERT(sticky_error_ == Error::null());
1518 sticky_error_ = sticky_error;
1519 message_handler()->PausedOnExit(true);
1520 }
1521
1522
1516 void Isolate::Run() { 1523 void Isolate::Run() {
1517 message_handler()->Run(Dart::thread_pool(), 1524 message_handler()->Run(Dart::thread_pool(),
1518 RunIsolate, 1525 RunIsolate,
1519 ShutdownIsolate, 1526 ShutdownIsolate,
1520 reinterpret_cast<uword>(this)); 1527 reinterpret_cast<uword>(this));
1521 } 1528 }
1522 1529
1523 1530
1524 void Isolate::AddClosureFunction(const Function& function) const { 1531 void Isolate::AddClosureFunction(const Function& function) const {
1525 ASSERT(!Compiler::IsBackgroundCompilation()); 1532 ASSERT(!Compiler::IsBackgroundCompilation());
(...skipping 1361 matching lines...) Expand 10 before | Expand all | Expand 10 after
2887 void IsolateSpawnState::DecrementSpawnCount() { 2894 void IsolateSpawnState::DecrementSpawnCount() {
2888 ASSERT(spawn_count_monitor_ != NULL); 2895 ASSERT(spawn_count_monitor_ != NULL);
2889 ASSERT(spawn_count_ != NULL); 2896 ASSERT(spawn_count_ != NULL);
2890 MonitorLocker ml(spawn_count_monitor_); 2897 MonitorLocker ml(spawn_count_monitor_);
2891 ASSERT(*spawn_count_ > 0); 2898 ASSERT(*spawn_count_ > 0);
2892 *spawn_count_ = *spawn_count_ - 1; 2899 *spawn_count_ = *spawn_count_ - 1;
2893 ml.Notify(); 2900 ml.Notify();
2894 } 2901 }
2895 2902
2896 } // namespace dart 2903 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/isolate.h ('k') | runtime/vm/service_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698