src/cpu/sparc/vm/templateInterpreter_sparc.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 7009361 Sdiff src/cpu/sparc/vm

src/cpu/sparc/vm/templateInterpreter_sparc.cpp

Print this page




1600     assert(interpreter_frame->is_interpreted_frame(), "Must be interpreted frame");
1601 
1602     intptr_t* fp = interpreter_frame->fp();
1603 
1604     JavaThread* thread = JavaThread::current();
1605     RegisterMap map(thread, false);
1606     // More verification that skeleton frame is properly walkable
1607     assert(fp == caller->sp(), "fp must match");
1608 
1609     intptr_t* montop     = fp - rounded_vm_local_words;
1610 
1611     // preallocate monitors (cf. __ add_monitor_to_stack)
1612     intptr_t* monitors = montop - monitor_size;
1613 
1614     // preallocate stack space
1615     intptr_t*  esp = monitors - 1 -
1616                      (tempcount * Interpreter::stackElementWords) -
1617                      popframe_extra_args;
1618 
1619     int local_words = method->max_locals() * Interpreter::stackElementWords;
1620     int parm_words  = method->size_of_parameters() * Interpreter::stackElementWords;
1621     NEEDS_CLEANUP;
1622     intptr_t* locals;
1623     if (caller->is_interpreted_frame()) {
1624       // Can force the locals area to end up properly overlapping the top of the expression stack.
1625       intptr_t* Lesp_ptr = caller->interpreter_frame_tos_address() - 1;
1626       // Note that this computation means we replace size_of_parameters() values from the caller
1627       // interpreter frame's expression stack with our argument locals
1628       locals = Lesp_ptr + parm_words;
1629       int delta = local_words - parm_words;
1630       int computed_sp_adjustment = (delta > 0) ? round_to(delta, WordsPerLong) : 0;
1631       *interpreter_frame->register_addr(I5_savedSP)    = (intptr_t) (fp + computed_sp_adjustment) - STACK_BIAS;
1632     } else {
1633       assert(caller->is_compiled_frame() || caller->is_entry_frame(), "only possible cases");
1634       // Don't have Lesp available; lay out locals block in the caller
1635       // adjacent to the register window save area.
1636       //
1637       // Compiled frames do not allocate a varargs area which is why this if
1638       // statement is needed.
1639       //
1640       if (caller->is_compiled_frame()) {


1641         locals = fp + frame::register_save_words + local_words - 1;
1642       } else {
1643         locals = fp + frame::memory_parameter_word_sp_offset + local_words - 1;
1644       }
1645       if (!caller->is_entry_frame()) {
1646         // Caller wants his own SP back
1647         int caller_frame_size = caller->cb()->frame_size();
1648         *interpreter_frame->register_addr(I5_savedSP) = (intptr_t)(caller->fp() - caller_frame_size) - STACK_BIAS;







1649       }
1650     }
1651     if (TraceDeoptimization) {
1652       if (caller->is_entry_frame()) {
1653         // make sure I5_savedSP and the entry frames notion of saved SP
1654         // agree.  This assertion duplicate a check in entry frame code
1655         // but catches the failure earlier.
1656         assert(*caller->register_addr(Lscratch) == *interpreter_frame->register_addr(I5_savedSP),
1657                "would change callers SP");
1658       }
1659       if (caller->is_entry_frame()) {
1660         tty->print("entry ");
1661       }
1662       if (caller->is_compiled_frame()) {
1663         tty->print("compiled ");
1664         if (caller->is_deoptimized_frame()) {
1665           tty->print("(deopt) ");
1666         }
1667       }
1668       if (caller->is_interpreted_frame()) {




1600     assert(interpreter_frame->is_interpreted_frame(), "Must be interpreted frame");
1601 
1602     intptr_t* fp = interpreter_frame->fp();
1603 
1604     JavaThread* thread = JavaThread::current();
1605     RegisterMap map(thread, false);
1606     // More verification that skeleton frame is properly walkable
1607     assert(fp == caller->sp(), "fp must match");
1608 
1609     intptr_t* montop     = fp - rounded_vm_local_words;
1610 
1611     // preallocate monitors (cf. __ add_monitor_to_stack)
1612     intptr_t* monitors = montop - monitor_size;
1613 
1614     // preallocate stack space
1615     intptr_t*  esp = monitors - 1 -
1616                      (tempcount * Interpreter::stackElementWords) -
1617                      popframe_extra_args;
1618 
1619     int local_words = method->max_locals() * Interpreter::stackElementWords;


1620     intptr_t* locals;

















1621     if (caller->is_compiled_frame()) {
1622       // Compiled frames do not allocate a varargs area so place them
1623       // next to the register save area.
1624       locals = fp + frame::register_save_words + local_words - 1;




1625       // Caller wants his own SP back
1626       int caller_frame_size = caller->cb()->frame_size();
1627       *interpreter_frame->register_addr(I5_savedSP) = (intptr_t)(caller->fp() - caller_frame_size) - STACK_BIAS;
1628     } else {
1629       assert(caller->is_interpreted_frame() || caller->is_entry_frame(), "only possible cases");
1630       // The entry and interpreter frames are laid out like normal C
1631       // frames so place the locals adjacent to the varargs area.
1632       locals = fp + frame::memory_parameter_word_sp_offset + local_words - 1;
1633       if (caller->is_interpreted_frame()) {
1634         *interpreter_frame->register_addr(I5_savedSP)    = (intptr_t) (fp + rounded_cls) - STACK_BIAS;
1635       }
1636     }
1637     if (TraceDeoptimization) {
1638       if (caller->is_entry_frame()) {
1639         // make sure I5_savedSP and the entry frames notion of saved SP
1640         // agree.  This assertion duplicate a check in entry frame code
1641         // but catches the failure earlier.
1642         assert(*caller->register_addr(Lscratch) == *interpreter_frame->register_addr(I5_savedSP),
1643                "would change callers SP");
1644       }
1645       if (caller->is_entry_frame()) {
1646         tty->print("entry ");
1647       }
1648       if (caller->is_compiled_frame()) {
1649         tty->print("compiled ");
1650         if (caller->is_deoptimized_frame()) {
1651           tty->print("(deopt) ");
1652         }
1653       }
1654       if (caller->is_interpreted_frame()) {


src/cpu/sparc/vm/templateInterpreter_sparc.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File