Skip to content

Commit

Permalink
Showing 2 changed files with 0 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -105,7 +105,6 @@ public AsciiCompatibleNode(RubyContext context, SourceSection sourceSection) {

@Specialization
public Object isCompatible(DynamicObject encoding) {
CompilerDirectives.transferToInterpreter();
return EncodingOperations.getEncoding(encoding).isAsciiCompatible();
}
}
Original file line number Diff line number Diff line change
@@ -26,8 +26,6 @@ public static Encoding getEncoding(DynamicObject rubyEncoding) {
Encoding encoding = Layouts.ENCODING.getEncoding(rubyEncoding);

if (encoding == null) {
CompilerDirectives.transferToInterpreter();

This comment has been minimized.

Copy link
@eregon

eregon Mar 10, 2016

Member

This one might be fine, since it can only happen a rather small and fixed number of times and is likely to never happen in compiled code (you would need to call getEncoding in the compiled code on an encoding on which getEncoding was never called in the interpreter).

This comment has been minimized.

Copy link
@nirvdrum

nirvdrum Mar 10, 2016

Author Contributor

Right. I forgot each encoding can only be instantiated once.

final ByteList name = Layouts.ENCODING.getName(rubyEncoding);
encoding = loadEncoding(name);
Layouts.ENCODING.setEncoding(rubyEncoding, encoding);

0 comments on commit 3935f7e

Please sign in to comment.