1 /*
2 * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
20 * CA 95054 USA or visit www.sun.com if you need additional information or
21 * have any questions.
22 *
517 public void setAddressVisitor(AddressVisitor addressVisitor) {
518 this.addressVisitor = addressVisitor;
519 }
520
521 public void visitOopLocation(Address oopAddr) {
522 addressVisitor.visitAddress(oopAddr);
523 }
524
525 public void visitDerivedOopLocation(Address baseOopAddr, Address derivedOopAddr) {
526 if (VM.getVM().isClientCompiler()) {
527 Assert.that(false, "should not reach here");
528 } else if (VM.getVM().isServerCompiler() &&
529 VM.getVM().useDerivedPointerTable()) {
530 Assert.that(false, "FIXME: add derived pointer table");
531 }
532 }
533
534 public void visitValueLocation(Address valueAddr) {
535 }
536
537 public void visitDeadLocation(Address deadAddr) {
538 }
539 }
540
541 private void oopsInterpretedDo(AddressVisitor oopVisitor, RegisterMap map) {
542 if (Assert.ASSERTS_ENABLED) {
543 Assert.that(map != null, "map must be set");
544 }
545 Method m = getInterpreterFrameMethod();
546 int bci = getInterpreterFrameBCI();
547
548 // FIXME: Seeing this sometimes
549 if (VM.getVM().isDebugging()) {
550 if (bci < 0 || bci >= m.getCodeSize()) return;
551 }
552
553 if (Assert.ASSERTS_ENABLED) {
554 // Assert.that(VM.getVM().getUniverse().heap().isIn(m), "method must be valid oop");
555 Assert.that((m.isNative() && (bci == 0)) || ((bci >= 0) && (bci < m.getCodeSize())), "invalid bci value");
556 }
557
|
1 /*
2 * Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
20 * CA 95054 USA or visit www.sun.com if you need additional information or
21 * have any questions.
22 *
517 public void setAddressVisitor(AddressVisitor addressVisitor) {
518 this.addressVisitor = addressVisitor;
519 }
520
521 public void visitOopLocation(Address oopAddr) {
522 addressVisitor.visitAddress(oopAddr);
523 }
524
525 public void visitDerivedOopLocation(Address baseOopAddr, Address derivedOopAddr) {
526 if (VM.getVM().isClientCompiler()) {
527 Assert.that(false, "should not reach here");
528 } else if (VM.getVM().isServerCompiler() &&
529 VM.getVM().useDerivedPointerTable()) {
530 Assert.that(false, "FIXME: add derived pointer table");
531 }
532 }
533
534 public void visitValueLocation(Address valueAddr) {
535 }
536
537 public void visitNarrowOopLocation(Address compOopAddr) {
538 addressVisitor.visitCompOopAddress(compOopAddr);
539 }
540 }
541
542 private void oopsInterpretedDo(AddressVisitor oopVisitor, RegisterMap map) {
543 if (Assert.ASSERTS_ENABLED) {
544 Assert.that(map != null, "map must be set");
545 }
546 Method m = getInterpreterFrameMethod();
547 int bci = getInterpreterFrameBCI();
548
549 // FIXME: Seeing this sometimes
550 if (VM.getVM().isDebugging()) {
551 if (bci < 0 || bci >= m.getCodeSize()) return;
552 }
553
554 if (Assert.ASSERTS_ENABLED) {
555 // Assert.that(VM.getVM().getUniverse().heap().isIn(m), "method must be valid oop");
556 Assert.that((m.isNative() && (bci == 0)) || ((bci >= 0) && (bci < m.getCodeSize())), "invalid bci value");
557 }
558
|