comparison src/cpu/ppc/vm/macroAssembler_ppc.hpp @ 14445:67fa91961822

8029940: PPC64 (part 122): C2 compiler port Reviewed-by: kvn
author goetz
date Wed, 11 Dec 2013 00:06:11 +0100
parents eb178e97560c
children e5e8aa897002
comparison
equal deleted inserted replaced
14444:492e67693373 14445:67fa91961822
56 void load_sized_value( Register dst, RegisterOrConstant offs, Register base, size_t size_in_bytes, bool is_signed); 56 void load_sized_value( Register dst, RegisterOrConstant offs, Register base, size_t size_in_bytes, bool is_signed);
57 void store_sized_value(Register dst, RegisterOrConstant offs, Register base, size_t size_in_bytes); 57 void store_sized_value(Register dst, RegisterOrConstant offs, Register base, size_t size_in_bytes);
58 58
59 // Move register if destination register and target register are different 59 // Move register if destination register and target register are different
60 inline void mr_if_needed(Register rd, Register rs); 60 inline void mr_if_needed(Register rd, Register rs);
61 inline void fmr_if_needed(FloatRegister rd, FloatRegister rs);
62 // This is dedicated for emitting scheduled mach nodes. For better
63 // readability of the ad file I put it here.
64 // Endgroups are not needed if
65 // - the scheduler is off
66 // - the scheduler found that there is a natural group end, in that
67 // case it reduced the size of the instruction used in the test
68 // yielding 'needed'.
69 inline void endgroup_if_needed(bool needed);
70
71 // Memory barriers.
72 inline void membar(int bits);
73 inline void release();
74 inline void acquire();
75 inline void fence();
61 76
62 // nop padding 77 // nop padding
63 void align(int modulus); 78 void align(int modulus, int max = 252, int rem = 0);
64 79
65 // 80 //
66 // Constants, loading constants, TOC support 81 // Constants, loading constants, TOC support
67 // 82 //
68 83
293 inline address last_calls_return_pc(); 308 inline address last_calls_return_pc();
294 309
295 // Call a C function via a function descriptor and use full C 310 // Call a C function via a function descriptor and use full C
296 // calling conventions. Updates and returns _last_calls_return_pc. 311 // calling conventions. Updates and returns _last_calls_return_pc.
297 address call_c(Register function_descriptor); 312 address call_c(Register function_descriptor);
313 // For tail calls: only branch, don't link, so callee returns to caller of this function.
314 address call_c_and_return_to_caller(Register function_descriptor);
298 address call_c(const FunctionDescriptor* function_descriptor, relocInfo::relocType rt); 315 address call_c(const FunctionDescriptor* function_descriptor, relocInfo::relocType rt);
299 address call_c_using_toc(const FunctionDescriptor* function_descriptor, relocInfo::relocType rt, 316 address call_c_using_toc(const FunctionDescriptor* function_descriptor, relocInfo::relocType rt,
300 Register toc); 317 Register toc);
301 318
302 protected: 319 protected:
318 // to set up last_Java_frame in stubs; use noreg otherwise 335 // to set up last_Java_frame in stubs; use noreg otherwise
319 Register last_java_sp, 336 Register last_java_sp,
320 // the entry point 337 // the entry point
321 address entry_point, 338 address entry_point,
322 // flag which indicates if exception should be checked 339 // flag which indicates if exception should be checked
323 bool check_exception=true 340 bool check_exception = true
324 ); 341 );
325 342
326 // Support for VM calls. This is the base routine called by the 343 // Support for VM calls. This is the base routine called by the
327 // different versions of call_VM_leaf. The interpreter may customize 344 // different versions of call_VM_leaf. The interpreter may customize
328 // this version by overriding it for its purposes (e.g., to 345 // this version by overriding it for its purposes (e.g., to
528 545
529 // Implicit or explicit null check, jumps to static address exception_entry. 546 // Implicit or explicit null check, jumps to static address exception_entry.
530 inline void null_check_throw(Register a, int offset, Register temp_reg, address exception_entry); 547 inline void null_check_throw(Register a, int offset, Register temp_reg, address exception_entry);
531 548
532 // Check accessed object for null. Use SIGTRAP-based null checks on AIX. 549 // Check accessed object for null. Use SIGTRAP-based null checks on AIX.
533 inline void ld_with_trap_null_check(Register d, int si16, Register s1); 550 inline void load_with_trap_null_check(Register d, int si16, Register s1);
534 // Variant for heap OOPs including decompression of compressed OOPs.
535 inline void load_heap_oop_with_trap_null_check(Register d, RegisterOrConstant offs, Register s1);
536 551
537 // Load heap oop and decompress. Loaded oop may not be null. 552 // Load heap oop and decompress. Loaded oop may not be null.
538 inline void load_heap_oop_not_null(Register d, RegisterOrConstant offs, Register s1 = noreg); 553 inline void load_heap_oop_not_null(Register d, RegisterOrConstant offs, Register s1 = noreg);
539 554
540 // Null allowed. 555 // Null allowed.
581 } 596 }
582 static bool is_trap_range_check(int x) { 597 static bool is_trap_range_check(int x) {
583 return is_trap_range_check_l(x) || is_trap_range_check_le(x) || 598 return is_trap_range_check_l(x) || is_trap_range_check_le(x) ||
584 is_trap_range_check_g(x) || is_trap_range_check_ge(x); 599 is_trap_range_check_g(x) || is_trap_range_check_ge(x);
585 } 600 }
601
602 void clear_memory_doubleword(Register base_ptr, Register cnt_dwords, Register tmp = R0);
586 603
587 // Needle of length 1. 604 // Needle of length 1.
588 void string_indexof_1(Register result, Register haystack, Register haycnt, 605 void string_indexof_1(Register result, Register haystack, Register haycnt,
589 Register needle, jchar needleChar, 606 Register needle, jchar needleChar,
590 Register tmp1, Register tmp2); 607 Register tmp1, Register tmp2);
628 // Emit code to verify that reg contains a valid oop if +VerifyOops is set. 645 // Emit code to verify that reg contains a valid oop if +VerifyOops is set.
629 void verify_oop(Register reg, const char* s = "broken oop"); 646 void verify_oop(Register reg, const char* s = "broken oop");
630 647
631 // TODO: verify method and klass metadata (compare against vptr?) 648 // TODO: verify method and klass metadata (compare against vptr?)
632 void _verify_method_ptr(Register reg, const char * msg, const char * file, int line) {} 649 void _verify_method_ptr(Register reg, const char * msg, const char * file, int line) {}
633 void _verify_klass_ptr(Register reg, const char * msg, const char * file, int line){} 650 void _verify_klass_ptr(Register reg, const char * msg, const char * file, int line) {}
634 651
635 #define verify_method_ptr(reg) _verify_method_ptr(reg, "broken method " #reg, __FILE__, __LINE__) 652 #define verify_method_ptr(reg) _verify_method_ptr(reg, "broken method " #reg, __FILE__, __LINE__)
636 #define verify_klass_ptr(reg) _verify_klass_ptr(reg, "broken klass " #reg, __FILE__, __LINE__) 653 #define verify_klass_ptr(reg) _verify_klass_ptr(reg, "broken klass " #reg, __FILE__, __LINE__)
637 654
638 private: 655 private: