Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4e39894428e2
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 913b0daf838d
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Feb 24, 2017

  1. Improve some of the debug logging in ConstantLookupSite.

    Added this while debugging an issue, figured it'd be useful
    upstream. Adds the method name to the log statement + adds
    logging for searchModuleForConst. Spelling out the method
    name is useful to distinguish between lexicalSearchConst
    and searchConst, but also makes it easier to map the log
    statements with the origin method when you're not familiar
    with the code.
    snowp committed Feb 24, 2017
    Copy the full SHA
    d276fc9 View commit details
  2. Merge pull request #4504 from snowp/snowp/add-logging

    Improve some of the debug logging in ConstantLookupSite.
    headius authored Feb 24, 2017
    Copy the full SHA
    913b0da View commit details
Showing with 7 additions and 3 deletions.
  1. +7 −3 core/src/main/java/org/jruby/ir/targets/ConstantLookupSite.java
10 changes: 7 additions & 3 deletions core/src/main/java/org/jruby/ir/targets/ConstantLookupSite.java
Original file line number Diff line number Diff line change
@@ -97,7 +97,7 @@ public IRubyObject searchConst(ThreadContext context, StaticScope staticScope) {
setTarget(switchPoint.guardWithTest(target, fallback));

if (Options.INVOKEDYNAMIC_LOG_CONSTANTS.load()) {
LOG.info(name + "\tretrieved and cached from scope " + staticScope.getIRScope());
LOG.info(name + "\tretrieved and cached from scope (searchConst) " + staticScope.getIRScope());
}

return constant;
@@ -122,6 +122,10 @@ public IRubyObject searchModuleForConst(ThreadContext context, IRubyObject cmVal
// bind constant until invalidated
bind(runtime, module, constant, SMFC());

if (Options.INVOKEDYNAMIC_LOG_CONSTANTS.load()) {
LOG.info(name + "\tretrieved and cached from module (searchModuleForConst) " + cmVal.getMetaClass());// + " added to PIC" + extractSourceInfo(site));
}

return constant;
}

@@ -166,7 +170,7 @@ public IRubyObject inheritanceSearchConst(ThreadContext context, IRubyObject cmV
tracker.addType(module.id);

if (Options.INVOKEDYNAMIC_LOG_CONSTANTS.load()) {
LOG.info(name + "\tconstant cached from type " + cmVal.getMetaClass());
LOG.info(name + "\tconstant cached from type (inheritanceSearchConst) " + cmVal.getMetaClass());
}

return constant;
@@ -277,7 +281,7 @@ public IRubyObject lexicalSearchConst(ThreadContext context, StaticScope scope)
setTarget(switchPoint.guardWithTest(target, fallback));

if (Options.INVOKEDYNAMIC_LOG_CONSTANTS.load()) {
LOG.info(name + "\tretrieved and cached from scope " + scope.getIRScope());// + " added to PIC" + extractSourceInfo(site));
LOG.info(name + "\tretrieved and cached from scope (lexicalSearchConst) " + scope.getIRScope());// + " added to PIC" + extractSourceInfo(site));
}

return constant;