hotspot/src/share/vm/oops/methodData.cpp
changeset 43455 96560cffef4d
parent 37473 8af1deb0c879
child 46542 73dd19b96b5d
equal deleted inserted replaced
43454:c11ebe3f754c 43455:96560cffef4d
   715   return new (loader_data, size, false, MetaspaceObj::MethodDataType, THREAD)
   715   return new (loader_data, size, false, MetaspaceObj::MethodDataType, THREAD)
   716     MethodData(method(), size, THREAD);
   716     MethodData(method(), size, THREAD);
   717 }
   717 }
   718 
   718 
   719 int MethodData::bytecode_cell_count(Bytecodes::Code code) {
   719 int MethodData::bytecode_cell_count(Bytecodes::Code code) {
   720 #if defined(COMPILER1) && !(defined(COMPILER2) || INCLUDE_JVMCI)
   720   if (is_client_compilation_mode_vm()) {
   721   return no_profile_data;
   721     return no_profile_data;
   722 #else
   722   }
   723   switch (code) {
   723   switch (code) {
   724   case Bytecodes::_checkcast:
   724   case Bytecodes::_checkcast:
   725   case Bytecodes::_instanceof:
   725   case Bytecodes::_instanceof:
   726   case Bytecodes::_aastore:
   726   case Bytecodes::_aastore:
   727     if (TypeProfileCasts) {
   727     if (TypeProfileCasts) {
   776   case Bytecodes::_lookupswitch:
   776   case Bytecodes::_lookupswitch:
   777   case Bytecodes::_tableswitch:
   777   case Bytecodes::_tableswitch:
   778     return variable_cell_count;
   778     return variable_cell_count;
   779   }
   779   }
   780   return no_profile_data;
   780   return no_profile_data;
   781 #endif
       
   782 }
   781 }
   783 
   782 
   784 // Compute the size of the profiling information corresponding to
   783 // Compute the size of the profiling information corresponding to
   785 // the current bytecode.
   784 // the current bytecode.
   786 int MethodData::compute_data_size(BytecodeStream* stream) {
   785 int MethodData::compute_data_size(BytecodeStream* stream) {
   838   case Bytecodes::_if_acmpne:
   837   case Bytecodes::_if_acmpne:
   839   case Bytecodes::_ifnull:
   838   case Bytecodes::_ifnull:
   840   case Bytecodes::_ifnonnull:
   839   case Bytecodes::_ifnonnull:
   841   case Bytecodes::_invokestatic:
   840   case Bytecodes::_invokestatic:
   842 #ifdef COMPILER2
   841 #ifdef COMPILER2
   843     return UseTypeSpeculation;
   842     if (is_server_compilation_mode_vm()) {
       
   843       return UseTypeSpeculation;
       
   844     }
   844 #endif
   845 #endif
   845   default:
   846   default:
   846     return false;
   847     return false;
   847   }
   848   }
   848   return false;
   849   return false;
   940 
   941 
   941 // Initialize an individual data segment.  Returns the size of
   942 // Initialize an individual data segment.  Returns the size of
   942 // the segment in bytes.
   943 // the segment in bytes.
   943 int MethodData::initialize_data(BytecodeStream* stream,
   944 int MethodData::initialize_data(BytecodeStream* stream,
   944                                        int data_index) {
   945                                        int data_index) {
   945 #if defined(COMPILER1) && !(defined(COMPILER2) || INCLUDE_JVMCI)
   946   if (is_client_compilation_mode_vm()) {
   946   return 0;
   947     return 0;
   947 #else
   948   }
   948   int cell_count = -1;
   949   int cell_count = -1;
   949   int tag = DataLayout::no_tag;
   950   int tag = DataLayout::no_tag;
   950   DataLayout* data_layout = data_layout_at(data_index);
   951   DataLayout* data_layout = data_layout_at(data_index);
   951   Bytecodes::Code c = stream->code();
   952   Bytecodes::Code c = stream->code();
   952   switch (c) {
   953   switch (c) {
  1059     return DataLayout::compute_size_in_bytes(cell_count);
  1060     return DataLayout::compute_size_in_bytes(cell_count);
  1060   } else {
  1061   } else {
  1061     assert(!bytecode_has_profile(c), "agree w/ !BHP");
  1062     assert(!bytecode_has_profile(c), "agree w/ !BHP");
  1062     return 0;
  1063     return 0;
  1063   }
  1064   }
  1064 #endif
       
  1065 }
  1065 }
  1066 
  1066 
  1067 // Get the data at an arbitrary (sort of) data index.
  1067 // Get the data at an arbitrary (sort of) data index.
  1068 ProfileData* MethodData::data_at(int data_index) const {
  1068 ProfileData* MethodData::data_at(int data_index) const {
  1069   if (out_of_bounds(data_index)) {
  1069   if (out_of_bounds(data_index)) {