/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef SHARE_VM_C1_C1_VALUESTACK_HPP
#define SHARE_VM_C1_C1_VALUESTACK_HPP
#include "c1/c1_Instruction.hpp"
public:
enum Kind {
};
private:
int _bci;
assert(tag == t->type()->tag() || tag == objectTag && t->type()->tag() == addressTag, "types must correspond");
return t;
}
}
// helper routine
// for simplified copying
public:
// creation
"only EmptyExceptionStates can be modified");
_caller_state = s;
}
// accessors
int total_locks_size() const;
// locals access
void clear_locals(); // sets all locals to NULL;
void invalidate_local(int i) {
}
return x;
}
// When overwriting local i, check if i - 1 was the start of a
// double word local and kill it.
if (i > 0) {
}
}
if (x->type()->is_double_word()) {
// hi-word of doubleword value is always NULL
}
}
// stack access
return x;
}
return x;
}
}
// pinning support
void pin_stack_for_linear_scan();
// iteration
void values_do(ValueVisitor* f);
// untyped manipulation (for dup_x1, etc.)
// typed manipulation
case addressTag: rpush(t); return;
}
}
case addressTag: return rpop();
}
return NULL;
}
// locks access
int unlock();
// SSA form IR support
// debugging
};
// Macro definitions for simple iteration of stack and local values of a ValueStack
// The macros can be used like a for-loop. All variables (state, index and value)
// must be defined before the loop.
// When states are nested because of inlining, the stack of the innermost state
// cumulates also the stack of the nested states. In contrast, the locals of all
// states must be iterated each.
// Use the following code pattern to iterate all stack values and all nested local values:
//
// ValueStack* state = ... // state that is iterated
// int index; // current loop index (overwritten in loop)
// Value value; // value at current loop index (overwritten in loop)
//
// for_each_stack_value(state, index, value {
// do something with value and index
// }
//
// for_each_state(state) {
// for_each_local_value(state, index, value) {
// do something with value and index
// }
// }
// as an invariant, state is NULL now
// construct a unique variable name with the line number where the macro is used
for (index = 0; \
for (index = 0; \
for (index = 0; \
index++) \
// Macro definition for simple iteration of all state values of a ValueStack
// Because the code cannot be executed in a single loop, the code must be passed
// as a macro parameter.
// Use the following code pattern to iterate all stack values and all nested local values:
//
// ValueStack* state = ... // state that is iterated
// for_each_state_value(state, value,
// do something with value (note that this is a macro parameter)
// );
{ \
int cur_index; \
for_each_state(cur_state) { \
{ \
v_code; \
} \
} \
{ \
v_code; \
} \
} \
} \
}
// Macro definition for simple iteration of all phif functions of a block, i.e all
// phi functions of the ValueStack where the block matches.
// Use the following code pattern to iterate all phi functions of a block:
//
// BlockBegin* block = ... // block that is iterated
// for_each_phi_function(block, phi,
// do something with the phi function phi (note that this is a macro parameter)
// );
{ \
int cur_index; \
{ \
v_code; \
} \
} \
} \
{ \
v_code; \
} \
} \
} \
}
#endif // SHARE_VM_C1_C1_VALUESTACK_HPP