Mercurial > hg > graal-jvmci-8
comparison src/share/vm/runtime/thread.cpp @ 8011:06fd03af6ce4
8001384: G1: assert(!is_null(v)) failed: narrow oop value can never be zero
Summary: Flush any deferred card mark before a Java thread exits.
Reviewed-by: brutisso, jmasa
author | johnc |
---|---|
date | Mon, 04 Feb 2013 13:24:57 -0800 |
parents | f422634e5828 |
children | 1135141fb97e 5d8325eb8240 |
comparison
equal
deleted
inserted
replaced
8008:256d3f43c177 | 8011:06fd03af6ce4 |
---|---|
1498 if (is_attaching_via_jni) { | 1498 if (is_attaching_via_jni) { |
1499 _jni_attach_state = _attaching_via_jni; | 1499 _jni_attach_state = _attaching_via_jni; |
1500 } else { | 1500 } else { |
1501 _jni_attach_state = _not_attaching_via_jni; | 1501 _jni_attach_state = _not_attaching_via_jni; |
1502 } | 1502 } |
1503 assert(_deferred_card_mark.is_empty(), "Default MemRegion ctor"); | 1503 assert(deferred_card_mark().is_empty(), "Default MemRegion ctor"); |
1504 _safepoint_visible = false; | 1504 _safepoint_visible = false; |
1505 } | 1505 } |
1506 | 1506 |
1507 bool JavaThread::reguard_stack(address cur_sp) { | 1507 bool JavaThread::reguard_stack(address cur_sp) { |
1508 if (_stack_guard_state != stack_guard_yellow_disabled) { | 1508 if (_stack_guard_state != stack_guard_yellow_disabled) { |
1894 | 1894 |
1895 if (JvmtiEnv::environments_might_exist()) { | 1895 if (JvmtiEnv::environments_might_exist()) { |
1896 JvmtiExport::cleanup_thread(this); | 1896 JvmtiExport::cleanup_thread(this); |
1897 } | 1897 } |
1898 | 1898 |
1899 // We must flush any deferred card marks before removing a thread from | |
1900 // the list of active threads. | |
1901 Universe::heap()->flush_deferred_store_barrier(this); | |
1902 assert(deferred_card_mark().is_empty(), "Should have been flushed"); | |
1903 | |
1899 #ifndef SERIALGC | 1904 #ifndef SERIALGC |
1900 // We must flush G1-related buffers before removing a thread from | 1905 // We must flush the G1-related buffers before removing a thread |
1901 // the list of active threads. | 1906 // from the list of active threads. We must do this after any deferred |
1907 // card marks have been flushed (above) so that any entries that are | |
1908 // added to the thread's dirty card queue as a result are not lost. | |
1902 if (UseG1GC) { | 1909 if (UseG1GC) { |
1903 flush_barrier_queues(); | 1910 flush_barrier_queues(); |
1904 } | 1911 } |
1905 #endif | 1912 #endif |
1906 | 1913 |