1.1 --- a/src/share/vm/opto/compile.cpp Wed Jan 08 12:05:19 2014 +0100 1.2 +++ b/src/share/vm/opto/compile.cpp Wed Jan 08 10:25:50 2014 -0800 1.3 @@ -25,6 +25,7 @@ 1.4 #include "precompiled.hpp" 1.5 #include "asm/macroAssembler.hpp" 1.6 #include "asm/macroAssembler.inline.hpp" 1.7 +#include "ci/ciReplay.hpp" 1.8 #include "classfile/systemDictionary.hpp" 1.9 #include "code/exceptionHandlerTable.hpp" 1.10 #include "code/nmethod.hpp" 1.11 @@ -647,6 +648,7 @@ 1.12 _printer(IdealGraphPrinter::printer()), 1.13 #endif 1.14 _congraph(NULL), 1.15 + _replay_inline_data(NULL), 1.16 _late_inlines(comp_arena(), 2, 0, NULL), 1.17 _string_late_inlines(comp_arena(), 2, 0, NULL), 1.18 _boxing_late_inlines(comp_arena(), 2, 0, NULL), 1.19 @@ -680,6 +682,10 @@ 1.20 } 1.21 set_print_assembly(print_opto_assembly); 1.22 set_parsed_irreducible_loop(false); 1.23 + 1.24 + if (method()->has_option("ReplayInline")) { 1.25 + _replay_inline_data = ciReplay::load_inline_data(method(), entry_bci(), ci_env->comp_level()); 1.26 + } 1.27 #endif 1.28 set_print_inlining(PrintInlining || method()->has_option("PrintInlining") NOT_PRODUCT( || PrintOptoInlining)); 1.29 set_print_intrinsics(PrintIntrinsics || method()->has_option("PrintIntrinsics")); 1.30 @@ -849,6 +855,15 @@ 1.31 #endif 1.32 1.33 NOT_PRODUCT( verify_barriers(); ) 1.34 + 1.35 + // Dump compilation data to replay it. 1.36 + if (method()->has_option("DumpReplay")) { 1.37 + env()->dump_replay_data(_compile_id); 1.38 + } 1.39 + if (method()->has_option("DumpInline") && (ilt() != NULL)) { 1.40 + env()->dump_inline_data(_compile_id); 1.41 + } 1.42 + 1.43 // Now that we know the size of all the monitors we can add a fixed slot 1.44 // for the original deopt pc. 1.45 1.46 @@ -938,6 +953,7 @@ 1.47 _dead_node_list(comp_arena()), 1.48 _dead_node_count(0), 1.49 _congraph(NULL), 1.50 + _replay_inline_data(NULL), 1.51 _number_of_mh_late_inlines(0), 1.52 _inlining_progress(false), 1.53 _inlining_incrementally(false), 1.54 @@ -3757,6 +3773,16 @@ 1.55 } 1.56 } 1.57 1.58 +// Dump inlining replay data to the stream. 1.59 +// Don't change thread state and acquire any locks. 1.60 +void Compile::dump_inline_data(outputStream* out) { 1.61 + InlineTree* inl_tree = ilt(); 1.62 + if (inl_tree != NULL) { 1.63 + out->print(" inline %d", inl_tree->count()); 1.64 + inl_tree->dump_replay_data(out); 1.65 + } 1.66 +} 1.67 + 1.68 int Compile::cmp_expensive_nodes(Node* n1, Node* n2) { 1.69 if (n1->Opcode() < n2->Opcode()) return -1; 1.70 else if (n1->Opcode() > n2->Opcode()) return 1;