Mercurial > hg > graal-jvmci-8
comparison src/share/vm/code/nmethod.cpp @ 13641:5a9afbf72714
Add a speculation oop for uncommon trap deoptimization. Save it in the SpeculationLog during deoptimization.
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Thu, 12 Dec 2013 15:13:02 +0100 |
parents | 02f27ecb4f3a |
children | cd22c8dbda4f d8041d695d19 |
comparison
equal
deleted
inserted
replaced
13640:bfe7a8c8c3c6 | 13641:5a9afbf72714 |
---|---|
526 _scavenge_root_link = NULL; | 526 _scavenge_root_link = NULL; |
527 _scavenge_root_state = 0; | 527 _scavenge_root_state = 0; |
528 _compiler = NULL; | 528 _compiler = NULL; |
529 #ifdef GRAAL | 529 #ifdef GRAAL |
530 _graal_installed_code = NULL; | 530 _graal_installed_code = NULL; |
531 _triggered_deoptimizations = NULL; | 531 _speculation_log = NULL; |
532 #endif | 532 #endif |
533 #ifdef HAVE_DTRACE_H | 533 #ifdef HAVE_DTRACE_H |
534 _trap_offset = 0; | 534 _trap_offset = 0; |
535 #endif // def HAVE_DTRACE_H | 535 #endif // def HAVE_DTRACE_H |
536 } | 536 } |
625 AbstractCompiler* compiler, | 625 AbstractCompiler* compiler, |
626 int comp_level, | 626 int comp_level, |
627 GrowableArray<jlong>* leaf_graph_ids | 627 GrowableArray<jlong>* leaf_graph_ids |
628 #ifdef GRAAL | 628 #ifdef GRAAL |
629 , Handle installed_code, | 629 , Handle installed_code, |
630 Handle triggered_deoptimizations | 630 Handle speculationLog |
631 #endif | 631 #endif |
632 ) | 632 ) |
633 { | 633 { |
634 assert(debug_info->oop_recorder() == code_buffer->oop_recorder(), "shared OR"); | 634 assert(debug_info->oop_recorder() == code_buffer->oop_recorder(), "shared OR"); |
635 code_buffer->finalize_oop_references(method); | 635 code_buffer->finalize_oop_references(method); |
654 compiler, | 654 compiler, |
655 comp_level, | 655 comp_level, |
656 leaf_graph_ids | 656 leaf_graph_ids |
657 #ifdef GRAAL | 657 #ifdef GRAAL |
658 , installed_code, | 658 , installed_code, |
659 triggered_deoptimizations | 659 speculationLog |
660 #endif | 660 #endif |
661 ); | 661 ); |
662 | 662 |
663 if (nm != NULL) { | 663 if (nm != NULL) { |
664 // To make dependency checking during class loading fast, record | 664 // To make dependency checking during class loading fast, record |
883 AbstractCompiler* compiler, | 883 AbstractCompiler* compiler, |
884 int comp_level, | 884 int comp_level, |
885 GrowableArray<jlong>* leaf_graph_ids | 885 GrowableArray<jlong>* leaf_graph_ids |
886 #ifdef GRAAL | 886 #ifdef GRAAL |
887 , Handle installed_code, | 887 , Handle installed_code, |
888 Handle triggered_deoptimizations | 888 Handle speculation_log |
889 #endif | 889 #endif |
890 ) | 890 ) |
891 : CodeBlob("nmethod", code_buffer, sizeof(nmethod), | 891 : CodeBlob("nmethod", code_buffer, sizeof(nmethod), |
892 nmethod_size, offsets->value(CodeOffsets::Frame_Complete), frame_size, oop_maps), | 892 nmethod_size, offsets->value(CodeOffsets::Frame_Complete), frame_size, oop_maps), |
893 _native_receiver_sp_offset(in_ByteSize(-1)), | 893 _native_receiver_sp_offset(in_ByteSize(-1)), |
911 _consts_offset = content_offset() + code_buffer->total_offset_of(code_buffer->consts()); | 911 _consts_offset = content_offset() + code_buffer->total_offset_of(code_buffer->consts()); |
912 _stub_offset = content_offset() + code_buffer->total_offset_of(code_buffer->stubs()); | 912 _stub_offset = content_offset() + code_buffer->total_offset_of(code_buffer->stubs()); |
913 | 913 |
914 #ifdef GRAAL | 914 #ifdef GRAAL |
915 _graal_installed_code = installed_code(); | 915 _graal_installed_code = installed_code(); |
916 _triggered_deoptimizations = (typeArrayOop)triggered_deoptimizations(); | 916 _speculation_log = (instanceOop)speculation_log(); |
917 #endif | 917 #endif |
918 if (compiler->is_graal()) { | 918 if (compiler->is_graal()) { |
919 // Graal might not produce any stub sections | 919 // Graal might not produce any stub sections |
920 if (offsets->value(CodeOffsets::Exceptions) != -1) { | 920 if (offsets->value(CodeOffsets::Exceptions) != -1) { |
921 _exception_offset = code_offset() + offsets->value(CodeOffsets::Exceptions); | 921 _exception_offset = code_offset() + offsets->value(CodeOffsets::Exceptions); |
1758 } | 1758 } |
1759 } else { | 1759 } else { |
1760 if (can_unload(is_alive, (oop*)&_graal_installed_code, unloading_occurred)) { | 1760 if (can_unload(is_alive, (oop*)&_graal_installed_code, unloading_occurred)) { |
1761 return; | 1761 return; |
1762 } | 1762 } |
1763 } | |
1764 } | |
1765 | |
1766 if (_speculation_log != NULL) { | |
1767 if (!is_alive->do_object_b(_speculation_log)) { | |
1768 _speculation_log = NULL; | |
1763 } | 1769 } |
1764 } | 1770 } |
1765 #endif | 1771 #endif |
1766 | 1772 |
1767 // Exception cache | 1773 // Exception cache |
1988 | 1994 |
1989 #ifdef GRAAL | 1995 #ifdef GRAAL |
1990 if (_graal_installed_code != NULL) { | 1996 if (_graal_installed_code != NULL) { |
1991 f->do_oop((oop*) &_graal_installed_code); | 1997 f->do_oop((oop*) &_graal_installed_code); |
1992 } | 1998 } |
1993 if (_triggered_deoptimizations != NULL) { | 1999 if (_speculation_log != NULL) { |
1994 f->do_oop((oop*) &_triggered_deoptimizations); | 2000 f->do_oop((oop*) &_speculation_log); |
1995 } | 2001 } |
1996 #endif | 2002 #endif |
1997 | 2003 |
1998 RelocIterator iter(this, low_boundary); | 2004 RelocIterator iter(this, low_boundary); |
1999 | 2005 |