Mercurial > hg > graal-jvmci-8
comparison src/share/vm/code/nmethod.cpp @ 14172:cd22c8dbda4f
Made graph caching compilation local
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Thu, 13 Mar 2014 15:36:30 +0100 |
parents | 5a9afbf72714 |
children | 29ccc4cbabca |
comparison
equal
deleted
inserted
replaced
14171:8c0e92c8c45b | 14172:cd22c8dbda4f |
---|---|
621 CodeBuffer* code_buffer, int frame_size, | 621 CodeBuffer* code_buffer, int frame_size, |
622 OopMapSet* oop_maps, | 622 OopMapSet* oop_maps, |
623 ExceptionHandlerTable* handler_table, | 623 ExceptionHandlerTable* handler_table, |
624 ImplicitExceptionTable* nul_chk_table, | 624 ImplicitExceptionTable* nul_chk_table, |
625 AbstractCompiler* compiler, | 625 AbstractCompiler* compiler, |
626 int comp_level, | 626 int comp_level |
627 GrowableArray<jlong>* leaf_graph_ids | |
628 #ifdef GRAAL | 627 #ifdef GRAAL |
629 , Handle installed_code, | 628 , Handle installed_code, |
630 Handle speculationLog | 629 Handle speculationLog |
631 #endif | 630 #endif |
632 ) | 631 ) |
633 { | 632 { |
634 assert(debug_info->oop_recorder() == code_buffer->oop_recorder(), "shared OR"); | 633 assert(debug_info->oop_recorder() == code_buffer->oop_recorder(), "shared OR"); |
635 code_buffer->finalize_oop_references(method); | 634 code_buffer->finalize_oop_references(method); |
636 int leaf_graph_ids_size = leaf_graph_ids == NULL ? 0 : round_to(sizeof(jlong) * leaf_graph_ids->length(), oopSize); | |
637 // create nmethod | 635 // create nmethod |
638 nmethod* nm = NULL; | 636 nmethod* nm = NULL; |
639 { MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); | 637 { MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); |
640 int nmethod_size = | 638 int nmethod_size = |
641 allocation_size(code_buffer, sizeof(nmethod)) | 639 allocation_size(code_buffer, sizeof(nmethod)) |
642 + adjust_pcs_size(debug_info->pcs_size()) | 640 + adjust_pcs_size(debug_info->pcs_size()) |
643 + round_to(dependencies->size_in_bytes() , oopSize) | 641 + round_to(dependencies->size_in_bytes() , oopSize) |
644 + round_to(handler_table->size_in_bytes(), oopSize) | 642 + round_to(handler_table->size_in_bytes(), oopSize) |
645 + round_to(nul_chk_table->size_in_bytes(), oopSize) | 643 + round_to(nul_chk_table->size_in_bytes(), oopSize) |
646 + round_to(debug_info->data_size() , oopSize) | 644 + round_to(debug_info->data_size() , oopSize); |
647 + leaf_graph_ids_size; | |
648 nm = new (nmethod_size) | 645 nm = new (nmethod_size) |
649 nmethod(method(), nmethod_size, compile_id, entry_bci, offsets, | 646 nmethod(method(), nmethod_size, compile_id, entry_bci, offsets, |
650 orig_pc_offset, debug_info, dependencies, code_buffer, frame_size, | 647 orig_pc_offset, debug_info, dependencies, code_buffer, frame_size, |
651 oop_maps, | 648 oop_maps, |
652 handler_table, | 649 handler_table, |
653 nul_chk_table, | 650 nul_chk_table, |
654 compiler, | 651 compiler, |
655 comp_level, | 652 comp_level |
656 leaf_graph_ids | |
657 #ifdef GRAAL | 653 #ifdef GRAAL |
658 , installed_code, | 654 , installed_code, |
659 speculationLog | 655 speculationLog |
660 #endif | 656 #endif |
661 ); | 657 ); |
731 _scopes_data_offset = _metadata_offset + round_to(code_buffer->total_metadata_size(), wordSize); | 727 _scopes_data_offset = _metadata_offset + round_to(code_buffer->total_metadata_size(), wordSize); |
732 _scopes_pcs_offset = _scopes_data_offset; | 728 _scopes_pcs_offset = _scopes_data_offset; |
733 _dependencies_offset = _scopes_pcs_offset; | 729 _dependencies_offset = _scopes_pcs_offset; |
734 _handler_table_offset = _dependencies_offset; | 730 _handler_table_offset = _dependencies_offset; |
735 _nul_chk_table_offset = _handler_table_offset; | 731 _nul_chk_table_offset = _handler_table_offset; |
736 _leaf_graph_ids_offset = _nul_chk_table_offset; | 732 _nmethod_end_offset = _nul_chk_table_offset; |
737 _nmethod_end_offset = _leaf_graph_ids_offset; | |
738 _compile_id = compile_id; | 733 _compile_id = compile_id; |
739 _comp_level = CompLevel_none; | 734 _comp_level = CompLevel_none; |
740 _entry_point = code_begin() + offsets->value(CodeOffsets::Entry); | 735 _entry_point = code_begin() + offsets->value(CodeOffsets::Entry); |
741 _verified_entry_point = code_begin() + offsets->value(CodeOffsets::Verified_Entry); | 736 _verified_entry_point = code_begin() + offsets->value(CodeOffsets::Verified_Entry); |
742 _osr_entry_point = NULL; | 737 _osr_entry_point = NULL; |
879 int frame_size, | 874 int frame_size, |
880 OopMapSet* oop_maps, | 875 OopMapSet* oop_maps, |
881 ExceptionHandlerTable* handler_table, | 876 ExceptionHandlerTable* handler_table, |
882 ImplicitExceptionTable* nul_chk_table, | 877 ImplicitExceptionTable* nul_chk_table, |
883 AbstractCompiler* compiler, | 878 AbstractCompiler* compiler, |
884 int comp_level, | 879 int comp_level |
885 GrowableArray<jlong>* leaf_graph_ids | |
886 #ifdef GRAAL | 880 #ifdef GRAAL |
887 , Handle installed_code, | 881 , Handle installed_code, |
888 Handle speculation_log | 882 Handle speculation_log |
889 #endif | 883 #endif |
890 ) | 884 ) |
949 _unwind_handler_offset = code_offset() + offsets->value(CodeOffsets::UnwindHandler); | 943 _unwind_handler_offset = code_offset() + offsets->value(CodeOffsets::UnwindHandler); |
950 } else { | 944 } else { |
951 _unwind_handler_offset = -1; | 945 _unwind_handler_offset = -1; |
952 } | 946 } |
953 | 947 |
954 int leaf_graph_ids_size = leaf_graph_ids == NULL ? 0 : round_to(sizeof(jlong) * leaf_graph_ids->length(), oopSize); | |
955 | |
956 _oops_offset = data_offset(); | 948 _oops_offset = data_offset(); |
957 _metadata_offset = _oops_offset + round_to(code_buffer->total_oop_size(), oopSize); | 949 _metadata_offset = _oops_offset + round_to(code_buffer->total_oop_size(), oopSize); |
958 _scopes_data_offset = _metadata_offset + round_to(code_buffer->total_metadata_size(), wordSize); | 950 _scopes_data_offset = _metadata_offset + round_to(code_buffer->total_metadata_size(), wordSize); |
959 | 951 |
960 _scopes_pcs_offset = _scopes_data_offset + round_to(debug_info->data_size (), oopSize); | 952 _scopes_pcs_offset = _scopes_data_offset + round_to(debug_info->data_size (), oopSize); |
961 _dependencies_offset = _scopes_pcs_offset + adjust_pcs_size(debug_info->pcs_size()); | 953 _dependencies_offset = _scopes_pcs_offset + adjust_pcs_size(debug_info->pcs_size()); |
962 _handler_table_offset = _dependencies_offset + round_to(dependencies->size_in_bytes (), oopSize); | 954 _handler_table_offset = _dependencies_offset + round_to(dependencies->size_in_bytes (), oopSize); |
963 _nul_chk_table_offset = _handler_table_offset + round_to(handler_table->size_in_bytes(), oopSize); | 955 _nul_chk_table_offset = _handler_table_offset + round_to(handler_table->size_in_bytes(), oopSize); |
964 _leaf_graph_ids_offset = _nul_chk_table_offset + round_to(nul_chk_table->size_in_bytes(), oopSize); | 956 _nmethod_end_offset = _nul_chk_table_offset + round_to(nul_chk_table->size_in_bytes(), oopSize); |
965 _nmethod_end_offset = _leaf_graph_ids_offset + leaf_graph_ids_size; | |
966 | 957 |
967 _entry_point = code_begin() + offsets->value(CodeOffsets::Entry); | 958 _entry_point = code_begin() + offsets->value(CodeOffsets::Entry); |
968 _verified_entry_point = code_begin() + offsets->value(CodeOffsets::Verified_Entry); | 959 _verified_entry_point = code_begin() + offsets->value(CodeOffsets::Verified_Entry); |
969 _osr_entry_point = code_begin() + offsets->value(CodeOffsets::OSR_Entry); | 960 _osr_entry_point = code_begin() + offsets->value(CodeOffsets::OSR_Entry); |
970 _exception_cache = NULL; | 961 _exception_cache = NULL; |
983 CodeCache::commit(this); | 974 CodeCache::commit(this); |
984 | 975 |
985 // Copy contents of ExceptionHandlerTable to nmethod | 976 // Copy contents of ExceptionHandlerTable to nmethod |
986 handler_table->copy_to(this); | 977 handler_table->copy_to(this); |
987 nul_chk_table->copy_to(this); | 978 nul_chk_table->copy_to(this); |
988 | |
989 if (leaf_graph_ids != NULL && leaf_graph_ids_size > 0) { | |
990 memcpy(leaf_graph_ids_begin(), leaf_graph_ids->adr_at(0), leaf_graph_ids_size); | |
991 } | |
992 | 979 |
993 // we use the information of entry points to find out if a method is | 980 // we use the information of entry points to find out if a method is |
994 // static or non static | 981 // static or non static |
995 assert(compiler->is_c2() || compiler->is_graal() || | 982 assert(compiler->is_c2() || compiler->is_graal() || |
996 _method->is_static() == (entry_point() == _verified_entry_point), | 983 _method->is_static() == (entry_point() == _verified_entry_point), |