Mon, 24 Jan 2011 13:34:18 -0800
7008809: should report the class in ArrayStoreExceptions from compiled code
Reviewed-by: iveresov, twisti
duke@435 | 1 | /* |
trims@1907 | 2 | * Copyright (c) 2000, 2010, 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_C1_C1_MACROASSEMBLER_HPP |
stefank@2314 | 26 | #define SHARE_VM_C1_C1_MACROASSEMBLER_HPP |
stefank@2314 | 27 | |
stefank@2314 | 28 | #include "asm/assembler.hpp" |
stefank@2314 | 29 | #ifdef TARGET_ARCH_x86 |
stefank@2314 | 30 | # include "assembler_x86.inline.hpp" |
stefank@2314 | 31 | #endif |
stefank@2314 | 32 | #ifdef TARGET_ARCH_sparc |
stefank@2314 | 33 | # include "assembler_sparc.inline.hpp" |
stefank@2314 | 34 | #endif |
stefank@2314 | 35 | #ifdef TARGET_ARCH_zero |
stefank@2314 | 36 | # include "assembler_zero.inline.hpp" |
stefank@2314 | 37 | #endif |
stefank@2314 | 38 | |
duke@435 | 39 | class CodeEmitInfo; |
duke@435 | 40 | |
duke@435 | 41 | class C1_MacroAssembler: public MacroAssembler { |
duke@435 | 42 | public: |
duke@435 | 43 | // creation |
duke@435 | 44 | C1_MacroAssembler(CodeBuffer* code) : MacroAssembler(code) { pd_init(); } |
duke@435 | 45 | |
duke@435 | 46 | //---------------------------------------------------- |
duke@435 | 47 | void explicit_null_check(Register base); |
duke@435 | 48 | |
duke@435 | 49 | void inline_cache_check(Register receiver, Register iCache); |
duke@435 | 50 | void build_frame(int frame_size_in_bytes); |
twisti@1730 | 51 | void remove_frame(int frame_size_in_bytes); |
duke@435 | 52 | |
duke@435 | 53 | void unverified_entry(Register receiver, Register ic_klass); |
duke@435 | 54 | void verified_entry(); |
duke@435 | 55 | void verify_stack_oop(int offset) PRODUCT_RETURN; |
duke@435 | 56 | void verify_not_null_oop(Register r) PRODUCT_RETURN; |
duke@435 | 57 | |
stefank@2314 | 58 | #ifdef TARGET_ARCH_x86 |
stefank@2314 | 59 | # include "c1_MacroAssembler_x86.hpp" |
stefank@2314 | 60 | #endif |
stefank@2314 | 61 | #ifdef TARGET_ARCH_sparc |
stefank@2314 | 62 | # include "c1_MacroAssembler_sparc.hpp" |
stefank@2314 | 63 | #endif |
stefank@2314 | 64 | |
duke@435 | 65 | }; |
duke@435 | 66 | |
duke@435 | 67 | |
duke@435 | 68 | |
duke@435 | 69 | // A StubAssembler is a MacroAssembler w/ extra functionality for runtime |
duke@435 | 70 | // stubs. Currently it 'knows' some stub info. Eventually, the information |
duke@435 | 71 | // may be set automatically or can be asserted when using specialised |
duke@435 | 72 | // StubAssembler functions. |
duke@435 | 73 | |
duke@435 | 74 | class StubAssembler: public C1_MacroAssembler { |
duke@435 | 75 | private: |
duke@435 | 76 | const char* _name; |
duke@435 | 77 | bool _must_gc_arguments; |
duke@435 | 78 | int _frame_size; |
duke@435 | 79 | int _num_rt_args; |
duke@435 | 80 | int _stub_id; |
duke@435 | 81 | |
duke@435 | 82 | public: |
duke@435 | 83 | // creation |
duke@435 | 84 | StubAssembler(CodeBuffer* code, const char * name, int stub_id); |
duke@435 | 85 | void set_info(const char* name, bool must_gc_arguments); |
duke@435 | 86 | |
duke@435 | 87 | void set_frame_size(int size); |
duke@435 | 88 | void set_num_rt_args(int args); |
duke@435 | 89 | |
duke@435 | 90 | // accessors |
duke@435 | 91 | const char* name() const { return _name; } |
duke@435 | 92 | bool must_gc_arguments() const { return _must_gc_arguments; } |
duke@435 | 93 | int frame_size() const { return _frame_size; } |
duke@435 | 94 | int num_rt_args() const { return _num_rt_args; } |
duke@435 | 95 | int stub_id() const { return _stub_id; } |
duke@435 | 96 | |
duke@435 | 97 | // runtime calls (return offset of call to be used by GC map) |
duke@435 | 98 | int call_RT(Register oop_result1, Register oop_result2, address entry, int args_size = 0); |
duke@435 | 99 | int call_RT(Register oop_result1, Register oop_result2, address entry, Register arg1); |
duke@435 | 100 | int call_RT(Register oop_result1, Register oop_result2, address entry, Register arg1, Register arg2); |
duke@435 | 101 | int call_RT(Register oop_result1, Register oop_result2, address entry, Register arg1, Register arg2, Register arg3); |
duke@435 | 102 | }; |
stefank@2314 | 103 | |
stefank@2314 | 104 | #endif // SHARE_VM_C1_C1_MACROASSEMBLER_HPP |