annotate src/hotspot/share/runtime/vframe_hp.hpp @ 60804:88e90d1bacba

Automatic merge with default
author mcimadamore
date Tue, 07 Apr 2020 18:33:26 +0000
parents 2f41e4935c34
children
rev   line source
duke@1 1 /*
coleenp@54304 2 * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
duke@1 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@1 4 *
duke@1 5 * This code is free software; you can redistribute it and/or modify it
duke@1 6 * under the terms of the GNU General Public License version 2 only, as
duke@1 7 * published by the Free Software Foundation.
duke@1 8 *
duke@1 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@1 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@1 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@1 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@1 13 * accompanied this code).
duke@1 14 *
duke@1 15 * You should have received a copy of the GNU General Public License version
duke@1 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@1 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@1 18 *
trims@5547 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@5547 20 * or visit www.oracle.com if you need additional information or have any
trims@5547 21 * questions.
duke@1 22 *
duke@1 23 */
duke@1 24
coleenp@54304 25 #ifndef SHARE_RUNTIME_VFRAME_HP_HPP
coleenp@54304 26 #define SHARE_RUNTIME_VFRAME_HP_HPP
stefank@7397 27
stefank@7397 28 #include "runtime/vframe.hpp"
stefank@7397 29
duke@1 30 class compiledVFrame: public javaVFrame {
duke@1 31 public:
duke@1 32 // JVM state
coleenp@13728 33 Method* method() const;
cfang@3600 34 int bci() const;
cfang@3600 35 bool should_reexecute() const;
cfang@3600 36 StackValueCollection* locals() const;
cfang@3600 37 StackValueCollection* expressions() const;
cfang@3600 38 GrowableArray<MonitorInfo*>* monitors() const;
never@43484 39 int vframe_id() const { return _vframe_id; }
duke@1 40
duke@1 41 void set_locals(StackValueCollection* values) const;
duke@1 42
duke@1 43 // Virtuals defined in vframe
duke@1 44 bool is_compiled_frame() const { return true; }
duke@1 45 vframe* sender() const;
duke@1 46 bool is_top() const;
duke@1 47
duke@1 48 // Casting
duke@1 49 static compiledVFrame* cast(vframe* vf) {
duke@1 50 assert(vf == NULL || vf->is_compiled_frame(), "must be compiled frame");
duke@1 51 return (compiledVFrame*) vf;
duke@1 52 }
duke@1 53
never@48910 54 void update_deferred_value(BasicType type, int index, jvalue value);
never@48910 55
duke@1 56 public:
duke@1 57 // Constructors
rbackman@38133 58 compiledVFrame(const frame* fr, const RegisterMap* reg_map, JavaThread* thread, CompiledMethod* nm);
duke@1 59
duke@1 60 // Update a local in a compiled frame. Update happens when deopt occurs
duke@1 61 void update_local(BasicType type, int index, jvalue value);
duke@1 62
never@48910 63 // Update an expression stack value in a compiled frame. Update happens when deopt occurs
never@48910 64 void update_stack(BasicType type, int index, jvalue value);
never@48910 65
never@48910 66 // Update a lock value in a compiled frame. Update happens when deopt occurs
never@48910 67 void update_monitor(int index, MonitorInfo* value);
never@48910 68
duke@1 69 // Returns the active nmethod
rbackman@38133 70 CompiledMethod* code() const;
duke@1 71
duke@1 72 // Returns the scopeDesc
duke@1 73 ScopeDesc* scope() const { return _scope; }
duke@1 74
dlong@54109 75 // Return the compiledVFrame for the desired scope
dlong@54109 76 compiledVFrame* at_scope(int decode_offset, int vframe_id);
dlong@54109 77
duke@1 78 // Returns SynchronizationEntryBCI or bci() (used for synchronization)
duke@1 79 int raw_bci() const;
duke@1 80
duke@1 81 protected:
duke@1 82 ScopeDesc* _scope;
never@43484 83 int _vframe_id;
duke@1 84
duke@1 85 //StackValue resolve(ScopeValue* sv) const;
duke@1 86 BasicLock* resolve_monitor_lock(Location location) const;
duke@1 87 StackValue *create_stack_value(ScopeValue *sv) const;
duke@1 88
duke@1 89 private:
never@43484 90 compiledVFrame(const frame* fr, const RegisterMap* reg_map, JavaThread* thread, ScopeDesc* scope, int vframe_id);
duke@1 91
duke@1 92 #ifndef PRODUCT
duke@1 93 public:
duke@1 94 void verify() const;
duke@1 95 #endif
duke@1 96 };
duke@1 97
duke@1 98 // In order to implement set_locals for compiled vframes we must
duke@1 99 // store updated locals in a data structure that contains enough
duke@1 100 // information to recognize equality with a vframe and to store
duke@1 101 // any updated locals.
duke@1 102
duke@1 103 class jvmtiDeferredLocalVariable;
zgu@13195 104 class jvmtiDeferredLocalVariableSet : public CHeapObj<mtCompiler> {
never@48910 105 friend class compiledVFrame;
never@48910 106
duke@1 107 private:
duke@1 108
coleenp@13728 109 Method* _method;
duke@1 110 int _bci;
duke@1 111 intptr_t* _id;
never@43484 112 int _vframe_id;
duke@1 113 GrowableArray<jvmtiDeferredLocalVariable*>* _locals;
duke@1 114
never@48910 115 void update_value(StackValueCollection* locals, BasicType type, int index, jvalue value);
never@48910 116
never@48910 117 void set_value_at(int idx, BasicType typ, jvalue val);
never@48910 118
duke@1 119 public:
duke@1 120 // JVM state
coleenp@13728 121 Method* method() const { return _method; }
duke@1 122 int bci() const { return _bci; }
duke@1 123 intptr_t* id() const { return _id; }
never@43484 124 int vframe_id() const { return _vframe_id; }
never@48910 125
never@48910 126 void update_locals(StackValueCollection* locals);
never@48910 127 void update_stack(StackValueCollection* locals);
never@48910 128 void update_monitors(GrowableArray<MonitorInfo*>* monitors);
duke@1 129
duke@1 130 // Does the vframe match this jvmtiDeferredLocalVariableSet
never@48910 131 bool matches(const vframe* vf);
duke@1 132 // GC
duke@1 133 void oops_do(OopClosure* f);
duke@1 134
duke@1 135 // constructor
never@43484 136 jvmtiDeferredLocalVariableSet(Method* method, int bci, intptr_t* id, int vframe_id);
duke@1 137
duke@1 138 // destructor
duke@1 139 ~jvmtiDeferredLocalVariableSet();
duke@1 140
duke@1 141
duke@1 142 };
duke@1 143
zgu@13195 144 class jvmtiDeferredLocalVariable : public CHeapObj<mtCompiler> {
duke@1 145 public:
duke@1 146
duke@1 147 jvmtiDeferredLocalVariable(int index, BasicType type, jvalue value);
duke@1 148
duke@1 149 BasicType type(void) { return _type; }
duke@1 150 int index(void) { return _index; }
duke@1 151 jvalue value(void) { return _value; }
duke@1 152 // Only mutator is for value as only it can change
duke@1 153 void set_value(jvalue value) { _value = value; }
duke@1 154 // For gc
duke@1 155 oop* oop_addr(void) { return (oop*) &_value.l; }
duke@1 156
duke@1 157 private:
duke@1 158
duke@1 159 BasicType _type;
duke@1 160 jvalue _value;
duke@1 161 int _index;
duke@1 162
duke@1 163 };
stefank@7397 164
coleenp@54304 165 #endif // SHARE_RUNTIME_VFRAME_HP_HPP