Mercurial > hg > graal-compiler
diff src/cpu/x86/vm/templateTable_x86_32.cpp @ 1513:df736661d0c8
Merge
author | jrose |
---|---|
date | Tue, 11 May 2010 15:19:19 -0700 |
parents | 2338d41fbd81 |
children | c18cbe5936b8 ab102d5d923e |
line wrap: on
line diff
--- a/src/cpu/x86/vm/templateTable_x86_32.cpp Mon May 10 14:58:38 2010 -0700 +++ b/src/cpu/x86/vm/templateTable_x86_32.cpp Tue May 11 15:19:19 2010 -0700 @@ -50,7 +50,7 @@ static inline Address aaddress(int n) { return iaddress(n); } static inline Address iaddress(Register r) { - return Address(rdi, r, Interpreter::stackElementScale(), Interpreter::value_offset_in_bytes()); + return Address(rdi, r, Interpreter::stackElementScale()); } static inline Address laddress(Register r) { return Address(rdi, r, Interpreter::stackElementScale(), Interpreter::local_offset_in_bytes(1)); @@ -59,12 +59,9 @@ return Address(rdi, r, Interpreter::stackElementScale(), Interpreter::local_offset_in_bytes(0)); } -static inline Address faddress(Register r) { return iaddress(r); }; -static inline Address daddress(Register r) { - assert(!TaggedStackInterpreter, "This doesn't work"); - return laddress(r); -}; -static inline Address aaddress(Register r) { return iaddress(r); }; +static inline Address faddress(Register r) { return iaddress(r); } +static inline Address daddress(Register r) { return laddress(r); } +static inline Address aaddress(Register r) { return iaddress(r); } // expression stack // (Note: Must not use symmetric equivalents at_rsp_m1/2 since they store @@ -448,7 +445,6 @@ // Get the local value into tos locals_index(rbx); __ movl(rax, iaddress(rbx)); - debug_only(__ verify_local_tag(frame::TagValue, rbx)); } @@ -456,18 +452,15 @@ transition(vtos, itos); locals_index(rbx); __ movl(rax, iaddress(rbx)); - debug_only(__ verify_local_tag(frame::TagValue, rbx)); __ push(itos); locals_index(rbx, 3); __ movl(rax, iaddress(rbx)); - debug_only(__ verify_local_tag(frame::TagValue, rbx)); } void TemplateTable::fast_iload() { transition(vtos, itos); locals_index(rbx); __ movl(rax, iaddress(rbx)); - debug_only(__ verify_local_tag(frame::TagValue, rbx)); } @@ -476,7 +469,6 @@ locals_index(rbx); __ movptr(rax, laddress(rbx)); NOT_LP64(__ movl(rdx, haddress(rbx))); - debug_only(__ verify_local_tag(frame::TagCategory2, rbx)); } @@ -484,26 +476,13 @@ transition(vtos, ftos); locals_index(rbx); __ fld_s(faddress(rbx)); - debug_only(__ verify_local_tag(frame::TagValue, rbx)); } void TemplateTable::dload() { transition(vtos, dtos); locals_index(rbx); - if (TaggedStackInterpreter) { - // Get double out of locals array, onto temp stack and load with - // float instruction into ST0 - __ movl(rax, laddress(rbx)); - __ movl(rdx, haddress(rbx)); - __ push(rdx); // push hi first - __ push(rax); - __ fld_d(Address(rsp, 0)); - __ addptr(rsp, 2*wordSize); - debug_only(__ verify_local_tag(frame::TagCategory2, rbx)); - } else { - __ fld_d(daddress(rbx)); - } + __ fld_d(daddress(rbx)); } @@ -511,7 +490,6 @@ transition(vtos, atos); locals_index(rbx); __ movptr(rax, aaddress(rbx)); - debug_only(__ verify_local_tag(frame::TagReference, rbx)); } @@ -527,7 +505,6 @@ transition(vtos, itos); locals_index_wide(rbx); __ movl(rax, iaddress(rbx)); - debug_only(__ verify_local_tag(frame::TagValue, rbx)); } @@ -536,7 +513,6 @@ locals_index_wide(rbx); __ movptr(rax, laddress(rbx)); NOT_LP64(__ movl(rdx, haddress(rbx))); - debug_only(__ verify_local_tag(frame::TagCategory2, rbx)); } @@ -544,26 +520,13 @@ transition(vtos, ftos); locals_index_wide(rbx); __ fld_s(faddress(rbx)); - debug_only(__ verify_local_tag(frame::TagValue, rbx)); } void TemplateTable::wide_dload() { transition(vtos, dtos); locals_index_wide(rbx); - if (TaggedStackInterpreter) { - // Get double out of locals array, onto temp stack and load with - // float instruction into ST0 - __ movl(rax, laddress(rbx)); - __ movl(rdx, haddress(rbx)); - __ push(rdx); // push hi first - __ push(rax); - __ fld_d(Address(rsp, 0)); - __ addl(rsp, 2*wordSize); - debug_only(__ verify_local_tag(frame::TagCategory2, rbx)); - } else { - __ fld_d(daddress(rbx)); - } + __ fld_d(daddress(rbx)); } @@ -571,7 +534,6 @@ transition(vtos, atos); locals_index_wide(rbx); __ movptr(rax, aaddress(rbx)); - debug_only(__ verify_local_tag(frame::TagReference, rbx)); } void TemplateTable::index_check(Register array, Register index) { @@ -672,7 +634,6 @@ // load index out of locals locals_index(rbx); __ movl(rax, iaddress(rbx)); - debug_only(__ verify_local_tag(frame::TagValue, rbx)); // rdx: array index_check(rdx, rax); @@ -695,7 +656,6 @@ void TemplateTable::iload(int n) { transition(vtos, itos); __ movl(rax, iaddress(n)); - debug_only(__ verify_local_tag(frame::TagValue, n)); } @@ -703,39 +663,24 @@ transition(vtos, ltos); __ movptr(rax, laddress(n)); NOT_LP64(__ movptr(rdx, haddress(n))); - debug_only(__ verify_local_tag(frame::TagCategory2, n)); } void TemplateTable::fload(int n) { transition(vtos, ftos); __ fld_s(faddress(n)); - debug_only(__ verify_local_tag(frame::TagValue, n)); } void TemplateTable::dload(int n) { transition(vtos, dtos); - if (TaggedStackInterpreter) { - // Get double out of locals array, onto temp stack and load with - // float instruction into ST0 - __ movl(rax, laddress(n)); - __ movl(rdx, haddress(n)); - __ push(rdx); // push hi first - __ push(rax); - __ fld_d(Address(rsp, 0)); - __ addptr(rsp, 2*wordSize); // reset rsp - debug_only(__ verify_local_tag(frame::TagCategory2, n)); - } else { - __ fld_d(daddress(n)); - } + __ fld_d(daddress(n)); } void TemplateTable::aload(int n) { transition(vtos, atos); __ movptr(rax, aaddress(n)); - debug_only(__ verify_local_tag(frame::TagReference, n)); } @@ -809,7 +754,6 @@ transition(itos, vtos); locals_index(rbx); __ movl(iaddress(rbx), rax); - __ tag_local(frame::TagValue, rbx); } @@ -818,7 +762,6 @@ locals_index(rbx); __ movptr(laddress(rbx), rax); NOT_LP64(__ movptr(haddress(rbx), rdx)); - __ tag_local(frame::TagCategory2, rbx); } @@ -826,34 +769,21 @@ transition(ftos, vtos); locals_index(rbx); __ fstp_s(faddress(rbx)); - __ tag_local(frame::TagValue, rbx); } void TemplateTable::dstore() { transition(dtos, vtos); locals_index(rbx); - if (TaggedStackInterpreter) { - // Store double on stack and reload into locals nonadjacently - __ subptr(rsp, 2 * wordSize); - __ fstp_d(Address(rsp, 0)); - __ pop(rax); - __ pop(rdx); - __ movptr(laddress(rbx), rax); - __ movptr(haddress(rbx), rdx); - __ tag_local(frame::TagCategory2, rbx); - } else { - __ fstp_d(daddress(rbx)); - } + __ fstp_d(daddress(rbx)); } void TemplateTable::astore() { transition(vtos, vtos); - __ pop_ptr(rax, rdx); // will need to pop tag too + __ pop_ptr(rax); locals_index(rbx); __ movptr(aaddress(rbx), rax); - __ tag_local(rdx, rbx); // need to store same tag in local may be returnAddr } @@ -862,7 +792,6 @@ __ pop_i(rax); locals_index_wide(rbx); __ movl(iaddress(rbx), rax); - __ tag_local(frame::TagValue, rbx); } @@ -872,7 +801,6 @@ locals_index_wide(rbx); __ movptr(laddress(rbx), rax); NOT_LP64(__ movl(haddress(rbx), rdx)); - __ tag_local(frame::TagCategory2, rbx); } @@ -888,10 +816,9 @@ void TemplateTable::wide_astore() { transition(vtos, vtos); - __ pop_ptr(rax, rdx); + __ pop_ptr(rax); locals_index_wide(rbx); __ movptr(aaddress(rbx), rax); - __ tag_local(rdx, rbx); } @@ -990,7 +917,7 @@ // Pop stack arguments __ bind(done); - __ addptr(rsp, 3 * Interpreter::stackElementSize()); + __ addptr(rsp, 3 * Interpreter::stackElementSize); } @@ -1024,7 +951,6 @@ void TemplateTable::istore(int n) { transition(itos, vtos); __ movl(iaddress(n), rax); - __ tag_local(frame::TagValue, n); } @@ -1032,58 +958,45 @@ transition(ltos, vtos); __ movptr(laddress(n), rax); NOT_LP64(__ movptr(haddress(n), rdx)); - __ tag_local(frame::TagCategory2, n); } void TemplateTable::fstore(int n) { transition(ftos, vtos); __ fstp_s(faddress(n)); - __ tag_local(frame::TagValue, n); } void TemplateTable::dstore(int n) { transition(dtos, vtos); - if (TaggedStackInterpreter) { - __ subptr(rsp, 2 * wordSize); - __ fstp_d(Address(rsp, 0)); - __ pop(rax); - __ pop(rdx); - __ movl(laddress(n), rax); - __ movl(haddress(n), rdx); - __ tag_local(frame::TagCategory2, n); - } else { - __ fstp_d(daddress(n)); - } + __ fstp_d(daddress(n)); } void TemplateTable::astore(int n) { transition(vtos, vtos); - __ pop_ptr(rax, rdx); + __ pop_ptr(rax); __ movptr(aaddress(n), rax); - __ tag_local(rdx, n); } void TemplateTable::pop() { transition(vtos, vtos); - __ addptr(rsp, Interpreter::stackElementSize()); + __ addptr(rsp, Interpreter::stackElementSize); } void TemplateTable::pop2() { transition(vtos, vtos); - __ addptr(rsp, 2*Interpreter::stackElementSize()); + __ addptr(rsp, 2*Interpreter::stackElementSize); } void TemplateTable::dup() { transition(vtos, vtos); // stack: ..., a - __ load_ptr_and_tag(0, rax, rdx); - __ push_ptr(rax, rdx); + __ load_ptr(0, rax); + __ push_ptr(rax); // stack: ..., a, a } @@ -1091,11 +1004,11 @@ void TemplateTable::dup_x1() { transition(vtos, vtos); // stack: ..., a, b - __ load_ptr_and_tag(0, rax, rdx); // load b - __ load_ptr_and_tag(1, rcx, rbx); // load a - __ store_ptr_and_tag(1, rax, rdx); // store b - __ store_ptr_and_tag(0, rcx, rbx); // store a - __ push_ptr(rax, rdx); // push b + __ load_ptr( 0, rax); // load b + __ load_ptr( 1, rcx); // load a + __ store_ptr(1, rax); // store b + __ store_ptr(0, rcx); // store a + __ push_ptr(rax); // push b // stack: ..., b, a, b } @@ -1103,15 +1016,15 @@ void TemplateTable::dup_x2() { transition(vtos, vtos); // stack: ..., a, b, c - __ load_ptr_and_tag(0, rax, rdx); // load c - __ load_ptr_and_tag(2, rcx, rbx); // load a - __ store_ptr_and_tag(2, rax, rdx); // store c in a - __ push_ptr(rax, rdx); // push c + __ load_ptr( 0, rax); // load c + __ load_ptr( 2, rcx); // load a + __ store_ptr(2, rax); // store c in a + __ push_ptr(rax); // push c // stack: ..., c, b, c, c - __ load_ptr_and_tag(2, rax, rdx); // load b - __ store_ptr_and_tag(2, rcx, rbx); // store a in b + __ load_ptr( 2, rax); // load b + __ store_ptr(2, rcx); // store a in b // stack: ..., c, a, c, c - __ store_ptr_and_tag(1, rax, rdx); // store b in c + __ store_ptr(1, rax); // store b in c // stack: ..., c, a, b, c } @@ -1119,10 +1032,10 @@ void TemplateTable::dup2() { transition(vtos, vtos); // stack: ..., a, b - __ load_ptr_and_tag(1, rax, rdx); // load a - __ push_ptr(rax, rdx); // push a - __ load_ptr_and_tag(1, rax, rdx); // load b - __ push_ptr(rax, rdx); // push b + __ load_ptr(1, rax); // load a + __ push_ptr(rax); // push a + __ load_ptr(1, rax); // load b + __ push_ptr(rax); // push b // stack: ..., a, b, a, b } @@ -1130,17 +1043,17 @@ void TemplateTable::dup2_x1() { transition(vtos, vtos); // stack: ..., a, b, c - __ load_ptr_and_tag(0, rcx, rbx); // load c - __ load_ptr_and_tag(1, rax, rdx); // load b - __ push_ptr(rax, rdx); // push b - __ push_ptr(rcx, rbx); // push c + __ load_ptr( 0, rcx); // load c + __ load_ptr( 1, rax); // load b + __ push_ptr(rax); // push b + __ push_ptr(rcx); // push c // stack: ..., a, b, c, b, c - __ store_ptr_and_tag(3, rcx, rbx); // store c in b + __ store_ptr(3, rcx); // store c in b // stack: ..., a, c, c, b, c - __ load_ptr_and_tag(4, rcx, rbx); // load a - __ store_ptr_and_tag(2, rcx, rbx); // store a in 2nd c + __ load_ptr( 4, rcx); // load a + __ store_ptr(2, rcx); // store a in 2nd c // stack: ..., a, c, a, b, c - __ store_ptr_and_tag(4, rax, rdx); // store b in a + __ store_ptr(4, rax); // store b in a // stack: ..., b, c, a, b, c // stack: ..., b, c, a, b, c } @@ -1149,19 +1062,19 @@ void TemplateTable::dup2_x2() { transition(vtos, vtos); // stack: ..., a, b, c, d - __ load_ptr_and_tag(0, rcx, rbx); // load d - __ load_ptr_and_tag(1, rax, rdx); // load c - __ push_ptr(rax, rdx); // push c - __ push_ptr(rcx, rbx); // push d + __ load_ptr( 0, rcx); // load d + __ load_ptr( 1, rax); // load c + __ push_ptr(rax); // push c + __ push_ptr(rcx); // push d // stack: ..., a, b, c, d, c, d - __ load_ptr_and_tag(4, rax, rdx); // load b - __ store_ptr_and_tag(2, rax, rdx); // store b in d - __ store_ptr_and_tag(4, rcx, rbx); // store d in b + __ load_ptr( 4, rax); // load b + __ store_ptr(2, rax); // store b in d + __ store_ptr(4, rcx); // store d in b // stack: ..., a, d, c, b, c, d - __ load_ptr_and_tag(5, rcx, rbx); // load a - __ load_ptr_and_tag(3, rax, rdx); // load c - __ store_ptr_and_tag(3, rcx, rbx); // store a in c - __ store_ptr_and_tag(5, rax, rdx); // store c in a + __ load_ptr( 5, rcx); // load a + __ load_ptr( 3, rax); // load c + __ store_ptr(3, rcx); // store a in c + __ store_ptr(5, rax); // store c in a // stack: ..., c, d, a, b, c, d // stack: ..., c, d, a, b, c, d } @@ -1170,10 +1083,10 @@ void TemplateTable::swap() { transition(vtos, vtos); // stack: ..., a, b - __ load_ptr_and_tag(1, rcx, rbx); // load a - __ load_ptr_and_tag(0, rax, rdx); // load b - __ store_ptr_and_tag(0, rcx, rbx); // store a in b - __ store_ptr_and_tag(1, rax, rdx); // store b in a + __ load_ptr( 1, rcx); // load a + __ load_ptr( 0, rax); // load b + __ store_ptr(0, rcx); // store a in b + __ store_ptr(1, rax); // store b in a // stack: ..., b, a } @@ -1181,12 +1094,12 @@ void TemplateTable::iop2(Operation op) { transition(itos, itos); switch (op) { - case add : __ pop_i(rdx); __ addl (rax, rdx); break; + case add : __ pop_i(rdx); __ addl (rax, rdx); break; case sub : __ mov(rdx, rax); __ pop_i(rax); __ subl (rax, rdx); break; - case mul : __ pop_i(rdx); __ imull(rax, rdx); break; - case _and : __ pop_i(rdx); __ andl (rax, rdx); break; - case _or : __ pop_i(rdx); __ orl (rax, rdx); break; - case _xor : __ pop_i(rdx); __ xorl (rax, rdx); break; + case mul : __ pop_i(rdx); __ imull(rax, rdx); break; + case _and : __ pop_i(rdx); __ andl (rax, rdx); break; + case _or : __ pop_i(rdx); __ orl (rax, rdx); break; + case _xor : __ pop_i(rdx); __ xorl (rax, rdx); break; case shl : __ mov(rcx, rax); __ pop_i(rax); __ shll (rax); break; // implicit masking of lower 5 bits by Intel shift instr. case shr : __ mov(rcx, rax); __ pop_i(rax); __ sarl (rax); break; // implicit masking of lower 5 bits by Intel shift instr. case ushr : __ mov(rcx, rax); __ pop_i(rax); __ shrl (rax); break; // implicit masking of lower 5 bits by Intel shift instr. @@ -1199,13 +1112,13 @@ transition(ltos, ltos); __ pop_l(rbx, rcx); switch (op) { - case add : __ addl(rax, rbx); __ adcl(rdx, rcx); break; - case sub : __ subl(rbx, rax); __ sbbl(rcx, rdx); - __ mov(rax, rbx); __ mov(rdx, rcx); break; - case _and: __ andl(rax, rbx); __ andl(rdx, rcx); break; - case _or : __ orl (rax, rbx); __ orl (rdx, rcx); break; - case _xor: __ xorl(rax, rbx); __ xorl(rdx, rcx); break; - default : ShouldNotReachHere(); + case add : __ addl(rax, rbx); __ adcl(rdx, rcx); break; + case sub : __ subl(rbx, rax); __ sbbl(rcx, rdx); + __ mov (rax, rbx); __ mov (rdx, rcx); break; + case _and : __ andl(rax, rbx); __ andl(rdx, rcx); break; + case _or : __ orl (rax, rbx); __ orl (rdx, rcx); break; + case _xor : __ xorl(rax, rbx); __ xorl(rdx, rcx); break; + default : ShouldNotReachHere(); } } @@ -1299,7 +1212,6 @@ void TemplateTable::fop2(Operation op) { transition(ftos, ftos); - __ pop_ftos_to_rsp(); // pop ftos into rsp switch (op) { case add: __ fadd_s (at_rsp()); break; case sub: __ fsubr_s(at_rsp()); break; @@ -1315,7 +1227,6 @@ void TemplateTable::dop2(Operation op) { transition(dtos, dtos); - __ pop_dtos_to_rsp(); // pop dtos into rsp switch (op) { case add: __ fadd_d (at_rsp()); break; @@ -1557,10 +1468,8 @@ void TemplateTable::float_cmp(bool is_float, int unordered_result) { if (is_float) { - __ pop_ftos_to_rsp(); __ fld_s(at_rsp()); } else { - __ pop_dtos_to_rsp(); __ fld_d(at_rsp()); __ pop(rdx); } @@ -2854,7 +2763,6 @@ transition(vtos, state); // get receiver __ movptr(rax, aaddress(0)); - debug_only(__ verify_local_tag(frame::TagReference, 0)); // access constant pool cache __ get_cache_and_index_at_bcp(rcx, rdx, 2); __ movptr(rbx, Address(rcx,