< prev index next >

src/share/vm/prims/jvmtiCodeBlobEvents.cpp

Print this page




 249                                                         jvmtiAddrLocationMap** map_ptr,
 250                                                         jint *map_length_ptr)
 251 {
 252   ResourceMark rm;
 253   jvmtiAddrLocationMap* map = NULL;
 254   jint map_length = 0;
 255 
 256 
 257   // Generate line numbers using PcDesc and ScopeDesc info
 258   methodHandle mh(nm->method());
 259 
 260   if (!mh->is_native()) {
 261     PcDesc *pcd;
 262     int pcds_in_method;
 263 
 264     pcds_in_method = (nm->scopes_pcs_end() - nm->scopes_pcs_begin());
 265     map = NEW_C_HEAP_ARRAY(jvmtiAddrLocationMap, pcds_in_method, mtInternal);
 266 
 267     address scopes_data = nm->scopes_data_begin();
 268     for( pcd = nm->scopes_pcs_begin(); pcd < nm->scopes_pcs_end(); ++pcd ) {
 269       ScopeDesc sc0(nm, pcd->scope_decode_offset(), pcd->should_reexecute(), pcd->return_oop());
 270       ScopeDesc *sd  = &sc0;
 271       while( !sd->is_top() ) { sd = sd->sender(); }
 272       int bci = sd->bci();
 273       if (bci != InvocationEntryBci) {
 274         assert(map_length < pcds_in_method, "checking");
 275         map[map_length].start_address = (const void*)pcd->real_pc(nm);
 276         map[map_length].location = bci;
 277         ++map_length;
 278       }
 279     }
 280   }
 281 
 282   *map_ptr = map;
 283   *map_length_ptr = map_length;
 284 }


 249                                                         jvmtiAddrLocationMap** map_ptr,
 250                                                         jint *map_length_ptr)
 251 {
 252   ResourceMark rm;
 253   jvmtiAddrLocationMap* map = NULL;
 254   jint map_length = 0;
 255 
 256 
 257   // Generate line numbers using PcDesc and ScopeDesc info
 258   methodHandle mh(nm->method());
 259 
 260   if (!mh->is_native()) {
 261     PcDesc *pcd;
 262     int pcds_in_method;
 263 
 264     pcds_in_method = (nm->scopes_pcs_end() - nm->scopes_pcs_begin());
 265     map = NEW_C_HEAP_ARRAY(jvmtiAddrLocationMap, pcds_in_method, mtInternal);
 266 
 267     address scopes_data = nm->scopes_data_begin();
 268     for( pcd = nm->scopes_pcs_begin(); pcd < nm->scopes_pcs_end(); ++pcd ) {
 269       ScopeDesc sc0(nm, pcd->scope_decode_offset(), pcd->should_reexecute(), pcd->rethrow_exception(), pcd->return_oop());
 270       ScopeDesc *sd  = &sc0;
 271       while( !sd->is_top() ) { sd = sd->sender(); }
 272       int bci = sd->bci();
 273       if (bci != InvocationEntryBci) {
 274         assert(map_length < pcds_in_method, "checking");
 275         map[map_length].start_address = (const void*)pcd->real_pc(nm);
 276         map[map_length].location = bci;
 277         ++map_length;
 278       }
 279     }
 280   }
 281 
 282   *map_ptr = map;
 283   *map_length_ptr = map_length;
 284 }
< prev index next >