comparison src/share/vm/runtime/sharedRuntime.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 8012aa3ccede
children d25d4ca69222 b92c45f2bc75
comparison
equal deleted inserted replaced
2176:27e4ea99855d 2177:3582bf76420e
525 #endif // PRODUCT 525 #endif // PRODUCT
526 return stub; 526 return stub;
527 } 527 }
528 528
529 529
530 oop SharedRuntime::retrieve_receiver( symbolHandle sig, frame caller ) { 530 oop SharedRuntime::retrieve_receiver( Symbol* sig, frame caller ) {
531 assert(caller.is_interpreted_frame(), ""); 531 assert(caller.is_interpreted_frame(), "");
532 int args_size = ArgumentSizeComputer(sig).size() + 1; 532 int args_size = ArgumentSizeComputer(sig).size() + 1;
533 assert(args_size <= caller.interpreter_frame_expression_stack_size(), "receiver must be on interpreter stack"); 533 assert(args_size <= caller.interpreter_frame_expression_stack_size(), "receiver must be on interpreter stack");
534 oop result = (oop) *caller.interpreter_frame_tos_at(args_size - 1); 534 oop result = (oop) *caller.interpreter_frame_tos_at(args_size - 1);
535 assert(Universe::heap()->is_in(result) && result->is_oop(), "receiver must be an oop"); 535 assert(Universe::heap()->is_in(result) && result->is_oop(), "receiver must be an oop");
545 JvmtiExport::post_exception_throw(thread, method(), bcp, h_exception()); 545 JvmtiExport::post_exception_throw(thread, method(), bcp, h_exception());
546 } 546 }
547 Exceptions::_throw(thread, __FILE__, __LINE__, h_exception); 547 Exceptions::_throw(thread, __FILE__, __LINE__, h_exception);
548 } 548 }
549 549
550 void SharedRuntime::throw_and_post_jvmti_exception(JavaThread *thread, symbolOop name, const char *message) { 550 void SharedRuntime::throw_and_post_jvmti_exception(JavaThread *thread, Symbol* name, const char *message) {
551 Handle h_exception = Exceptions::new_exception(thread, name, message); 551 Handle h_exception = Exceptions::new_exception(thread, name, message);
552 throw_and_post_jvmti_exception(thread, h_exception); 552 throw_and_post_jvmti_exception(thread, h_exception);
553 } 553 }
554 554
555 // The interpreter code to call this tracing function is only 555 // The interpreter code to call this tracing function is only
878 878
879 int SharedRuntime::dtrace_object_alloc_base(Thread* thread, oopDesc* o) { 879 int SharedRuntime::dtrace_object_alloc_base(Thread* thread, oopDesc* o) {
880 assert(DTraceAllocProbes, "wrong call"); 880 assert(DTraceAllocProbes, "wrong call");
881 Klass* klass = o->blueprint(); 881 Klass* klass = o->blueprint();
882 int size = o->size(); 882 int size = o->size();
883 symbolOop name = klass->name(); 883 Symbol* name = klass->name();
884 HS_DTRACE_PROBE4(hotspot, object__alloc, get_java_tid(thread), 884 HS_DTRACE_PROBE4(hotspot, object__alloc, get_java_tid(thread),
885 name->bytes(), name->utf8_length(), size * HeapWordSize); 885 name->bytes(), name->utf8_length(), size * HeapWordSize);
886 return 0; 886 return 0;
887 } 887 }
888 888
889 JRT_LEAF(int, SharedRuntime::dtrace_method_entry( 889 JRT_LEAF(int, SharedRuntime::dtrace_method_entry(
890 JavaThread* thread, methodOopDesc* method)) 890 JavaThread* thread, methodOopDesc* method))
891 assert(DTraceMethodProbes, "wrong call"); 891 assert(DTraceMethodProbes, "wrong call");
892 symbolOop kname = method->klass_name(); 892 Symbol* kname = method->klass_name();
893 symbolOop name = method->name(); 893 Symbol* name = method->name();
894 symbolOop sig = method->signature(); 894 Symbol* sig = method->signature();
895 HS_DTRACE_PROBE7(hotspot, method__entry, get_java_tid(thread), 895 HS_DTRACE_PROBE7(hotspot, method__entry, get_java_tid(thread),
896 kname->bytes(), kname->utf8_length(), 896 kname->bytes(), kname->utf8_length(),
897 name->bytes(), name->utf8_length(), 897 name->bytes(), name->utf8_length(),
898 sig->bytes(), sig->utf8_length()); 898 sig->bytes(), sig->utf8_length());
899 return 0; 899 return 0;
900 JRT_END 900 JRT_END
901 901
902 JRT_LEAF(int, SharedRuntime::dtrace_method_exit( 902 JRT_LEAF(int, SharedRuntime::dtrace_method_exit(
903 JavaThread* thread, methodOopDesc* method)) 903 JavaThread* thread, methodOopDesc* method))
904 assert(DTraceMethodProbes, "wrong call"); 904 assert(DTraceMethodProbes, "wrong call");
905 symbolOop kname = method->klass_name(); 905 Symbol* kname = method->klass_name();
906 symbolOop name = method->name(); 906 Symbol* name = method->name();
907 symbolOop sig = method->signature(); 907 Symbol* sig = method->signature();
908 HS_DTRACE_PROBE7(hotspot, method__return, get_java_tid(thread), 908 HS_DTRACE_PROBE7(hotspot, method__return, get_java_tid(thread),
909 kname->bytes(), kname->utf8_length(), 909 kname->bytes(), kname->utf8_length(),
910 name->bytes(), name->utf8_length(), 910 name->bytes(), name->utf8_length(),
911 sig->bytes(), sig->utf8_length()); 911 sig->bytes(), sig->utf8_length());
912 return 0; 912 return 0;
2635 // Return argument 0 register. In the LP64 build pointers 2635 // Return argument 0 register. In the LP64 build pointers
2636 // take 2 registers, but the VM wants only the 'main' name. 2636 // take 2 registers, but the VM wants only the 'main' name.
2637 return regs.first(); 2637 return regs.first();
2638 } 2638 }
2639 2639
2640 VMRegPair *SharedRuntime::find_callee_arguments(symbolOop sig, bool has_receiver, int* arg_size) { 2640 VMRegPair *SharedRuntime::find_callee_arguments(Symbol* sig, bool has_receiver, int* arg_size) {
2641 // This method is returning a data structure allocating as a 2641 // This method is returning a data structure allocating as a
2642 // ResourceObject, so do not put any ResourceMarks in here. 2642 // ResourceObject, so do not put any ResourceMarks in here.
2643 char *s = sig->as_C_string(); 2643 char *s = sig->as_C_string();
2644 int len = (int)strlen(s); 2644 int len = (int)strlen(s);
2645 *s++; len--; // Skip opening paren 2645 *s++; len--; // Skip opening paren