Skip to content

Commit e71e8ab

Browse files
committed
ModuleFields#parentModule should not be CompilationFinal
1 parent 42774c8 commit e71e8ab

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

src/main/java/org/truffleruby/core/module/ModuleChain.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@
99
*/
1010
package org.truffleruby.core.module;
1111

12-
import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
13-
1412
/** Either an IncludedModule, a RubyClass or a RubyModule. Private interface, do not use outside RubyModule. */
1513
public abstract class ModuleChain {
1614

17-
@CompilationFinal protected ModuleChain parentModule;
15+
protected ModuleChain parentModule;
1816

1917
public ModuleChain(ModuleChain parentModule) {
2018
this.parentModule = parentModule;

src/main/java/org/truffleruby/core/module/ModuleFields.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public void updateAnonymousChildrenModules(RubyContext context) {
177177
}
178178
}
179179

180-
private boolean hasPrependedModules() {
180+
public boolean hasPrependedModules() {
181181
return start.getParentModule() != this;
182182
}
183183

src/main/java/org/truffleruby/language/methods/LookupMethodNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ protected InternalMethod lookupMethodUncached(
8989
// Lookup first in the metaclass as we are likely to find the method there
9090
final ModuleFields fields = metaClass.fields;
9191
InternalMethod topMethod;
92-
if (noPrependedModulesProfile.profile(fields.getFirstModuleChain() == fields) &&
92+
if (noPrependedModulesProfile.profile(!fields.hasPrependedModules()) &&
9393
onMetaClassProfile.profile((topMethod = fields.getMethod(name)) != null) &&
9494
!hasRefinementsProfile.profile(declarationContext != null && declarationContext.hasRefinements())) {
9595
method = topMethod;

0 commit comments

Comments
 (0)