< prev index next >

src/cpu/sparc/vm/abstractInterpreter_sparc.cpp

Print this page
rev 13183 : 8183232: Avoid resolving method_kind in AbstractInterpreter::can_be_compiled
Reviewed-by: coleenp, mdoerr, neliasso


  35 int AbstractInterpreter::BasicType_as_index(BasicType type) {
  36   int i = 0;
  37   switch (type) {
  38     case T_BOOLEAN: i = 0; break;
  39     case T_CHAR   : i = 1; break;
  40     case T_BYTE   : i = 2; break;
  41     case T_SHORT  : i = 3; break;
  42     case T_INT    : i = 4; break;
  43     case T_LONG   : i = 5; break;
  44     case T_VOID   : i = 6; break;
  45     case T_FLOAT  : i = 7; break;
  46     case T_DOUBLE : i = 8; break;
  47     case T_OBJECT : i = 9; break;
  48     case T_ARRAY  : i = 9; break;
  49     default       : ShouldNotReachHere();
  50   }
  51   assert(0 <= i && i < AbstractInterpreter::number_of_result_handlers, "index out of bounds");
  52   return i;
  53 }
  54 
  55 // These should never be compiled since the interpreter will prefer the compiled
  56 // version to the intrinsic version.
  57 bool AbstractInterpreter::can_be_compiled(methodHandle m) {
  58   switch (method_kind(m)) {
  59     case Interpreter::java_lang_math_fmaD:
  60     case Interpreter::java_lang_math_fmaF:
  61       return false;
  62     default:
  63       break;
  64   }
  65   return true;
  66 }
  67 
  68 static int size_activation_helper(int callee_extra_locals, int max_stack, int monitor_size) {
  69 
  70   // Figure out the size of an interpreter frame (in words) given that we have a fully allocated
  71   // expression stack, the callee will have callee_extra_locals (so we can account for
  72   // frame extension) and monitor_size for monitors. Basically we need to calculate
  73   // this exactly like generate_fixed_frame/generate_compute_interpreter_state.
  74   //
  75   //
  76   // The big complicating thing here is that we must ensure that the stack stays properly
  77   // aligned. This would be even uglier if monitor size wasn't modulo what the stack
  78   // needs to be aligned for). We are given that the sp (fp) is already aligned by
  79   // the caller so we must ensure that it is properly aligned for our callee.
  80   //
  81   const int rounded_vm_local_words =
  82        round_to(frame::interpreter_frame_vm_local_words,WordsPerLong);
  83   // callee_locals and max_stack are counts, not the size in frame.
  84   const int locals_size =
  85        round_to(callee_extra_locals * Interpreter::stackElementWords, WordsPerLong);
  86   const int max_stack_words = max_stack * Interpreter::stackElementWords;
  87   return (round_to((max_stack_words




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













  55 static int size_activation_helper(int callee_extra_locals, int max_stack, int monitor_size) {
  56 
  57   // Figure out the size of an interpreter frame (in words) given that we have a fully allocated
  58   // expression stack, the callee will have callee_extra_locals (so we can account for
  59   // frame extension) and monitor_size for monitors. Basically we need to calculate
  60   // this exactly like generate_fixed_frame/generate_compute_interpreter_state.
  61   //
  62   //
  63   // The big complicating thing here is that we must ensure that the stack stays properly
  64   // aligned. This would be even uglier if monitor size wasn't modulo what the stack
  65   // needs to be aligned for). We are given that the sp (fp) is already aligned by
  66   // the caller so we must ensure that it is properly aligned for our callee.
  67   //
  68   const int rounded_vm_local_words =
  69        round_to(frame::interpreter_frame_vm_local_words,WordsPerLong);
  70   // callee_locals and max_stack are counts, not the size in frame.
  71   const int locals_size =
  72        round_to(callee_extra_locals * Interpreter::stackElementWords, WordsPerLong);
  73   const int max_stack_words = max_stack * Interpreter::stackElementWords;
  74   return (round_to((max_stack_words


< prev index next >