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

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: r 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..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) {
« 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