< prev index next >

src/hotspot/share/interpreter/templateInterpreter.cpp

Print this page
rev 47398 : 8166317: InterpreterCodeSize should be computed
Reviewed-by: kvn, coleenp


  37 # define __ _masm->
  38 
  39 void TemplateInterpreter::initialize() {
  40   if (_code != NULL) return;
  41   // assertions
  42   assert((int)Bytecodes::number_of_codes <= (int)DispatchTable::length,
  43          "dispatch table too small");
  44 
  45   AbstractInterpreter::initialize();
  46 
  47   TemplateTable::initialize();
  48 
  49   // generate interpreter
  50   { ResourceMark rm;
  51     TraceTime timer("Interpreter generation", TRACETIME_LOG(Info, startuptime));
  52     int code_size = InterpreterCodeSize;
  53     NOT_PRODUCT(code_size *= 4;)  // debug uses extra interpreter code space
  54     _code = new StubQueue(new InterpreterCodeletInterface, code_size, NULL,
  55                           "Interpreter");
  56     TemplateInterpreterGenerator g(_code);


  57   }
  58 
  59   if (PrintInterpreter) {
  60     ResourceMark rm;
  61     print();
  62   }
  63 
  64   // initialize dispatch table
  65   _active_table = _normal_table;
  66 }
  67 
  68 //------------------------------------------------------------------------------------------------------------------------
  69 // Implementation of EntryPoint
  70 
  71 EntryPoint::EntryPoint() {
  72   assert(number_of_states == 10, "check the code below");
  73   _entry[btos] = NULL;
  74   _entry[ztos] = NULL;
  75   _entry[ctos] = NULL;
  76   _entry[stos] = NULL;




  37 # define __ _masm->
  38 
  39 void TemplateInterpreter::initialize() {
  40   if (_code != NULL) return;
  41   // assertions
  42   assert((int)Bytecodes::number_of_codes <= (int)DispatchTable::length,
  43          "dispatch table too small");
  44 
  45   AbstractInterpreter::initialize();
  46 
  47   TemplateTable::initialize();
  48 
  49   // generate interpreter
  50   { ResourceMark rm;
  51     TraceTime timer("Interpreter generation", TRACETIME_LOG(Info, startuptime));
  52     int code_size = InterpreterCodeSize;
  53     NOT_PRODUCT(code_size *= 4;)  // debug uses extra interpreter code space
  54     _code = new StubQueue(new InterpreterCodeletInterface, code_size, NULL,
  55                           "Interpreter");
  56     TemplateInterpreterGenerator g(_code);
  57     // Free the unused memory not occupied by the interpreter and the stubs
  58     _code->deallocate_unused_tail();
  59   }
  60 
  61   if (PrintInterpreter) {
  62     ResourceMark rm;
  63     print();
  64   }
  65 
  66   // initialize dispatch table
  67   _active_table = _normal_table;
  68 }
  69 
  70 //------------------------------------------------------------------------------------------------------------------------
  71 // Implementation of EntryPoint
  72 
  73 EntryPoint::EntryPoint() {
  74   assert(number_of_states == 10, "check the code below");
  75   _entry[btos] = NULL;
  76   _entry[ztos] = NULL;
  77   _entry[ctos] = NULL;
  78   _entry[stos] = NULL;


< prev index next >