Move thread flags and state into 32bits.

We need to ensure that transitions to Runnable are atomic wrt to a
thread modifying the suspend count. Currently this is achieved by
holding the thread_suspend_count_lock_. This change creates a set of bit
flags that summarize that the suspend_count_ is raised and also others
flags that signify the managed code should go into a slow path.

The effect of this change are two-fold:
1) transitions from suspended to runnable can CAS the thread state
rather than holding the suspend_count_lock_. This will make JNI
transitions cheaper.
2) the exception/suspend/interpreter poll needed for shadow frames can
be rolled into a single compare of the bit fields against 0.

Change-Id: I589f84e3dca396c3db448bf32d814565acf3d11f
diff --git a/src/scoped_thread_state_change.h b/src/scoped_thread_state_change.h
index c9b353f..14956e4 100644
--- a/src/scoped_thread_state_change.h
+++ b/src/scoped_thread_state_change.h
@@ -40,11 +40,11 @@
       DCHECK_EQ(self, Thread::Current());
       // Read state without locks, ok as state is effectively thread local and we're not interested
       // in the suspend count (this will be handled in the runnable transitions).
-      old_thread_state_ = self->GetStateUnsafe();
+      old_thread_state_ = self->GetState();
       runnable_transition = old_thread_state_ == kRunnable || new_thread_state == kRunnable;
       if (!runnable_transition) {
         // A suspended transition to another effectively suspended transition, ok to use Unsafe.
-        self_->SetStateUnsafe(new_thread_state);
+        self_->SetState(new_thread_state);
       }
       if (runnable_transition && old_thread_state_ != new_thread_state) {
         if (new_thread_state == kRunnable) {
@@ -70,7 +70,7 @@
           self_->TransitionFromRunnableToSuspended(old_thread_state_);
         } else {
           // A suspended transition to another effectively suspended transition, ok to use Unsafe.
-          self_->SetStateUnsafe(old_thread_state_);
+          self_->SetState(old_thread_state_);
         }
       }
     }