comparison src/share/vm/graal/graalCodeInstaller.cpp @ 7660:0b646334c5f7

keep track of leafGraphIds only at the StructuredGraph level (see GRAAL-60)
author Lukas Stadler <lukas.stadler@jku.at>
date Fri, 01 Feb 2013 17:32:59 +0100
parents 5d0bb7d52783
children fa8a56a351a5
comparison
equal deleted inserted replaced
7656:01aeaf194641 7660:0b646334c5f7
286 } 286 }
287 } 287 }
288 } 288 }
289 } 289 }
290 290
291 GrowableArray<jlong>* get_leaf_graph_ids(Handle& comp_result) {
292 arrayOop leafGraphArray = (arrayOop) CompilationResult::leafGraphIds(HotSpotCompilationResult::comp(comp_result));
293
294 GrowableArray<jlong>* result = new GrowableArray<jlong>(leafGraphArray->length());
295 for (int i = 0; i < leafGraphArray->length(); i++) {
296 result->append(((jlong*) leafGraphArray->base(T_LONG))[i]);
297 }
298
299 return result;
300 }
301
291 // constructor used to create a method 302 // constructor used to create a method
292 CodeInstaller::CodeInstaller(Handle& comp_result, methodHandle method, GraalEnv::CodeInstallResult& result, nmethod*& nm, Handle installed_code) { 303 CodeInstaller::CodeInstaller(Handle& comp_result, methodHandle method, GraalEnv::CodeInstallResult& result, nmethod*& nm, Handle installed_code) {
293 GraalCompiler::initialize_buffer_blob(); 304 GraalCompiler::initialize_buffer_blob();
294 CodeBuffer buffer(JavaThread::current()->get_buffer_blob()); 305 CodeBuffer buffer(JavaThread::current()->get_buffer_blob());
295 jobject comp_result_obj = JNIHandles::make_local(comp_result()); 306 jobject comp_result_obj = JNIHandles::make_local(comp_result());
302 initialize_buffer(buffer); 313 initialize_buffer(buffer);
303 process_exception_handlers(); 314 process_exception_handlers();
304 } 315 }
305 316
306 int stack_slots = _total_frame_size / HeapWordSize; // conversion to words 317 int stack_slots = _total_frame_size / HeapWordSize; // conversion to words
318 GrowableArray<jlong>* leaf_graph_ids = get_leaf_graph_ids(comp_result);
307 319
308 result = GraalEnv::register_method(method, nm, entry_bci, &_offsets, _custom_stack_area_offset, &buffer, stack_slots, _debug_recorder->_oopmaps, &_exception_handler_table, 320 result = GraalEnv::register_method(method, nm, entry_bci, &_offsets, _custom_stack_area_offset, &buffer, stack_slots, _debug_recorder->_oopmaps, &_exception_handler_table,
309 &_implicit_exception_table, GraalCompiler::instance(), _debug_recorder, _dependencies, NULL, -1, true, false, installed_code); 321 &_implicit_exception_table, GraalCompiler::instance(), _debug_recorder, _dependencies, NULL, -1, true, false, leaf_graph_ids, installed_code);
310 322
311 method->clear_queued_for_compilation(); 323 method->clear_queued_for_compilation();
312 } 324 }
313 325
314 // constructor used to create a stub 326 // constructor used to create a stub
550 oop debug_info = CompilationResult_Safepoint::debugInfo(site); 562 oop debug_info = CompilationResult_Safepoint::debugInfo(site);
551 assert(debug_info != NULL, "debug info expected"); 563 assert(debug_info != NULL, "debug info expected");
552 564
553 // address instruction = _instructions->start() + pc_offset; 565 // address instruction = _instructions->start() + pc_offset;
554 // jint next_pc_offset = Assembler::locate_next_instruction(instruction) - _instructions->start(); 566 // jint next_pc_offset = Assembler::locate_next_instruction(instruction) - _instructions->start();
555 _debug_recorder->add_safepoint(pc_offset, -1, create_oop_map(_total_frame_size, _parameter_count, debug_info)); 567 _debug_recorder->add_safepoint(pc_offset, create_oop_map(_total_frame_size, _parameter_count, debug_info));
556 568
557 oop frame = DebugInfo::bytecodePosition(debug_info); 569 oop frame = DebugInfo::bytecodePosition(debug_info);
558 if (frame != NULL) { 570 if (frame != NULL) {
559 record_scope(pc_offset, frame, new GrowableArray<ScopeValue*>()); 571 record_scope(pc_offset, frame, new GrowableArray<ScopeValue*>());
560 } else { 572 } else {
613 return; 625 return;
614 } 626 }
615 627
616 if (debug_info != NULL) { 628 if (debug_info != NULL) {
617 oop frame = DebugInfo::bytecodePosition(debug_info); 629 oop frame = DebugInfo::bytecodePosition(debug_info);
618 jlong leaf_graph_id = frame == NULL ? -1 : BytecodeFrame::leafGraphId(frame); 630 _debug_recorder->add_safepoint(next_pc_offset, create_oop_map(_total_frame_size, _parameter_count, debug_info));
619 _debug_recorder->add_safepoint(next_pc_offset, leaf_graph_id, create_oop_map(_total_frame_size, _parameter_count, debug_info));
620 if (frame != NULL) { 631 if (frame != NULL) {
621 record_scope(next_pc_offset, frame, new GrowableArray<ScopeValue*>()); 632 record_scope(next_pc_offset, frame, new GrowableArray<ScopeValue*>());
622 } else { 633 } else {
623 // Stubs do not record scope info, just oop maps 634 // Stubs do not record scope info, just oop maps
624 } 635 }