src/share/vm/opto/library_call.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
*** old/src/share/vm/opto/library_call.cpp Thu Feb 24 12:43:04 2011
--- new/src/share/vm/opto/library_call.cpp Thu Feb 24 12:43:04 2011
*** 1,7 ****
--- 1,7 ----
/*
! * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
! * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 95,105 ****
--- 95,105 ----
Node* generate_limit_guard(Node* offset, Node* subseq_length,
Node* array_length,
RegionNode* region);
Node* generate_current_thread(Node* &tls_output);
address basictype2arraycopy(BasicType t, Node *src_offset, Node *dest_offset,
! bool disjoint_bases, const char* &name, bool need_pre_barrier = true);
Node* load_mirror_from_klass(Node* klass);
Node* load_klass_from_mirror_common(Node* mirror, bool never_see_null,
int nargs,
RegionNode* region, int null_path,
int offset);
*** 219,239 ****
--- 219,239 ----
Node* copy_length);
Node* generate_checkcast_arraycopy(const TypePtr* adr_type,
Node* dest_elem_klass,
Node* src, Node* src_offset,
Node* dest, Node* dest_offset,
! Node* copy_length, bool need_pre_barrier = true);
Node* generate_generic_arraycopy(const TypePtr* adr_type,
Node* src, Node* src_offset,
Node* dest, Node* dest_offset,
Node* copy_length);
void generate_unchecked_arraycopy(const TypePtr* adr_type,
BasicType basic_elem_type,
bool disjoint_bases,
Node* src, Node* src_offset,
Node* dest, Node* dest_offset,
! Node* copy_length, bool need_pre_barrier = true);
bool inline_unsafe_CAS(BasicType type);
bool inline_unsafe_ordered_store(BasicType type);
bool inline_fp_conversions(vmIntrinsics::ID id);
bool inline_numberOfLeadingZeros(vmIntrinsics::ID id);
bool inline_numberOfTrailingZeros(vmIntrinsics::ID id);
*** 4293,4311 ****
--- 4293,4315 ----
};
// Note: The condition "disjoint" applies also for overlapping copies
// where an descending copy is permitted (i.e., dest_offset <= src_offset).
static address
! select_arraycopy_function(BasicType t, bool aligned, bool disjoint, const char* &name, bool need_pre_barrier) {
int selector =
(aligned ? COPYFUNC_ALIGNED : COPYFUNC_UNALIGNED) +
(disjoint ? COPYFUNC_DISJOINT : COPYFUNC_CONJOINT);
#define RETURN_STUB(xxx_arraycopy) { \
name = #xxx_arraycopy; \
return StubRoutines::xxx_arraycopy(); }
+ #define RETURN_STUB_PARM(xxx_arraycopy, parm) { \
+ name = #xxx_arraycopy; \
+ return StubRoutines::xxx_arraycopy(parm); }
+
switch (t) {
case T_BYTE:
case T_BOOLEAN:
switch (selector) {
case COPYFUNC_CONJOINT | COPYFUNC_UNALIGNED: RETURN_STUB(jbyte_arraycopy);
*** 4338,4366 ****
--- 4342,4372 ----
case COPYFUNC_DISJOINT | COPYFUNC_ALIGNED: RETURN_STUB(arrayof_jlong_disjoint_arraycopy);
}
case T_ARRAY:
case T_OBJECT:
switch (selector) {
! case COPYFUNC_CONJOINT | COPYFUNC_UNALIGNED: RETURN_STUB_PARM(oop_arraycopy, need_pre_barrier);
! case COPYFUNC_CONJOINT | COPYFUNC_ALIGNED: RETURN_STUB_PARM(arrayof_oop_arraycopy, need_pre_barrier);
! case COPYFUNC_DISJOINT | COPYFUNC_UNALIGNED: RETURN_STUB_PARM(oop_disjoint_arraycopy, need_pre_barrier);
! case COPYFUNC_DISJOINT | COPYFUNC_ALIGNED: RETURN_STUB_PARM(arrayof_oop_disjoint_arraycopy, need_pre_barrier);
}
default:
ShouldNotReachHere();
return NULL;
}
#undef RETURN_STUB
+ #undef RETURN_STUB_PARM
}
//------------------------------basictype2arraycopy----------------------------
address LibraryCallKit::basictype2arraycopy(BasicType t,
Node* src_offset,
Node* dest_offset,
bool disjoint_bases,
! const char* &name) {
! const char* &name,
+ bool need_pre_barrier) {
const TypeInt* src_offset_inttype = gvn().find_int_type(src_offset);;
const TypeInt* dest_offset_inttype = gvn().find_int_type(dest_offset);;
bool aligned = false;
bool disjoint = disjoint_bases;
*** 4382,4392 ****
--- 4388,4398 ----
} else if (src_offset == dest_offset && src_offset != NULL) {
// This can occur if the offsets are identical non-constants.
disjoint = true;
}
! return select_arraycopy_function(t, aligned, disjoint, name, need_pre_barrier);
}
//------------------------------inline_arraycopy-----------------------
bool LibraryCallKit::inline_arraycopy() {
*** 4772,4782 ****
--- 4778,4788 ----
Node* n1 = LoadKlassNode::make(_gvn, immutable_memory(), p1, TypeRawPtr::BOTTOM);
Node* dest_elem_klass = _gvn.transform(n1);
Node* cv = generate_checkcast_arraycopy(adr_type,
dest_elem_klass,
src, src_offset, dest, dest_offset,
! ConvI2X(copy_length), !must_clear_dest);
if (cv == NULL) cv = intcon(-1); // failure (no stub available)
checked_control = control();
checked_i_o = i_o();
checked_mem = memory(adr_type);
checked_value = cv;
*** 4795,4805 ****
--- 4801,4811 ----
if (!stopped()) {
// Generate the fast path, if possible.
PreserveJVMState pjvms(this);
generate_unchecked_arraycopy(adr_type, copy_type, disjoint_bases,
src, src_offset, dest, dest_offset,
! ConvI2X(copy_length), !must_clear_dest);
// Present the results of the fast call.
result_region->init_req(fast_path, control());
result_i_o ->init_req(fast_path, i_o());
result_memory->init_req(fast_path, memory(adr_type));
*** 5202,5215 ****
--- 5208,5221 ----
Node*
LibraryCallKit::generate_checkcast_arraycopy(const TypePtr* adr_type,
Node* dest_elem_klass,
Node* src, Node* src_offset,
Node* dest, Node* dest_offset,
! Node* copy_length, bool need_pre_barrier) {
if (stopped()) return NULL;
! address copyfunc_addr = StubRoutines::checkcast_arraycopy(need_pre_barrier);
if (copyfunc_addr == NULL) { // Stub was not generated, go slow path.
return NULL;
}
// Pick out the parameters required to perform a store-check
*** 5266,5276 ****
--- 5272,5282 ----
LibraryCallKit::generate_unchecked_arraycopy(const TypePtr* adr_type,
BasicType basic_elem_type,
bool disjoint_bases,
Node* src, Node* src_offset,
Node* dest, Node* dest_offset,
! Node* copy_length, bool need_pre_barrier) {
if (stopped()) return; // nothing to do
Node* src_start = src;
Node* dest_start = dest;
if (src_offset != NULL || dest_offset != NULL) {
*** 5281,5291 ****
--- 5287,5297 ----
// Figure out which arraycopy runtime method to call.
const char* copyfunc_name = "arraycopy";
address copyfunc_addr =
basictype2arraycopy(basic_elem_type, src_offset, dest_offset,
! disjoint_bases, copyfunc_name, need_pre_barrier);
// Call it. Note that the count_ix value is not scaled to a byte-size.
make_runtime_call(RC_LEAF|RC_NO_FP,
OptoRuntime::fast_arraycopy_Type(),
copyfunc_addr, copyfunc_name, adr_type,
src/share/vm/opto/library_call.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File