< prev index next >

src/share/vm/interpreter/abstractInterpreter.cpp

Print this page

        

*** 23,33 **** */ #include "precompiled.hpp" #include "asm/macroAssembler.hpp" #include "asm/macroAssembler.inline.hpp" - #include "compiler/disassembler.hpp" #include "interpreter/bytecodeHistogram.hpp" #include "interpreter/bytecodeInterpreter.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interpreterRuntime.hpp" #include "interpreter/interp_masm.hpp" --- 23,32 ----
*** 46,118 **** #include "runtime/stubRoutines.hpp" #include "runtime/timer.hpp" # define __ _masm-> - - //------------------------------------------------------------------------------------------------------------------------ - // Implementation of InterpreterCodelet - - void InterpreterCodelet::initialize(const char* description, Bytecodes::Code bytecode) { - _description = description; - _bytecode = bytecode; - } - - - void InterpreterCodelet::verify() { - } - - - void InterpreterCodelet::print_on(outputStream* st) const { - ttyLocker ttyl; - - if (PrintInterpreter) { - st->cr(); - st->print_cr("----------------------------------------------------------------------"); - } - - if (description() != NULL) st->print("%s ", description()); - if (bytecode() >= 0 ) st->print("%d %s ", bytecode(), Bytecodes::name(bytecode())); - st->print_cr("[" INTPTR_FORMAT ", " INTPTR_FORMAT "] %d bytes", - p2i(code_begin()), p2i(code_end()), code_size()); - - if (PrintInterpreter) { - st->cr(); - Disassembler::decode(code_begin(), code_end(), st, DEBUG_ONLY(_strings) NOT_DEBUG(CodeStrings())); - } - } - - CodeletMark::CodeletMark(InterpreterMacroAssembler*& masm, - const char* description, - Bytecodes::Code bytecode) : - _clet((InterpreterCodelet*)AbstractInterpreter::code()->request(codelet_size())), - _cb(_clet->code_begin(), _clet->code_size()) { - // Request all space (add some slack for Codelet data). - assert(_clet != NULL, "we checked not enough space already"); - - // Initialize Codelet attributes. - _clet->initialize(description, bytecode); - // Create assembler for code generation. - masm = new InterpreterMacroAssembler(&_cb); - _masm = &masm; - } - - CodeletMark::~CodeletMark() { - // Align so printing shows nop's instead of random code at the end (Codelets are aligned). - (*_masm)->align(wordSize); - // Make sure all code is in code buffer. - (*_masm)->flush(); - - // Commit Codelet. - int committed_code_size = (*_masm)->code()->pure_insts_size(); - if (committed_code_size) { - AbstractInterpreter::code()->commit(committed_code_size, (*_masm)->code()->strings()); - } - // Make sure nobody can use _masm outside a CodeletMark lifespan. - *_masm = NULL; - } - //------------------------------------------------------------------------------------------------------------------------ // Implementation of platform independent aspects of Interpreter void AbstractInterpreter::initialize() { if (_code != NULL) return; --- 45,54 ----
*** 144,174 **** tty->print_cr("----------------------------------------------------------------------"); tty->cr(); } - void interpreter_init() { - Interpreter::initialize(); - #ifndef PRODUCT - if (TraceBytecodes) BytecodeTracer::set_closure(BytecodeTracer::std_closure()); - #endif // PRODUCT - // need to hit every safepoint in order to call zapping routine - // register the interpreter - Forte::register_stub( - "Interpreter", - AbstractInterpreter::code()->code_start(), - AbstractInterpreter::code()->code_end() - ); - - // notify JVMTI profiler - if (JvmtiExport::should_post_dynamic_code_generated()) { - JvmtiExport::post_dynamic_code_generated("Interpreter", - AbstractInterpreter::code()->code_start(), - AbstractInterpreter::code()->code_end()); - } - } - //------------------------------------------------------------------------------------------------------------------------ // Implementation of interpreter StubQueue* AbstractInterpreter::_code = NULL; bool AbstractInterpreter::_notice_safepoints = false; --- 80,89 ----
*** 186,217 **** AbstractInterpreterGenerator::AbstractInterpreterGenerator(StubQueue* _code) { _masm = NULL; } - static const BasicType types[Interpreter::number_of_result_handlers] = { - T_BOOLEAN, - T_CHAR , - T_BYTE , - T_SHORT , - T_INT , - T_LONG , - T_VOID , - T_FLOAT , - T_DOUBLE , - T_OBJECT - }; - - void AbstractInterpreterGenerator::generate_all() { - - - { CodeletMark cm(_masm, "slow signature handler"); - Interpreter::_slow_signature_handler = generate_slow_signature_handler(); - } - - } - //------------------------------------------------------------------------------------------------------------------------ // Entry points AbstractInterpreter::MethodKind AbstractInterpreter::method_kind(methodHandle m) { // Abstract method? --- 101,110 ----
*** 516,549 **** default: return false; } } ! void AbstractInterpreterGenerator::bang_stack_shadow_pages(bool native_call) { ! // Quick & dirty stack overflow checking: bang the stack & handle trap. ! // Note that we do the banging after the frame is setup, since the exception ! // handling code expects to find a valid interpreter frame on the stack. ! // Doing the banging earlier fails if the caller frame is not an interpreter ! // frame. ! // (Also, the exception throwing code expects to unlock any synchronized ! // method receiever, so do the banging after locking the receiver.) ! ! // Bang each page in the shadow zone. We can't assume it's been done for ! // an interpreter frame with greater than a page of locals, so each page ! // needs to be checked. Only true for non-native. ! if (UseStackBanging) { ! const int page_size = os::vm_page_size(); ! const int n_shadow_pages = ((int)JavaThread::stack_shadow_zone_size()) / page_size; ! const int start_page = native_call ? n_shadow_pages : 1; ! for (int pages = start_page; pages <= n_shadow_pages; pages++) { ! __ bang_stack_with_offset(pages*page_size); ! } ! } ! } ! ! void AbstractInterpreterGenerator::initialize_method_handle_entries() { // method handle entry kinds are generated later in MethodHandlesAdapterGenerator::generate: ! for (int i = Interpreter::method_handle_invoke_FIRST; i <= Interpreter::method_handle_invoke_LAST; i++) { ! Interpreter::MethodKind kind = (Interpreter::MethodKind) i; ! Interpreter::_entry_table[kind] = Interpreter::_entry_table[Interpreter::abstract]; } } --- 409,420 ---- default: return false; } } ! void AbstractInterpreter::initialize_method_handle_entries() { // method handle entry kinds are generated later in MethodHandlesAdapterGenerator::generate: ! for (int i = method_handle_invoke_FIRST; i <= method_handle_invoke_LAST; i++) { ! MethodKind kind = (MethodKind) i; ! _entry_table[kind] = _entry_table[Interpreter::abstract]; } }
< prev index next >