615 const intptr_t interpreter_frame_initial_sp_offset = interpreter_frame_vm_local_words;
616 if (fp() + interpreter_frame_initial_sp_offset < sp()) {
617 return false;
618 }
619 // These are hacks to keep us out of trouble.
620 // The problem with these is that they mask other problems
621 if (fp() <= sp()) { // this attempts to deal with unsigned comparison above
622 return false;
623 }
624 // do some validation of frame elements
625
626 // first the method
627
628 Method* m = *interpreter_frame_method_addr();
629
630 // validate the method we'd find in this potential sender
631 if (!m->is_valid_method()) return false;
632
633 // stack frames shouldn't be much larger than max_stack elements
634
635 if (fp() - sp() > 1024 + m->max_stack()*Interpreter::stackElementSize) {
636 return false;
637 }
638
639 // validate bci/bcp
640
641 address bcp = interpreter_frame_bcp();
642 if (m->validate_bci_from_bcp(bcp) < 0) {
643 return false;
644 }
645
646 // validate ConstantPoolCache*
647 ConstantPoolCache* cp = *interpreter_frame_cache_addr();
648 if (cp == NULL || !cp->is_metaspace_object()) return false;
649
650 // validate locals
651
652 address locals = (address) *interpreter_frame_locals_addr();
653
654 if (locals > thread->stack_base() || locals < (address) fp()) return false;
655
|
615 const intptr_t interpreter_frame_initial_sp_offset = interpreter_frame_vm_local_words;
616 if (fp() + interpreter_frame_initial_sp_offset < sp()) {
617 return false;
618 }
619 // These are hacks to keep us out of trouble.
620 // The problem with these is that they mask other problems
621 if (fp() <= sp()) { // this attempts to deal with unsigned comparison above
622 return false;
623 }
624 // do some validation of frame elements
625
626 // first the method
627
628 Method* m = *interpreter_frame_method_addr();
629
630 // validate the method we'd find in this potential sender
631 if (!m->is_valid_method()) return false;
632
633 // stack frames shouldn't be much larger than max_stack elements
634
635 if (fp() - unextended_sp() > 1024 + m->max_stack()*Interpreter::stackElementSize) {
636 return false;
637 }
638
639 // validate bci/bcp
640
641 address bcp = interpreter_frame_bcp();
642 if (m->validate_bci_from_bcp(bcp) < 0) {
643 return false;
644 }
645
646 // validate ConstantPoolCache*
647 ConstantPoolCache* cp = *interpreter_frame_cache_addr();
648 if (cp == NULL || !cp->is_metaspace_object()) return false;
649
650 // validate locals
651
652 address locals = (address) *interpreter_frame_locals_addr();
653
654 if (locals > thread->stack_base() || locals < (address) fp()) return false;
655
|