7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()

Reviewed-by: kvn, jrose
This commit is contained in:
Christian Thalinger 2012-11-26 17:25:11 -08:00
parent 7f0d3fe5e7
commit 31411dbc32
16 changed files with 774 additions and 1067 deletions

View file

@ -116,7 +116,7 @@ void Parse::do_field_access(bool is_get, bool is_field) {
Node* obj;
if (is_field) {
int obj_depth = is_get ? 0 : field->type()->size();
obj = do_null_check(peek(obj_depth), T_OBJECT);
obj = null_check(peek(obj_depth));
// Compile-time detect of null-exception?
if (stopped()) return;
@ -126,11 +126,11 @@ void Parse::do_field_access(bool is_get, bool is_field) {
#endif
if (is_get) {
--_sp; // pop receiver before getting
(void) pop(); // pop receiver before getting
do_get_xxx(obj, field, is_field);
} else {
do_put_xxx(obj, field, is_field);
--_sp; // pop receiver after putting
(void) pop(); // pop receiver after putting
}
} else {
const TypeInstPtr* tip = TypeInstPtr::make(field_holder->java_mirror());
@ -230,7 +230,7 @@ void Parse::do_get_xxx(Node* obj, ciField* field, bool is_field) {
}
// If there is going to be a trap, put it at the next bytecode:
set_bci(iter().next_bci());
do_null_assert(peek(), T_OBJECT);
null_assert(peek());
set_bci(iter().cur_bci()); // put it back
}
@ -463,7 +463,7 @@ void Parse::do_multianewarray() {
// Note: the reexecute bit will be set in GraphKit::add_safepoint_edges()
// when AllocateArray node for newarray is created.
{ PreserveReexecuteState preexecs(this);
_sp += ndimensions;
inc_sp(ndimensions);
// Pass 0 as nargs since uncommon trap code does not need to restore stack.
obj = expand_multianewarray(array_klass, &length[0], ndimensions, 0);
} //original reexecute and sp are set back here
@ -492,7 +492,7 @@ void Parse::do_multianewarray() {
// Create a java array for dimension sizes
Node* dims = NULL;
{ PreserveReexecuteState preexecs(this);
_sp += ndimensions;
inc_sp(ndimensions);
Node* dims_array_klass = makecon(TypeKlassPtr::make(ciArrayKlass::make(ciType::make(T_INT))));
dims = new_array(dims_array_klass, intcon(ndimensions), 0);