comparison src/share/vm/runtime/frame.cpp @ 7212:291ffc492eb6

Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/
author Doug Simon <doug.simon@oracle.com>
date Fri, 14 Dec 2012 14:35:13 +0100
parents e522a00b91aa d2f8c38e543d
children a7a93887b4c4
comparison
equal deleted inserted replaced
7163:2ed8d74e5984 7212:291ffc492eb6
21 * questions. 21 * questions.
22 * 22 *
23 */ 23 */
24 24
25 #include "precompiled.hpp" 25 #include "precompiled.hpp"
26 #include "compiler/disassembler.hpp"
26 #include "gc_interface/collectedHeap.inline.hpp" 27 #include "gc_interface/collectedHeap.inline.hpp"
27 #include "interpreter/interpreter.hpp" 28 #include "interpreter/interpreter.hpp"
28 #include "interpreter/oopMapCache.hpp" 29 #include "interpreter/oopMapCache.hpp"
29 #include "memory/resourceArea.hpp" 30 #include "memory/resourceArea.hpp"
30 #include "memory/universe.inline.hpp" 31 #include "memory/universe.inline.hpp"
899 int size = asc.size(); 900 int size = asc.size();
900 return (oop *)interpreter_frame_tos_at(size); 901 return (oop *)interpreter_frame_tos_at(size);
901 } 902 }
902 903
903 904
904 void frame::oops_interpreted_do(OopClosure* f, const RegisterMap* map, bool query_oop_map_cache) { 905 void frame::oops_interpreted_do(OopClosure* f, CLDToOopClosure* cld_f,
906 const RegisterMap* map, bool query_oop_map_cache) {
905 assert(is_interpreted_frame(), "Not an interpreted frame"); 907 assert(is_interpreted_frame(), "Not an interpreted frame");
906 assert(map != NULL, "map must be set"); 908 assert(map != NULL, "map must be set");
907 Thread *thread = Thread::current(); 909 Thread *thread = Thread::current();
908 methodHandle m (thread, interpreter_frame_method()); 910 methodHandle m (thread, interpreter_frame_method());
909 jint bci = interpreter_frame_bci(); 911 jint bci = interpreter_frame_bci();
926 #endif 928 #endif
927 current->oops_do(f); 929 current->oops_do(f);
928 } 930 }
929 931
930 // process fixed part 932 // process fixed part
933 if (cld_f != NULL) {
934 // The method pointer in the frame might be the only path to the method's
935 // klass, and the klass needs to be kept alive while executing. The GCs
936 // don't trace through method pointers, so typically in similar situations
937 // the mirror or the class loader of the klass are installed as a GC root.
938 // To minimze the overhead of doing that here, we ask the GC to pass down a
939 // closure that knows how to keep klasses alive given a ClassLoaderData.
940 cld_f->do_cld(m->method_holder()->class_loader_data());
941 }
942
931 #if !defined(PPC) || defined(ZERO) 943 #if !defined(PPC) || defined(ZERO)
932 if (m->is_native()) { 944 if (m->is_native()) {
933 #ifdef CC_INTERP 945 #ifdef CC_INTERP
934 interpreterState istate = get_interpreterState(); 946 interpreterState istate = get_interpreterState();
935 f->do_oop((oop*)&istate->_oop_temp); 947 f->do_oop((oop*)&istate->_oop_temp);
1128 // Traverse the Handle Block saved in the entry frame 1140 // Traverse the Handle Block saved in the entry frame
1129 entry_frame_call_wrapper()->oops_do(f); 1141 entry_frame_call_wrapper()->oops_do(f);
1130 } 1142 }
1131 1143
1132 1144
1133 void frame::oops_do_internal(OopClosure* f, CodeBlobClosure* cf, RegisterMap* map, bool use_interpreter_oop_map_cache) { 1145 void frame::oops_do_internal(OopClosure* f, CLDToOopClosure* cld_f, CodeBlobClosure* cf, RegisterMap* map, bool use_interpreter_oop_map_cache) {
1134 #ifndef PRODUCT 1146 #ifndef PRODUCT
1135 // simulate GC crash here to dump java thread in error report 1147 // simulate GC crash here to dump java thread in error report
1136 if (CrashGCForDumpingJavaThread) { 1148 if (CrashGCForDumpingJavaThread) {
1137 char *t = NULL; 1149 char *t = NULL;
1138 *t = 'c'; 1150 *t = 'c';
1139 } 1151 }
1140 #endif 1152 #endif
1141 if (is_interpreted_frame()) { 1153 if (is_interpreted_frame()) {
1142 oops_interpreted_do(f, map, use_interpreter_oop_map_cache); 1154 oops_interpreted_do(f, cld_f, map, use_interpreter_oop_map_cache);
1143 } else if (is_entry_frame()) { 1155 } else if (is_entry_frame()) {
1144 oops_entry_do(f, map); 1156 oops_entry_do(f, map);
1145 } else if (CodeCache::contains(pc())) { 1157 } else if (CodeCache::contains(pc())) {
1146 oops_code_blob_do(f, cf, map); 1158 oops_code_blob_do(f, cf, map);
1147 #ifdef SHARK 1159 #ifdef SHARK
1298 oop* p = (oop*) interpreter_frame_local_at(0); 1310 oop* p = (oop*) interpreter_frame_local_at(0);
1299 // make sure we have the right receiver type 1311 // make sure we have the right receiver type
1300 } 1312 }
1301 } 1313 }
1302 COMPILER2_PRESENT(assert(DerivedPointerTable::is_empty(), "must be empty before verify");) 1314 COMPILER2_PRESENT(assert(DerivedPointerTable::is_empty(), "must be empty before verify");)
1303 oops_do_internal(&VerifyOopClosure::verify_oop, NULL, (RegisterMap*)map, false); 1315 oops_do_internal(&VerifyOopClosure::verify_oop, NULL, NULL, (RegisterMap*)map, false);
1304 } 1316 }
1305 1317
1306 1318
1307 #ifdef ASSERT 1319 #ifdef ASSERT
1308 bool frame::verify_return_pc(address x) { 1320 bool frame::verify_return_pc(address x) {