Mercurial > hg > truffle
comparison src/share/vm/runtime/thread.hpp @ 6725:da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author | coleenp |
---|---|
date | Sat, 01 Sep 2012 13:25:18 -0400 |
parents | d2a62e0f25eb |
children | fb19af007ffc |
comparison
equal
deleted
inserted
replaced
6724:36d1d483d5d6 | 6725:da91efe96a93 |
---|---|
415 | 415 |
416 // Internal handle support | 416 // Internal handle support |
417 HandleArea* handle_area() const { return _handle_area; } | 417 HandleArea* handle_area() const { return _handle_area; } |
418 void set_handle_area(HandleArea* area) { _handle_area = area; } | 418 void set_handle_area(HandleArea* area) { _handle_area = area; } |
419 | 419 |
420 GrowableArray<Metadata*>* metadata_handles() const { return _metadata_handles; } | |
421 void set_metadata_handles(GrowableArray<Metadata*>* handles){ _metadata_handles = handles; } | |
422 | |
420 // Thread-Local Allocation Buffer (TLAB) support | 423 // Thread-Local Allocation Buffer (TLAB) support |
421 ThreadLocalAllocBuffer& tlab() { return _tlab; } | 424 ThreadLocalAllocBuffer& tlab() { return _tlab; } |
422 void initialize_tlab() { | 425 void initialize_tlab() { |
423 if (UseTLAB) { | 426 if (UseTLAB) { |
424 tlab().initialize(); | 427 tlab().initialize(); |
498 } | 501 } |
499 | 502 |
500 // Sweeper support | 503 // Sweeper support |
501 void nmethods_do(CodeBlobClosure* cf); | 504 void nmethods_do(CodeBlobClosure* cf); |
502 | 505 |
506 // jvmtiRedefineClasses support | |
507 void metadata_do(void f(Metadata*)); | |
508 | |
503 // Used by fast lock support | 509 // Used by fast lock support |
504 virtual bool is_lock_owned(address adr) const; | 510 virtual bool is_lock_owned(address adr) const; |
505 | 511 |
506 // Check if address is in the stack of the thread (not just for locks). | 512 // Check if address is in the stack of the thread (not just for locks). |
507 // Warning: the method can only be used on the running thread | 513 // Warning: the method can only be used on the running thread |
518 // Thread local resource area for temporary allocation within the VM | 524 // Thread local resource area for temporary allocation within the VM |
519 ResourceArea* _resource_area; | 525 ResourceArea* _resource_area; |
520 | 526 |
521 // Thread local handle area for allocation of handles within the VM | 527 // Thread local handle area for allocation of handles within the VM |
522 HandleArea* _handle_area; | 528 HandleArea* _handle_area; |
529 GrowableArray<Metadata*>* _metadata_handles; | |
523 | 530 |
524 // Support for stack overflow handling, get_thread, etc. | 531 // Support for stack overflow handling, get_thread, etc. |
525 address _stack_base; | 532 address _stack_base; |
526 size_t _stack_size; | 533 size_t _stack_size; |
527 uintptr_t _self_raw_id; // used by get_thread (mutable) | 534 uintptr_t _self_raw_id; // used by get_thread (mutable) |
788 // This holds the pointer to array (yeah like there might be more than one) of | 795 // This holds the pointer to array (yeah like there might be more than one) of |
789 // description of compiled vframes that have locals that need to be updated. | 796 // description of compiled vframes that have locals that need to be updated. |
790 GrowableArray<jvmtiDeferredLocalVariableSet*>* _deferred_locals_updates; | 797 GrowableArray<jvmtiDeferredLocalVariableSet*>* _deferred_locals_updates; |
791 | 798 |
792 // Handshake value for fixing 6243940. We need a place for the i2c | 799 // Handshake value for fixing 6243940. We need a place for the i2c |
793 // adapter to store the callee methodOop. This value is NEVER live | 800 // adapter to store the callee Method*. This value is NEVER live |
794 // across a gc point so it does NOT have to be gc'd | 801 // across a gc point so it does NOT have to be gc'd |
795 // The handshake is open ended since we can't be certain that it will | 802 // The handshake is open ended since we can't be certain that it will |
796 // be NULLed. This is because we rarely ever see the race and end up | 803 // be NULLed. This is because we rarely ever see the race and end up |
797 // in handle_wrong_method which is the backend of the handshake. See | 804 // in handle_wrong_method which is the backend of the handshake. See |
798 // code in i2c adapters and handle_wrong_method. | 805 // code in i2c adapters and handle_wrong_method. |
799 | 806 |
800 methodOop _callee_target; | 807 Method* _callee_target; |
801 | 808 |
802 // Oop results of VM runtime calls | 809 // Used to pass back results to the interpreter or generated code running Java code. |
803 oop _vm_result; // Used to pass back an oop result into Java code, GC-preserved | 810 oop _vm_result; // oop result is GC-preserved |
804 oop _vm_result_2; // Used to pass back an oop result into Java code, GC-preserved | 811 Metadata* _vm_result_2; // non-oop result |
805 | 812 |
806 // See ReduceInitialCardMarks: this holds the precise space interval of | 813 // See ReduceInitialCardMarks: this holds the precise space interval of |
807 // the most recent slow path allocation for which compiled code has | 814 // the most recent slow path allocation for which compiled code has |
808 // elided card-marks for performance along the fast-path. | 815 // elided card-marks for performance along the fast-path. |
809 MemRegion _deferred_card_mark; | 816 MemRegion _deferred_card_mark; |
1216 void clear_must_deopt_id() { _must_deopt_id = NULL; } | 1223 void clear_must_deopt_id() { _must_deopt_id = NULL; } |
1217 | 1224 |
1218 void set_deopt_nmethod(nmethod* nm) { _deopt_nmethod = nm; } | 1225 void set_deopt_nmethod(nmethod* nm) { _deopt_nmethod = nm; } |
1219 nmethod* deopt_nmethod() { return _deopt_nmethod; } | 1226 nmethod* deopt_nmethod() { return _deopt_nmethod; } |
1220 | 1227 |
1221 methodOop callee_target() const { return _callee_target; } | 1228 Method* callee_target() const { return _callee_target; } |
1222 void set_callee_target (methodOop x) { _callee_target = x; } | 1229 void set_callee_target (Method* x) { _callee_target = x; } |
1223 | 1230 |
1224 // Oop results of vm runtime calls | 1231 // Oop results of vm runtime calls |
1225 oop vm_result() const { return _vm_result; } | 1232 oop vm_result() const { return _vm_result; } |
1226 void set_vm_result (oop x) { _vm_result = x; } | 1233 void set_vm_result (oop x) { _vm_result = x; } |
1227 | 1234 |
1228 oop vm_result_2() const { return _vm_result_2; } | 1235 Metadata* vm_result_2() const { return _vm_result_2; } |
1229 void set_vm_result_2 (oop x) { _vm_result_2 = x; } | 1236 void set_vm_result_2 (Metadata* x) { _vm_result_2 = x; } |
1230 | 1237 |
1231 MemRegion deferred_card_mark() const { return _deferred_card_mark; } | 1238 MemRegion deferred_card_mark() const { return _deferred_card_mark; } |
1232 void set_deferred_card_mark(MemRegion mr) { _deferred_card_mark = mr; } | 1239 void set_deferred_card_mark(MemRegion mr) { _deferred_card_mark = mr; } |
1233 | 1240 |
1234 // Exception handling for compiled methods | 1241 // Exception handling for compiled methods |
1386 // Memory operations | 1393 // Memory operations |
1387 void oops_do(OopClosure* f, CodeBlobClosure* cf); | 1394 void oops_do(OopClosure* f, CodeBlobClosure* cf); |
1388 | 1395 |
1389 // Sweeper operations | 1396 // Sweeper operations |
1390 void nmethods_do(CodeBlobClosure* cf); | 1397 void nmethods_do(CodeBlobClosure* cf); |
1398 | |
1399 // RedefineClasses Support | |
1400 void metadata_do(void f(Metadata*)); | |
1391 | 1401 |
1392 // Memory management operations | 1402 // Memory management operations |
1393 void gc_epilogue(); | 1403 void gc_epilogue(); |
1394 void gc_prologue(); | 1404 void gc_prologue(); |
1395 | 1405 |
1417 } | 1427 } |
1418 javaVFrame* last_java_vframe(RegisterMap* reg_map); | 1428 javaVFrame* last_java_vframe(RegisterMap* reg_map); |
1419 | 1429 |
1420 // Returns method at 'depth' java or native frames down the stack | 1430 // Returns method at 'depth' java or native frames down the stack |
1421 // Used for security checks | 1431 // Used for security checks |
1422 klassOop security_get_caller_class(int depth); | 1432 Klass* security_get_caller_class(int depth); |
1423 | 1433 |
1424 // Print stack trace in external format | 1434 // Print stack trace in external format |
1425 void print_stack_on(outputStream* st); | 1435 void print_stack_on(outputStream* st); |
1426 void print_stack() { print_stack_on(tty); } | 1436 void print_stack() { print_stack_on(tty); } |
1427 | 1437 |
1834 private: | 1844 private: |
1835 static JavaThread* _thread_list; | 1845 static JavaThread* _thread_list; |
1836 static int _number_of_threads; | 1846 static int _number_of_threads; |
1837 static int _number_of_non_daemon_threads; | 1847 static int _number_of_non_daemon_threads; |
1838 static int _return_code; | 1848 static int _return_code; |
1849 #ifdef ASSERT | |
1850 static bool _vm_complete; | |
1851 #endif | |
1839 | 1852 |
1840 public: | 1853 public: |
1841 // Thread management | 1854 // Thread management |
1842 // force_daemon is a concession to JNI, where we may need to add a | 1855 // force_daemon is a concession to JNI, where we may need to add a |
1843 // thread to the thread list before allocating its thread object | 1856 // thread to the thread list before allocating its thread object |
1881 static void restore_hcode_pointers(); | 1894 static void restore_hcode_pointers(); |
1882 | 1895 |
1883 // Sweeper | 1896 // Sweeper |
1884 static void nmethods_do(CodeBlobClosure* cf); | 1897 static void nmethods_do(CodeBlobClosure* cf); |
1885 | 1898 |
1899 // RedefineClasses support | |
1900 static void metadata_do(void f(Metadata*)); | |
1901 | |
1886 static void gc_epilogue(); | 1902 static void gc_epilogue(); |
1887 static void gc_prologue(); | 1903 static void gc_prologue(); |
1904 #ifdef ASSERT | |
1905 static bool is_vm_complete() { return _vm_complete; } | |
1906 #endif | |
1888 | 1907 |
1889 // Verification | 1908 // Verification |
1890 static void verify(); | 1909 static void verify(); |
1891 static void print_on(outputStream* st, bool print_stacks, bool internal_format, bool print_concurrent_locks); | 1910 static void print_on(outputStream* st, bool print_stacks, bool internal_format, bool print_concurrent_locks); |
1892 static void print(bool print_stacks, bool internal_format) { | 1911 static void print(bool print_stacks, bool internal_format) { |