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