Mercurial > hg > graal-jvmci-8
comparison src/share/vm/oops/methodOop.cpp @ 2264:a97fd181b813
Merge
author | kvn |
---|---|
date | Wed, 23 Feb 2011 11:18:16 -0800 |
parents | 173926398291 f77b3ec064b0 |
children | dbad0519a1c4 |
comparison
equal
deleted
inserted
replaced
2263:5841dc1964f0 | 2264:a97fd181b813 |
---|---|
983 localvariable_len, | 983 localvariable_len, |
984 checked_exceptions_len, | 984 checked_exceptions_len, |
985 IsUnsafeConc, | 985 IsUnsafeConc, |
986 CHECK_(methodHandle())); | 986 CHECK_(methodHandle())); |
987 methodHandle newm (THREAD, newm_oop); | 987 methodHandle newm (THREAD, newm_oop); |
988 NOT_PRODUCT(int nmsz = newm->is_parsable() ? newm->size() : -1;) | |
988 int new_method_size = newm->method_size(); | 989 int new_method_size = newm->method_size(); |
989 // Create a shallow copy of methodOopDesc part, but be careful to preserve the new constMethodOop | 990 // Create a shallow copy of methodOopDesc part, but be careful to preserve the new constMethodOop |
990 constMethodOop newcm = newm->constMethod(); | 991 constMethodOop newcm = newm->constMethod(); |
992 NOT_PRODUCT(int ncmsz = newcm->is_parsable() ? newcm->size() : -1;) | |
991 int new_const_method_size = newm->constMethod()->object_size(); | 993 int new_const_method_size = newm->constMethod()->object_size(); |
992 | 994 |
993 memcpy(newm(), m(), sizeof(methodOopDesc)); | 995 memcpy(newm(), m(), sizeof(methodOopDesc)); |
994 // Create shallow copy of constMethodOopDesc, but be careful to preserve the methodOop | 996 // Create shallow copy of constMethodOopDesc, but be careful to preserve the methodOop |
995 // is_conc_safe is set to false because that is the value of | 997 // is_conc_safe is set to false because that is the value of |
997 // not overwrite that value. During the window during which it is | 999 // not overwrite that value. During the window during which it is |
998 // tagged as unsafe, some extra work could be needed during precleaning | 1000 // tagged as unsafe, some extra work could be needed during precleaning |
999 // or concurrent marking but those phases will be correct. Setting and | 1001 // or concurrent marking but those phases will be correct. Setting and |
1000 // resetting is done in preference to a careful copying into newcm to | 1002 // resetting is done in preference to a careful copying into newcm to |
1001 // avoid having to know the precise layout of a constMethodOop. | 1003 // avoid having to know the precise layout of a constMethodOop. |
1002 m->constMethod()->set_is_conc_safe(false); | 1004 m->constMethod()->set_is_conc_safe(oopDesc::IsUnsafeConc); |
1005 assert(m->constMethod()->is_parsable(), "Should remain parsable"); | |
1006 | |
1007 // NOTE: this is a reachable object that transiently signals "conc_unsafe" | |
1008 // However, no allocations are done during this window | |
1009 // during which it is tagged conc_unsafe, so we are assured that any concurrent | |
1010 // thread will not wait forever for the object to revert to "conc_safe". | |
1011 // Further, any such conc_unsafe object will indicate a stable size | |
1012 // through the transition. | |
1003 memcpy(newcm, m->constMethod(), sizeof(constMethodOopDesc)); | 1013 memcpy(newcm, m->constMethod(), sizeof(constMethodOopDesc)); |
1004 m->constMethod()->set_is_conc_safe(true); | 1014 m->constMethod()->set_is_conc_safe(oopDesc::IsSafeConc); |
1015 assert(m->constMethod()->is_parsable(), "Should remain parsable"); | |
1016 | |
1005 // Reset correct method/const method, method size, and parameter info | 1017 // Reset correct method/const method, method size, and parameter info |
1006 newcm->set_method(newm()); | 1018 newcm->set_method(newm()); |
1007 newm->set_constMethod(newcm); | 1019 newm->set_constMethod(newcm); |
1008 assert(newcm->method() == newm(), "check"); | 1020 assert(newcm->method() == newm(), "check"); |
1009 newm->constMethod()->set_code_size(new_code_length); | 1021 newm->constMethod()->set_code_size(new_code_length); |
1033 localvariable_len * sizeof(LocalVariableTableElement)); | 1045 localvariable_len * sizeof(LocalVariableTableElement)); |
1034 } | 1046 } |
1035 | 1047 |
1036 // Only set is_conc_safe to true when changes to newcm are | 1048 // Only set is_conc_safe to true when changes to newcm are |
1037 // complete. | 1049 // complete. |
1050 assert(!newm->is_parsable() || nmsz < 0 || newm->size() == nmsz, "newm->size() inconsistency"); | |
1051 assert(!newcm->is_parsable() || ncmsz < 0 || newcm->size() == ncmsz, "newcm->size() inconsistency"); | |
1038 newcm->set_is_conc_safe(true); | 1052 newcm->set_is_conc_safe(true); |
1039 return newm; | 1053 return newm; |
1040 } | 1054 } |
1041 | 1055 |
1042 vmSymbols::SID methodOopDesc::klass_id_for_intrinsics(klassOop holder) { | 1056 vmSymbols::SID methodOopDesc::klass_id_for_intrinsics(klassOop holder) { |
1370 write_signed_int(bci_delta); | 1384 write_signed_int(bci_delta); |
1371 write_signed_int(line_delta); | 1385 write_signed_int(line_delta); |
1372 } | 1386 } |
1373 | 1387 |
1374 // See comment in methodOop.hpp which explains why this exists. | 1388 // See comment in methodOop.hpp which explains why this exists. |
1375 #if defined(_M_AMD64) && MSC_VER >= 1400 | 1389 #if defined(_M_AMD64) && _MSC_VER >= 1400 |
1376 #pragma optimize("", off) | 1390 #pragma optimize("", off) |
1377 void CompressedLineNumberWriteStream::write_pair(int bci, int line) { | 1391 void CompressedLineNumberWriteStream::write_pair(int bci, int line) { |
1378 write_pair_inline(bci, line); | 1392 write_pair_inline(bci, line); |
1379 } | 1393 } |
1380 #pragma optimize("", on) | 1394 #pragma optimize("", on) |