comparison graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java @ 2534:4af63190ee3d

Prohibit inlining of synchronized and inlining of method with exception handlers (remove C1XOption).
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Wed, 27 Apr 2011 19:25:26 +0200
parents c480605ef068
children 4a016ff4d2df
comparison
equal deleted inserted replaced
2533:c480605ef068 2534:4af63190ee3d
1053 // If inlining, then returns become gotos to the continuation point. 1053 // If inlining, then returns become gotos to the continuation point.
1054 if (scopeData.continuation() != null) { 1054 if (scopeData.continuation() != null) {
1055 if (isSynchronized(method().accessFlags())) { 1055 if (isSynchronized(method().accessFlags())) {
1056 // if the inlined method is synchronized, then the monitor 1056 // if the inlined method is synchronized, then the monitor
1057 // must be released before jumping to the continuation point 1057 // must be released before jumping to the continuation point
1058 assert C1XOptions.OptInlineSynchronized;
1059 Value object = curState.lockAt(0); 1058 Value object = curState.lockAt(0);
1060 if (object instanceof Instruction) { 1059 if (object instanceof Instruction) {
1061 Instruction obj = (Instruction) object; 1060 Instruction obj = (Instruction) object;
1062 if (!obj.isAppended()) { 1061 if (!obj.isAppended()) {
1063 appendWithoutOptimization(obj, Instruction.SYNCHRONIZATION_ENTRY_BCI); 1062 appendWithoutOptimization(obj, Instruction.SYNCHRONIZATION_ENTRY_BCI);
1467 return cannotInline(target, "inlining excluded by runtime"); 1466 return cannotInline(target, "inlining excluded by runtime");
1468 } 1467 }
1469 if (compilation.runtime.mustNotCompile(target)) { 1468 if (compilation.runtime.mustNotCompile(target)) {
1470 return cannotInline(target, "compile excluded by runtime"); 1469 return cannotInline(target, "compile excluded by runtime");
1471 } 1470 }
1472 if (isSynchronized(target.accessFlags()) && !C1XOptions.OptInlineSynchronized) { 1471 if (isSynchronized(target.accessFlags())) {
1473 return cannotInline(target, "is synchronized"); 1472 return cannotInline(target, "is synchronized");
1474 } 1473 }
1475 if (target.exceptionHandlers().length != 0 && !C1XOptions.OptInlineExcept) { 1474 if (target.exceptionHandlers().length != 0) {
1476 return cannotInline(target, "has exception handlers"); 1475 return cannotInline(target, "has exception handlers");
1477 } 1476 }
1478 if (!target.hasBalancedMonitors()) { 1477 if (!target.hasBalancedMonitors()) {
1479 return cannotInline(target, "has unbalanced monitors"); 1478 return cannotInline(target, "has unbalanced monitors");
1480 } 1479 }