001/*
002 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
003 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004 *
005 * This code is free software; you can redistribute it and/or modify it
006 * under the terms of the GNU General Public License version 2 only, as
007 * published by the Free Software Foundation.
008 *
009 * This code is distributed in the hope that it will be useful, but WITHOUT
010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
011 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
012 * version 2 for more details (a copy is included in the LICENSE file that
013 * accompanied this code).
014 *
015 * You should have received a copy of the GNU General Public License version
016 * 2 along with this work; if not, write to the Free Software Foundation,
017 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
018 *
019 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
020 * or visit www.oracle.com if you need additional information or have any
021 * questions.
022 */
023package com.oracle.graal.truffle;
024
025import jdk.internal.jvmci.common.*;
026
027import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
028import com.oracle.truffle.api.frame.*;
029
030class ReadOnlyFrame implements Frame {
031    private final Frame delegate;
032
033    public ReadOnlyFrame(Frame delegate) {
034        this.delegate = delegate;
035    }
036
037    @TruffleBoundary
038    public FrameDescriptor getFrameDescriptor() {
039        return delegate.getFrameDescriptor();
040    }
041
042    @TruffleBoundary
043    public Object[] getArguments() {
044        return delegate.getArguments().clone();
045    }
046
047    @TruffleBoundary
048    public Object getObject(FrameSlot slot) throws FrameSlotTypeException {
049        return delegate.getObject(slot);
050    }
051
052    @TruffleBoundary
053    public void setObject(FrameSlot slot, Object value) {
054        throw JVMCIError.shouldNotReachHere();
055    }
056
057    @TruffleBoundary
058    public byte getByte(FrameSlot slot) throws FrameSlotTypeException {
059        return delegate.getByte(slot);
060    }
061
062    @TruffleBoundary
063    public void setByte(FrameSlot slot, byte value) {
064        throw JVMCIError.shouldNotReachHere();
065    }
066
067    @TruffleBoundary
068    public boolean getBoolean(FrameSlot slot) throws FrameSlotTypeException {
069        return delegate.getBoolean(slot);
070    }
071
072    @TruffleBoundary
073    public void setBoolean(FrameSlot slot, boolean value) {
074        throw JVMCIError.shouldNotReachHere();
075    }
076
077    @TruffleBoundary
078    public int getInt(FrameSlot slot) throws FrameSlotTypeException {
079        return delegate.getInt(slot);
080    }
081
082    @TruffleBoundary
083    public void setInt(FrameSlot slot, int value) {
084        throw JVMCIError.shouldNotReachHere();
085    }
086
087    @TruffleBoundary
088    public long getLong(FrameSlot slot) throws FrameSlotTypeException {
089        return delegate.getLong(slot);
090    }
091
092    @TruffleBoundary
093    public void setLong(FrameSlot slot, long value) {
094        throw JVMCIError.shouldNotReachHere();
095    }
096
097    @TruffleBoundary
098    public float getFloat(FrameSlot slot) throws FrameSlotTypeException {
099        return delegate.getFloat(slot);
100    }
101
102    @TruffleBoundary
103    public void setFloat(FrameSlot slot, float value) {
104        throw JVMCIError.shouldNotReachHere();
105    }
106
107    @TruffleBoundary
108    public double getDouble(FrameSlot slot) throws FrameSlotTypeException {
109        return delegate.getDouble(slot);
110    }
111
112    @TruffleBoundary
113    public void setDouble(FrameSlot slot, double value) {
114        throw JVMCIError.shouldNotReachHere();
115    }
116
117    @TruffleBoundary
118    public Object getValue(FrameSlot slot) {
119        return delegate.getValue(slot);
120    }
121
122    @TruffleBoundary
123    public MaterializedFrame materialize() {
124        throw JVMCIError.shouldNotReachHere();
125    }
126
127    @TruffleBoundary
128    public boolean isObject(FrameSlot slot) {
129        return delegate.isObject(slot);
130    }
131
132    @TruffleBoundary
133    public boolean isByte(FrameSlot slot) {
134        return delegate.isByte(slot);
135    }
136
137    @TruffleBoundary
138    public boolean isBoolean(FrameSlot slot) {
139        return delegate.isBoolean(slot);
140    }
141
142    @TruffleBoundary
143    public boolean isInt(FrameSlot slot) {
144        return delegate.isInt(slot);
145    }
146
147    @TruffleBoundary
148    public boolean isLong(FrameSlot slot) {
149        return delegate.isLong(slot);
150    }
151
152    @TruffleBoundary
153    public boolean isFloat(FrameSlot slot) {
154        return delegate.isFloat(slot);
155    }
156
157    @TruffleBoundary
158    public boolean isDouble(FrameSlot slot) {
159        return delegate.isDouble(slot);
160    }
161}