< prev index next >

src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp

Print this page

*** 1928,1956 **** ShouldNotReachHere(); } } ! void LIR_Assembler::emit_opFlattenedStoreCheck(LIR_OpFlattenedStoreCheck* op) { ! Klass* k = (Klass*)(op->element_klass()->constant_encoding()); ! assert(k->is_klass(), "must be a loaded klass"); ! add_debug_info_for_null_check_here(op->info_for_exception()); ! ! #ifdef _LP64 ! if (UseCompressedClassPointers) { ! __ movl(op->tmp1()->as_register(), Address(op->object()->as_register(), oopDesc::klass_offset_in_bytes())); ! __ cmp_narrow_klass(op->tmp1()->as_register(), k); ! } else { ! __ movq(op->tmp1()->as_register(), Address(op->object()->as_register(), oopDesc::klass_offset_in_bytes())); ! __ cmpq(op->tmp1()->as_register(), op->tmp2()->as_register()); } ! #else ! Unimplemented(); // FIXME ! #endif ! __ jcc(Assembler::notEqual, *op->stub()->entry()); ! __ bind(*op->stub()->continuation()); } void LIR_Assembler::emit_compare_and_swap(LIR_OpCompareAndSwap* op) { if (LP64_ONLY(false &&) op->code() == lir_cas_long && VM_Version::supports_cx8()) { assert(op->cmp_value()->as_register_lo() == rax, "wrong register"); --- 1928,1964 ---- ShouldNotReachHere(); } } ! void LIR_Assembler::emit_opFlattenedArrayCheck(LIR_OpFlattenedArrayCheck* op) { ! // We are loading/storing an array that *may* be a flattened array (e.g., the declared type ! // is Object[]). If this array is flattened, take slow path. ! ! __ load_storage_props(op->tmp()->as_register(), op->array()->as_register()); ! __ testb(op->tmp()->as_register(), ArrayStorageProperties::flattened_value); ! __ jcc(Assembler::notZero, *op->stub()->entry()); ! if (!op->value()->is_illegal()) { ! // We are storing into the array. ! Label skip; ! __ testb(op->tmp()->as_register(), ArrayStorageProperties::null_free_value); ! __ jcc(Assembler::zero, skip); ! // The array is not flattened, but it is null_free. If we are storing ! // a null, take the slow path (which will throw NPE). ! __ cmpptr(op->value()->as_register(), (int32_t)NULL_WORD); ! __ jcc(Assembler::zero, *op->stub()->entry()); ! __ bind(skip); } ! } ! void LIR_Assembler::emit_opNullFreeArrayCheck(LIR_OpNullFreeArrayCheck* op) { ! // This is called when we use aastore into a an array declared as "[LVT;", ! // where we know VT is not flattenable (due to ValueArrayElemMaxFlatOops, etc). ! // However, we need to do a NULL check if the actual array is a "QLVT;". ! ! __ load_storage_props(op->tmp()->as_register(), op->array()->as_register()); ! __ testb(op->tmp()->as_register(), ArrayStorageProperties::null_free_value); } void LIR_Assembler::emit_compare_and_swap(LIR_OpCompareAndSwap* op) { if (LP64_ONLY(false &&) op->code() == lir_cas_long && VM_Version::supports_cx8()) { assert(op->cmp_value()->as_register_lo() == rax, "wrong register");
*** 3101,3111 **** __ resolve(ACCESS_WRITE, dst); CodeStub* stub = op->stub(); int flags = op->flags(); BasicType basic_type = default_type != NULL ? default_type->element_type()->basic_type() : T_ILLEGAL; ! if (basic_type == T_ARRAY) basic_type = T_OBJECT; if (flags & LIR_OpArrayCopy::always_slow_path) { __ jmp(*stub->entry()); __ bind(*stub->continuation()); return; --- 3109,3119 ---- __ resolve(ACCESS_WRITE, dst); CodeStub* stub = op->stub(); int flags = op->flags(); BasicType basic_type = default_type != NULL ? default_type->element_type()->basic_type() : T_ILLEGAL; ! if (basic_type == T_ARRAY || basic_type == T_VALUETYPE) basic_type = T_OBJECT; if (flags & LIR_OpArrayCopy::always_slow_path) { __ jmp(*stub->entry()); __ bind(*stub->continuation()); return;
*** 3117,3136 **** if (flags & LIR_OpArrayCopy::dst_flat_check) { arraycopy_flat_check(dst, tmp, stub); } - if (basic_type == T_VALUETYPE) { - assert(flags & (LIR_OpArrayCopy::always_slow_path | - LIR_OpArrayCopy::src_flat_check | - LIR_OpArrayCopy::dst_flat_check), "must have checked"); - // If either src or dst is (or maybe) a flattened array, one of the 3 checks - // above would have caught it, and taken the slow path. So when we come here, - // the array must be a (non-flat) object array. - basic_type = T_OBJECT; - } - // if we don't know anything, just go through the generic arraycopy if (default_type == NULL) { // save outgoing arguments on stack in case call to System.arraycopy is needed // HACK ALERT. This code used to push the parameters in a hardwired fashion // for interpreter calling conventions. Now we have to do it in new style conventions. --- 3125,3134 ----
< prev index next >