Skip to content

Commit

Permalink
Cuts out unnecessary constant resetting.
Browse files Browse the repository at this point in the history
  • Loading branch information
yokolet committed Jul 24, 2012
1 parent 9a672d0 commit 7c86662
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
1 change: 1 addition & 0 deletions src/org/jruby/Ruby.java
Expand Up @@ -1281,6 +1281,7 @@ private void initRoot() {
}

private void initCore() {
// this is a hack to avoid NoClassDefFoundError.
org.jruby.runtime.backtrace.FrameType frameType = org.jruby.runtime.backtrace.FrameType.METHOD;
if (profile.allowClass("Data")) {
defineClass("Data", objectClass, ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
Expand Down
14 changes: 2 additions & 12 deletions src/org/jruby/RubyModule.java
Expand Up @@ -3011,7 +3011,7 @@ public IRubyObject getConstantNoConstMissing(String name, boolean inherit, boole
if (constant == null && !isClass() && includeObject) {
constant = iterateConstantNoConstMissing(name, getRuntime().getObject(), inherit);
}

if (constant == null) constant = tryGetConstantIfPossible(getRuntime(), name);

return constant;
Expand Down Expand Up @@ -3479,17 +3479,7 @@ private IRubyObject tryGetConstantIfPossible(Ruby runtime, String name) {
if (method != null) {
try {
Object obj = method.invoke(runtime);
if (obj instanceof IRubyObject) {
if (getSuperClass() != null) {
getSuperClass().storeConstant(name, (IRubyObject)obj);
getSuperClass().invalidateConstantCache();
}
else {
storeConstant(name, (IRubyObject)obj);
invalidateConstantCache();
}
return (IRubyObject)obj;
}
if (obj instanceof IRubyObject) return (IRubyObject)obj;
} catch (IllegalAccessException ex) {
return null;
} catch (IllegalArgumentException ex) {
Expand Down

0 comments on commit 7c86662

Please sign in to comment.