# HG changeset patch # User Gary Benson # Date 1236952522 14400 # Node ID ae9230c3f0c54223a79895eb613be72de99274c5 # Parent ffdbfdce6b92e4a7d20553dbd04567254b8cf2fb# Parent 96d1de001c8d45a4f4a2bb77d583db89dd2b6653 2009-03-13 Gary Benson * ports/hotspot/src/share/vm/shark/sharkValue.hpp (SharkValue::create_generic): Make zero_checked argument mandatory. (SharkValue::create_jint): Fixups for the above. (SharkValue::create_jlong): Likewise. (SharkValue::create_jfloat): Likewise. (SharkValue::create_jdouble): Likewise. (SharkValue::create_jobject): Likewise. (SharkValue::jint_constant): Likewise. (SharkValue::jlong_constant): Likewise. (SharkValue::null): Likewise. * ports/hotspot/src/share/vm/shark/sharkState.cpp (SharkState::merge): Likewise. (SharkState::cache_after_Java_call): Likewise. (SharkEntryState::SharkEntryState): Likewise. (SharkPHIState::SharkPHIState): Likewise. * ports/hotspot/src/share/vm/shark/sharkBlock.hpp (SharkBlock::do_ldc): Likewise. * ports/hotspot/src/share/vm/shark/sharkBlock.cpp (SharkBlock::parse_bytecode): Likewise. (SharkBlock::do_div_or_rem): Likewise. (SharkBlock::do_field_access): Likewise. (SharkBlock::do_lcmp): Likewise. (SharkBlock::do_fcmp): Likewise. * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp (SharkTopLevelBlock::handle_exception): Likewise. (SharkTopLevelBlock::do_arraylength): Likewise. (SharkTopLevelBlock::do_aload): Likewise. (SharkTopLevelBlock::do_instance_check): Likewise. (SharkTopLevelBlock::do_new): Likewise. (SharkTopLevelBlock::do_newarray): Likewise. (SharkTopLevelBlock::do_anewarray): Likewise. (SharkTopLevelBlock::do_multianewarray): Likewise. * ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp (SharkCacher::process_stack_slot): Likewise. (SharkCacher::process_local_slot): Likewise. * ports/hotspot/src/share/vm/shark/sharkIntrinsics.cpp (SharkIntrinsics::do_Math_minmax): Likewise. (SharkIntrinsics::do_Object_getClass): Likewise. (SharkIntrinsics::do_System_currentTimeMillis): Likewise. (SharkIntrinsics::do_Thread_currentThread): Likewise. (SharkIntrinsics::do_Unsafe_compareAndSwapInt): Likewise. (transplanted from 96d1de001c8d45a4f4a2bb77d583db89dd2b6653) diff -r ffdbfdce6b92 -r ae9230c3f0c5 ChangeLog --- a/ChangeLog Fri Mar 13 09:39:47 2009 -0400 +++ b/ChangeLog Fri Mar 13 09:55:22 2009 -0400 @@ -1,3 +1,47 @@ +2009-03-13 Gary Benson + + * ports/hotspot/src/share/vm/shark/sharkValue.hpp + (SharkValue::create_generic): Make zero_checked argument mandatory. + (SharkValue::create_jint): Fixups for the above. + (SharkValue::create_jlong): Likewise. + (SharkValue::create_jfloat): Likewise. + (SharkValue::create_jdouble): Likewise. + (SharkValue::create_jobject): Likewise. + (SharkValue::jint_constant): Likewise. + (SharkValue::jlong_constant): Likewise. + (SharkValue::null): Likewise. + * ports/hotspot/src/share/vm/shark/sharkState.cpp + (SharkState::merge): Likewise. + (SharkState::cache_after_Java_call): Likewise. + (SharkEntryState::SharkEntryState): Likewise. + (SharkPHIState::SharkPHIState): Likewise. + * ports/hotspot/src/share/vm/shark/sharkBlock.hpp + (SharkBlock::do_ldc): Likewise. + * ports/hotspot/src/share/vm/shark/sharkBlock.cpp + (SharkBlock::parse_bytecode): Likewise. + (SharkBlock::do_div_or_rem): Likewise. + (SharkBlock::do_field_access): Likewise. + (SharkBlock::do_lcmp): Likewise. + (SharkBlock::do_fcmp): Likewise. + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp + (SharkTopLevelBlock::handle_exception): Likewise. + (SharkTopLevelBlock::do_arraylength): Likewise. + (SharkTopLevelBlock::do_aload): Likewise. + (SharkTopLevelBlock::do_instance_check): Likewise. + (SharkTopLevelBlock::do_new): Likewise. + (SharkTopLevelBlock::do_newarray): Likewise. + (SharkTopLevelBlock::do_anewarray): Likewise. + (SharkTopLevelBlock::do_multianewarray): Likewise. + * ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp + (SharkCacher::process_stack_slot): Likewise. + (SharkCacher::process_local_slot): Likewise. + * ports/hotspot/src/share/vm/shark/sharkIntrinsics.cpp + (SharkIntrinsics::do_Math_minmax): Likewise. + (SharkIntrinsics::do_Object_getClass): Likewise. + (SharkIntrinsics::do_System_currentTimeMillis): Likewise. + (SharkIntrinsics::do_Thread_currentThread): Likewise. + (SharkIntrinsics::do_Unsafe_compareAndSwapInt): Likewise. + 2009-03-13 Gary Benson * ports/hotspot/src/share/vm/shark/sharkInliner.cpp diff -r ffdbfdce6b92 -r ae9230c3f0c5 ports/hotspot/src/share/vm/shark/sharkBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkBlock.cpp Fri Mar 13 09:39:47 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkBlock.cpp Fri Mar 13 09:55:22 2009 -0400 @@ -369,19 +369,19 @@ b = pop(); a = pop(); push(SharkValue::create_jint( - builder()->CreateAdd(a->jint_value(), b->jint_value()))); + builder()->CreateAdd(a->jint_value(), b->jint_value()), false)); break; case Bytecodes::_isub: b = pop(); a = pop(); push(SharkValue::create_jint( - builder()->CreateSub(a->jint_value(), b->jint_value()))); + builder()->CreateSub(a->jint_value(), b->jint_value()), false)); break; case Bytecodes::_imul: b = pop(); a = pop(); push(SharkValue::create_jint( - builder()->CreateMul(a->jint_value(), b->jint_value()))); + builder()->CreateMul(a->jint_value(), b->jint_value()), false)); break; case Bytecodes::_idiv: do_idiv(); @@ -392,7 +392,7 @@ case Bytecodes::_ineg: a = pop(); push(SharkValue::create_jint( - builder()->CreateNeg(a->jint_value()))); + builder()->CreateNeg(a->jint_value()), a->zero_checked())); break; case Bytecodes::_ishl: b = pop(); @@ -401,7 +401,7 @@ builder()->CreateShl( a->jint_value(), builder()->CreateAnd( - b->jint_value(), LLVMValue::jint_constant(0x1f))))); + b->jint_value(), LLVMValue::jint_constant(0x1f))), false)); break; case Bytecodes::_ishr: b = pop(); @@ -410,7 +410,7 @@ builder()->CreateAShr( a->jint_value(), builder()->CreateAnd( - b->jint_value(), LLVMValue::jint_constant(0x1f))))); + b->jint_value(), LLVMValue::jint_constant(0x1f))), false)); break; case Bytecodes::_iushr: b = pop(); @@ -419,44 +419,45 @@ builder()->CreateLShr( a->jint_value(), builder()->CreateAnd( - b->jint_value(), LLVMValue::jint_constant(0x1f))))); + b->jint_value(), LLVMValue::jint_constant(0x1f))), false)); break; case Bytecodes::_iand: b = pop(); a = pop(); push(SharkValue::create_jint( - builder()->CreateAnd(a->jint_value(), b->jint_value()))); + builder()->CreateAnd(a->jint_value(), b->jint_value()), false)); break; case Bytecodes::_ior: b = pop(); a = pop(); push(SharkValue::create_jint( - builder()->CreateOr(a->jint_value(), b->jint_value()))); + builder()->CreateOr(a->jint_value(), b->jint_value()), + a->zero_checked() && b->zero_checked())); break; case Bytecodes::_ixor: b = pop(); a = pop(); push(SharkValue::create_jint( - builder()->CreateXor(a->jint_value(), b->jint_value()))); + builder()->CreateXor(a->jint_value(), b->jint_value()), false)); break; case Bytecodes::_ladd: b = pop(); a = pop(); push(SharkValue::create_jlong( - builder()->CreateAdd(a->jlong_value(), b->jlong_value()))); + builder()->CreateAdd(a->jlong_value(), b->jlong_value()), false)); break; case Bytecodes::_lsub: b = pop(); a = pop(); push(SharkValue::create_jlong( - builder()->CreateSub(a->jlong_value(), b->jlong_value()))); + builder()->CreateSub(a->jlong_value(), b->jlong_value()), false)); break; case Bytecodes::_lmul: b = pop(); a = pop(); push(SharkValue::create_jlong( - builder()->CreateMul(a->jlong_value(), b->jlong_value()))); + builder()->CreateMul(a->jlong_value(), b->jlong_value()), false)); break; case Bytecodes::_ldiv: do_ldiv(); @@ -467,7 +468,7 @@ case Bytecodes::_lneg: a = pop(); push(SharkValue::create_jlong( - builder()->CreateNeg(a->jlong_value()))); + builder()->CreateNeg(a->jlong_value()), a->zero_checked())); break; case Bytecodes::_lshl: b = pop(); @@ -478,7 +479,7 @@ builder()->CreateIntCast( builder()->CreateAnd( b->jint_value(), LLVMValue::jint_constant(0x3f)), - SharkType::jlong_type(), true)))); + SharkType::jlong_type(), true)), false)); break; case Bytecodes::_lshr: b = pop(); @@ -489,7 +490,7 @@ builder()->CreateIntCast( builder()->CreateAnd( b->jint_value(), LLVMValue::jint_constant(0x3f)), - SharkType::jlong_type(), true)))); + SharkType::jlong_type(), true)), false)); break; case Bytecodes::_lushr: b = pop(); @@ -500,25 +501,26 @@ builder()->CreateIntCast( builder()->CreateAnd( b->jint_value(), LLVMValue::jint_constant(0x3f)), - SharkType::jlong_type(), true)))); + SharkType::jlong_type(), true)), false)); break; case Bytecodes::_land: b = pop(); a = pop(); push(SharkValue::create_jlong( - builder()->CreateAnd(a->jlong_value(), b->jlong_value()))); + builder()->CreateAnd(a->jlong_value(), b->jlong_value()), false)); break; case Bytecodes::_lor: b = pop(); a = pop(); push(SharkValue::create_jlong( - builder()->CreateOr(a->jlong_value(), b->jlong_value()))); + builder()->CreateOr(a->jlong_value(), b->jlong_value()), + a->zero_checked() && b->zero_checked())); break; case Bytecodes::_lxor: b = pop(); a = pop(); push(SharkValue::create_jlong( - builder()->CreateXor(a->jlong_value(), b->jlong_value()))); + builder()->CreateXor(a->jlong_value(), b->jlong_value()), false)); break; case Bytecodes::_fadd: @@ -600,7 +602,7 @@ SharkValue::create_jint( builder()->CreateAdd( LLVMValue::jint_constant(iter()->get_iinc_con()), - local(i)->jint_value()))); + local(i)->jint_value()), false)); break; case Bytecodes::_lcmp: @@ -621,9 +623,10 @@ break; case Bytecodes::_i2l: + a = pop(); push(SharkValue::create_jlong( builder()->CreateIntCast( - pop()->jint_value(), SharkType::jlong_type(), true))); + a->jint_value(), SharkType::jlong_type(), true), a->zero_checked())); break; case Bytecodes::_i2f: push(SharkValue::create_jfloat( @@ -639,7 +642,7 @@ case Bytecodes::_l2i: push(SharkValue::create_jint( builder()->CreateIntCast( - pop()->jlong_value(), SharkType::jint_type(), true))); + pop()->jlong_value(), SharkType::jint_type(), true), false)); break; case Bytecodes::_l2f: push(SharkValue::create_jfloat( @@ -654,11 +657,11 @@ case Bytecodes::_f2i: push(SharkValue::create_jint( - call_vm_leaf(SharkRuntime::f2i(), pop()->jfloat_value()))); + call_vm_leaf(SharkRuntime::f2i(), pop()->jfloat_value()), false)); break; case Bytecodes::_f2l: push(SharkValue::create_jlong( - call_vm_leaf(SharkRuntime::f2l(), pop()->jfloat_value()))); + call_vm_leaf(SharkRuntime::f2l(), pop()->jfloat_value()), false)); break; case Bytecodes::_f2d: push(SharkValue::create_jdouble( @@ -668,11 +671,11 @@ case Bytecodes::_d2i: push(SharkValue::create_jint( - call_vm_leaf(SharkRuntime::d2i(), pop()->jdouble_value()))); + call_vm_leaf(SharkRuntime::d2i(), pop()->jdouble_value()), false)); break; case Bytecodes::_d2l: push(SharkValue::create_jlong( - call_vm_leaf(SharkRuntime::d2l(), pop()->jdouble_value()))); + call_vm_leaf(SharkRuntime::d2l(), pop()->jdouble_value()), false)); break; case Bytecodes::_d2f: push(SharkValue::create_jfloat( @@ -686,13 +689,13 @@ builder()->CreateShl( pop()->jint_value(), LLVMValue::jint_constant(24)), - LLVMValue::jint_constant(24)))); + LLVMValue::jint_constant(24)), false)); break; case Bytecodes::_i2c: push(SharkValue::create_jint( builder()->CreateAnd( pop()->jint_value(), - LLVMValue::jint_constant(0xffff)))); + LLVMValue::jint_constant(0xffff)), false)); break; case Bytecodes::_i2s: push(SharkValue::create_jint( @@ -700,7 +703,7 @@ builder()->CreateShl( pop()->jint_value(), LLVMValue::jint_constant(16)), - LLVMValue::jint_constant(16)))); + LLVMValue::jint_constant(16)), false)); break; case Bytecodes::_return: @@ -963,9 +966,9 @@ result->addIncoming(general_result, general_case); if (is_long) - push(SharkValue::create_jlong(result)); + push(SharkValue::create_jlong(result, false)); else - push(SharkValue::create_jint(result)); + push(SharkValue::create_jint(result, false)); } void SharkBlock::do_field_access(bool is_get, bool is_field) @@ -1011,7 +1014,7 @@ field_value = builder()->CreateIntCast( field_value, stack_type, basic_type != T_CHAR); - value = SharkValue::create_generic(field->type(), field_value); + value = SharkValue::create_generic(field->type(), field_value, false); } else { Value *field_value = value->generic_value(); @@ -1064,7 +1067,7 @@ result->addIncoming(LLVMValue::jint_constant(0), eq); result->addIncoming(LLVMValue::jint_constant(1), gt); - push(SharkValue::create_jint(result)); + push(SharkValue::create_jint(result, false)); } void SharkBlock::do_fcmp(bool is_double, bool unordered_is_greater) @@ -1112,7 +1115,7 @@ result->addIncoming(LLVMValue::jint_constant(0), eq); result->addIncoming(LLVMValue::jint_constant(1), gt); - push(SharkValue::create_jint(result)); + push(SharkValue::create_jint(result, false)); } void SharkBlock::emit_IR() diff -r ffdbfdce6b92 -r ae9230c3f0c5 ports/hotspot/src/share/vm/shark/sharkBlock.hpp --- a/ports/hotspot/src/share/vm/shark/sharkBlock.hpp Fri Mar 13 09:39:47 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkBlock.hpp Fri Mar 13 09:55:22 2009 -0400 @@ -239,7 +239,7 @@ { SharkValue *value = SharkValue::from_ciConstant(iter()->get_constant()); if (value == NULL) - value = SharkValue::create_jobject(lookup_for_ldc()); + value = SharkValue::create_jobject(lookup_for_ldc(), true); push(value); } diff -r ffdbfdce6b92 -r ae9230c3f0c5 ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp --- a/ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp Fri Mar 13 09:39:47 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp Fri Mar 13 09:55:22 2009 -0400 @@ -1,6 +1,6 @@ /* * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. - * Copyright 2008 Red Hat, Inc. + * Copyright 2008, 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -180,7 +180,8 @@ builder()->CreateLoad( function()->CreateAddressOfFrameEntry( adjusted_offset(value, offset), - SharkType::to_stackType(value->basic_type())))); + SharkType::to_stackType(value->basic_type()))), + value->zero_checked()); } } @@ -206,6 +207,7 @@ builder()->CreateLoad( function()->CreateAddressOfFrameEntry( adjusted_offset(value, offset), - SharkType::to_stackType(value->basic_type())))); + SharkType::to_stackType(value->basic_type()))), + value->zero_checked()); } } diff -r ffdbfdce6b92 -r ae9230c3f0c5 ports/hotspot/src/share/vm/shark/sharkIntrinsics.cpp --- a/ports/hotspot/src/share/vm/shark/sharkIntrinsics.cpp Fri Mar 13 09:39:47 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkIntrinsics.cpp Fri Mar 13 09:55:22 2009 -0400 @@ -173,10 +173,10 @@ phi->addIncoming(b, return_b); // Push the result - SharkValue *result = SharkValue::create_jint(phi); - if (sa->zero_checked() && sb->zero_checked()) - result->set_zero_checked(true); - state->push(result); + state->push( + SharkValue::create_jint( + phi, + sa->zero_checked() && sb->zero_checked())); } void SharkIntrinsics::do_Math_1to1(SharkState *state, Constant *function) @@ -219,34 +219,34 @@ SharkType::klass_type(), "klass_part"); - SharkValue *result = SharkValue::create_jobject( - builder->CreateValueOfStructEntry( - klass_part, - in_ByteSize(Klass::java_mirror_offset_in_bytes()), - SharkType::oop_type(), - "java_mirror")); - - result->set_zero_checked(true); - state->push(result); + state->push( + SharkValue::create_jobject( + builder->CreateValueOfStructEntry( + klass_part, + in_ByteSize(Klass::java_mirror_offset_in_bytes()), + SharkType::oop_type(), + "java_mirror"), + true)); } void SharkIntrinsics::do_System_currentTimeMillis(SharkState *state) { state->push( SharkValue::create_jlong( - state->builder()->CreateCall(SharkRuntime::current_time_millis()))); + state->builder()->CreateCall(SharkRuntime::current_time_millis()), + false)); state->push(NULL); } void SharkIntrinsics::do_Thread_currentThread(SharkState *state, Value *thread) { - SharkValue *result = SharkValue::create_jobject( - state->builder()->CreateValueOfStructEntry( - thread, JavaThread::threadObj_offset(), - SharkType::jobject_type(), - "threadObj")); - result->set_zero_checked(true); - state->push(result); + state->push( + SharkValue::create_jobject( + state->builder()->CreateValueOfStructEntry( + thread, JavaThread::threadObj_offset(), + SharkType::jobject_type(), + "threadObj"), + true)); } void SharkIntrinsics::do_Unsafe_compareAndSwapInt(SharkState *state) @@ -279,6 +279,9 @@ Value *result = builder->CreateCmpxchgInt(x, addr, e); // Push the result - state->push(SharkValue::create_jint(builder->CreateIntCast( - builder->CreateICmpEQ(result, e), SharkType::jint_type(), true))); + state->push( + SharkValue::create_jint( + builder->CreateIntCast( + builder->CreateICmpEQ(result, e), SharkType::jint_type(), true), + false)); } diff -r ffdbfdce6b92 -r ae9230c3f0c5 ports/hotspot/src/share/vm/shark/sharkState.cpp --- a/ports/hotspot/src/share/vm/shark/sharkState.cpp Fri Mar 13 09:39:47 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkState.cpp Fri Mar 13 09:55:22 2009 -0400 @@ -173,11 +173,14 @@ ciType *this_type = this_value->type(); assert(this_type == other_value->type(), "should be"); + bool this_checked = this_value->zero_checked(); + assert(this_checked == other_value->zero_checked(), "should be"); + snprintf(name, sizeof(name), "local_%d_", i); phi = builder()->CreatePHI(SharkType::to_stackType(this_type), name); phi->addIncoming(this_value->generic_value(), this_block); phi->addIncoming(other_value->generic_value(), other_block); - set_local(i, SharkValue::create_generic(this_type, phi)); + set_local(i, SharkValue::create_generic(this_type, phi, this_checked)); } // Expression stack @@ -192,11 +195,14 @@ ciType *this_type = this_value->type(); assert(this_type == other_value->type(), "should be"); + bool this_checked = this_value->zero_checked(); + assert(this_checked == other_value->zero_checked(), "should be"); + snprintf(name, sizeof(name), "stack_%d_", i); phi = builder()->CreatePHI(SharkType::to_stackType(this_type), name); phi->addIncoming(this_value->generic_value(), this_block); phi->addIncoming(other_value->generic_value(), other_block); - set_stack(i, SharkValue::create_generic(this_type, phi)); + set_stack(i, SharkValue::create_generic(this_type, phi, this_checked)); } } @@ -224,7 +230,7 @@ type = callee->return_type(); } - push(SharkValue::create_generic(type, NULL)); + push(SharkValue::create_generic(type, NULL, false)); if (type->is_two_word()) push(NULL); } @@ -275,7 +281,8 @@ function()->locals_slots_offset() + max_locals() - type->size() - i, SharkType::to_stackType(type)), - name)); + name), + i == 0 && !function()->target()->is_static()); } else { Unimplemented(); @@ -295,12 +302,6 @@ set_local(i, value); } - // Non-static methods have a guaranteed non-null receiver - if (!function()->target()->is_static()) { - assert(local(0)->is_jobject(), "should be"); - local(0)->set_zero_checked(true); - } - // Expression stack assert(!block->stack_depth_at_entry(), "entry block shouldn't have stack"); } @@ -333,7 +334,9 @@ case T_ARRAY: snprintf(name, sizeof(name), "local_%d_", i); value = SharkValue::create_generic( - type, builder()->CreatePHI(SharkType::to_stackType(type), name)); + type, + builder()->CreatePHI(SharkType::to_stackType(type), name), + false); break; case T_ADDRESS: @@ -371,7 +374,9 @@ case T_ARRAY: snprintf(name, sizeof(name), "stack_%d_", i); value = SharkValue::create_generic( - type, builder()->CreatePHI(SharkType::to_stackType(type), name)); + type, + builder()->CreatePHI(SharkType::to_stackType(type), name), + false); break; case T_ADDRESS: diff -r ffdbfdce6b92 -r ae9230c3f0c5 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Fri Mar 13 09:39:47 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Fri Mar 13 09:55:22 2009 -0400 @@ -444,7 +444,7 @@ // we may be about to make. while (xstack_depth()) pop(); - push(SharkValue::create_jobject(exception)); + push(SharkValue::create_jobject(exception, true)); int *indexes = NEW_RESOURCE_ARRAY(int, num_exceptions()); bool has_catch_all = false; @@ -718,7 +718,7 @@ SharkValue *array = pop(); check_null(array); Value *length = builder()->CreateArrayLength(array->jarray_value()); - push(SharkValue::create_jint(length)); + push(SharkValue::create_jint(length, false)); } void SharkTopLevelBlock::do_aload(BasicType basic_type) @@ -748,11 +748,11 @@ case T_CHAR: case T_SHORT: case T_INT: - push(SharkValue::create_jint(value)); + push(SharkValue::create_jint(value, false)); break; case T_LONG: - push(SharkValue::create_jlong(value)); + push(SharkValue::create_jlong(value, false)); break; case T_FLOAT: @@ -764,7 +764,7 @@ break; case T_OBJECT: - push(SharkValue::create_generic(element_type, value)); + push(SharkValue::create_generic(element_type, value, false)); break; default: @@ -1400,7 +1400,7 @@ builder()->CreateUnreachable(); builder()->SetInsertPoint(success); - push(SharkValue::create_generic(klass, object)); + push(SharkValue::create_generic(klass, object, false)); } else { push( @@ -1408,7 +1408,7 @@ builder()->CreateIntCast( builder()->CreateICmpEQ( result, LLVMValue::jint_constant(IC_IS_INSTANCE)), - SharkType::jint_type(), false))); + SharkType::jint_type(), false), false)); } } @@ -1597,9 +1597,7 @@ object = slow_object; } - SharkValue *result = SharkValue::create_jobject(object); - result->set_zero_checked(true); - push(result); + push(SharkValue::create_jobject(object, true)); } void SharkTopLevelBlock::do_newarray() @@ -1611,11 +1609,10 @@ LLVMValue::jint_constant(type), pop()->jint_value()); - SharkValue *result = SharkValue::create_generic( + push(SharkValue::create_generic( ciArrayKlass::make(ciType::make(type)), - function()->CreateGetVMResult()); - result->set_zero_checked(true); - push(result); + function()->CreateGetVMResult(), + true)); } void SharkTopLevelBlock::do_anewarray() @@ -1634,10 +1631,8 @@ LLVMValue::jint_constant(iter()->get_klass_index()), pop()->jint_value()); - SharkValue *result = SharkValue::create_generic( - array_klass, function()->CreateGetVMResult()); - result->set_zero_checked(true); - push(result); + push(SharkValue::create_generic( + array_klass, function()->CreateGetVMResult(), true)); } void SharkTopLevelBlock::do_multianewarray() @@ -1672,10 +1667,8 @@ for (int i = 0; i < ndims; i++) pop(); - SharkValue *result = SharkValue::create_generic( - array_klass, function()->CreateGetVMResult()); - result->set_zero_checked(true); - push(result); + push(SharkValue::create_generic( + array_klass, function()->CreateGetVMResult(), true)); } void SharkTopLevelBlock::do_monitorenter() diff -r ffdbfdce6b92 -r ae9230c3f0c5 ports/hotspot/src/share/vm/shark/sharkValue.hpp --- a/ports/hotspot/src/share/vm/shark/sharkValue.hpp Fri Mar 13 09:39:47 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkValue.hpp Fri Mar 13 09:55:22 2009 -0400 @@ -83,47 +83,41 @@ // Typed conversion to SharkValues public: - static SharkValue* create_jint(llvm::Value* value) + static SharkValue* create_jint(llvm::Value* value, bool zero_checked) { assert(value->getType() == SharkType::jint_type(), "should be"); - return create_generic(ciType::make(T_INT), value); + return create_generic(ciType::make(T_INT), value, zero_checked); } - static SharkValue* create_jlong(llvm::Value* value) + static SharkValue* create_jlong(llvm::Value* value, bool zero_checked) { assert(value->getType() == SharkType::jlong_type(), "should be"); - return create_generic(ciType::make(T_LONG), value); + return create_generic(ciType::make(T_LONG), value, zero_checked); } static SharkValue* create_jfloat(llvm::Value* value) { assert(value->getType() == SharkType::jfloat_type(), "should be"); - return create_generic(ciType::make(T_FLOAT), value); + return create_generic(ciType::make(T_FLOAT), value, false); } static SharkValue* create_jdouble(llvm::Value* value) { assert(value->getType() == SharkType::jdouble_type(), "should be"); - return create_generic(ciType::make(T_DOUBLE), value); + return create_generic(ciType::make(T_DOUBLE), value, false); } - static SharkValue* create_jobject(llvm::Value* value) + static SharkValue* create_jobject(llvm::Value* value, bool zero_checked) { assert(value->getType() == SharkType::jobject_type(), "should be"); - return create_generic(ciType::make(T_OBJECT), value); + return create_generic(ciType::make(T_OBJECT), value, zero_checked); } // Typed conversion from constants of various types public: static SharkValue* jint_constant(jint value) { - SharkValue *result = create_jint(LLVMValue::jint_constant(value)); - if (value != 0) - result->set_zero_checked(true); - return result; + return create_jint(LLVMValue::jint_constant(value), value != 0); } static SharkValue* jlong_constant(jlong value) { - SharkValue *result = create_jlong(LLVMValue::jlong_constant(value)); - if (value != 0) - result->set_zero_checked(true); - return result; + return create_jlong(LLVMValue::jlong_constant(value), value != 0); } static SharkValue* jfloat_constant(jfloat value) { @@ -135,7 +129,7 @@ } static SharkValue* null() { - return create_jobject(LLVMValue::null()); + return create_jobject(LLVMValue::null(), false); } static inline SharkValue* address_constant(int bci); @@ -185,7 +179,7 @@ static inline SharkValue* create_generic(ciType* type, llvm::Value* value, - bool zero_checked = false); + bool zero_checked); // Phi-style stuff public: