comparison src/share/vm/asm/assembler.inline.hpp @ 2008:2f644f85485d

6961690: load oops from constant table on SPARC Summary: oops should be loaded from the constant table of an nmethod instead of materializing them with a long code sequence. Reviewed-by: never, kvn
author twisti
date Fri, 03 Dec 2010 01:34:31 -0800
parents f95d63e2154a
children 6ab62ad83507
comparison
equal deleted inserted replaced
2007:5ddfcf4b079e 2008:2f644f85485d
112 112
113 inline void Label::bind_loc(int pos, int sect) { 113 inline void Label::bind_loc(int pos, int sect) {
114 bind_loc(CodeBuffer::locator(pos, sect)); 114 bind_loc(CodeBuffer::locator(pos, sect));
115 } 115 }
116 116
117 address AbstractAssembler::address_constant(Label& L) {
118 address c = NULL;
119 address ptr = start_a_const(sizeof(c), sizeof(c));
120 if (ptr != NULL) {
121 relocate(Relocation::spec_simple(relocInfo::internal_word_type));
122 *(address*)ptr = c = code_section()->target(L, ptr);
123 _code_pos = ptr + sizeof(c);
124 end_a_const();
125 }
126 return ptr;
127 }
128
129 address AbstractAssembler::address_table_constant(GrowableArray<Label*> labels) {
130 int addressSize = sizeof(address);
131 int sizeLabel = addressSize * labels.length();
132 address ptr = start_a_const(sizeLabel, addressSize);
133
134 if (ptr != NULL) {
135 address *labelLoc = (address*)ptr;
136 for (int i=0; i < labels.length(); i++) {
137 emit_address(code_section()->target(*labels.at(i), (address)&labelLoc[i]));
138 code_section()->relocate((address)&labelLoc[i], relocInfo::internal_word_type);
139 }
140 end_a_const();
141 }
142 return ptr;
143 }
144
145 #endif // SHARE_VM_ASM_ASSEMBLER_INLINE_HPP 117 #endif // SHARE_VM_ASM_ASSEMBLER_INLINE_HPP