< prev index next >

src/cpu/ppc/vm/abstractInterpreter_ppc.cpp

Print this page
rev 12409 : 8171244: PPC64: Make interpreter's math entries consistent with C1 and C2 and support FMA
Reviewed-by:


  34 int AbstractInterpreter::BasicType_as_index(BasicType type) {
  35   int i = 0;
  36   switch (type) {
  37     case T_BOOLEAN: i = 0; break;
  38     case T_CHAR   : i = 1; break;
  39     case T_BYTE   : i = 2; break;
  40     case T_SHORT  : i = 3; break;
  41     case T_INT    : i = 4; break;
  42     case T_LONG   : i = 5; break;
  43     case T_VOID   : i = 6; break;
  44     case T_FLOAT  : i = 7; break;
  45     case T_DOUBLE : i = 8; break;
  46     case T_OBJECT : i = 9; break;
  47     case T_ARRAY  : i = 9; break;
  48     default       : ShouldNotReachHere();
  49   }
  50   assert(0 <= i && i < AbstractInterpreter::number_of_result_handlers, "index out of bounds");
  51   return i;
  52 }
  53 
  54 // Support abs and sqrt like in compiler.
  55 // For others we can use a normal (native) entry.
  56 bool AbstractInterpreter::math_entry_available(AbstractInterpreter::MethodKind kind) {
  57   if (!InlineIntrinsics) return false;
  58 
  59   return ((kind==Interpreter::java_lang_math_sqrt && VM_Version::has_fsqrt()) ||
  60           (kind==Interpreter::java_lang_math_abs));
  61 }
  62 
  63 // These should never be compiled since the interpreter will prefer
  64 // the compiled version to the intrinsic version.
  65 bool AbstractInterpreter::can_be_compiled(methodHandle m) {
  66   return !math_entry_available(method_kind(m));















  67 }
  68 
  69 // How much stack a method activation needs in stack slots.
  70 // We must calc this exactly like in generate_fixed_frame.
  71 // Note: This returns the conservative size assuming maximum alignment.
  72 int AbstractInterpreter::size_top_interpreter_activation(Method* method) {
  73   const int max_alignment_size = 2;
  74   const int abi_scratch = frame::abi_reg_args_size;
  75   return method->max_locals() + method->max_stack() +
  76          frame::interpreter_frame_monitor_size() + max_alignment_size + abi_scratch;
  77 }
  78 
  79 // Returns number of stackElementWords needed for the interpreter frame with the
  80 // given sections.
  81 // This overestimates the stack by one slot in case of alignments.
  82 int AbstractInterpreter::size_activation(int max_stack,
  83                                          int temps,
  84                                          int extra_args,
  85                                          int monitors,
  86                                          int callee_params,




  34 int AbstractInterpreter::BasicType_as_index(BasicType type) {
  35   int i = 0;
  36   switch (type) {
  37     case T_BOOLEAN: i = 0; break;
  38     case T_CHAR   : i = 1; break;
  39     case T_BYTE   : i = 2; break;
  40     case T_SHORT  : i = 3; break;
  41     case T_INT    : i = 4; break;
  42     case T_LONG   : i = 5; break;
  43     case T_VOID   : i = 6; break;
  44     case T_FLOAT  : i = 7; break;
  45     case T_DOUBLE : i = 8; break;
  46     case T_OBJECT : i = 9; break;
  47     case T_ARRAY  : i = 9; break;
  48     default       : ShouldNotReachHere();
  49   }
  50   assert(0 <= i && i < AbstractInterpreter::number_of_result_handlers, "index out of bounds");
  51   return i;
  52 }
  53 









  54 // These should never be compiled since the interpreter will prefer
  55 // the compiled version to the intrinsic version.
  56 bool AbstractInterpreter::can_be_compiled(methodHandle m) {
  57   switch (method_kind(m)) {
  58     case Interpreter::java_lang_math_sin     : // fall thru
  59     case Interpreter::java_lang_math_cos     : // fall thru
  60     case Interpreter::java_lang_math_tan     : // fall thru
  61     case Interpreter::java_lang_math_abs     : // fall thru
  62     case Interpreter::java_lang_math_log     : // fall thru
  63     case Interpreter::java_lang_math_log10   : // fall thru
  64     case Interpreter::java_lang_math_sqrt    : // fall thru
  65     case Interpreter::java_lang_math_pow     : // fall thru
  66     case Interpreter::java_lang_math_exp     : // fall thru
  67     case Interpreter::java_lang_math_fmaD    : // fall thru
  68     case Interpreter::java_lang_math_fmaF    :
  69       return false;
  70     default:
  71       return true;
  72   }
  73 }
  74 
  75 // How much stack a method activation needs in stack slots.
  76 // We must calc this exactly like in generate_fixed_frame.
  77 // Note: This returns the conservative size assuming maximum alignment.
  78 int AbstractInterpreter::size_top_interpreter_activation(Method* method) {
  79   const int max_alignment_size = 2;
  80   const int abi_scratch = frame::abi_reg_args_size;
  81   return method->max_locals() + method->max_stack() +
  82          frame::interpreter_frame_monitor_size() + max_alignment_size + abi_scratch;
  83 }
  84 
  85 // Returns number of stackElementWords needed for the interpreter frame with the
  86 // given sections.
  87 // This overestimates the stack by one slot in case of alignments.
  88 int AbstractInterpreter::size_activation(int max_stack,
  89                                          int temps,
  90                                          int extra_args,
  91                                          int monitors,
  92                                          int callee_params,


< prev index next >