0N/A/*
1879N/A * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
0N/A * published by the Free Software Foundation.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1472N/A * or visit www.oracle.com if you need additional information or have any
1472N/A * questions.
0N/A *
0N/A */
0N/A
1879N/A#ifndef SHARE_VM_RUNTIME_VFRAME_HP_HPP
1879N/A#define SHARE_VM_RUNTIME_VFRAME_HP_HPP
1879N/A
1879N/A#include "runtime/vframe.hpp"
1879N/A
0N/Aclass compiledVFrame: public javaVFrame {
0N/A public:
0N/A // JVM state
900N/A methodOop method() const;
900N/A int bci() const;
900N/A bool should_reexecute() const;
900N/A StackValueCollection* locals() const;
900N/A StackValueCollection* expressions() const;
900N/A GrowableArray<MonitorInfo*>* monitors() const;
0N/A
0N/A void set_locals(StackValueCollection* values) const;
0N/A
0N/A // Virtuals defined in vframe
0N/A bool is_compiled_frame() const { return true; }
0N/A vframe* sender() const;
0N/A bool is_top() const;
0N/A
0N/A // Casting
0N/A static compiledVFrame* cast(vframe* vf) {
0N/A assert(vf == NULL || vf->is_compiled_frame(), "must be compiled frame");
0N/A return (compiledVFrame*) vf;
0N/A }
0N/A
0N/A public:
0N/A // Constructors
0N/A compiledVFrame(const frame* fr, const RegisterMap* reg_map, JavaThread* thread, nmethod* nm);
0N/A
0N/A // Update a local in a compiled frame. Update happens when deopt occurs
0N/A void update_local(BasicType type, int index, jvalue value);
0N/A
0N/A // Returns the active nmethod
0N/A nmethod* code() const;
0N/A
0N/A // Returns the scopeDesc
0N/A ScopeDesc* scope() const { return _scope; }
0N/A
0N/A // Returns SynchronizationEntryBCI or bci() (used for synchronization)
0N/A int raw_bci() const;
0N/A
0N/A protected:
0N/A ScopeDesc* _scope;
0N/A
0N/A
0N/A //StackValue resolve(ScopeValue* sv) const;
0N/A BasicLock* resolve_monitor_lock(Location location) const;
0N/A StackValue *create_stack_value(ScopeValue *sv) const;
0N/A
0N/A private:
0N/A compiledVFrame(const frame* fr, const RegisterMap* reg_map, JavaThread* thread, ScopeDesc* scope);
0N/A
0N/A#ifndef PRODUCT
0N/A public:
0N/A void verify() const;
0N/A#endif
0N/A};
0N/A
0N/A// In order to implement set_locals for compiled vframes we must
0N/A// store updated locals in a data structure that contains enough
0N/A// information to recognize equality with a vframe and to store
0N/A// any updated locals.
0N/A
0N/Aclass jvmtiDeferredLocalVariable;
3863N/Aclass jvmtiDeferredLocalVariableSet : public CHeapObj<mtCompiler> {
0N/Aprivate:
0N/A
0N/A methodOop _method; // must be GC'd
0N/A int _bci;
0N/A intptr_t* _id;
0N/A GrowableArray<jvmtiDeferredLocalVariable*>* _locals;
0N/A
0N/A public:
0N/A // JVM state
0N/A methodOop method() const { return _method; }
0N/A int bci() const { return _bci; }
0N/A intptr_t* id() const { return _id; }
0N/A GrowableArray<jvmtiDeferredLocalVariable*>* locals() const { return _locals; }
0N/A void set_local_at(int idx, BasicType typ, jvalue val);
0N/A
0N/A // Does the vframe match this jvmtiDeferredLocalVariableSet
0N/A bool matches(vframe* vf);
0N/A // GC
0N/A void oops_do(OopClosure* f);
0N/A
0N/A // constructor
0N/A jvmtiDeferredLocalVariableSet(methodOop method, int bci, intptr_t* id);
0N/A
0N/A // destructor
0N/A ~jvmtiDeferredLocalVariableSet();
0N/A
0N/A
0N/A};
0N/A
3863N/Aclass jvmtiDeferredLocalVariable : public CHeapObj<mtCompiler> {
0N/A public:
0N/A
0N/A jvmtiDeferredLocalVariable(int index, BasicType type, jvalue value);
0N/A
0N/A BasicType type(void) { return _type; }
0N/A int index(void) { return _index; }
0N/A jvalue value(void) { return _value; }
0N/A // Only mutator is for value as only it can change
0N/A void set_value(jvalue value) { _value = value; }
0N/A // For gc
0N/A oop* oop_addr(void) { return (oop*) &_value.l; }
0N/A
0N/A private:
0N/A
0N/A BasicType _type;
0N/A jvalue _value;
0N/A int _index;
0N/A
0N/A};
1879N/A
1879N/A#endif // SHARE_VM_RUNTIME_VFRAME_HP_HPP