duke@435: /* coleenp@4037: * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. duke@435: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. duke@435: * duke@435: * This code is free software; you can redistribute it and/or modify it duke@435: * under the terms of the GNU General Public License version 2 only, as duke@435: * published by the Free Software Foundation. duke@435: * duke@435: * This code is distributed in the hope that it will be useful, but WITHOUT duke@435: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or duke@435: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License duke@435: * version 2 for more details (a copy is included in the LICENSE file that duke@435: * accompanied this code). duke@435: * duke@435: * You should have received a copy of the GNU General Public License version duke@435: * 2 along with this work; if not, write to the Free Software Foundation, duke@435: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. duke@435: * trims@1907: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA trims@1907: * or visit www.oracle.com if you need additional information or have any trims@1907: * questions. duke@435: * duke@435: */ duke@435: stefank@2314: #ifndef SHARE_VM_C1_C1_MACROASSEMBLER_HPP stefank@2314: #define SHARE_VM_C1_C1_MACROASSEMBLER_HPP stefank@2314: twisti@4318: #include "asm/macroAssembler.hpp" twisti@4318: #include "asm/macroAssembler.inline.hpp" stefank@2314: duke@435: class CodeEmitInfo; duke@435: duke@435: class C1_MacroAssembler: public MacroAssembler { duke@435: public: duke@435: // creation duke@435: C1_MacroAssembler(CodeBuffer* code) : MacroAssembler(code) { pd_init(); } duke@435: duke@435: //---------------------------------------------------- duke@435: void explicit_null_check(Register base); duke@435: duke@435: void inline_cache_check(Register receiver, Register iCache); duke@435: void build_frame(int frame_size_in_bytes); twisti@1730: void remove_frame(int frame_size_in_bytes); duke@435: duke@435: void unverified_entry(Register receiver, Register ic_klass); duke@435: void verified_entry(); duke@435: void verify_stack_oop(int offset) PRODUCT_RETURN; duke@435: void verify_not_null_oop(Register r) PRODUCT_RETURN; duke@435: stefank@2314: #ifdef TARGET_ARCH_x86 stefank@2314: # include "c1_MacroAssembler_x86.hpp" stefank@2314: #endif stefank@2314: #ifdef TARGET_ARCH_sparc stefank@2314: # include "c1_MacroAssembler_sparc.hpp" stefank@2314: #endif bobv@2508: #ifdef TARGET_ARCH_arm bobv@2508: # include "c1_MacroAssembler_arm.hpp" bobv@2508: #endif bobv@2508: #ifdef TARGET_ARCH_ppc bobv@2508: # include "c1_MacroAssembler_ppc.hpp" bobv@2508: #endif stefank@2314: duke@435: }; duke@435: duke@435: duke@435: duke@435: // A StubAssembler is a MacroAssembler w/ extra functionality for runtime duke@435: // stubs. Currently it 'knows' some stub info. Eventually, the information duke@435: // may be set automatically or can be asserted when using specialised duke@435: // StubAssembler functions. duke@435: duke@435: class StubAssembler: public C1_MacroAssembler { duke@435: private: duke@435: const char* _name; duke@435: bool _must_gc_arguments; duke@435: int _frame_size; duke@435: int _num_rt_args; duke@435: int _stub_id; duke@435: duke@435: public: duke@435: // creation duke@435: StubAssembler(CodeBuffer* code, const char * name, int stub_id); duke@435: void set_info(const char* name, bool must_gc_arguments); duke@435: duke@435: void set_frame_size(int size); duke@435: void set_num_rt_args(int args); duke@435: duke@435: // accessors duke@435: const char* name() const { return _name; } duke@435: bool must_gc_arguments() const { return _must_gc_arguments; } duke@435: int frame_size() const { return _frame_size; } duke@435: int num_rt_args() const { return _num_rt_args; } duke@435: int stub_id() const { return _stub_id; } duke@435: duke@435: // runtime calls (return offset of call to be used by GC map) coleenp@4037: int call_RT(Register oop_result1, Register metadata_result, address entry, int args_size = 0); coleenp@4037: int call_RT(Register oop_result1, Register metadata_result, address entry, Register arg1); coleenp@4037: int call_RT(Register oop_result1, Register metadata_result, address entry, Register arg1, Register arg2); coleenp@4037: int call_RT(Register oop_result1, Register metadata_result, address entry, Register arg1, Register arg2, Register arg3); duke@435: }; stefank@2314: stefank@2314: #endif // SHARE_VM_C1_C1_MACROASSEMBLER_HPP