9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 package sun.jvm.hotspot.runtime;
26
27 import java.io.*;
28 import java.util.*;
29 import sun.jvm.hotspot.*;
30 import sun.jvm.hotspot.code.*;
31 import sun.jvm.hotspot.compiler.*;
32 import sun.jvm.hotspot.c1.*;
33 import sun.jvm.hotspot.debugger.*;
34 import sun.jvm.hotspot.interpreter.*;
35 import sun.jvm.hotspot.oops.*;
36 import sun.jvm.hotspot.runtime.sparc.SPARCFrame;
37 import sun.jvm.hotspot.types.*;
38 import sun.jvm.hotspot.utilities.*;
39
40 /** <P> A frame represents a physical stack frame (an activation).
41 Frames can be C or Java frames, and the Java frames can be
42 interpreted or compiled. In contrast, vframes represent
43 source-level activations, so that one physical frame can
44 correspond to multiple source level frames because of inlining.
45 </P>
46
47 <P> NOTE that this is not a VMObject and does not wrap an Address
48 -- this is an actual port of the VM's Frame code to Java. </P>
49
50 <P> NOTE also that this is incomplete -- just trying to get
51 reading of interpreted frames working for now, so all non-core and
52 setter methods are removed for now. (FIXME) </P> */
53
54 public abstract class Frame implements Cloneable {
55 /** A raw stack pointer. The accessor getSP() will return a real (usable)
56 stack pointer (e.g. from Thread::last_Java_sp) */
609 //
610 // Note: The expression stack can be empty if an exception
611 // occured during method resolution/execution. In all
612 // cases we empty the expression stack completely be-
613 // fore handling the exception (the exception handling
614 // code in the interpreter calls a blocking runtime
615 // routine which can cause this code to be executed).
616 // (was bug gri 7/27/98)
617 oopsInterpretedArgumentsDo(call.signature(), call.isInvokestatic(), oopVisitor);
618 }
619 }
620 }
621
622 private void oopsEntryDo (AddressVisitor oopVisitor, RegisterMap regMap) {}
623 private void oopsCodeBlobDo (AddressVisitor oopVisitor, RegisterMap regMap) {
624 CodeBlob cb = VM.getVM().getCodeCache().findBlob(getPC());
625 if (Assert.ASSERTS_ENABLED) {
626 Assert.that(cb != null, "sanity check");
627 }
628 if (cb.getOopMaps() != null) {
629 OopMapSet.oopsDo(this, cb, regMap, oopVisitor, VM.getVM().isDebugging());
630
631 // FIXME: add in traversal of argument oops (skipping this for
632 // now until we have the other stuff tested)
633
634 }
635
636 // FIXME: would add this in in non-debugging system
637
638 // If we see an activation belonging to a non_entrant nmethod, we mark it.
639 // if (cb->is_nmethod() && ((nmethod *)cb)->is_not_entrant()) {
640 // ((nmethod*)cb)->mark_as_seen_on_stack();
641 // }
642 }
643
644 // FIXME: implement the above routines, plus add
645 // oops_interpreted_arguments_do and oops_compiled_arguments_do
646 }
647
648 //
649 // Only used internally, to iterate through oop slots in interpreted
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 package sun.jvm.hotspot.runtime;
26
27 import java.io.*;
28 import java.util.*;
29
30 import sun.jvm.hotspot.code.*;
31 import sun.jvm.hotspot.compiler.*;
32 import sun.jvm.hotspot.debugger.*;
33 import sun.jvm.hotspot.interpreter.*;
34 import sun.jvm.hotspot.oops.*;
35 import sun.jvm.hotspot.types.*;
36 import sun.jvm.hotspot.utilities.*;
37
38 /** <P> A frame represents a physical stack frame (an activation).
39 Frames can be C or Java frames, and the Java frames can be
40 interpreted or compiled. In contrast, vframes represent
41 source-level activations, so that one physical frame can
42 correspond to multiple source level frames because of inlining.
43 </P>
44
45 <P> NOTE that this is not a VMObject and does not wrap an Address
46 -- this is an actual port of the VM's Frame code to Java. </P>
47
48 <P> NOTE also that this is incomplete -- just trying to get
49 reading of interpreted frames working for now, so all non-core and
50 setter methods are removed for now. (FIXME) </P> */
51
52 public abstract class Frame implements Cloneable {
53 /** A raw stack pointer. The accessor getSP() will return a real (usable)
54 stack pointer (e.g. from Thread::last_Java_sp) */
607 //
608 // Note: The expression stack can be empty if an exception
609 // occured during method resolution/execution. In all
610 // cases we empty the expression stack completely be-
611 // fore handling the exception (the exception handling
612 // code in the interpreter calls a blocking runtime
613 // routine which can cause this code to be executed).
614 // (was bug gri 7/27/98)
615 oopsInterpretedArgumentsDo(call.signature(), call.isInvokestatic(), oopVisitor);
616 }
617 }
618 }
619
620 private void oopsEntryDo (AddressVisitor oopVisitor, RegisterMap regMap) {}
621 private void oopsCodeBlobDo (AddressVisitor oopVisitor, RegisterMap regMap) {
622 CodeBlob cb = VM.getVM().getCodeCache().findBlob(getPC());
623 if (Assert.ASSERTS_ENABLED) {
624 Assert.that(cb != null, "sanity check");
625 }
626 if (cb.getOopMaps() != null) {
627 ImmutableOopMapSet.oopsDo(this, cb, regMap, oopVisitor, VM.getVM().isDebugging());
628
629 // FIXME: add in traversal of argument oops (skipping this for
630 // now until we have the other stuff tested)
631
632 }
633
634 // FIXME: would add this in in non-debugging system
635
636 // If we see an activation belonging to a non_entrant nmethod, we mark it.
637 // if (cb->is_nmethod() && ((nmethod *)cb)->is_not_entrant()) {
638 // ((nmethod*)cb)->mark_as_seen_on_stack();
639 // }
640 }
641
642 // FIXME: implement the above routines, plus add
643 // oops_interpreted_arguments_do and oops_compiled_arguments_do
644 }
645
646 //
647 // Only used internally, to iterate through oop slots in interpreted
|