Mercurial > hg > truffle
comparison src/cpu/sparc/vm/assembler_sparc.cpp @ 642:660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
Summary: Use zero based compressed oops if java heap is below 32gb and unscaled compressed oops if java heap is below 4gb.
Reviewed-by: never, twisti, jcoomes, coleenp
author | kvn |
---|---|
date | Thu, 12 Mar 2009 10:37:46 -0700 |
parents | 9adddb8c0fc8 |
children | c517646eef23 |
comparison
equal
deleted
inserted
replaced
641:6af0a709d52b | 642:660978a2a31a |
---|---|
4314 } | 4314 } |
4315 | 4315 |
4316 | 4316 |
4317 void MacroAssembler::encode_heap_oop(Register src, Register dst) { | 4317 void MacroAssembler::encode_heap_oop(Register src, Register dst) { |
4318 assert (UseCompressedOops, "must be compressed"); | 4318 assert (UseCompressedOops, "must be compressed"); |
4319 assert (Universe::heap() != NULL, "java heap should be initialized"); | |
4320 assert (LogMinObjAlignmentInBytes == Universe::narrow_oop_shift(), "decode alg wrong"); | |
4319 verify_oop(src); | 4321 verify_oop(src); |
4322 if (Universe::narrow_oop_base() == NULL) { | |
4323 srlx(src, LogMinObjAlignmentInBytes, dst); | |
4324 return; | |
4325 } | |
4320 Label done; | 4326 Label done; |
4321 if (src == dst) { | 4327 if (src == dst) { |
4322 // optimize for frequent case src == dst | 4328 // optimize for frequent case src == dst |
4323 bpr(rc_nz, true, Assembler::pt, src, done); | 4329 bpr(rc_nz, true, Assembler::pt, src, done); |
4324 delayed() -> sub(src, G6_heapbase, dst); // annuled if not taken | 4330 delayed() -> sub(src, G6_heapbase, dst); // annuled if not taken |
4336 } | 4342 } |
4337 | 4343 |
4338 | 4344 |
4339 void MacroAssembler::encode_heap_oop_not_null(Register r) { | 4345 void MacroAssembler::encode_heap_oop_not_null(Register r) { |
4340 assert (UseCompressedOops, "must be compressed"); | 4346 assert (UseCompressedOops, "must be compressed"); |
4347 assert (Universe::heap() != NULL, "java heap should be initialized"); | |
4348 assert (LogMinObjAlignmentInBytes == Universe::narrow_oop_shift(), "decode alg wrong"); | |
4341 verify_oop(r); | 4349 verify_oop(r); |
4342 sub(r, G6_heapbase, r); | 4350 if (Universe::narrow_oop_base() != NULL) |
4351 sub(r, G6_heapbase, r); | |
4343 srlx(r, LogMinObjAlignmentInBytes, r); | 4352 srlx(r, LogMinObjAlignmentInBytes, r); |
4344 } | 4353 } |
4345 | 4354 |
4346 void MacroAssembler::encode_heap_oop_not_null(Register src, Register dst) { | 4355 void MacroAssembler::encode_heap_oop_not_null(Register src, Register dst) { |
4347 assert (UseCompressedOops, "must be compressed"); | 4356 assert (UseCompressedOops, "must be compressed"); |
4357 assert (Universe::heap() != NULL, "java heap should be initialized"); | |
4358 assert (LogMinObjAlignmentInBytes == Universe::narrow_oop_shift(), "decode alg wrong"); | |
4348 verify_oop(src); | 4359 verify_oop(src); |
4349 sub(src, G6_heapbase, dst); | 4360 if (Universe::narrow_oop_base() == NULL) { |
4350 srlx(dst, LogMinObjAlignmentInBytes, dst); | 4361 srlx(src, LogMinObjAlignmentInBytes, dst); |
4362 } else { | |
4363 sub(src, G6_heapbase, dst); | |
4364 srlx(dst, LogMinObjAlignmentInBytes, dst); | |
4365 } | |
4351 } | 4366 } |
4352 | 4367 |
4353 // Same algorithm as oops.inline.hpp decode_heap_oop. | 4368 // Same algorithm as oops.inline.hpp decode_heap_oop. |
4354 void MacroAssembler::decode_heap_oop(Register src, Register dst) { | 4369 void MacroAssembler::decode_heap_oop(Register src, Register dst) { |
4355 assert (UseCompressedOops, "must be compressed"); | 4370 assert (UseCompressedOops, "must be compressed"); |
4356 Label done; | 4371 assert (Universe::heap() != NULL, "java heap should be initialized"); |
4372 assert (LogMinObjAlignmentInBytes == Universe::narrow_oop_shift(), "decode alg wrong"); | |
4357 sllx(src, LogMinObjAlignmentInBytes, dst); | 4373 sllx(src, LogMinObjAlignmentInBytes, dst); |
4358 bpr(rc_nz, true, Assembler::pt, dst, done); | 4374 if (Universe::narrow_oop_base() != NULL) { |
4359 delayed() -> add(dst, G6_heapbase, dst); // annuled if not taken | 4375 Label done; |
4360 bind(done); | 4376 bpr(rc_nz, true, Assembler::pt, dst, done); |
4377 delayed() -> add(dst, G6_heapbase, dst); // annuled if not taken | |
4378 bind(done); | |
4379 } | |
4361 verify_oop(dst); | 4380 verify_oop(dst); |
4362 } | 4381 } |
4363 | 4382 |
4364 void MacroAssembler::decode_heap_oop_not_null(Register r) { | 4383 void MacroAssembler::decode_heap_oop_not_null(Register r) { |
4365 // Do not add assert code to this unless you change vtableStubs_sparc.cpp | 4384 // Do not add assert code to this unless you change vtableStubs_sparc.cpp |
4366 // pd_code_size_limit. | 4385 // pd_code_size_limit. |
4367 // Also do not verify_oop as this is called by verify_oop. | 4386 // Also do not verify_oop as this is called by verify_oop. |
4368 assert (UseCompressedOops, "must be compressed"); | 4387 assert (UseCompressedOops, "must be compressed"); |
4388 assert (Universe::heap() != NULL, "java heap should be initialized"); | |
4389 assert (LogMinObjAlignmentInBytes == Universe::narrow_oop_shift(), "decode alg wrong"); | |
4369 sllx(r, LogMinObjAlignmentInBytes, r); | 4390 sllx(r, LogMinObjAlignmentInBytes, r); |
4370 add(r, G6_heapbase, r); | 4391 if (Universe::narrow_oop_base() != NULL) |
4392 add(r, G6_heapbase, r); | |
4371 } | 4393 } |
4372 | 4394 |
4373 void MacroAssembler::decode_heap_oop_not_null(Register src, Register dst) { | 4395 void MacroAssembler::decode_heap_oop_not_null(Register src, Register dst) { |
4374 // Do not add assert code to this unless you change vtableStubs_sparc.cpp | 4396 // Do not add assert code to this unless you change vtableStubs_sparc.cpp |
4375 // pd_code_size_limit. | 4397 // pd_code_size_limit. |
4376 // Also do not verify_oop as this is called by verify_oop. | 4398 // Also do not verify_oop as this is called by verify_oop. |
4377 assert (UseCompressedOops, "must be compressed"); | 4399 assert (UseCompressedOops, "must be compressed"); |
4400 assert (Universe::heap() != NULL, "java heap should be initialized"); | |
4401 assert (LogMinObjAlignmentInBytes == Universe::narrow_oop_shift(), "decode alg wrong"); | |
4378 sllx(src, LogMinObjAlignmentInBytes, dst); | 4402 sllx(src, LogMinObjAlignmentInBytes, dst); |
4379 add(dst, G6_heapbase, dst); | 4403 if (Universe::narrow_oop_base() != NULL) |
4404 add(dst, G6_heapbase, dst); | |
4380 } | 4405 } |
4381 | 4406 |
4382 void MacroAssembler::reinit_heapbase() { | 4407 void MacroAssembler::reinit_heapbase() { |
4383 if (UseCompressedOops) { | 4408 if (UseCompressedOops) { |
4384 // call indirectly to solve generation ordering problem | 4409 // call indirectly to solve generation ordering problem |
4385 Address base(G6_heapbase, (address)Universe::heap_base_addr()); | 4410 Address base(G6_heapbase, (address)Universe::narrow_oop_base_addr()); |
4386 load_ptr_contents(base, G6_heapbase); | 4411 load_ptr_contents(base, G6_heapbase); |
4387 } | 4412 } |
4388 } | 4413 } |