Mercurial > hg > graal-jvmci-8
annotate src/share/vm/asm/assembler.inline.hpp @ 7198:6ab62ad83507
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
Reviewed-by: twisti, kvn
Contributed-by: Bharadwaj Yadavalli <bharadwaj.yadavalli@oracle.com>
author | twisti |
---|---|
date | Fri, 30 Nov 2012 11:44:05 -0800 |
parents | 2f644f85485d |
children | cd3d6a6b95d9 |
rev | line source |
---|---|
0 | 1 /* |
1972 | 2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. |
0 | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | |
5 * This code is free software; you can redistribute it and/or modify it | |
6 * under the terms of the GNU General Public License version 2 only, as | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
15 * You should have received a copy of the GNU General Public License version | |
16 * 2 along with this work; if not, write to the Free Software Foundation, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
1972 | 25 #ifndef SHARE_VM_ASM_ASSEMBLER_INLINE_HPP |
26 #define SHARE_VM_ASM_ASSEMBLER_INLINE_HPP | |
27 | |
28 #include "asm/assembler.hpp" | |
29 #include "asm/codeBuffer.hpp" | |
30 #include "compiler/disassembler.hpp" | |
31 #include "runtime/threadLocalStorage.hpp" | |
32 | |
7198
6ab62ad83507
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
2008
diff
changeset
|
33 inline address AbstractAssembler::addr_at(int pos) const { |
6ab62ad83507
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
2008
diff
changeset
|
34 return code_section()->start() + pos; |
0 | 35 } |
36 | |
7198
6ab62ad83507
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
2008
diff
changeset
|
37 void AbstractAssembler::emit_int8(int8_t x) { code_section()->emit_int8 (x); } |
6ab62ad83507
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
2008
diff
changeset
|
38 void AbstractAssembler::emit_int16(int16_t x) { code_section()->emit_int16(x); } |
6ab62ad83507
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
2008
diff
changeset
|
39 void AbstractAssembler::emit_int32(int32_t x) { code_section()->emit_int32(x); } |
6ab62ad83507
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
2008
diff
changeset
|
40 void AbstractAssembler::emit_int64(int64_t x) { code_section()->emit_int64(x); } |
0 | 41 |
7198
6ab62ad83507
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
2008
diff
changeset
|
42 void AbstractAssembler::emit_float(jfloat x) { code_section()->emit_float(x); } |
6ab62ad83507
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
2008
diff
changeset
|
43 void AbstractAssembler::emit_double(jdouble x) { code_section()->emit_double(x); } |
6ab62ad83507
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
2008
diff
changeset
|
44 void AbstractAssembler::emit_address(address x) { code_section()->emit_address(x); } |
0 | 45 |
46 inline address AbstractAssembler::inst_mark() const { | |
47 return code_section()->mark(); | |
48 } | |
49 | |
50 inline void AbstractAssembler::set_inst_mark() { | |
51 code_section()->set_mark(); | |
52 } | |
53 | |
54 inline void AbstractAssembler::clear_inst_mark() { | |
55 code_section()->clear_mark(); | |
56 } | |
57 | |
58 | |
59 inline void AbstractAssembler::relocate(RelocationHolder const& rspec, int format) { | |
60 assert(!pd_check_instruction_mark() | |
7198
6ab62ad83507
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
2008
diff
changeset
|
61 || inst_mark() == NULL || inst_mark() == code_section()->end(), |
0 | 62 "call relocate() between instructions"); |
7198
6ab62ad83507
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
2008
diff
changeset
|
63 code_section()->relocate(code_section()->end(), rspec, format); |
0 | 64 } |
65 | |
66 | |
67 inline CodeBuffer* AbstractAssembler::code() const { | |
68 return code_section()->outer(); | |
69 } | |
70 | |
71 inline int AbstractAssembler::sect() const { | |
72 return code_section()->index(); | |
73 } | |
74 | |
7198
6ab62ad83507
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
2008
diff
changeset
|
75 inline address AbstractAssembler::pc() const { |
6ab62ad83507
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
2008
diff
changeset
|
76 return code_section()->end(); |
6ab62ad83507
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
2008
diff
changeset
|
77 } |
6ab62ad83507
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
2008
diff
changeset
|
78 |
6ab62ad83507
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
2008
diff
changeset
|
79 inline int AbstractAssembler::offset() const { |
6ab62ad83507
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
2008
diff
changeset
|
80 return code_section()->size(); |
6ab62ad83507
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
2008
diff
changeset
|
81 } |
6ab62ad83507
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
2008
diff
changeset
|
82 |
0 | 83 inline int AbstractAssembler::locator() const { |
84 return CodeBuffer::locator(offset(), sect()); | |
85 } | |
86 | |
87 inline address AbstractAssembler::target(Label& L) { | |
88 return code_section()->target(L, pc()); | |
89 } | |
90 | |
91 inline int Label::loc_pos() const { | |
92 return CodeBuffer::locator_pos(loc()); | |
93 } | |
94 | |
95 inline int Label::loc_sect() const { | |
96 return CodeBuffer::locator_sect(loc()); | |
97 } | |
98 | |
99 inline void Label::bind_loc(int pos, int sect) { | |
100 bind_loc(CodeBuffer::locator(pos, sect)); | |
101 } | |
102 | |
1972 | 103 #endif // SHARE_VM_ASM_ASSEMBLER_INLINE_HPP |