DummyOopHandle.java revision 9883:903a2e023ffb
1139778Simp/*
2190507Slulf * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
3130389Sle * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4130389Sle *
5130389Sle * This code is free software; you can redistribute it and/or modify it
6130389Sle * under the terms of the GNU General Public License version 2 only, as
7130389Sle * published by the Free Software Foundation.
8130389Sle *
9130389Sle * This code is distributed in the hope that it will be useful, but WITHOUT
10130389Sle * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11130389Sle * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12130389Sle * version 2 for more details (a copy is included in the LICENSE file that
13130389Sle * accompanied this code).
14130389Sle *
15130389Sle * You should have received a copy of the GNU General Public License version
16130389Sle * 2 along with this work; if not, write to the Free Software Foundation,
17130389Sle * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18130389Sle *
19130389Sle * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20130389Sle * or visit www.oracle.com if you need additional information or have any
21130389Sle * questions.
22130389Sle *
23130389Sle */
24130389Sle
25130389Slepackage sun.jvm.hotspot.debugger.dummy;
26130389Sle
27130389Sleimport sun.jvm.hotspot.debugger.*;
28130389Sle
29130389Sle/** For testing purposes */
30130389Sle
31130389Sleclass DummyOopHandle extends DummyAddress implements OopHandle {
32130389Sle  DummyOopHandle(DummyDebugger debugger, long addr) {
33130389Sle    super(debugger, addr);
34130389Sle  }
35135426Sle
36130389Sle  public boolean equals(Object arg) {
37130389Sle    if (arg == null) {
38130389Sle      return false;
39135426Sle    }
40130389Sle
41130389Sle    if (!(arg instanceof DummyOopHandle)) {
42130389Sle      return false;
43130389Sle    }
44135426Sle
45135426Sle    return (addr == ((DummyAddress) arg).addr);
46130389Sle  }
47135426Sle
48135426Sle  public Address    addOffsetTo       (long offset) throws UnsupportedOperationException {
49130389Sle    throw new UnsupportedOperationException("addOffsetTo not applicable to OopHandles (interior object pointers not allowed)");
50130389Sle  }
51190507Slulf
52190507Slulf  public Address    andWithMask(long mask) throws UnsupportedOperationException {
53135426Sle    throw new UnsupportedOperationException("andWithMask not applicable to OopHandles (i.e., anything but C addresses)");
54130389Sle  }
55130389Sle
56  public Address    orWithMask(long mask) throws UnsupportedOperationException {
57    throw new UnsupportedOperationException("orWithMask not applicable to OopHandles (i.e., anything but C addresses)");
58  }
59
60  public Address    xorWithMask(long mask) throws UnsupportedOperationException {
61    throw new UnsupportedOperationException("xorWithMask not applicable to OopHandles (i.e., anything but C addresses)");
62  }
63}
64