< prev index next >

src/hotspot/share/prims/jvmtiCodeBlobEvents.cpp

Print this page
rev 60137 : 8227745: Enable Escape Analysis for Better Performance in the Presence of JVMTI Agents
Reviewed-by: mdoerr, goetz


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


 258                                                         jvmtiAddrLocationMap** map_ptr,
 259                                                         jint *map_length_ptr)
 260 {
 261   ResourceMark rm;
 262   jvmtiAddrLocationMap* map = NULL;
 263   jint map_length = 0;
 264 
 265 
 266   // Generate line numbers using PcDesc and ScopeDesc info
 267   methodHandle mh(Thread::current(), nm->method());
 268 
 269   if (!mh->is_native()) {
 270     PcDesc *pcd;
 271     int pcds_in_method;
 272 
 273     pcds_in_method = (nm->scopes_pcs_end() - nm->scopes_pcs_begin());
 274     map = NEW_C_HEAP_ARRAY(jvmtiAddrLocationMap, pcds_in_method, mtInternal);
 275 
 276     address scopes_data = nm->scopes_data_begin();
 277     for( pcd = nm->scopes_pcs_begin(); pcd < nm->scopes_pcs_end(); ++pcd ) {
 278       ScopeDesc sc0(nm, pcd, true);
 279       ScopeDesc *sd  = &sc0;
 280       while( !sd->is_top() ) { sd = sd->sender(); }
 281       int bci = sd->bci();
 282       if (bci >= 0) {
 283         assert(map_length < pcds_in_method, "checking");
 284         map[map_length].start_address = (const void*)pcd->real_pc(nm);
 285         map[map_length].location = bci;
 286         ++map_length;
 287       }
 288     }
 289   }
 290 
 291   *map_ptr = map;
 292   *map_length_ptr = map_length;
 293 }
< prev index next >