mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-04 23:48:33 +00:00
8014286: failed java/lang/Math/DivModTests.java after 6934604 changes
Corrected escape state for the result of boxing method. Added force inlining executed boxing methods. Reviewed-by: twisti
This commit is contained in:
parent
2c7c39072c
commit
2ed62e808c
@ -85,20 +85,34 @@ InlineTree::InlineTree(Compile* c, ciMethod* callee_method, JVMState* caller_jvm
|
||||
assert(!UseOldInlining, "do not use for old stuff");
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true when EA is ON and a java constructor is called or
|
||||
* a super constructor is called from an inlined java constructor.
|
||||
* Also return true for boxing methods.
|
||||
*/
|
||||
static bool is_init_with_ea(ciMethod* callee_method,
|
||||
ciMethod* caller_method, Compile* C) {
|
||||
// True when EA is ON and a java constructor is called or
|
||||
// a super constructor is called from an inlined java constructor.
|
||||
return C->do_escape_analysis() && EliminateAllocations &&
|
||||
( callee_method->is_initializer() ||
|
||||
(caller_method->is_initializer() &&
|
||||
caller_method != C->method() &&
|
||||
caller_method->holder()->is_subclass_of(callee_method->holder()))
|
||||
);
|
||||
if (!C->do_escape_analysis() || !EliminateAllocations) {
|
||||
return false; // EA is off
|
||||
}
|
||||
if (callee_method->is_initializer()) {
|
||||
return true; // constuctor
|
||||
}
|
||||
if (caller_method->is_initializer() &&
|
||||
caller_method != C->method() &&
|
||||
caller_method->holder()->is_subclass_of(callee_method->holder())) {
|
||||
return true; // super constructor is called from inlined constructor
|
||||
}
|
||||
if (C->eliminate_boxing() && callee_method->is_boxing_method()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Force inlining unboxing accessor.
|
||||
*/
|
||||
static bool is_unboxing_method(ciMethod* callee_method, Compile* C) {
|
||||
// Force inlining unboxing accessor.
|
||||
return C->eliminate_boxing() && callee_method->is_unboxing_method();
|
||||
}
|
||||
|
||||
|
||||
@ -822,7 +822,16 @@ void ConnectionGraph::add_call_node(CallNode* call) {
|
||||
ptnode_adr(call_idx)->set_scalar_replaceable(false);
|
||||
} else if (meth->is_boxing_method()) {
|
||||
// Returns boxing object
|
||||
add_java_object(call, PointsToNode::NoEscape);
|
||||
PointsToNode::EscapeState es;
|
||||
vmIntrinsics::ID intr = meth->intrinsic_id();
|
||||
if (intr == vmIntrinsics::_floatValue || intr == vmIntrinsics::_doubleValue) {
|
||||
// It does not escape if object is always allocated.
|
||||
es = PointsToNode::NoEscape;
|
||||
} else {
|
||||
// It escapes globally if object could be loaded from cache.
|
||||
es = PointsToNode::GlobalEscape;
|
||||
}
|
||||
add_java_object(call, es);
|
||||
} else {
|
||||
BCEscapeAnalyzer* call_analyzer = meth->get_bcea();
|
||||
call_analyzer->copy_dependencies(_compile->dependencies());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user