Skip to content

Commit

Permalink
Showing 3 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1454,9 +1454,7 @@ public RubyNode coerceFeatureToPath(RubyNode feature) {

@Specialization(guards = "isRubyString(featureString)")
public boolean require(VirtualFrame frame, DynamicObject featureString, @Cached("create()") IndirectCallNode callNode) {
// We transfer because we want the virtual frame when requring but can't compile that code

CompilerDirectives.transferToInterpreter();
CompilerDirectives.bailout("require cannot be compiled but needs the frame");

final String feature = featureString.toString();

@@ -1493,7 +1491,7 @@ public abstract static class RequireRelativeNode extends CoreMethodArrayArgument

@Specialization(guards = "isRubyString(feature)")
public boolean requireRelative(VirtualFrame frame, DynamicObject feature, @Cached("create()") IndirectCallNode callNode) {
CompilerDirectives.transferToInterpreter();
CompilerDirectives.bailout("require cannot be compiled but needs the frame");

final FeatureLoader featureLoader = getContext().getFeatureLoader();

Original file line number Diff line number Diff line change
@@ -525,6 +525,7 @@ public Iterable<Entry<String, RubyConstant>> getConstants() {
return constants.entrySet();
}

@TruffleBoundary
public RubyConstant getConstant(String name) {
return constants.get(name);
}
Original file line number Diff line number Diff line change
@@ -73,7 +73,7 @@ public Object defineModuleWrongParent(VirtualFrame frame, Object lexicalParentOb

public static RubyConstant lookupForExistingModule(VirtualFrame frame, RubyContext context, String name,
DynamicObject lexicalParent, IndirectCallNode callNode) {
CompilerDirectives.transferToInterpreter();
CompilerDirectives.bailout("require cannot be compiled but needs the frame");

RubyConstant constant = Layouts.MODULE.getFields(lexicalParent).getConstant(name);

0 comments on commit 01a69f0

Please sign in to comment.