< prev index next >

src/hotspot/share/interpreter/templateInterpreter.cpp

Print this page

 40 # define __ _masm->
 41 
 42 void TemplateInterpreter::initialize_stub() {
 43   // assertions
 44   assert(_code == nullptr, "must only initialize once");
 45   assert((int)Bytecodes::number_of_codes <= (int)DispatchTable::length,
 46          "dispatch table too small");
 47 
 48   // allocate interpreter
 49   int code_size = InterpreterCodeSize;
 50   NOT_PRODUCT(code_size *= 4;)  // debug uses extra interpreter code space
 51   // 270+ interpreter codelets are generated and each of them is aligned to HeapWordSize,
 52   // plus their code section is aligned to CodeEntryAlignement. So we need additional size due to alignment.
 53   int max_aligned_codelets = 280;
 54   int max_aligned_bytes = checked_cast<int>(max_aligned_codelets * (HeapWordSize + CodeEntryAlignment));
 55   _code = new StubQueue(new InterpreterCodeletInterface, code_size + max_aligned_bytes, nullptr,
 56                         "Interpreter");
 57 }
 58 
 59 void TemplateInterpreter::initialize_code() {


 60   AbstractInterpreter::initialize();
 61 
 62   TemplateTable::initialize();
 63 
 64   // generate interpreter
 65   { ResourceMark rm;
 66     TraceTime timer("Interpreter generation", TRACETIME_LOG(Info, startuptime));
 67     TemplateInterpreterGenerator g;
 68     // Free the unused memory not occupied by the interpreter and the stubs
 69     _code->deallocate_unused_tail();
 70   }
 71 
 72   if (PrintInterpreter) {
 73     ResourceMark rm;
 74     print();
 75   }
 76 
 77   // initialize dispatch table
 78   _active_table = _normal_table;
 79 }

 40 # define __ _masm->
 41 
 42 void TemplateInterpreter::initialize_stub() {
 43   // assertions
 44   assert(_code == nullptr, "must only initialize once");
 45   assert((int)Bytecodes::number_of_codes <= (int)DispatchTable::length,
 46          "dispatch table too small");
 47 
 48   // allocate interpreter
 49   int code_size = InterpreterCodeSize;
 50   NOT_PRODUCT(code_size *= 4;)  // debug uses extra interpreter code space
 51   // 270+ interpreter codelets are generated and each of them is aligned to HeapWordSize,
 52   // plus their code section is aligned to CodeEntryAlignement. So we need additional size due to alignment.
 53   int max_aligned_codelets = 280;
 54   int max_aligned_bytes = checked_cast<int>(max_aligned_codelets * (HeapWordSize + CodeEntryAlignment));
 55   _code = new StubQueue(new InterpreterCodeletInterface, code_size + max_aligned_bytes, nullptr,
 56                         "Interpreter");
 57 }
 58 
 59 void TemplateInterpreter::initialize_code() {
 60   InterpreterRuntime::init_counters();
 61 
 62   AbstractInterpreter::initialize();
 63 
 64   TemplateTable::initialize();
 65 
 66   // generate interpreter
 67   { ResourceMark rm;
 68     TraceTime timer("Interpreter generation", TRACETIME_LOG(Info, startuptime));
 69     TemplateInterpreterGenerator g;
 70     // Free the unused memory not occupied by the interpreter and the stubs
 71     _code->deallocate_unused_tail();
 72   }
 73 
 74   if (PrintInterpreter) {
 75     ResourceMark rm;
 76     print();
 77   }
 78 
 79   // initialize dispatch table
 80   _active_table = _normal_table;
 81 }
< prev index next >