hotspot/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp
changeset 29580 a67a581cfe11
parent 27880 afb974a04396
child 29799 3ad47a56094a
--- a/hotspot/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp	Thu Mar 12 15:51:12 2015 -0700
+++ b/hotspot/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp	Mon Feb 16 14:07:36 2015 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -195,8 +195,9 @@
   // our closures depend on this property and do not protect against
   // double scans.
 
-  uintptr_t cur_chunk_index = addr_to_chunk_index(chunk_mr.start());
-  cur_chunk_index           = cur_chunk_index - lowest_non_clean_base_chunk_index;
+  uintptr_t start_chunk_index = addr_to_chunk_index(chunk_mr.start());
+  assert(start_chunk_index >= lowest_non_clean_base_chunk_index, "Bounds error.");
+  uintptr_t cur_chunk_index   = start_chunk_index - lowest_non_clean_base_chunk_index;
 
   NOISY(tty->print_cr("===========================================================================");)
   NOISY(tty->print_cr(" process_chunk_boundary: Called with [" PTR_FORMAT "," PTR_FORMAT ")",
@@ -242,8 +243,7 @@
     if (first_dirty_card != NULL) {
       NOISY(tty->print_cr(" LNC: Found a dirty card at " PTR_FORMAT " in current chunk",
                     first_dirty_card);)
-      assert(0 <= cur_chunk_index && cur_chunk_index < lowest_non_clean_chunk_size,
-             "Bounds error.");
+      assert(cur_chunk_index < lowest_non_clean_chunk_size, "Bounds error.");
       assert(lowest_non_clean[cur_chunk_index] == NULL,
              "Write exactly once : value should be stable hereafter for this round");
       lowest_non_clean[cur_chunk_index] = first_dirty_card;