Skip to content

Commit

Permalink
[Truffle] Move Kernel#fork to Ruby.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisseaton committed Nov 2, 2016
1 parent adaf871 commit b254e25
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
Expand Up @@ -814,19 +814,6 @@ private void exec(RubyContext context, DynamicObject envAsHash, String[] command

}

@CoreMethod(names = "fork", isModuleFunction = true, rest = true, unsafe = UnsafeGroup.PROCESSES)
public abstract static class ForkNode extends CoreMethodArrayArgumentsNode {

@TruffleBoundary
@Specialization
public Object fork(Object[] args) {
final SourceSection sourceSection = getContext().getCallStack().getTopMostUserCallNode().getEncapsulatingSourceSection();
getContext().getJRubyRuntime().getWarnings().warn(IRubyWarnings.ID.TRUFFLE, sourceSection.getSource().getName(), sourceSection.getStartLine(), "Kernel#fork not implemented - defined to satisfy some metaprogramming in RubySpec");
return nil();
}

}

@CoreMethod(names = "freeze")
public abstract static class KernelFreezeNode extends CoreMethodArrayArgumentsNode {

Expand Down
5 changes: 5 additions & 0 deletions truffle/src/main/ruby/core/kernel.rb
Expand Up @@ -673,4 +673,9 @@ def global_variables
end
module_function :global_variables

def fork
raise RubyTruffleError.new('Kernel#fork not implemented')
end
module_function :fork

end

0 comments on commit b254e25

Please sign in to comment.