Skip to content

Commit

Permalink
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -30,8 +30,8 @@ public class ReadKeywordArgumentNode extends RubyNode {
private final int kwIndex;
private final ValueProfile argumentValueProfile = ValueProfile.createPrimitiveProfile();

private ConditionProfile optimizedProfile = ConditionProfile.createBinaryProfile();
private ConditionProfile defaultProfile = ConditionProfile.createBinaryProfile();
private final ConditionProfile optimizedProfile = ConditionProfile.createBinaryProfile();
private final ConditionProfile defaultProfile = ConditionProfile.createBinaryProfile();

@Child private RubyNode defaultValue;

Original file line number Diff line number Diff line change
@@ -215,7 +215,7 @@ public Object div(VirtualFrame frame, double a, Object b) {
@CoreMethod(names = "%", required = 1)
public abstract static class ModNode extends CoreMethodArrayArgumentsNode {

private ConditionProfile lessThanZeroProfile = ConditionProfile.createBinaryProfile();
private final ConditionProfile lessThanZeroProfile = ConditionProfile.createBinaryProfile();

public ModNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
Original file line number Diff line number Diff line change
@@ -1660,7 +1660,7 @@ public int size(DynamicObject string) {
@CoreMethod(names = "squeeze!", rest = true, raiseIfFrozenSelf = true)
public abstract static class SqueezeBangNode extends CoreMethodArrayArgumentsNode {

private ConditionProfile singleByteOptimizableProfile = ConditionProfile.createBinaryProfile();
private final ConditionProfile singleByteOptimizableProfile = ConditionProfile.createBinaryProfile();

@Child private ToStrNode toStrNode;

Original file line number Diff line number Diff line change
@@ -1663,7 +1663,7 @@ public int doInteger(VirtualFrame frame, DynamicObject module, String name) {
@CoreMethod(names = "sign")
public abstract static class SignNode extends BigDecimalCoreMethodArrayArgumentsNode {

final private ConditionProfile positive = ConditionProfile.createBinaryProfile();
private final ConditionProfile positive = ConditionProfile.createBinaryProfile();
@Child private GetIntegerConstantNode sign;

public SignNode(RubyContext context, SourceSection sourceSection) {

3 comments on commit 7b78f76

@pitr-ch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add a test for this? Maybe in general it could be helpful to have similar rules machine-checked.

Sorry, something went wrong.

@eregon
Copy link
Member Author

@eregon eregon commented on 7b78f76 Sep 15, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'll discuss with Andreas, there are already perf warnings in truffle.
OTOH it's very obvious to see such problems in IGV.

Sorry, something went wrong.

@eregon
Copy link
Member Author

@eregon eregon commented on 7b78f76 Sep 15, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The -J-G:+TraceTrufflePerformanceWarnings flag would show:

[truffle] perf warn        not inlined Virtual call to HotSpotMethod<ConditionProfile.profile(boolean)> (34|MethodCallTarget)

And it's sort of hard to make it better: annotation processors need annotations, hacking it at the Truffle/Graal level seems pretty much a hack, etc

Please sign in to comment.