Tue, 09 Mar 2010 20:16:19 +0100
6919934: JSR 292 needs to support x86 C1
Summary: This implements JSR 292 support for C1 x86.
Reviewed-by: never, jrose, kvn
duke@435 | 1 | /* |
twisti@1730 | 2 | * Copyright 2000-2010 Sun Microsystems, Inc. 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 | * |
duke@435 | 19 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
duke@435 | 20 | * CA 95054 USA or visit www.sun.com if you need additional information or |
duke@435 | 21 | * have any questions. |
duke@435 | 22 | * |
duke@435 | 23 | */ |
duke@435 | 24 | |
duke@435 | 25 | class CodeEmitInfo; |
duke@435 | 26 | |
duke@435 | 27 | class C1_MacroAssembler: public MacroAssembler { |
duke@435 | 28 | public: |
duke@435 | 29 | // creation |
duke@435 | 30 | C1_MacroAssembler(CodeBuffer* code) : MacroAssembler(code) { pd_init(); } |
duke@435 | 31 | |
duke@435 | 32 | //---------------------------------------------------- |
duke@435 | 33 | void explicit_null_check(Register base); |
duke@435 | 34 | |
duke@435 | 35 | void inline_cache_check(Register receiver, Register iCache); |
duke@435 | 36 | void build_frame(int frame_size_in_bytes); |
twisti@1730 | 37 | void remove_frame(int frame_size_in_bytes); |
duke@435 | 38 | |
duke@435 | 39 | void unverified_entry(Register receiver, Register ic_klass); |
duke@435 | 40 | void verified_entry(); |
duke@435 | 41 | void verify_stack_oop(int offset) PRODUCT_RETURN; |
duke@435 | 42 | void verify_not_null_oop(Register r) PRODUCT_RETURN; |
duke@435 | 43 | |
duke@435 | 44 | #include "incls/_c1_MacroAssembler_pd.hpp.incl" |
duke@435 | 45 | }; |
duke@435 | 46 | |
duke@435 | 47 | |
duke@435 | 48 | |
duke@435 | 49 | // A StubAssembler is a MacroAssembler w/ extra functionality for runtime |
duke@435 | 50 | // stubs. Currently it 'knows' some stub info. Eventually, the information |
duke@435 | 51 | // may be set automatically or can be asserted when using specialised |
duke@435 | 52 | // StubAssembler functions. |
duke@435 | 53 | |
duke@435 | 54 | class StubAssembler: public C1_MacroAssembler { |
duke@435 | 55 | private: |
duke@435 | 56 | const char* _name; |
duke@435 | 57 | bool _must_gc_arguments; |
duke@435 | 58 | int _frame_size; |
duke@435 | 59 | int _num_rt_args; |
duke@435 | 60 | int _stub_id; |
duke@435 | 61 | |
duke@435 | 62 | public: |
duke@435 | 63 | // creation |
duke@435 | 64 | StubAssembler(CodeBuffer* code, const char * name, int stub_id); |
duke@435 | 65 | void set_info(const char* name, bool must_gc_arguments); |
duke@435 | 66 | |
duke@435 | 67 | void set_frame_size(int size); |
duke@435 | 68 | void set_num_rt_args(int args); |
duke@435 | 69 | |
duke@435 | 70 | // accessors |
duke@435 | 71 | const char* name() const { return _name; } |
duke@435 | 72 | bool must_gc_arguments() const { return _must_gc_arguments; } |
duke@435 | 73 | int frame_size() const { return _frame_size; } |
duke@435 | 74 | int num_rt_args() const { return _num_rt_args; } |
duke@435 | 75 | int stub_id() const { return _stub_id; } |
duke@435 | 76 | |
duke@435 | 77 | // runtime calls (return offset of call to be used by GC map) |
duke@435 | 78 | int call_RT(Register oop_result1, Register oop_result2, address entry, int args_size = 0); |
duke@435 | 79 | int call_RT(Register oop_result1, Register oop_result2, address entry, Register arg1); |
duke@435 | 80 | int call_RT(Register oop_result1, Register oop_result2, address entry, Register arg1, Register arg2); |
duke@435 | 81 | int call_RT(Register oop_result1, Register oop_result2, address entry, Register arg1, Register arg2, Register arg3); |
duke@435 | 82 | }; |