Mercurial > hg > truffle
annotate src/share/vm/asm/assembler.inline.hpp @ 3757:f8c9417e3571
7052219: JSR 292: Crash in ~BufferBlob::MethodHandles adapters
Reviewed-by: twisti, kvn, jrose
author | never |
---|---|
date | Tue, 14 Jun 2011 14:41:33 -0700 |
parents | 2f644f85485d |
children | 6ab62ad83507 |
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 | |
0 | 33 inline void AbstractAssembler::sync() { |
34 CodeSection* cs = code_section(); | |
35 guarantee(cs->start() == _code_begin, "must not shift code buffer"); | |
36 cs->set_end(_code_pos); | |
37 } | |
38 | |
39 inline void AbstractAssembler::emit_byte(int x) { | |
40 assert(isByte(x), "not a byte"); | |
41 *(unsigned char*)_code_pos = (unsigned char)x; | |
42 _code_pos += sizeof(unsigned char); | |
43 sync(); | |
44 } | |
45 | |
46 | |
47 inline void AbstractAssembler::emit_word(int x) { | |
48 *(short*)_code_pos = (short)x; | |
49 _code_pos += sizeof(short); | |
50 sync(); | |
51 } | |
52 | |
53 | |
54 inline void AbstractAssembler::emit_long(jint x) { | |
55 *(jint*)_code_pos = x; | |
56 _code_pos += sizeof(jint); | |
57 sync(); | |
58 } | |
59 | |
60 inline void AbstractAssembler::emit_address(address x) { | |
61 *(address*)_code_pos = x; | |
62 _code_pos += sizeof(address); | |
63 sync(); | |
64 } | |
65 | |
66 inline address AbstractAssembler::inst_mark() const { | |
67 return code_section()->mark(); | |
68 } | |
69 | |
70 | |
71 inline void AbstractAssembler::set_inst_mark() { | |
72 code_section()->set_mark(); | |
73 } | |
74 | |
75 | |
76 inline void AbstractAssembler::clear_inst_mark() { | |
77 code_section()->clear_mark(); | |
78 } | |
79 | |
80 | |
81 inline void AbstractAssembler::relocate(RelocationHolder const& rspec, int format) { | |
82 assert(!pd_check_instruction_mark() | |
83 || inst_mark() == NULL || inst_mark() == _code_pos, | |
84 "call relocate() between instructions"); | |
85 code_section()->relocate(_code_pos, rspec, format); | |
86 } | |
87 | |
88 | |
89 inline CodeBuffer* AbstractAssembler::code() const { | |
90 return code_section()->outer(); | |
91 } | |
92 | |
93 inline int AbstractAssembler::sect() const { | |
94 return code_section()->index(); | |
95 } | |
96 | |
97 inline int AbstractAssembler::locator() const { | |
98 return CodeBuffer::locator(offset(), sect()); | |
99 } | |
100 | |
101 inline address AbstractAssembler::target(Label& L) { | |
102 return code_section()->target(L, pc()); | |
103 } | |
104 | |
105 inline int Label::loc_pos() const { | |
106 return CodeBuffer::locator_pos(loc()); | |
107 } | |
108 | |
109 inline int Label::loc_sect() const { | |
110 return CodeBuffer::locator_sect(loc()); | |
111 } | |
112 | |
113 inline void Label::bind_loc(int pos, int sect) { | |
114 bind_loc(CodeBuffer::locator(pos, sect)); | |
115 } | |
116 | |
1972 | 117 #endif // SHARE_VM_ASM_ASSEMBLER_INLINE_HPP |