Mercurial > hg > graal-jvmci-8
comparison src/share/vm/prims/jvmtiImpl.cpp @ 2177:3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
Summary: move symbols from permgen into C heap and reference count them
Reviewed-by: never, acorn, jmasa, stefank
author | coleenp |
---|---|
date | Thu, 27 Jan 2011 16:11:27 -0800 |
parents | 9afee0b9fc1d |
children | bf8517f4e4d0 |
comparison
equal
deleted
inserted
replaced
2176:27e4ea99855d | 2177:3582bf76420e |
---|---|
283 // add/remove breakpoint to/from versions of the method that | 283 // add/remove breakpoint to/from versions of the method that |
284 // are EMCP. Directly or transitively obsolete methods are | 284 // are EMCP. Directly or transitively obsolete methods are |
285 // not saved in the PreviousVersionInfo. | 285 // not saved in the PreviousVersionInfo. |
286 Thread *thread = Thread::current(); | 286 Thread *thread = Thread::current(); |
287 instanceKlassHandle ikh = instanceKlassHandle(thread, _method->method_holder()); | 287 instanceKlassHandle ikh = instanceKlassHandle(thread, _method->method_holder()); |
288 symbolOop m_name = _method->name(); | 288 Symbol* m_name = _method->name(); |
289 symbolOop m_signature = _method->signature(); | 289 Symbol* m_signature = _method->signature(); |
290 | 290 |
291 { | 291 { |
292 ResourceMark rm(thread); | 292 ResourceMark rm(thread); |
293 // PreviousVersionInfo objects returned via PreviousVersionWalker | 293 // PreviousVersionInfo objects returned via PreviousVersionWalker |
294 // contain a GrowableArray of handles. We have to clean up the | 294 // contain a GrowableArray of handles. We have to clean up the |
626 int len = (int) strlen(ty_sign); | 626 int len = (int) strlen(ty_sign); |
627 if (ty_sign[0] == 'L' && ty_sign[len-1] == ';') { // Need pure class/interface name | 627 if (ty_sign[0] == 'L' && ty_sign[len-1] == ';') { // Need pure class/interface name |
628 ty_sign++; | 628 ty_sign++; |
629 len -= 2; | 629 len -= 2; |
630 } | 630 } |
631 symbolHandle ty_sym = oopFactory::new_symbol_handle(ty_sign, len, thread); | 631 TempNewSymbol ty_sym = SymbolTable::new_symbol(ty_sign, len, thread); |
632 if (klass->name() == ty_sym()) { | 632 if (klass->name() == ty_sym) { |
633 return true; | 633 return true; |
634 } | 634 } |
635 // Compare primary supers | 635 // Compare primary supers |
636 int super_depth = klass->super_depth(); | 636 int super_depth = klass->super_depth(); |
637 int idx; | 637 int idx; |
638 for (idx = 0; idx < super_depth; idx++) { | 638 for (idx = 0; idx < super_depth; idx++) { |
639 if (Klass::cast(klass->primary_super_of_depth(idx))->name() == ty_sym()) { | 639 if (Klass::cast(klass->primary_super_of_depth(idx))->name() == ty_sym) { |
640 return true; | 640 return true; |
641 } | 641 } |
642 } | 642 } |
643 // Compare secondary supers | 643 // Compare secondary supers |
644 objArrayOop sec_supers = klass->secondary_supers(); | 644 objArrayOop sec_supers = klass->secondary_supers(); |
645 for (idx = 0; idx < sec_supers->length(); idx++) { | 645 for (idx = 0; idx < sec_supers->length(); idx++) { |
646 if (Klass::cast((klassOop) sec_supers->obj_at(idx))->name() == ty_sym()) { | 646 if (Klass::cast((klassOop) sec_supers->obj_at(idx))->name() == ty_sym) { |
647 return true; | 647 return true; |
648 } | 648 } |
649 } | 649 } |
650 return false; | 650 return false; |
651 } | 651 } |
688 } | 688 } |
689 if (signature_idx == -1) { | 689 if (signature_idx == -1) { |
690 _result = JVMTI_ERROR_INVALID_SLOT; | 690 _result = JVMTI_ERROR_INVALID_SLOT; |
691 return false; // Incorrect slot index | 691 return false; // Incorrect slot index |
692 } | 692 } |
693 symbolOop sign_sym = method_oop->constants()->symbol_at(signature_idx); | 693 Symbol* sign_sym = method_oop->constants()->symbol_at(signature_idx); |
694 const char* signature = (const char *) sign_sym->as_utf8(); | 694 const char* signature = (const char *) sign_sym->as_utf8(); |
695 BasicType slot_type = char2type(signature[0]); | 695 BasicType slot_type = char2type(signature[0]); |
696 | 696 |
697 switch (slot_type) { | 697 switch (slot_type) { |
698 case T_BYTE: | 698 case T_BYTE: |