Mercurial > hg > graal-jvmci-8
comparison src/cpu/ppc/vm/macroAssembler_ppc.cpp @ 14427:eb178e97560c
8027968: Adapt PPC to 8024927: Nashorn performance regression with CompressedOops
Reviewed-by: coleenp, kvn
author | goetz |
---|---|
date | Thu, 07 Nov 2013 11:47:11 +0100 |
parents | a0d02bb625e2 |
children | b0133e4187d3 |
comparison
equal
deleted
inserted
replaced
14426:600acc4b8b1e | 14427:eb178e97560c |
---|---|
2380 } | 2380 } |
2381 | 2381 |
2382 | 2382 |
2383 void MacroAssembler::encode_klass_not_null(Register dst, Register src) { | 2383 void MacroAssembler::encode_klass_not_null(Register dst, Register src) { |
2384 if (src == noreg) src = dst; | 2384 if (src == noreg) src = dst; |
2385 assert(Universe::narrow_klass_base() != NULL, "Base should be initialized"); | 2385 if (Universe::narrow_klass_base() != 0) { |
2386 load_const(R0, Universe::narrow_klass_base()); | 2386 load_const(R0, Universe::narrow_klass_base()); |
2387 sub(dst, src, R0); | 2387 sub(dst, src, R0); |
2388 if (Universe::narrow_klass_shift() != 0) { | 2388 } |
2389 if (Universe::narrow_klass_shift() != 0 || | |
2390 Universe::narrow_klass_base() == 0 && src != dst) { // Move required. | |
2389 srdi(dst, src, Universe::narrow_klass_shift()); | 2391 srdi(dst, src, Universe::narrow_klass_shift()); |
2390 } | 2392 } |
2391 } | 2393 } |
2392 | 2394 |
2393 void MacroAssembler::store_klass(Register dst_oop, Register klass, Register ck) { | 2395 void MacroAssembler::store_klass(Register dst_oop, Register klass, Register ck) { |
2397 } else { | 2399 } else { |
2398 std(klass, oopDesc::klass_offset_in_bytes(), dst_oop); | 2400 std(klass, oopDesc::klass_offset_in_bytes(), dst_oop); |
2399 } | 2401 } |
2400 } | 2402 } |
2401 | 2403 |
2404 int MacroAssembler::instr_size_for_decode_klass_not_null() { | |
2405 if (!UseCompressedClassPointers) return 0; | |
2406 int num_instrs = 1; // shift or move | |
2407 if (Universe::narrow_klass_base() != 0) num_instrs = 7; // shift + load const + add | |
2408 return num_instrs * BytesPerInstWord; | |
2409 } | |
2410 | |
2402 void MacroAssembler::decode_klass_not_null(Register dst, Register src) { | 2411 void MacroAssembler::decode_klass_not_null(Register dst, Register src) { |
2403 if (src == noreg) src = dst; | 2412 if (src == noreg) src = dst; |
2404 Register shifted_src = src; | 2413 Register shifted_src = src; |
2405 assert(Universe::narrow_klass_base() != NULL, "Base should be initialized"); | 2414 if (Universe::narrow_klass_shift() != 0 || |
2406 if (Universe::narrow_klass_shift() != 0) { | 2415 Universe::narrow_klass_base() == 0 && src != dst) { // Move required. |
2407 shifted_src = dst; | 2416 shifted_src = dst; |
2408 sldi(shifted_src, src, Universe::narrow_klass_shift()); | 2417 sldi(shifted_src, src, Universe::narrow_klass_shift()); |
2409 } | 2418 } |
2410 load_const(R0, Universe::narrow_klass_base()); | 2419 if (Universe::narrow_klass_base() != 0) { |
2411 add(dst, shifted_src, R0); | 2420 load_const(R0, Universe::narrow_klass_base()); |
2421 add(dst, shifted_src, R0); | |
2422 } | |
2412 } | 2423 } |
2413 | 2424 |
2414 void MacroAssembler::load_klass(Register dst, Register src) { | 2425 void MacroAssembler::load_klass(Register dst, Register src) { |
2415 if (UseCompressedClassPointers) { | 2426 if (UseCompressedClassPointers) { |
2416 lwz(dst, oopDesc::klass_offset_in_bytes(), src); | 2427 lwz(dst, oopDesc::klass_offset_in_bytes(), src); |