提交 f317413f 编写于 作者: J jcoomes

Merge

......@@ -257,6 +257,18 @@ const char* InlineTree::should_not_inline(ciMethod *callee_method, ciMethod* cal
return "exception method";
}
if (callee_method->should_not_inline()) {
return "disallowed by CompilerOracle";
}
if (UseStringCache) {
// Do not inline StringCache::profile() method used only at the beginning.
if (callee_method->name() == ciSymbol::profile_name() &&
callee_method->holder()->name() == ciSymbol::java_lang_StringCache()) {
return "profiling method";
}
}
// use frequency-based objections only for non-trivial methods
if (callee_method->code_size_for_inlining() <= MaxTrivialSize) return NULL;
......@@ -278,18 +290,6 @@ const char* InlineTree::should_not_inline(ciMethod *callee_method, ciMethod* cal
}
}
if (callee_method->should_not_inline()) {
return "disallowed by CompilerOracle";
}
if (UseStringCache) {
// Do not inline StringCache::profile() method used only at the beginning.
if (callee_method->name() == ciSymbol::profile_name() &&
callee_method->holder()->name() == ciSymbol::java_lang_StringCache()) {
return "profiling method";
}
}
return NULL;
}
......
/*
* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2012, 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
......@@ -465,6 +465,9 @@
notproduct(bool, PrintOptimizePtrCompare, false, \
"Print information about optimized pointers compare") \
\
notproduct(bool, VerifyConnectionGraph , true, \
"Verify Connection Graph construction in Escape Analysis") \
\
product(bool, UseOptoBiasInlining, true, \
"Generate biased locking code in C2 ideal graph") \
\
......
/*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2012, 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
......@@ -1538,10 +1538,7 @@ Node *LockNode::Ideal(PhaseGVN *phase, bool can_reshape) {
// If we are locking an unescaped object, the lock/unlock is unnecessary
//
ConnectionGraph *cgr = phase->C->congraph();
PointsToNode::EscapeState es = PointsToNode::GlobalEscape;
if (cgr != NULL)
es = cgr->escape_state(obj_node());
if (es != PointsToNode::UnknownEscape && es != PointsToNode::GlobalEscape) {
if (cgr != NULL && cgr->not_global_escape(obj_node())) {
assert(!is_eliminated() || is_coarsened(), "sanity");
// The lock could be marked eliminated by lock coarsening
// code during first IGVN before EA. Replace coarsened flag
......@@ -1680,10 +1677,7 @@ Node *UnlockNode::Ideal(PhaseGVN *phase, bool can_reshape) {
// If we are unlocking an unescaped object, the lock/unlock is unnecessary.
//
ConnectionGraph *cgr = phase->C->congraph();
PointsToNode::EscapeState es = PointsToNode::GlobalEscape;
if (cgr != NULL)
es = cgr->escape_state(obj_node());
if (es != PointsToNode::UnknownEscape && es != PointsToNode::GlobalEscape) {
if (cgr != NULL && cgr->not_global_escape(obj_node())) {
assert(!is_eliminated() || is_coarsened(), "sanity");
// The lock could be marked eliminated by lock coarsening
// code during first IGVN before EA. Replace coarsened flag
......
/*
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2012, 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
......@@ -546,6 +546,12 @@ public:
// or result projection is there are several CheckCastPP
// or returns NULL if there is no one.
Node *result_cast();
// Does this node returns pointer?
bool returns_pointer() const {
const TypeTuple *r = tf()->range();
return (r->cnt() > TypeFunc::Parms &&
r->field_at(TypeFunc::Parms)->isa_ptr());
}
// Collect all the interesting edges from a call for use in
// replacing the call by something else. Used by macro expansion
......
/*
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2012, 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
......@@ -1707,7 +1707,6 @@ void Compile::Optimize() {
if (major_progress()) print_method("PhaseIdealLoop before EA", 2);
if (failing()) return;
}
TracePhase t2("escapeAnalysis", &_t_escapeAnalysis, true);
ConnectionGraph::do_analysis(this, &igvn);
if (failing()) return;
......@@ -1719,6 +1718,7 @@ void Compile::Optimize() {
if (failing()) return;
if (congraph() != NULL && macro_count() > 0) {
NOT_PRODUCT( TracePhase t2("macroEliminate", &_t_macroEliminate, TimeCompiler); )
PhaseMacroExpand mexp(igvn);
mexp.eliminate_macro_nodes();
igvn.set_delay_transform(false);
......@@ -1875,10 +1875,10 @@ void Compile::Code_Gen() {
cfg.Estimate_Block_Frequency();
cfg.GlobalCodeMotion(m,unique(),proj_list);
if (failing()) return;
print_method("Global code motion", 2);
if (failing()) return;
NOT_PRODUCT( verify_graph_edges(); )
debug_only( cfg.verify(); )
......
此差异已折叠。
此差异已折叠。
/*
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2012, 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
......@@ -39,8 +39,9 @@ elapsedTimer Phase::_t_stubCompilation;
// The next timers used for LogCompilation
elapsedTimer Phase::_t_parser;
elapsedTimer Phase::_t_escapeAnalysis;
elapsedTimer Phase::_t_optimizer;
elapsedTimer Phase::_t_escapeAnalysis;
elapsedTimer Phase::_t_connectionGraph;
elapsedTimer Phase::_t_idealLoop;
elapsedTimer Phase::_t_ccp;
elapsedTimer Phase::_t_matcher;
......@@ -51,6 +52,7 @@ elapsedTimer Phase::_t_output;
elapsedTimer Phase::_t_graphReshaping;
elapsedTimer Phase::_t_scheduler;
elapsedTimer Phase::_t_blockOrdering;
elapsedTimer Phase::_t_macroEliminate;
elapsedTimer Phase::_t_macroExpand;
elapsedTimer Phase::_t_peephole;
elapsedTimer Phase::_t_codeGeneration;
......@@ -104,6 +106,8 @@ void Phase::print_timers() {
if (DoEscapeAnalysis) {
// EA is part of Optimizer.
tty->print_cr (" escape analysis: %3.3f sec", Phase::_t_escapeAnalysis.seconds());
tty->print_cr (" connection graph: %3.3f sec", Phase::_t_connectionGraph.seconds());
tty->print_cr (" macroEliminate : %3.3f sec", Phase::_t_macroEliminate.seconds());
}
tty->print_cr (" iterGVN : %3.3f sec", Phase::_t_iterGVN.seconds());
tty->print_cr (" idealLoop : %3.3f sec", Phase::_t_idealLoop.seconds());
......@@ -112,9 +116,10 @@ void Phase::print_timers() {
tty->print_cr (" iterGVN2 : %3.3f sec", Phase::_t_iterGVN2.seconds());
tty->print_cr (" macroExpand : %3.3f sec", Phase::_t_macroExpand.seconds());
tty->print_cr (" graphReshape : %3.3f sec", Phase::_t_graphReshaping.seconds());
double optimizer_subtotal = Phase::_t_iterGVN.seconds() +
double optimizer_subtotal = Phase::_t_iterGVN.seconds() + Phase::_t_iterGVN2.seconds() +
Phase::_t_escapeAnalysis.seconds() + Phase::_t_macroEliminate.seconds() +
Phase::_t_idealLoop.seconds() + Phase::_t_ccp.seconds() +
Phase::_t_graphReshaping.seconds();
Phase::_t_macroExpand.seconds() + Phase::_t_graphReshaping.seconds();
double percent_of_optimizer = ((optimizer_subtotal == 0.0) ? 0.0 : (optimizer_subtotal / Phase::_t_optimizer.seconds() * 100.0));
tty->print_cr (" subtotal : %3.3f sec, %3.2f %%", optimizer_subtotal, percent_of_optimizer);
}
......
/*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2012, 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
......@@ -72,8 +72,12 @@ protected:
// The next timers used for LogCompilation
static elapsedTimer _t_parser;
static elapsedTimer _t_escapeAnalysis;
static elapsedTimer _t_optimizer;
public:
// ConnectionGraph can't be Phase since it is used after EA done.
static elapsedTimer _t_escapeAnalysis;
static elapsedTimer _t_connectionGraph;
protected:
static elapsedTimer _t_idealLoop;
static elapsedTimer _t_ccp;
static elapsedTimer _t_matcher;
......@@ -84,6 +88,7 @@ protected:
static elapsedTimer _t_graphReshaping;
static elapsedTimer _t_scheduler;
static elapsedTimer _t_blockOrdering;
static elapsedTimer _t_macroEliminate;
static elapsedTimer _t_macroExpand;
static elapsedTimer _t_peephole;
static elapsedTimer _t_codeGeneration;
......
......@@ -2523,15 +2523,6 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
// was arrived at by experimenting with specjbb.
FLAG_SET_CMDLINE(uintx, OldPLABSize, 8*K); // Note: this is in words
// CompilationPolicyChoice=0 causes the server compiler to adopt
// a more conservative which-method-do-I-compile policy when one
// of the counters maintained by the interpreter trips. The
// result is reduced startup time and improved specjbb and
// alacrity performance. Zero is the default, but we set it
// explicitly here in case the default changes.
// See runtime/compilationPolicy.*.
FLAG_SET_CMDLINE(intx, CompilationPolicyChoice, 0);
// Enable parallel GC and adaptive generation sizing
FLAG_SET_CMDLINE(bool, UseParallelGC, true);
FLAG_SET_DEFAULT(ParallelGCThreads,
......
/*
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2012, 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
......@@ -198,8 +198,11 @@ template<class E> class GrowableArray : public GenericGrowableArray {
return idx;
}
void append_if_missing(const E& elem) {
if (!contains(elem)) append(elem);
bool append_if_missing(const E& elem) {
// Returns TRUE if elem is added.
bool missed = !contains(elem);
if (missed) append(elem);
return missed;
}
E at(int i) const {
......@@ -292,12 +295,22 @@ template<class E> class GrowableArray : public GenericGrowableArray {
ShouldNotReachHere();
}
// The order is preserved.
void remove_at(int index) {
assert(0 <= index && index < _len, "illegal index");
for (int j = index + 1; j < _len; j++) _data[j-1] = _data[j];
_len--;
}
// The order is changed.
void delete_at(int index) {
assert(0 <= index && index < _len, "illegal index");
if (index < --_len) {
// Replace removed element with last one.
_data[index] = _data[_len];
}
}
// inserts the given element before the element at index i
void insert_before(const int idx, const E& elem) {
check_nesting();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册