Mercurial > hg > graal-compiler
comparison src/cpu/x86/vm/macroAssembler_x86.cpp @ 12356:359f7e70ae7f
Reduce HotSpot diff and fix previous merge
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Fri, 11 Oct 2013 15:41:33 +0200 |
parents | cefad50507d8 |
children | 096c224171c4 |
comparison
equal
deleted
inserted
replaced
12355:cefad50507d8 | 12356:359f7e70ae7f |
---|---|
5073 // Function instr_size_for_decode_klass_not_null() counts the instructions | 5073 // Function instr_size_for_decode_klass_not_null() counts the instructions |
5074 // generated by decode_klass_not_null(register r) and reinit_heapbase(), | 5074 // generated by decode_klass_not_null(register r) and reinit_heapbase(), |
5075 // when (Universe::heap() != NULL). Hence, if the instructions they | 5075 // when (Universe::heap() != NULL). Hence, if the instructions they |
5076 // generate change, then this method needs to be updated. | 5076 // generate change, then this method needs to be updated. |
5077 int MacroAssembler::instr_size_for_decode_klass_not_null() { | 5077 int MacroAssembler::instr_size_for_decode_klass_not_null() { |
5078 assert (UseCompressedKlassPointers, "only for compressed klass ptrs"); | 5078 assert (UseCompressedClassPointers, "only for compressed klass ptrs"); |
5079 // mov64 + addq + shlq? + mov64 (for reinit_heapbase()). | 5079 // mov64 + addq + shlq? + mov64 (for reinit_heapbase()). |
5080 return (Universe::narrow_klass_shift() == 0 ? 20 : 24); | 5080 return (Universe::narrow_klass_shift() == 0 ? 20 : 24); |
5081 } | 5081 } |
5082 | 5082 |
5083 // !!! If the instructions that get generated here change then function | 5083 // !!! If the instructions that get generated here change then function |
5084 // instr_size_for_decode_klass_not_null() needs to get updated. | 5084 // instr_size_for_decode_klass_not_null() needs to get updated. |
5085 void MacroAssembler::decode_klass_not_null(Register r) { | 5085 void MacroAssembler::decode_klass_not_null(Register r) { |
5086 // Note: it will change flags | 5086 // Note: it will change flags |
5087 assert(Universe::narrow_klass_base() != NULL, "Base should be initialized"); | 5087 assert(Universe::narrow_klass_base() != NULL, "Base should be initialized"); |
5088 assert (UseCompressedKlassPointers, "should only be used for compressed headers"); | 5088 assert (UseCompressedClassPointers, "should only be used for compressed headers"); |
5089 assert(r != r12_heapbase, "Decoding a klass in r12"); | 5089 assert(r != r12_heapbase, "Decoding a klass in r12"); |
5090 // Cannot assert, unverified entry point counts instructions (see .ad file) | 5090 // Cannot assert, unverified entry point counts instructions (see .ad file) |
5091 // vtableStubs also counts instructions in pd_code_size_limit. | 5091 // vtableStubs also counts instructions in pd_code_size_limit. |
5092 // Also do not verify_oop as this is called by verify_oop. | 5092 // Also do not verify_oop as this is called by verify_oop. |
5093 if (Universe::narrow_klass_shift() != 0) { | 5093 if (Universe::narrow_klass_shift() != 0) { |
5101 } | 5101 } |
5102 | 5102 |
5103 void MacroAssembler::decode_klass_not_null(Register dst, Register src) { | 5103 void MacroAssembler::decode_klass_not_null(Register dst, Register src) { |
5104 // Note: it will change flags | 5104 // Note: it will change flags |
5105 assert(Universe::narrow_klass_base() != NULL, "Base should be initialized"); | 5105 assert(Universe::narrow_klass_base() != NULL, "Base should be initialized"); |
5106 assert (UseCompressedKlassPointers, "should only be used for compressed headers"); | 5106 assert (UseCompressedClassPointers, "should only be used for compressed headers"); |
5107 if (dst == src) { | 5107 if (dst == src) { |
5108 decode_klass_not_null(dst); | 5108 decode_klass_not_null(dst); |
5109 } else { | 5109 } else { |
5110 // Cannot assert, unverified entry point counts instructions (see .ad file) | 5110 // Cannot assert, unverified entry point counts instructions (see .ad file) |
5111 // vtableStubs also counts instructions in pd_code_size_limit. | 5111 // vtableStubs also counts instructions in pd_code_size_limit. |
5139 RelocationHolder rspec = oop_Relocation::spec(oop_index); | 5139 RelocationHolder rspec = oop_Relocation::spec(oop_index); |
5140 mov_narrow_oop(dst, oop_index, rspec); | 5140 mov_narrow_oop(dst, oop_index, rspec); |
5141 } | 5141 } |
5142 | 5142 |
5143 void MacroAssembler::set_narrow_klass(Register dst, Klass* k) { | 5143 void MacroAssembler::set_narrow_klass(Register dst, Klass* k) { |
5144 assert (UseCompressedKlassPointers, "should only be used for compressed headers"); | 5144 assert (UseCompressedClassPointers, "should only be used for compressed headers"); |
5145 assert (oop_recorder() != NULL, "this assembler needs an OopRecorder"); | 5145 assert (oop_recorder() != NULL, "this assembler needs an OopRecorder"); |
5146 int klass_index = oop_recorder()->find_index(k); | 5146 int klass_index = oop_recorder()->find_index(k); |
5147 RelocationHolder rspec = metadata_Relocation::spec(klass_index); | 5147 RelocationHolder rspec = metadata_Relocation::spec(klass_index); |
5148 mov_narrow_oop(dst, Klass::encode_klass(k), rspec); | 5148 mov_narrow_oop(dst, Klass::encode_klass(k), rspec); |
5149 } | 5149 } |
5150 | 5150 |
5151 void MacroAssembler::set_narrow_klass(Address dst, Klass* k) { | 5151 void MacroAssembler::set_narrow_klass(Address dst, Klass* k) { |
5152 assert (UseCompressedKlassPointers, "should only be used for compressed headers"); | 5152 assert (UseCompressedClassPointers, "should only be used for compressed headers"); |
5153 assert (oop_recorder() != NULL, "this assembler needs an OopRecorder"); | 5153 assert (oop_recorder() != NULL, "this assembler needs an OopRecorder"); |
5154 int klass_index = oop_recorder()->find_index(k); | 5154 int klass_index = oop_recorder()->find_index(k); |
5155 RelocationHolder rspec = metadata_Relocation::spec(klass_index); | 5155 RelocationHolder rspec = metadata_Relocation::spec(klass_index); |
5156 mov_narrow_oop(dst, Klass::encode_klass(k), rspec); | 5156 mov_narrow_oop(dst, Klass::encode_klass(k), rspec); |
5157 } | 5157 } |
5173 RelocationHolder rspec = oop_Relocation::spec(oop_index); | 5173 RelocationHolder rspec = oop_Relocation::spec(oop_index); |
5174 Assembler::cmp_narrow_oop(dst, oop_index, rspec); | 5174 Assembler::cmp_narrow_oop(dst, oop_index, rspec); |
5175 } | 5175 } |
5176 | 5176 |
5177 void MacroAssembler::cmp_narrow_klass(Register dst, Klass* k) { | 5177 void MacroAssembler::cmp_narrow_klass(Register dst, Klass* k) { |
5178 assert (UseCompressedKlassPointers, "should only be used for compressed headers"); | 5178 assert (UseCompressedClassPointers, "should only be used for compressed headers"); |
5179 assert (oop_recorder() != NULL, "this assembler needs an OopRecorder"); | 5179 assert (oop_recorder() != NULL, "this assembler needs an OopRecorder"); |
5180 int klass_index = oop_recorder()->find_index(k); | 5180 int klass_index = oop_recorder()->find_index(k); |
5181 RelocationHolder rspec = metadata_Relocation::spec(klass_index); | 5181 RelocationHolder rspec = metadata_Relocation::spec(klass_index); |
5182 Assembler::cmp_narrow_oop(dst, Klass::encode_klass(k), rspec); | 5182 Assembler::cmp_narrow_oop(dst, Klass::encode_klass(k), rspec); |
5183 } | 5183 } |
5184 | 5184 |
5185 void MacroAssembler::cmp_narrow_klass(Address dst, Klass* k) { | 5185 void MacroAssembler::cmp_narrow_klass(Address dst, Klass* k) { |
5186 assert (UseCompressedKlassPointers, "should only be used for compressed headers"); | 5186 assert (UseCompressedClassPointers, "should only be used for compressed headers"); |
5187 assert (oop_recorder() != NULL, "this assembler needs an OopRecorder"); | 5187 assert (oop_recorder() != NULL, "this assembler needs an OopRecorder"); |
5188 int klass_index = oop_recorder()->find_index(k); | 5188 int klass_index = oop_recorder()->find_index(k); |
5189 RelocationHolder rspec = metadata_Relocation::spec(klass_index); | 5189 RelocationHolder rspec = metadata_Relocation::spec(klass_index); |
5190 Assembler::cmp_narrow_oop(dst, Klass::encode_klass(k), rspec); | 5190 Assembler::cmp_narrow_oop(dst, Klass::encode_klass(k), rspec); |
5191 } | 5191 } |
5192 | 5192 |
5193 void MacroAssembler::reinit_heapbase() { | 5193 void MacroAssembler::reinit_heapbase() { |
5194 if (UseCompressedOops || UseCompressedKlassPointers) { | 5194 if (UseCompressedOops || UseCompressedClassPointers) { |
5195 if (Universe::heap() != NULL) { | 5195 if (Universe::heap() != NULL) { |
5196 if (Universe::narrow_oop_base() == NULL) { | 5196 if (Universe::narrow_oop_base() == NULL) { |
5197 MacroAssembler::xorptr(r12_heapbase, r12_heapbase); | 5197 MacroAssembler::xorptr(r12_heapbase, r12_heapbase); |
5198 } else { | 5198 } else { |
5199 mov64(r12_heapbase, (int64_t)Universe::narrow_ptrs_base()); | 5199 mov64(r12_heapbase, (int64_t)Universe::narrow_ptrs_base()); |