839 OptoReg::Name box_reg = BoxLockNode::reg(box_node);
840 Location basic_lock = Location::new_stk_loc(Location::normal,_regalloc->reg2offset(box_reg));
841 bool eliminated = (box_node->is_BoxLock() && box_node->as_BoxLock()->is_eliminated());
842 monarray->append(new MonitorValue(scval, basic_lock, eliminated));
843 }
844
845 // We dump the object pool first, since deoptimization reads it in first.
846 debug_info()->dump_object_pool(objs);
847
848 // Build first class objects to pass to scope
849 DebugToken *locvals = debug_info()->create_scope_values(locarray);
850 DebugToken *expvals = debug_info()->create_scope_values(exparray);
851 DebugToken *monvals = debug_info()->create_monitor_values(monarray);
852
853 // Make method available for all Safepoints
854 ciMethod* scope_method = method ? method : _method;
855 // Describe the scope here
856 assert(jvms->bci() >= InvocationEntryBci && jvms->bci() <= 0x10000, "must be a valid or entry BCI");
857 assert(!jvms->should_reexecute() || depth == max_depth, "reexecute allowed only for the youngest");
858 // Now we can describe the scope.
859 debug_info()->describe_scope(safepoint_pc_offset, scope_method, jvms->bci(), jvms->should_reexecute(), is_method_handle_invoke, return_oop, locvals, expvals, monvals);
860 } // End jvms loop
861
862 // Mark the end of the scope set.
863 debug_info()->end_safepoint(safepoint_pc_offset);
864 }
865
866
867
868 // A simplified version of Process_OopMap_Node, to handle non-safepoints.
869 class NonSafepointEmitter {
870 Compile* C;
871 JVMState* _pending_jvms;
872 int _pending_offset;
873
874 void emit_non_safepoint();
875
876 public:
877 NonSafepointEmitter(Compile* compile) {
878 this->C = compile;
879 _pending_jvms = NULL;
922 };
923
924 void NonSafepointEmitter::emit_non_safepoint() {
925 JVMState* youngest_jvms = _pending_jvms;
926 int pc_offset = _pending_offset;
927
928 // Clear it now:
929 _pending_jvms = NULL;
930
931 DebugInformationRecorder* debug_info = C->debug_info();
932 assert(debug_info->recording_non_safepoints(), "sanity");
933
934 debug_info->add_non_safepoint(pc_offset);
935 int max_depth = youngest_jvms->depth();
936
937 // Visit scopes from oldest to youngest.
938 for (int depth = 1; depth <= max_depth; depth++) {
939 JVMState* jvms = youngest_jvms->of_depth(depth);
940 ciMethod* method = jvms->has_method() ? jvms->method() : NULL;
941 assert(!jvms->should_reexecute() || depth==max_depth, "reexecute allowed only for the youngest");
942 debug_info->describe_scope(pc_offset, method, jvms->bci(), jvms->should_reexecute());
943 }
944
945 // Mark the end of the scope set.
946 debug_info->end_non_safepoint(pc_offset);
947 }
948
949 //------------------------------init_buffer------------------------------------
950 CodeBuffer* Compile::init_buffer(uint* blk_starts) {
951
952 // Set the initially allocated size
953 int code_req = initial_code_capacity;
954 int locs_req = initial_locs_capacity;
955 int stub_req = TraceJumps ? initial_stub_capacity * 10 : initial_stub_capacity;
956 int const_req = initial_const_capacity;
957
958 int pad_req = NativeCall::instruction_size;
959 // The extra spacing after the code is necessary on some platforms.
960 // Sometimes we need to patch in a jump after the last instruction,
961 // if the nmethod has been deoptimized. (See 4932387, 4894843.)
962
|
839 OptoReg::Name box_reg = BoxLockNode::reg(box_node);
840 Location basic_lock = Location::new_stk_loc(Location::normal,_regalloc->reg2offset(box_reg));
841 bool eliminated = (box_node->is_BoxLock() && box_node->as_BoxLock()->is_eliminated());
842 monarray->append(new MonitorValue(scval, basic_lock, eliminated));
843 }
844
845 // We dump the object pool first, since deoptimization reads it in first.
846 debug_info()->dump_object_pool(objs);
847
848 // Build first class objects to pass to scope
849 DebugToken *locvals = debug_info()->create_scope_values(locarray);
850 DebugToken *expvals = debug_info()->create_scope_values(exparray);
851 DebugToken *monvals = debug_info()->create_monitor_values(monarray);
852
853 // Make method available for all Safepoints
854 ciMethod* scope_method = method ? method : _method;
855 // Describe the scope here
856 assert(jvms->bci() >= InvocationEntryBci && jvms->bci() <= 0x10000, "must be a valid or entry BCI");
857 assert(!jvms->should_reexecute() || depth == max_depth, "reexecute allowed only for the youngest");
858 // Now we can describe the scope.
859 methodHandle null_mh;
860 bool rethrow_exception = false;
861 debug_info()->describe_scope(safepoint_pc_offset, null_mh, scope_method, jvms->bci(), jvms->should_reexecute(), rethrow_exception, is_method_handle_invoke, return_oop, locvals, expvals, monvals);
862 } // End jvms loop
863
864 // Mark the end of the scope set.
865 debug_info()->end_safepoint(safepoint_pc_offset);
866 }
867
868
869
870 // A simplified version of Process_OopMap_Node, to handle non-safepoints.
871 class NonSafepointEmitter {
872 Compile* C;
873 JVMState* _pending_jvms;
874 int _pending_offset;
875
876 void emit_non_safepoint();
877
878 public:
879 NonSafepointEmitter(Compile* compile) {
880 this->C = compile;
881 _pending_jvms = NULL;
924 };
925
926 void NonSafepointEmitter::emit_non_safepoint() {
927 JVMState* youngest_jvms = _pending_jvms;
928 int pc_offset = _pending_offset;
929
930 // Clear it now:
931 _pending_jvms = NULL;
932
933 DebugInformationRecorder* debug_info = C->debug_info();
934 assert(debug_info->recording_non_safepoints(), "sanity");
935
936 debug_info->add_non_safepoint(pc_offset);
937 int max_depth = youngest_jvms->depth();
938
939 // Visit scopes from oldest to youngest.
940 for (int depth = 1; depth <= max_depth; depth++) {
941 JVMState* jvms = youngest_jvms->of_depth(depth);
942 ciMethod* method = jvms->has_method() ? jvms->method() : NULL;
943 assert(!jvms->should_reexecute() || depth==max_depth, "reexecute allowed only for the youngest");
944 methodHandle null_mh;
945 debug_info->describe_scope(pc_offset, null_mh, method, jvms->bci(), jvms->should_reexecute());
946 }
947
948 // Mark the end of the scope set.
949 debug_info->end_non_safepoint(pc_offset);
950 }
951
952 //------------------------------init_buffer------------------------------------
953 CodeBuffer* Compile::init_buffer(uint* blk_starts) {
954
955 // Set the initially allocated size
956 int code_req = initial_code_capacity;
957 int locs_req = initial_locs_capacity;
958 int stub_req = TraceJumps ? initial_stub_capacity * 10 : initial_stub_capacity;
959 int const_req = initial_const_capacity;
960
961 int pad_req = NativeCall::instruction_size;
962 // The extra spacing after the code is necessary on some platforms.
963 // Sometimes we need to patch in a jump after the last instruction,
964 // if the nmethod has been deoptimized. (See 4932387, 4894843.)
965
|