1 #ifdef USE_PRAGMA_IDENT_HDR
2 #pragma ident "@(#)c1_LIRAssembler.hpp 1.116 07/05/05 17:05:08 JVM"
3 #endif
4 /*
5 * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved.
6 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7 *
8 * This code is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 only, as
10 * published by the Free Software Foundation.
11 *
12 * This code is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * version 2 for more details (a copy is included in the LICENSE file that
16 * accompanied this code).
17 *
18 * You should have received a copy of the GNU General Public License version
19 * 2 along with this work; if not, write to the Free Software Foundation,
20 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21 *
22 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23 * CA 95054 USA or visit www.sun.com if you need additional information or
24 * have any questions.
25 *
26 */
27
28 class Compilation;
29 class ScopeValue;
30
31 class LIR_Assembler: public CompilationResourceObj {
32 private:
33 C1_MacroAssembler* _masm;
34 CodeStubList* _slow_case_stubs;
35
36 Compilation* _compilation;
37 FrameMap* _frame_map;
38 BlockBegin* _current_block;
39
40 Instruction* _pending_non_safepoint;
41 int _pending_non_safepoint_offset;
42
43 #ifdef ASSERT
44 BlockList _branch_target_blocks;
45 void check_no_unbound_labels();
46 #endif
47
48 FrameMap* frame_map() const { return _frame_map; }
49
50 void set_current_block(BlockBegin* b) { _current_block = b; }
51 BlockBegin* current_block() const { return _current_block; }
52
53 // non-safepoint debug info management
54 void flush_debug_info(int before_pc_offset) {
61 void process_debug_info(LIR_Op* op);
62 void record_non_safepoint_debug_info();
63
64 // unified bailout support
65 void bailout(const char* msg) const { compilation()->bailout(msg); }
66 bool bailed_out() const { return compilation()->bailed_out(); }
67
68 // code emission patterns and accessors
69 void check_codespace();
70 bool needs_icache(ciMethod* method) const;
71
72 // returns offset of icache check
73 int check_icache();
74
75 void jobject2reg(jobject o, Register reg);
76 void jobject2reg_with_patching(Register reg, CodeEmitInfo* info);
77
78 void emit_stubs(CodeStubList* stub_list);
79
80 // addresses
81 static Address as_Address(LIR_Address* addr);
82 static Address as_Address_lo(LIR_Address* addr);
83 static Address as_Address_hi(LIR_Address* addr);
84
85 // debug information
86 void add_call_info(int pc_offset, CodeEmitInfo* cinfo);
87 void add_debug_info_for_branch(CodeEmitInfo* info);
88 void add_debug_info_for_div0(int pc_offset, CodeEmitInfo* cinfo);
89 void add_debug_info_for_div0_here(CodeEmitInfo* info);
90 void add_debug_info_for_null_check(int pc_offset, CodeEmitInfo* cinfo);
91 void add_debug_info_for_null_check_here(CodeEmitInfo* info);
92
93 void set_24bit_FPU();
94 void reset_FPU();
95 void fpop();
96 void fxch(int i);
97 void fld(int i);
98 void ffree(int i);
99
100 void breakpoint();
101 void push(LIR_Opr opr);
102 void pop(LIR_Opr opr);
103
|
1 #ifdef USE_PRAGMA_IDENT_HDR
2 #pragma ident "@(#)c1_LIRAssembler.hpp 1.116 07/05/05 17:05:08 JVM"
3 #endif
4 /*
5 * Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
6 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7 *
8 * This code is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 only, as
10 * published by the Free Software Foundation.
11 *
12 * This code is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * version 2 for more details (a copy is included in the LICENSE file that
16 * accompanied this code).
17 *
18 * You should have received a copy of the GNU General Public License version
19 * 2 along with this work; if not, write to the Free Software Foundation,
20 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21 *
22 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23 * CA 95054 USA or visit www.sun.com if you need additional information or
24 * have any questions.
25 *
26 */
27
28 class Compilation;
29 class ScopeValue;
30 class BarrierSet;
31
32 class LIR_Assembler: public CompilationResourceObj {
33 private:
34 C1_MacroAssembler* _masm;
35 CodeStubList* _slow_case_stubs;
36 BarrierSet* _bs;
37
38 Compilation* _compilation;
39 FrameMap* _frame_map;
40 BlockBegin* _current_block;
41
42 Instruction* _pending_non_safepoint;
43 int _pending_non_safepoint_offset;
44
45 #ifdef ASSERT
46 BlockList _branch_target_blocks;
47 void check_no_unbound_labels();
48 #endif
49
50 FrameMap* frame_map() const { return _frame_map; }
51
52 void set_current_block(BlockBegin* b) { _current_block = b; }
53 BlockBegin* current_block() const { return _current_block; }
54
55 // non-safepoint debug info management
56 void flush_debug_info(int before_pc_offset) {
63 void process_debug_info(LIR_Op* op);
64 void record_non_safepoint_debug_info();
65
66 // unified bailout support
67 void bailout(const char* msg) const { compilation()->bailout(msg); }
68 bool bailed_out() const { return compilation()->bailed_out(); }
69
70 // code emission patterns and accessors
71 void check_codespace();
72 bool needs_icache(ciMethod* method) const;
73
74 // returns offset of icache check
75 int check_icache();
76
77 void jobject2reg(jobject o, Register reg);
78 void jobject2reg_with_patching(Register reg, CodeEmitInfo* info);
79
80 void emit_stubs(CodeStubList* stub_list);
81
82 // addresses
83 Address as_Address(LIR_Address* addr);
84 Address as_Address_lo(LIR_Address* addr);
85 Address as_Address_hi(LIR_Address* addr);
86
87 // debug information
88 void add_call_info(int pc_offset, CodeEmitInfo* cinfo);
89 void add_debug_info_for_branch(CodeEmitInfo* info);
90 void add_debug_info_for_div0(int pc_offset, CodeEmitInfo* cinfo);
91 void add_debug_info_for_div0_here(CodeEmitInfo* info);
92 void add_debug_info_for_null_check(int pc_offset, CodeEmitInfo* cinfo);
93 void add_debug_info_for_null_check_here(CodeEmitInfo* info);
94
95 void set_24bit_FPU();
96 void reset_FPU();
97 void fpop();
98 void fxch(int i);
99 void fld(int i);
100 void ffree(int i);
101
102 void breakpoint();
103 void push(LIR_Opr opr);
104 void pop(LIR_Opr opr);
105
|