Wed, 13 Mar 2013 09:44:45 +0100
8009761: Deoptimization on sparc doesn't set Llast_SP correctly in the interpreter frames it creates
Summary: deoptimization doesn't set up callee frames so that they restore caller frames correctly.
Reviewed-by: kvn
duke@435 | 1 | /* |
trims@2708 | 2 | * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. |
duke@435 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@435 | 4 | * |
duke@435 | 5 | * This code is free software; you can redistribute it and/or modify it |
duke@435 | 6 | * under the terms of the GNU General Public License version 2 only, as |
duke@435 | 7 | * published by the Free Software Foundation. |
duke@435 | 8 | * |
duke@435 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
duke@435 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@435 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@435 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
duke@435 | 13 | * accompanied this code). |
duke@435 | 14 | * |
duke@435 | 15 | * You should have received a copy of the GNU General Public License version |
duke@435 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
duke@435 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@435 | 18 | * |
trims@1907 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
trims@1907 | 20 | * or visit www.oracle.com if you need additional information or have any |
trims@1907 | 21 | * questions. |
duke@435 | 22 | * |
duke@435 | 23 | */ |
duke@435 | 24 | |
stefank@2314 | 25 | #ifndef SHARE_VM_INTERPRETER_TEMPLATEINTERPRETERGENERATOR_HPP |
stefank@2314 | 26 | #define SHARE_VM_INTERPRETER_TEMPLATEINTERPRETERGENERATOR_HPP |
stefank@2314 | 27 | |
twisti@1040 | 28 | // This file contains the platform-independent parts |
duke@435 | 29 | // of the template interpreter generator. |
duke@435 | 30 | |
duke@435 | 31 | #ifndef CC_INTERP |
duke@435 | 32 | |
duke@435 | 33 | class TemplateInterpreterGenerator: public AbstractInterpreterGenerator { |
duke@435 | 34 | protected: |
duke@435 | 35 | |
duke@435 | 36 | // entry points for shared code sequence |
duke@435 | 37 | address _unimplemented_bytecode; |
duke@435 | 38 | address _illegal_bytecode_sequence; |
duke@435 | 39 | |
duke@435 | 40 | // shared code sequences |
duke@435 | 41 | // Converter for native abi result to tosca result |
duke@435 | 42 | address generate_result_handler_for(BasicType type); |
duke@435 | 43 | address generate_slow_signature_handler(); |
duke@435 | 44 | address generate_error_exit(const char* msg); |
duke@435 | 45 | address generate_StackOverflowError_handler(); |
duke@435 | 46 | address generate_exception_handler(const char* name, const char* message) { |
duke@435 | 47 | return generate_exception_handler_common(name, message, false); |
duke@435 | 48 | } |
duke@435 | 49 | address generate_klass_exception_handler(const char* name) { |
duke@435 | 50 | return generate_exception_handler_common(name, NULL, true); |
duke@435 | 51 | } |
duke@435 | 52 | address generate_exception_handler_common(const char* name, const char* message, bool pass_oop); |
duke@435 | 53 | address generate_ClassCastException_handler(); |
duke@435 | 54 | address generate_ArrayIndexOutOfBounds_handler(const char* name); |
duke@435 | 55 | address generate_continuation_for(TosState state); |
jrose@1494 | 56 | address generate_return_entry_for(TosState state, int step); |
duke@435 | 57 | address generate_earlyret_entry_for(TosState state); |
duke@435 | 58 | address generate_deopt_entry_for(TosState state, int step); |
duke@435 | 59 | address generate_safept_entry_for(TosState state, address runtime_entry); |
duke@435 | 60 | void generate_throw_exception(); |
duke@435 | 61 | |
duke@435 | 62 | // entry point generator |
duke@435 | 63 | // address generate_method_entry(AbstractInterpreter::MethodKind kind); |
duke@435 | 64 | |
duke@435 | 65 | // Instruction generation |
duke@435 | 66 | void generate_and_dispatch (Template* t, TosState tos_out = ilgl); |
duke@435 | 67 | void set_vtos_entry_points (Template* t, address& bep, address& cep, address& sep, address& aep, address& iep, address& lep, address& fep, address& dep, address& vep); |
duke@435 | 68 | void set_short_entry_points(Template* t, address& bep, address& cep, address& sep, address& aep, address& iep, address& lep, address& fep, address& dep, address& vep); |
duke@435 | 69 | void set_wide_entry_point (Template* t, address& wep); |
duke@435 | 70 | |
duke@435 | 71 | void set_entry_points(Bytecodes::Code code); |
duke@435 | 72 | void set_unimplemented(int i); |
duke@435 | 73 | void set_entry_points_for_all_bytes(); |
duke@435 | 74 | void set_safepoints_for_all_bytes(); |
duke@435 | 75 | |
duke@435 | 76 | // Helpers for generate_and_dispatch |
duke@435 | 77 | address generate_trace_code(TosState state) PRODUCT_RETURN0; |
duke@435 | 78 | void count_bytecode() PRODUCT_RETURN; |
duke@435 | 79 | void histogram_bytecode(Template* t) PRODUCT_RETURN; |
duke@435 | 80 | void histogram_bytecode_pair(Template* t) PRODUCT_RETURN; |
duke@435 | 81 | void trace_bytecode(Template* t) PRODUCT_RETURN; |
duke@435 | 82 | void stop_interpreter_at() PRODUCT_RETURN; |
duke@435 | 83 | |
duke@435 | 84 | void generate_all(); |
duke@435 | 85 | |
duke@435 | 86 | public: |
duke@435 | 87 | TemplateInterpreterGenerator(StubQueue* _code); |
duke@435 | 88 | |
stefank@2314 | 89 | #ifdef TARGET_ARCH_x86 |
stefank@2314 | 90 | # include "templateInterpreterGenerator_x86.hpp" |
stefank@2314 | 91 | #endif |
stefank@2314 | 92 | #ifdef TARGET_ARCH_sparc |
stefank@2314 | 93 | # include "templateInterpreterGenerator_sparc.hpp" |
stefank@2314 | 94 | #endif |
stefank@2314 | 95 | #ifdef TARGET_ARCH_zero |
stefank@2314 | 96 | # include "templateInterpreterGenerator_zero.hpp" |
stefank@2314 | 97 | #endif |
bobv@2508 | 98 | #ifdef TARGET_ARCH_arm |
bobv@2508 | 99 | # include "templateInterpreterGenerator_arm.hpp" |
bobv@2508 | 100 | #endif |
bobv@2508 | 101 | #ifdef TARGET_ARCH_ppc |
bobv@2508 | 102 | # include "templateInterpreterGenerator_ppc.hpp" |
bobv@2508 | 103 | #endif |
stefank@2314 | 104 | |
duke@435 | 105 | |
duke@435 | 106 | }; |
duke@435 | 107 | |
duke@435 | 108 | #endif // !CC_INTERP |
stefank@2314 | 109 | |
stefank@2314 | 110 | #endif // SHARE_VM_INTERPRETER_TEMPLATEINTERPRETERGENERATOR_HPP |