src/share/vm/opto/output.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/opto

src/share/vm/opto/output.cpp

Print this page




 956       OptoReg::Name box_reg = BoxLockNode::reg(box_node);
 957       Location basic_lock = Location::new_stk_loc(Location::normal,_regalloc->reg2offset(box_reg));
 958       bool eliminated = (box_node->is_BoxLock() && box_node->as_BoxLock()->is_eliminated());
 959       monarray->append(new MonitorValue(scval, basic_lock, eliminated));
 960     }
 961 
 962     // We dump the object pool first, since deoptimization reads it in first.
 963     debug_info()->dump_object_pool(objs);
 964 
 965     // Build first class objects to pass to scope
 966     DebugToken *locvals = debug_info()->create_scope_values(locarray);
 967     DebugToken *expvals = debug_info()->create_scope_values(exparray);
 968     DebugToken *monvals = debug_info()->create_monitor_values(monarray);
 969 
 970     // Make method available for all Safepoints
 971     ciMethod* scope_method = method ? method : _method;
 972     // Describe the scope here
 973     assert(jvms->bci() >= InvocationEntryBci && jvms->bci() <= 0x10000, "must be a valid or entry BCI");
 974     assert(!jvms->should_reexecute() || depth == max_depth, "reexecute allowed only for the youngest");
 975     // Now we can describe the scope.
 976     debug_info()->describe_scope(safepoint_pc_offset, scope_method, jvms->bci(), jvms->should_reexecute(), is_method_handle_invoke, return_oop, locvals, expvals, monvals);


 977   } // End jvms loop
 978 
 979   // Mark the end of the scope set.
 980   debug_info()->end_safepoint(safepoint_pc_offset);
 981 }
 982 
 983 
 984 
 985 // A simplified version of Process_OopMap_Node, to handle non-safepoints.
 986 class NonSafepointEmitter {
 987   Compile*  C;
 988   JVMState* _pending_jvms;
 989   int       _pending_offset;
 990 
 991   void emit_non_safepoint();
 992 
 993  public:
 994   NonSafepointEmitter(Compile* compile) {
 995     this->C = compile;
 996     _pending_jvms = NULL;


1039 };
1040 
1041 void NonSafepointEmitter::emit_non_safepoint() {
1042   JVMState* youngest_jvms = _pending_jvms;
1043   int       pc_offset     = _pending_offset;
1044 
1045   // Clear it now:
1046   _pending_jvms = NULL;
1047 
1048   DebugInformationRecorder* debug_info = C->debug_info();
1049   assert(debug_info->recording_non_safepoints(), "sanity");
1050 
1051   debug_info->add_non_safepoint(pc_offset);
1052   int max_depth = youngest_jvms->depth();
1053 
1054   // Visit scopes from oldest to youngest.
1055   for (int depth = 1; depth <= max_depth; depth++) {
1056     JVMState* jvms = youngest_jvms->of_depth(depth);
1057     ciMethod* method = jvms->has_method() ? jvms->method() : NULL;
1058     assert(!jvms->should_reexecute() || depth==max_depth, "reexecute allowed only for the youngest");
1059     debug_info->describe_scope(pc_offset, method, jvms->bci(), jvms->should_reexecute());

1060   }
1061 
1062   // Mark the end of the scope set.
1063   debug_info->end_non_safepoint(pc_offset);
1064 }
1065 
1066 //------------------------------init_buffer------------------------------------
1067 CodeBuffer* Compile::init_buffer(uint* blk_starts) {
1068 
1069   // Set the initially allocated size
1070   int  code_req   = initial_code_capacity;
1071   int  locs_req   = initial_locs_capacity;
1072   int  stub_req   = TraceJumps ? initial_stub_capacity * 10 : initial_stub_capacity;
1073   int  const_req  = initial_const_capacity;
1074 
1075   int  pad_req    = NativeCall::instruction_size;
1076   // The extra spacing after the code is necessary on some platforms.
1077   // Sometimes we need to patch in a jump after the last instruction,
1078   // if the nmethod has been deoptimized.  (See 4932387, 4894843.)
1079 




 956       OptoReg::Name box_reg = BoxLockNode::reg(box_node);
 957       Location basic_lock = Location::new_stk_loc(Location::normal,_regalloc->reg2offset(box_reg));
 958       bool eliminated = (box_node->is_BoxLock() && box_node->as_BoxLock()->is_eliminated());
 959       monarray->append(new MonitorValue(scval, basic_lock, eliminated));
 960     }
 961 
 962     // We dump the object pool first, since deoptimization reads it in first.
 963     debug_info()->dump_object_pool(objs);
 964 
 965     // Build first class objects to pass to scope
 966     DebugToken *locvals = debug_info()->create_scope_values(locarray);
 967     DebugToken *expvals = debug_info()->create_scope_values(exparray);
 968     DebugToken *monvals = debug_info()->create_monitor_values(monarray);
 969 
 970     // Make method available for all Safepoints
 971     ciMethod* scope_method = method ? method : _method;
 972     // Describe the scope here
 973     assert(jvms->bci() >= InvocationEntryBci && jvms->bci() <= 0x10000, "must be a valid or entry BCI");
 974     assert(!jvms->should_reexecute() || depth == max_depth, "reexecute allowed only for the youngest");
 975     // Now we can describe the scope.
 976     methodHandle null_mh;
 977     bool rethrow_exception = false;
 978     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);
 979   } // End jvms loop
 980 
 981   // Mark the end of the scope set.
 982   debug_info()->end_safepoint(safepoint_pc_offset);
 983 }
 984 
 985 
 986 
 987 // A simplified version of Process_OopMap_Node, to handle non-safepoints.
 988 class NonSafepointEmitter {
 989   Compile*  C;
 990   JVMState* _pending_jvms;
 991   int       _pending_offset;
 992 
 993   void emit_non_safepoint();
 994 
 995  public:
 996   NonSafepointEmitter(Compile* compile) {
 997     this->C = compile;
 998     _pending_jvms = NULL;


1041 };
1042 
1043 void NonSafepointEmitter::emit_non_safepoint() {
1044   JVMState* youngest_jvms = _pending_jvms;
1045   int       pc_offset     = _pending_offset;
1046 
1047   // Clear it now:
1048   _pending_jvms = NULL;
1049 
1050   DebugInformationRecorder* debug_info = C->debug_info();
1051   assert(debug_info->recording_non_safepoints(), "sanity");
1052 
1053   debug_info->add_non_safepoint(pc_offset);
1054   int max_depth = youngest_jvms->depth();
1055 
1056   // Visit scopes from oldest to youngest.
1057   for (int depth = 1; depth <= max_depth; depth++) {
1058     JVMState* jvms = youngest_jvms->of_depth(depth);
1059     ciMethod* method = jvms->has_method() ? jvms->method() : NULL;
1060     assert(!jvms->should_reexecute() || depth==max_depth, "reexecute allowed only for the youngest");
1061     methodHandle null_mh;
1062     debug_info->describe_scope(pc_offset, null_mh, method, jvms->bci(), jvms->should_reexecute());
1063   }
1064 
1065   // Mark the end of the scope set.
1066   debug_info->end_non_safepoint(pc_offset);
1067 }
1068 
1069 //------------------------------init_buffer------------------------------------
1070 CodeBuffer* Compile::init_buffer(uint* blk_starts) {
1071 
1072   // Set the initially allocated size
1073   int  code_req   = initial_code_capacity;
1074   int  locs_req   = initial_locs_capacity;
1075   int  stub_req   = TraceJumps ? initial_stub_capacity * 10 : initial_stub_capacity;
1076   int  const_req  = initial_const_capacity;
1077 
1078   int  pad_req    = NativeCall::instruction_size;
1079   // The extra spacing after the code is necessary on some platforms.
1080   // Sometimes we need to patch in a jump after the last instruction,
1081   // if the nmethod has been deoptimized.  (See 4932387, 4894843.)
1082 


src/share/vm/opto/output.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File