Mercurial > hg > graal-jvmci-8
comparison src/share/vm/runtime/thread.cpp @ 18929:8f2fb6bec986
removed GPU code
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Fri, 23 Jan 2015 10:54:21 +0100 |
parents | c307546c7b0a |
children | 7848fc12602b |
comparison
equal
deleted
inserted
replaced
18928:c8fc6e2d128b | 18929:8f2fb6bec986 |
---|---|
52 #include "runtime/arguments.hpp" | 52 #include "runtime/arguments.hpp" |
53 #include "runtime/biasedLocking.hpp" | 53 #include "runtime/biasedLocking.hpp" |
54 #include "runtime/deoptimization.hpp" | 54 #include "runtime/deoptimization.hpp" |
55 #include "runtime/fprofiler.hpp" | 55 #include "runtime/fprofiler.hpp" |
56 #include "runtime/frame.inline.hpp" | 56 #include "runtime/frame.inline.hpp" |
57 #include "runtime/gpu.hpp" | |
58 #ifdef GRAAL | |
59 # include "hsail/vm/gpu_hsail.hpp" | |
60 #endif | |
61 #include "runtime/init.hpp" | 57 #include "runtime/init.hpp" |
62 #include "runtime/interfaceSupport.hpp" | 58 #include "runtime/interfaceSupport.hpp" |
63 #include "runtime/java.hpp" | 59 #include "runtime/java.hpp" |
64 #include "runtime/javaCalls.hpp" | 60 #include "runtime/javaCalls.hpp" |
65 #include "runtime/jniPeriodicChecker.hpp" | 61 #include "runtime/jniPeriodicChecker.hpp" |
1477 set_deopt_mark(NULL); | 1473 set_deopt_mark(NULL); |
1478 set_deopt_nmethod(NULL); | 1474 set_deopt_nmethod(NULL); |
1479 clear_must_deopt_id(); | 1475 clear_must_deopt_id(); |
1480 set_monitor_chunks(NULL); | 1476 set_monitor_chunks(NULL); |
1481 set_next(NULL); | 1477 set_next(NULL); |
1482 #ifdef GRAAL | |
1483 set_gpu_exception_bci(0); | |
1484 set_gpu_exception_method(NULL); | |
1485 set_gpu_hsail_deopt_info(NULL); | |
1486 _gpu_hsail_tlabs_count = 0; | |
1487 _gpu_hsail_tlabs = NULL; | |
1488 #endif | |
1489 set_thread_state(_thread_new); | 1478 set_thread_state(_thread_new); |
1490 #if INCLUDE_NMT | 1479 #if INCLUDE_NMT |
1491 set_recorder(NULL); | 1480 set_recorder(NULL); |
1492 #endif | 1481 #endif |
1493 _terminated = _not_terminated; | 1482 _terminated = _not_terminated; |
1702 _graal_old_thread_counters[i] += _graal_counters[i]; | 1691 _graal_old_thread_counters[i] += _graal_counters[i]; |
1703 } | 1692 } |
1704 } | 1693 } |
1705 FREE_C_HEAP_ARRAY(jlong, _graal_counters, mtInternal); | 1694 FREE_C_HEAP_ARRAY(jlong, _graal_counters, mtInternal); |
1706 } | 1695 } |
1707 | |
1708 delete_gpu_hsail_tlabs(); | |
1709 #endif // GRAAL | 1696 #endif // GRAAL |
1710 } | 1697 } |
1711 | 1698 |
1712 | 1699 |
1713 // The first routine called by a new Java thread | 1700 // The first routine called by a new Java thread |
1978 | 1965 |
1979 // These have to be removed while this is still a valid thread. | 1966 // These have to be removed while this is still a valid thread. |
1980 remove_stack_guard_pages(); | 1967 remove_stack_guard_pages(); |
1981 | 1968 |
1982 if (UseTLAB) { | 1969 if (UseTLAB) { |
1983 tlabs_make_parsable(true); // retire TLABs, if any | 1970 tlab().make_parsable(true); // retire TLAB |
1984 } | 1971 } |
1985 | 1972 |
1986 if (JvmtiEnv::environments_might_exist()) { | 1973 if (JvmtiEnv::environments_might_exist()) { |
1987 JvmtiExport::cleanup_thread(this); | 1974 JvmtiExport::cleanup_thread(this); |
1988 } | 1975 } |
2057 | 2044 |
2058 // These have to be removed while this is still a valid thread. | 2045 // These have to be removed while this is still a valid thread. |
2059 remove_stack_guard_pages(); | 2046 remove_stack_guard_pages(); |
2060 | 2047 |
2061 if (UseTLAB) { | 2048 if (UseTLAB) { |
2062 tlabs_make_parsable(true); // retire TLABs, if any | 2049 tlab().make_parsable(true); // retire TLAB, if any |
2063 } | 2050 } |
2064 | 2051 |
2065 #if INCLUDE_ALL_GCS | 2052 #if INCLUDE_ALL_GCS |
2066 if (UseG1GC) { | 2053 if (UseG1GC) { |
2067 flush_barrier_queues(); | 2054 flush_barrier_queues(); |
2863 // Safepoints can occur when the sweeper is scanning an nmethod so | 2850 // Safepoints can occur when the sweeper is scanning an nmethod so |
2864 // process it here to make sure it isn't unloaded in the middle of | 2851 // process it here to make sure it isn't unloaded in the middle of |
2865 // a scan. | 2852 // a scan. |
2866 cf->do_code_blob(_scanned_nmethod); | 2853 cf->do_code_blob(_scanned_nmethod); |
2867 } | 2854 } |
2868 | |
2869 #ifdef GRAAL | |
2870 Hsail::HSAILDeoptimizationInfo* gpu_hsail_deopt_info = (Hsail::HSAILDeoptimizationInfo*) get_gpu_hsail_deopt_info(); | |
2871 if (gpu_hsail_deopt_info != NULL) { | |
2872 gpu_hsail_deopt_info->oops_do(f); | |
2873 } | |
2874 #endif | |
2875 } | 2855 } |
2876 | 2856 |
2877 void JavaThread::nmethods_do(CodeBlobClosure* cf) { | 2857 void JavaThread::nmethods_do(CodeBlobClosure* cf) { |
2878 Thread::nmethods_do(cf); // (super method is a no-op) | 2858 Thread::nmethods_do(cf); // (super method is a no-op) |
2879 | 2859 |
4789 p->verify(); | 4769 p->verify(); |
4790 } | 4770 } |
4791 VMThread* thread = VMThread::vm_thread(); | 4771 VMThread* thread = VMThread::vm_thread(); |
4792 if (thread != NULL) thread->verify(); | 4772 if (thread != NULL) thread->verify(); |
4793 } | 4773 } |
4794 | |
4795 void JavaThread::tlabs_make_parsable(bool retire) { | |
4796 // do the primary tlab for this thread | |
4797 tlab().make_parsable(retire); | |
4798 #ifdef GRAAL | |
4799 // do the gpu_hsail tlabs if any | |
4800 gpu_hsail_tlabs_make_parsable(retire); | |
4801 #endif | |
4802 } | |
4803 | |
4804 | |
4805 #ifdef GRAAL | |
4806 void JavaThread::initialize_gpu_hsail_tlabs(jint count) { | |
4807 if (!UseTLAB) return; | |
4808 // create tlabs | |
4809 _gpu_hsail_tlabs = NEW_C_HEAP_ARRAY(ThreadLocalAllocBuffer*, count, mtInternal); | |
4810 // initialize | |
4811 for (jint i = 0; i < count; i++) { | |
4812 _gpu_hsail_tlabs[i] = new ThreadLocalAllocBuffer(); | |
4813 _gpu_hsail_tlabs[i]->initialize(Thread::current()); | |
4814 } | |
4815 _gpu_hsail_tlabs_count = count; | |
4816 } | |
4817 | |
4818 ThreadLocalAllocBuffer* JavaThread::get_gpu_hsail_tlab_at(jint idx) { | |
4819 assert(idx >= 0 && idx < get_gpu_hsail_tlabs_count(), "illegal gpu tlab index"); | |
4820 return _gpu_hsail_tlabs[idx]; | |
4821 } | |
4822 | |
4823 void JavaThread::gpu_hsail_tlabs_make_parsable(bool retire) { | |
4824 for (jint i = 0; i < get_gpu_hsail_tlabs_count(); i++) { | |
4825 get_gpu_hsail_tlab_at(i)->make_parsable(retire); | |
4826 } | |
4827 } | |
4828 | |
4829 void JavaThread::delete_gpu_hsail_tlabs() { | |
4830 if (!UseTLAB) return; | |
4831 if (_gpu_hsail_tlabs_count == 0) return; | |
4832 | |
4833 gpu_hsail_tlabs_make_parsable(true); | |
4834 for (jint i = 0; i < get_gpu_hsail_tlabs_count(); i++) { | |
4835 delete get_gpu_hsail_tlab_at(i); | |
4836 } | |
4837 FREE_C_HEAP_ARRAY(ThreadLocalAllocBuffer*, _gpu_hsail_tlabs, mtInternal); | |
4838 _gpu_hsail_tlabs = NULL; | |
4839 _gpu_hsail_tlabs_count = 0; | |
4840 } | |
4841 | |
4842 | |
4843 #endif | |
4844 |