Chromium Code Reviews| Index: runtime/vm/thread.cc |
| diff --git a/runtime/vm/thread.cc b/runtime/vm/thread.cc |
| index adfc4b4ee2bc7baf4f2ab0827e9ed654314a26e9..6f48b7a2d5e58222fe51d75d92cbaec022db68d2 100644 |
| --- a/runtime/vm/thread.cc |
| +++ b/runtime/vm/thread.cc |
| @@ -62,6 +62,7 @@ Thread::Thread(Isolate* isolate) |
| deopt_id_(0), |
| vm_tag_(0), |
| pending_functions_(GrowableObjectArray::null()), |
| + sticky_error_(Error::null()), |
| REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_INITIALIZERS) |
| REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_INIT) |
| safepoint_state_(0), |
| @@ -175,6 +176,29 @@ RawGrowableObjectArray* Thread::pending_functions() { |
| } |
| +void Thread::clear_pending_functions() { |
| + pending_functions_ = GrowableObjectArray::null(); |
| +} |
| + |
| + |
| +RawError* Thread::sticky_error() const { |
| + return sticky_error_; |
| +} |
| + |
| + |
| +void Thread::set_sticky_error(const Error& value) { |
| + // TODO(asiva): Move sticky_error_ into thread specific area. |
| + // ASSERT(Thread::Current()->IsMutatorThread()); |
|
siva
2016/02/05 22:46:36
This TODO and ASSERT can be removed now.
srdjan
2016/02/05 23:34:33
Done.
|
| + ASSERT(!value.IsNull()); |
| + sticky_error_ = value.raw(); |
| +} |
| + |
| + |
| +void Thread::clear_sticky_error() { |
| + sticky_error_ = Error::null(); |
| +} |
| + |
| + |
| bool Thread::EnterIsolate(Isolate* isolate) { |
| const bool kIsMutatorThread = true; |
| Thread* thread = isolate->ScheduleThread(kIsMutatorThread); |
| @@ -338,6 +362,11 @@ void Thread::VisitObjectPointers(ObjectPointerVisitor* visitor) { |
| reinterpret_cast<RawObject**>(&pending_functions_)); |
| } |
| + if (sticky_error_ != Error::null()) { |
| + visitor->VisitPointer( |
| + reinterpret_cast<RawObject**>(&sticky_error_)); |
| + } |
|
siva
2016/02/05 22:46:36
Why do we have these checks for NULL the visitor s
srdjan
2016/02/05 23:34:33
Do not remember why that was done. Removed both ch
|
| + |
| // Visit the api local scope as it has all the api local handles. |
| ApiLocalScope* scope = api_top_scope_; |
| while (scope != NULL) { |