comparison src/cpu/sparc/vm/assembler_sparc.hpp @ 342:37f87013dfd8

6711316: Open source the Garbage-First garbage collector Summary: First mercurial integration of the code for the Garbage-First garbage collector. Reviewed-by: apetrusenko, iveresov, jmasa, sgoldman, tonyp, ysr
author ysr
date Thu, 05 Jun 2008 15:57:56 -0700
parents b130b98db9cf
children 6aae2f9d0294
comparison
equal deleted inserted replaced
189:0b27f3512f9e 342:37f87013dfd8
1437 inline void rett( Register s1, int simm13a, relocInfo::relocType rt = relocInfo::none); 1437 inline void rett( Register s1, int simm13a, relocInfo::relocType rt = relocInfo::none);
1438 1438
1439 // pp 214 1439 // pp 214
1440 1440
1441 void save( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(save_op3) | rs1(s1) | rs2(s2) ); } 1441 void save( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(save_op3) | rs1(s1) | rs2(s2) ); }
1442 void save( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(save_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } 1442 void save( Register s1, int simm13a, Register d ) {
1443 // make sure frame is at least large enough for the register save area
1444 assert(-simm13a >= 16 * wordSize, "frame too small");
1445 emit_long( op(arith_op) | rd(d) | op3(save_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) );
1446 }
1443 1447
1444 void restore( Register s1 = G0, Register s2 = G0, Register d = G0 ) { emit_long( op(arith_op) | rd(d) | op3(restore_op3) | rs1(s1) | rs2(s2) ); } 1448 void restore( Register s1 = G0, Register s2 = G0, Register d = G0 ) { emit_long( op(arith_op) | rd(d) | op3(restore_op3) | rs1(s1) | rs2(s2) ); }
1445 void restore( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(restore_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } 1449 void restore( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(restore_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
1446 1450
1447 // pp 216 1451 // pp 216
1592 u_field(1, 13, 13) | 1596 u_field(1, 13, 13) |
1593 simm(simm13a, 13)); } 1597 simm(simm13a, 13)); }
1594 inline void wrasi( Register d) { v9_only(); emit_long( op(arith_op) | rs1(d) | op3(wrreg_op3) | u_field(3, 29, 25)); } 1598 inline void wrasi( Register d) { v9_only(); emit_long( op(arith_op) | rs1(d) | op3(wrreg_op3) | u_field(3, 29, 25)); }
1595 inline void wrfprs( Register d) { v9_only(); emit_long( op(arith_op) | rs1(d) | op3(wrreg_op3) | u_field(6, 29, 25)); } 1599 inline void wrfprs( Register d) { v9_only(); emit_long( op(arith_op) | rs1(d) | op3(wrreg_op3) | u_field(6, 29, 25)); }
1596 1600
1601 // For a given register condition, return the appropriate condition code
1602 // Condition (the one you would use to get the same effect after "tst" on
1603 // the target register.)
1604 Assembler::Condition reg_cond_to_cc_cond(RCondition in);
1605
1597 1606
1598 // Creation 1607 // Creation
1599 Assembler(CodeBuffer* code) : AbstractAssembler(code) { 1608 Assembler(CodeBuffer* code) : AbstractAssembler(code) {
1600 #ifdef CHECK_DELAY 1609 #ifdef CHECK_DELAY
1601 delay_state = no_delay; 1610 delay_state = no_delay;
1628 // gen asm code to save regs 1637 // gen asm code to save regs
1629 static void save_registers(MacroAssembler* a); 1638 static void save_registers(MacroAssembler* a);
1630 1639
1631 // restore global registers in case C code disturbed them 1640 // restore global registers in case C code disturbed them
1632 static void restore_registers(MacroAssembler* a, Register r); 1641 static void restore_registers(MacroAssembler* a, Register r);
1642
1643
1633 }; 1644 };
1634 1645
1635 1646
1636 // MacroAssembler extends Assembler by a few frequently used macros. 1647 // MacroAssembler extends Assembler by a few frequently used macros.
1637 // 1648 //
1720 // Compares a pointer register with zero and branches on (not)null. 1731 // Compares a pointer register with zero and branches on (not)null.
1721 // Does a test & branch on 32-bit systems and a register-branch on 64-bit. 1732 // Does a test & branch on 32-bit systems and a register-branch on 64-bit.
1722 void br_null ( Register s1, bool a, Predict p, Label& L ); 1733 void br_null ( Register s1, bool a, Predict p, Label& L );
1723 void br_notnull( Register s1, bool a, Predict p, Label& L ); 1734 void br_notnull( Register s1, bool a, Predict p, Label& L );
1724 1735
1736 // These versions will do the most efficient thing on v8 and v9. Perhaps
1737 // this is what the routine above was meant to do, but it didn't (and
1738 // didn't cover both target address kinds.)
1739 void br_on_reg_cond( RCondition c, bool a, Predict p, Register s1, address d, relocInfo::relocType rt = relocInfo::none );
1740 void br_on_reg_cond( RCondition c, bool a, Predict p, Register s1, Label& L);
1741
1725 inline void bp( Condition c, bool a, CC cc, Predict p, address d, relocInfo::relocType rt = relocInfo::none ); 1742 inline void bp( Condition c, bool a, CC cc, Predict p, address d, relocInfo::relocType rt = relocInfo::none );
1726 inline void bp( Condition c, bool a, CC cc, Predict p, Label& L ); 1743 inline void bp( Condition c, bool a, CC cc, Predict p, Label& L );
1727 1744
1728 // Branch that tests xcc in LP64 and icc in !LP64 1745 // Branch that tests xcc in LP64 and icc in !LP64
1729 inline void brx( Condition c, bool a, Predict p, address d, relocInfo::relocType rt = relocInfo::none ); 1746 inline void brx( Condition c, bool a, Predict p, address d, relocInfo::relocType rt = relocInfo::none );
2053 void read_ccr_v8_assert(Register ccr_save); 2070 void read_ccr_v8_assert(Register ccr_save);
2054 void write_ccr_v8_assert(Register ccr_save); 2071 void write_ccr_v8_assert(Register ccr_save);
2055 #endif // ASSERT 2072 #endif // ASSERT
2056 2073
2057 public: 2074 public:
2058 // Stores 2075
2059 void store_check(Register tmp, Register obj); // store check for obj - register is destroyed afterwards 2076 // Write to card table for - register is destroyed afterwards.
2060 void store_check(Register tmp, Register obj, Register offset); // store check for obj - register is destroyed afterwards 2077 void card_table_write(jbyte* byte_map_base, Register tmp, Register obj);
2078
2079 void card_write_barrier_post(Register store_addr, Register new_val, Register tmp);
2080
2081 #ifndef SERIALGC
2082 // Array store and offset
2083 void g1_write_barrier_pre(Register obj, Register index, int offset, Register tmp, bool preserve_o_regs);
2084
2085 void g1_write_barrier_post(Register store_addr, Register new_val, Register tmp);
2086
2087 // May do filtering, depending on the boolean arguments.
2088 void g1_card_table_write(jbyte* byte_map_base,
2089 Register tmp, Register obj, Register new_val,
2090 bool region_filter, bool null_filter);
2091 #endif // SERIALGC
2061 2092
2062 // pushes double TOS element of FPU stack on CPU stack; pops from FPU stack 2093 // pushes double TOS element of FPU stack on CPU stack; pops from FPU stack
2063 void push_fTOS(); 2094 void push_fTOS();
2064 2095
2065 // pops double TOS element from CPU stack and pushes on FPU stack 2096 // pops double TOS element from CPU stack and pushes on FPU stack