Merge change I71938023

* changes:
  Assert that the incoming thread and monitor objects are not NULL.  The old implementation allowed monitors to be NULL when they were unlocked and otherwise unowned.  With the new lock word format, a NULL monitor object can only mean that an invariant has been lost.  Also, nix some trailing whitespace that crept into a comment.
diff --git a/vm/Sync.c b/vm/Sync.c
index 5f9c2fa..5505166 100644
--- a/vm/Sync.c
+++ b/vm/Sync.c
@@ -108,7 +108,7 @@
  *
  * The LSB of the lock value encodes its state.  If cleared, the lock
  * is in the "thin" state and its bits are formatted as follows:
- * 
+ *
  *    [31 ---- 19] [18 ---- 3] [2 ---- 1] [0]
  *     lock count   thread id  hash state  0
  *
@@ -470,8 +470,11 @@
     bool timed;
     int cc;
 
+    assert(self != NULL);
+    assert(mon != NULL);
+
     /* Make sure that we hold the lock. */
-    if (mon == NULL || mon->owner != self) {
+    if (mon->owner != self) {
         dvmThrowException("Ljava/lang/IllegalMonitorStateException;",
             "object not locked by thread before wait()");
         return;
@@ -676,8 +679,11 @@
  */
 static void notifyMonitor(Thread* self, Monitor* mon)
 {
+    assert(self != NULL);
+    assert(mon != NULL);
+
     /* Make sure that we hold the lock. */
-    if (mon == NULL || mon->owner != self) {
+    if (mon->owner != self) {
         dvmThrowException("Ljava/lang/IllegalMonitorStateException;",
             "object not locked by thread before notify()");
         return;
@@ -710,8 +716,11 @@
  */
 static void notifyAllMonitor(Thread* self, Monitor* mon)
 {
+    assert(self != NULL);
+    assert(mon != NULL);
+
     /* Make sure that we hold the lock. */
-    if (mon == NULL || mon->owner != self) {
+    if (mon->owner != self) {
         dvmThrowException("Ljava/lang/IllegalMonitorStateException;",
             "object not locked by thread before notifyAll()");
         return;