1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/share/vm/c1/c1_MacroAssembler.hpp Wed Apr 27 01:25:04 2016 +0800 1.3 @@ -0,0 +1,102 @@ 1.4 +/* 1.5 + * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. 1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 + * 1.8 + * This code is free software; you can redistribute it and/or modify it 1.9 + * under the terms of the GNU General Public License version 2 only, as 1.10 + * published by the Free Software Foundation. 1.11 + * 1.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 1.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.15 + * version 2 for more details (a copy is included in the LICENSE file that 1.16 + * accompanied this code). 1.17 + * 1.18 + * You should have received a copy of the GNU General Public License version 1.19 + * 2 along with this work; if not, write to the Free Software Foundation, 1.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.21 + * 1.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1.23 + * or visit www.oracle.com if you need additional information or have any 1.24 + * questions. 1.25 + * 1.26 + */ 1.27 + 1.28 +#ifndef SHARE_VM_C1_C1_MACROASSEMBLER_HPP 1.29 +#define SHARE_VM_C1_C1_MACROASSEMBLER_HPP 1.30 + 1.31 +#include "asm/macroAssembler.hpp" 1.32 +#include "asm/macroAssembler.inline.hpp" 1.33 + 1.34 +class CodeEmitInfo; 1.35 + 1.36 +class C1_MacroAssembler: public MacroAssembler { 1.37 + public: 1.38 + // creation 1.39 + C1_MacroAssembler(CodeBuffer* code) : MacroAssembler(code) { pd_init(); } 1.40 + 1.41 + //---------------------------------------------------- 1.42 + void explicit_null_check(Register base); 1.43 + 1.44 + void inline_cache_check(Register receiver, Register iCache); 1.45 + void build_frame(int frame_size_in_bytes, int bang_size_in_bytes); 1.46 + void remove_frame(int frame_size_in_bytes); 1.47 + 1.48 + void unverified_entry(Register receiver, Register ic_klass); 1.49 + void verified_entry(); 1.50 + void verify_stack_oop(int offset) PRODUCT_RETURN; 1.51 + void verify_not_null_oop(Register r) PRODUCT_RETURN; 1.52 + 1.53 +#ifdef TARGET_ARCH_x86 1.54 +# include "c1_MacroAssembler_x86.hpp" 1.55 +#endif 1.56 +#ifdef TARGET_ARCH_sparc 1.57 +# include "c1_MacroAssembler_sparc.hpp" 1.58 +#endif 1.59 +#ifdef TARGET_ARCH_arm 1.60 +# include "c1_MacroAssembler_arm.hpp" 1.61 +#endif 1.62 +#ifdef TARGET_ARCH_ppc 1.63 +# include "c1_MacroAssembler_ppc.hpp" 1.64 +#endif 1.65 + 1.66 +}; 1.67 + 1.68 + 1.69 + 1.70 +// A StubAssembler is a MacroAssembler w/ extra functionality for runtime 1.71 +// stubs. Currently it 'knows' some stub info. Eventually, the information 1.72 +// may be set automatically or can be asserted when using specialised 1.73 +// StubAssembler functions. 1.74 + 1.75 +class StubAssembler: public C1_MacroAssembler { 1.76 + private: 1.77 + const char* _name; 1.78 + bool _must_gc_arguments; 1.79 + int _frame_size; 1.80 + int _num_rt_args; 1.81 + int _stub_id; 1.82 + 1.83 + public: 1.84 + // creation 1.85 + StubAssembler(CodeBuffer* code, const char * name, int stub_id); 1.86 + void set_info(const char* name, bool must_gc_arguments); 1.87 + 1.88 + void set_frame_size(int size); 1.89 + void set_num_rt_args(int args); 1.90 + 1.91 + // accessors 1.92 + const char* name() const { return _name; } 1.93 + bool must_gc_arguments() const { return _must_gc_arguments; } 1.94 + int frame_size() const { return _frame_size; } 1.95 + int num_rt_args() const { return _num_rt_args; } 1.96 + int stub_id() const { return _stub_id; } 1.97 + 1.98 + // runtime calls (return offset of call to be used by GC map) 1.99 + int call_RT(Register oop_result1, Register metadata_result, address entry, int args_size = 0); 1.100 + int call_RT(Register oop_result1, Register metadata_result, address entry, Register arg1); 1.101 + int call_RT(Register oop_result1, Register metadata_result, address entry, Register arg1, Register arg2); 1.102 + int call_RT(Register oop_result1, Register metadata_result, address entry, Register arg1, Register arg2, Register arg3); 1.103 +}; 1.104 + 1.105 +#endif // SHARE_VM_C1_C1_MACROASSEMBLER_HPP