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

Unified Diff: runtime/vm/thread.cc

Issue 1672853002: Move sticky_error_ from isolate to thread (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Comments addressed Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/thread.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/thread.cc
diff --git a/runtime/vm/thread.cc b/runtime/vm/thread.cc
index adfc4b4ee2bc7baf4f2ab0827e9ed654314a26e9..0fa2d403f06f2e5fa2a59886046097e637225ff6 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,27 @@ 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) {
+ 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);
@@ -332,11 +354,10 @@ void Thread::VisitObjectPointers(ObjectPointerVisitor* visitor) {
// Visit objects in thread specific handles area.
reusable_handles_.VisitObjectPointers(visitor);
- // Visit the pending functions.
- if (pending_functions_ != GrowableObjectArray::null()) {
- visitor->VisitPointer(
- reinterpret_cast<RawObject**>(&pending_functions_));
- }
+ visitor->VisitPointer(
+ reinterpret_cast<RawObject**>(&pending_functions_));
+ visitor->VisitPointer(
+ reinterpret_cast<RawObject**>(&sticky_error_));
// Visit the api local scope as it has all the api local handles.
ApiLocalScope* scope = api_top_scope_;
« no previous file with comments | « runtime/vm/thread.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698