Mercurial > hg > truffle
comparison src/cpu/x86/vm/assembler_x86.cpp @ 1579:e9ff18c4ace7
Merge
author | jrose |
---|---|
date | Wed, 02 Jun 2010 22:45:42 -0700 |
parents | c18cbe5936b8 2d127394260e |
children | 02e771df338e |
comparison
equal
deleted
inserted
replaced
1562:dfe27f03244a | 1579:e9ff18c4ace7 |
---|---|
8183 #ifdef _LP64 | 8183 #ifdef _LP64 |
8184 if (UseCompressedOops) { | 8184 if (UseCompressedOops) { |
8185 assert (Universe::heap() != NULL, "java heap should be initialized"); | 8185 assert (Universe::heap() != NULL, "java heap should be initialized"); |
8186 movl(dst, Address(src, oopDesc::klass_offset_in_bytes())); | 8186 movl(dst, Address(src, oopDesc::klass_offset_in_bytes())); |
8187 if (Universe::narrow_oop_shift() != 0) { | 8187 if (Universe::narrow_oop_shift() != 0) { |
8188 assert(Address::times_8 == LogMinObjAlignmentInBytes && | 8188 assert(LogMinObjAlignmentInBytes == Universe::narrow_oop_shift(), "decode alg wrong"); |
8189 Address::times_8 == Universe::narrow_oop_shift(), "decode alg wrong"); | 8189 if (LogMinObjAlignmentInBytes == Address::times_8) { |
8190 movq(dst, Address(r12_heapbase, dst, Address::times_8, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes())); | 8190 movq(dst, Address(r12_heapbase, dst, Address::times_8, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes())); |
8191 } else { | |
8192 // OK to use shift since we don't need to preserve flags. | |
8193 shlq(dst, LogMinObjAlignmentInBytes); | |
8194 movq(dst, Address(r12_heapbase, dst, Address::times_1, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes())); | |
8195 } | |
8191 } else { | 8196 } else { |
8192 movq(dst, Address(dst, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes())); | 8197 movq(dst, Address(dst, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes())); |
8193 } | 8198 } |
8194 } else | 8199 } else |
8195 #endif | 8200 #endif |
8359 bind(done); | 8364 bind(done); |
8360 verify_oop(r, "broken oop in decode_heap_oop"); | 8365 verify_oop(r, "broken oop in decode_heap_oop"); |
8361 } | 8366 } |
8362 | 8367 |
8363 void MacroAssembler::decode_heap_oop_not_null(Register r) { | 8368 void MacroAssembler::decode_heap_oop_not_null(Register r) { |
8369 // Note: it will change flags | |
8364 assert (UseCompressedOops, "should only be used for compressed headers"); | 8370 assert (UseCompressedOops, "should only be used for compressed headers"); |
8365 assert (Universe::heap() != NULL, "java heap should be initialized"); | 8371 assert (Universe::heap() != NULL, "java heap should be initialized"); |
8366 // Cannot assert, unverified entry point counts instructions (see .ad file) | 8372 // Cannot assert, unverified entry point counts instructions (see .ad file) |
8367 // vtableStubs also counts instructions in pd_code_size_limit. | 8373 // vtableStubs also counts instructions in pd_code_size_limit. |
8368 // Also do not verify_oop as this is called by verify_oop. | 8374 // Also do not verify_oop as this is called by verify_oop. |
8369 if (Universe::narrow_oop_shift() != 0) { | 8375 if (Universe::narrow_oop_shift() != 0) { |
8370 assert (Address::times_8 == LogMinObjAlignmentInBytes && | 8376 assert(LogMinObjAlignmentInBytes == Universe::narrow_oop_shift(), "decode alg wrong"); |
8371 Address::times_8 == Universe::narrow_oop_shift(), "decode alg wrong"); | 8377 shlq(r, LogMinObjAlignmentInBytes); |
8372 // Don't use Shift since it modifies flags. | 8378 if (Universe::narrow_oop_base() != NULL) { |
8373 leaq(r, Address(r12_heapbase, r, Address::times_8, 0)); | 8379 addq(r, r12_heapbase); |
8380 } | |
8374 } else { | 8381 } else { |
8375 assert (Universe::narrow_oop_base() == NULL, "sanity"); | 8382 assert (Universe::narrow_oop_base() == NULL, "sanity"); |
8376 } | 8383 } |
8377 } | 8384 } |
8378 | 8385 |
8379 void MacroAssembler::decode_heap_oop_not_null(Register dst, Register src) { | 8386 void MacroAssembler::decode_heap_oop_not_null(Register dst, Register src) { |
8387 // Note: it will change flags | |
8380 assert (UseCompressedOops, "should only be used for compressed headers"); | 8388 assert (UseCompressedOops, "should only be used for compressed headers"); |
8381 assert (Universe::heap() != NULL, "java heap should be initialized"); | 8389 assert (Universe::heap() != NULL, "java heap should be initialized"); |
8382 // Cannot assert, unverified entry point counts instructions (see .ad file) | 8390 // Cannot assert, unverified entry point counts instructions (see .ad file) |
8383 // vtableStubs also counts instructions in pd_code_size_limit. | 8391 // vtableStubs also counts instructions in pd_code_size_limit. |
8384 // Also do not verify_oop as this is called by verify_oop. | 8392 // Also do not verify_oop as this is called by verify_oop. |
8385 if (Universe::narrow_oop_shift() != 0) { | 8393 if (Universe::narrow_oop_shift() != 0) { |
8386 assert (Address::times_8 == LogMinObjAlignmentInBytes && | 8394 assert(LogMinObjAlignmentInBytes == Universe::narrow_oop_shift(), "decode alg wrong"); |
8387 Address::times_8 == Universe::narrow_oop_shift(), "decode alg wrong"); | 8395 if (LogMinObjAlignmentInBytes == Address::times_8) { |
8388 leaq(dst, Address(r12_heapbase, src, Address::times_8, 0)); | 8396 leaq(dst, Address(r12_heapbase, src, Address::times_8, 0)); |
8397 } else { | |
8398 if (dst != src) { | |
8399 movq(dst, src); | |
8400 } | |
8401 shlq(dst, LogMinObjAlignmentInBytes); | |
8402 if (Universe::narrow_oop_base() != NULL) { | |
8403 addq(dst, r12_heapbase); | |
8404 } | |
8405 } | |
8389 } else if (dst != src) { | 8406 } else if (dst != src) { |
8390 assert (Universe::narrow_oop_base() == NULL, "sanity"); | 8407 assert (Universe::narrow_oop_base() == NULL, "sanity"); |
8391 movq(dst, src); | 8408 movq(dst, src); |
8392 } | 8409 } |
8393 } | 8410 } |