< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahAsserts.hpp

Print this page
*** 1,7 ***
--- 1,8 ---
  /*
   * Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved.
+  * Copyright Amazon.com Inc. 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
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.

*** 70,10 ***
--- 71,11 ---
    static void assert_locked_or_shenandoah_safepoint(Mutex* lock, const char* file, int line);
  
    static void assert_heaplocked(const char* file, int line);
    static void assert_not_heaplocked(const char* file, int line);
    static void assert_heaplocked_or_safepoint(const char* file, int line);
+   static void assert_heaplocked_or_fullgc_safepoint(const char* file, int line);
  
  #ifdef ASSERT
  #define shenandoah_assert_in_heap(interior_loc, obj) \
                      ShenandoahAsserts::assert_in_heap(interior_loc, obj, __FILE__, __LINE__)
  #define shenandoah_assert_in_heap_or_null(interior_loc, obj) \

*** 161,10 ***
--- 163,18 ---
  #define shenandoah_assert_not_heaplocked() \
                      ShenandoahAsserts::assert_not_heaplocked(__FILE__, __LINE__)
  
  #define shenandoah_assert_heaplocked_or_safepoint() \
                      ShenandoahAsserts::assert_heaplocked_or_safepoint(__FILE__, __LINE__)
+ 
+ #define shenandoah_assert_heaplocked_or_fullgc_safepoint() \
+                     ShenandoahAsserts::assert_heaplocked_or_fullgc_safepoint(__FILE__, __LINE__)
+ #define shenandoah_assert_control_or_vm_thread() \
+                     assert(Thread::current()->is_VM_thread() || Thread::current() == ShenandoahHeap::heap()->control_thread(), "Expected control thread or vm thread")
+ 
+ #define shenandoah_assert_generational() \
+                     assert(ShenandoahHeap::heap()->mode()->is_generational(), "Must be in generational mode here.")
  #else
  #define shenandoah_assert_in_heap(interior_loc, obj)
  #define shenandoah_assert_in_heap_or_null(interior_loc, obj)
  #define shenandoah_assert_in_correct_region(interior_loc, obj)
  

*** 211,10 ***
--- 221,13 ---
  #define shenandoah_assert_locked_or_safepoint(lock)
  
  #define shenandoah_assert_heaplocked()
  #define shenandoah_assert_not_heaplocked()
  #define shenandoah_assert_heaplocked_or_safepoint()
+ #define shenandoah_assert_heaplocked_or_fullgc_safepoint()
+ #define shenandoah_assert_control_or_vm_thread()
+ #define shenandoah_assert_generational()
  
  #endif
  
  #define shenandoah_not_implemented \
                      { fatal("Deliberately not implemented."); }
< prev index next >