comparison src/share/vm/code/nmethod.hpp @ 1202:5f24d0319e54

4360113: Evict nmethods when code cache gets full Summary: Speculatively unload the oldest nmethods when code cache gets full. Reviewed-by: never, kvn Contributed-by: eric.caspole@amd.com
author kvn
date Fri, 29 Jan 2010 09:27:22 -0800
parents 24128c2ffa87
children 18a389214829
comparison
equal deleted inserted replaced
1201:24128c2ffa87 1202:5f24d0319e54
93 unsigned int markedForReclamation:1; // Used by NMethodSweeper 93 unsigned int markedForReclamation:1; // Used by NMethodSweeper
94 94
95 unsigned int has_unsafe_access:1; // May fault due to unsafe access. 95 unsigned int has_unsafe_access:1; // May fault due to unsafe access.
96 unsigned int has_method_handle_invokes:1; // Has this method MethodHandle invokes? 96 unsigned int has_method_handle_invokes:1; // Has this method MethodHandle invokes?
97 97
98 unsigned int speculatively_disconnected:1; // Marked for potential unload
99
98 void clear(); 100 void clear();
99 }; 101 };
100 102
101 103
102 // A nmethod contains: 104 // A nmethod contains:
135 int _entry_bci; // != InvocationEntryBci if this nmethod is an on-stack replacement method 137 int _entry_bci; // != InvocationEntryBci if this nmethod is an on-stack replacement method
136 138
137 // To support simple linked-list chaining of nmethods: 139 // To support simple linked-list chaining of nmethods:
138 nmethod* _osr_link; // from instanceKlass::osr_nmethods_head 140 nmethod* _osr_link; // from instanceKlass::osr_nmethods_head
139 nmethod* _scavenge_root_link; // from CodeCache::scavenge_root_nmethods 141 nmethod* _scavenge_root_link; // from CodeCache::scavenge_root_nmethods
142 nmethod* _saved_nmethod_link; // from CodeCache::speculatively_disconnect
140 143
141 static nmethod* volatile _oops_do_mark_nmethods; 144 static nmethod* volatile _oops_do_mark_nmethods;
142 nmethod* volatile _oops_do_mark_link; 145 nmethod* volatile _oops_do_mark_link;
143 146
144 AbstractCompiler* _compiler; // The compiler which compiled this nmethod 147 AbstractCompiler* _compiler; // The compiler which compiled this nmethod
411 void set_has_unsafe_access(bool z) { flags.has_unsafe_access = z; } 414 void set_has_unsafe_access(bool z) { flags.has_unsafe_access = z; }
412 415
413 bool has_method_handle_invokes() const { return flags.has_method_handle_invokes; } 416 bool has_method_handle_invokes() const { return flags.has_method_handle_invokes; }
414 void set_has_method_handle_invokes(bool z) { flags.has_method_handle_invokes = z; } 417 void set_has_method_handle_invokes(bool z) { flags.has_method_handle_invokes = z; }
415 418
419 bool is_speculatively_disconnected() const { return flags.speculatively_disconnected; }
420 void set_speculatively_disconnected(bool z) { flags.speculatively_disconnected = z; }
421
416 int level() const { return flags.level; } 422 int level() const { return flags.level; }
417 void set_level(int newLevel) { check_safepoint(); flags.level = newLevel; } 423 void set_level(int newLevel) { check_safepoint(); flags.level = newLevel; }
418 424
419 int comp_level() const { return _comp_level; } 425 int comp_level() const { return _comp_level; }
420 426
435 // N.B. there is no positive marked query, and we only use the not_marked query for asserts. 441 // N.B. there is no positive marked query, and we only use the not_marked query for asserts.
436 #endif //PRODUCT 442 #endif //PRODUCT
437 nmethod* scavenge_root_link() const { return _scavenge_root_link; } 443 nmethod* scavenge_root_link() const { return _scavenge_root_link; }
438 void set_scavenge_root_link(nmethod *n) { _scavenge_root_link = n; } 444 void set_scavenge_root_link(nmethod *n) { _scavenge_root_link = n; }
439 445
446 nmethod* saved_nmethod_link() const { return _saved_nmethod_link; }
447 void set_saved_nmethod_link(nmethod *n) { _saved_nmethod_link = n; }
448
440 public: 449 public:
441 450
442 // Sweeper support 451 // Sweeper support
443 long stack_traversal_mark() { return _stack_traversal_mark; } 452 long stack_traversal_mark() { return _stack_traversal_mark; }
444 void set_stack_traversal_mark(long l) { _stack_traversal_mark = l; } 453 void set_stack_traversal_mark(long l) { _stack_traversal_mark = l; }