883 if (PrintDependencies) {
884 print_dependencies();
885 }
886 if (PrintExceptionHandlers) {
887 print_handler_table();
888 print_nul_chk_table();
889 }
890 if (xtty != NULL) {
891 xtty->tail("print_nmethod");
892 }
893 }
894
895
896 // Promote one word from an assembly-time handle to a live embedded oop.
897 inline void nmethod::initialize_immediate_oop(oop* dest, jobject handle) {
898 if (handle == NULL ||
899 // As a special case, IC oops are initialized to 1 or -1.
900 handle == (jobject) Universe::non_oop_word()) {
901 (*dest) = (oop) handle;
902 } else {
903 (*dest) = JNIHandles::resolve_non_null(handle);
904 }
905 }
906
907
908 // Have to have the same name because it's called by a template
909 void nmethod::copy_values(GrowableArray<jobject>* array) {
910 int length = array->length();
911 assert((address)(oops_begin() + length) <= (address)oops_end(), "oops big enough");
912 oop* dest = oops_begin();
913 for (int index = 0 ; index < length; index++) {
914 initialize_immediate_oop(&dest[index], array->at(index));
915 }
916
917 // Now we can fix up all the oops in the code. We need to do this
918 // in the code because the assembler uses jobjects as placeholders.
919 // The code and relocations have already been initialized by the
920 // CodeBlob constructor, so it is valid even at this early point to
921 // iterate over relocations and patch the code.
922 fix_oop_relocations(NULL, NULL, /*initialize_immediates=*/ true);
923 }
|
883 if (PrintDependencies) {
884 print_dependencies();
885 }
886 if (PrintExceptionHandlers) {
887 print_handler_table();
888 print_nul_chk_table();
889 }
890 if (xtty != NULL) {
891 xtty->tail("print_nmethod");
892 }
893 }
894
895
896 // Promote one word from an assembly-time handle to a live embedded oop.
897 inline void nmethod::initialize_immediate_oop(oop* dest, jobject handle) {
898 if (handle == NULL ||
899 // As a special case, IC oops are initialized to 1 or -1.
900 handle == (jobject) Universe::non_oop_word()) {
901 (*dest) = (oop) handle;
902 } else {
903 oop obj = JNIHandles::resolve_non_null(handle);
904 assert(obj == oopDesc::bs()->resolve_and_maybe_copy_oop(obj), "expect to-space copy");
905 (*dest) = obj;
906 }
907 }
908
909
910 // Have to have the same name because it's called by a template
911 void nmethod::copy_values(GrowableArray<jobject>* array) {
912 int length = array->length();
913 assert((address)(oops_begin() + length) <= (address)oops_end(), "oops big enough");
914 oop* dest = oops_begin();
915 for (int index = 0 ; index < length; index++) {
916 initialize_immediate_oop(&dest[index], array->at(index));
917 }
918
919 // Now we can fix up all the oops in the code. We need to do this
920 // in the code because the assembler uses jobjects as placeholders.
921 // The code and relocations have already been initialized by the
922 // CodeBlob constructor, so it is valid even at this early point to
923 // iterate over relocations and patch the code.
924 fix_oop_relocations(NULL, NULL, /*initialize_immediates=*/ true);
925 }
|