Skip to content

Commit

Permalink
[Truffle] Make safepoints not a node or instrument, but just a runtim…
Browse files Browse the repository at this point in the history
…e call.
  • Loading branch information
chrisseaton committed Oct 29, 2014
1 parent d35c59d commit ce10121
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 87 deletions.
2 changes: 2 additions & 0 deletions core/src/main/java/org/jruby/truffle/nodes/RubyRootNode.java
Expand Up @@ -46,6 +46,8 @@ public RubyRootNode cloneRubyRootNode() {

@Override
public Object execute(VirtualFrame frame) {
context.getSafepointManager().poll();

return body.execute(frame);
}

Expand Down
Expand Up @@ -50,6 +50,8 @@ public Object execute(VirtualFrame frame) {
try {
outer: while (true) {
while (true) {
getContext().getSafepointManager().poll();

if (CompilerDirectives.inInterpreter()) {
count++;
}
Expand Down
Expand Up @@ -44,6 +44,8 @@ public TryNode(RubyContext context, SourceSection sourceSection, ExceptionTransl
@Override
public Object execute(VirtualFrame frame) {
while (true) {
getContext().getSafepointManager().poll();

try {
final Object result = tryPart.execute(frame);
elseProfile.enter();
Expand Down
Expand Up @@ -24,8 +24,6 @@
*/
public class WhileNode extends RubyNode {



@Child protected BooleanCastNode condition;
@Child protected RubyNode body;

Expand All @@ -46,6 +44,8 @@ public Object execute(VirtualFrame frame) {
try {
outer: while (condition.executeBoolean(frame)) {
while (true) {
getContext().getSafepointManager().poll();

if (CompilerDirectives.inInterpreter()) {
count++;
}
Expand Down
Expand Up @@ -22,13 +22,7 @@ public class RubyASTProber implements ASTProber {
private final List<RubyNodeProber> probers = new ArrayList<>();

public RubyASTProber() {
if ((boolean) Options.TRUFFLE_TRACE.load()) {
probers.add(new TraceProber());
}

if ((boolean) Options.TRUFFLE_OBJECTSPACE.load()) {
probers.add(new SafepointProber());
}
probers.add(new TraceProber());
}

@Override
Expand Down

This file was deleted.

This file was deleted.

Expand Up @@ -30,6 +30,8 @@ public RedoableNode(RubyContext context, SourceSection sourceSection, RubyNode b
@Override
public Object execute(VirtualFrame frame) {
while (true) {
getContext().getSafepointManager().poll();

try {
return body.execute(frame);
} catch (RedoException e) {
Expand Down
4 changes: 1 addition & 3 deletions core/src/main/java/org/jruby/util/cli/Options.java
Expand Up @@ -130,9 +130,7 @@ public class Options {
public static final Option<Boolean> TRUFFLE_PRINT_RUNTIME = bool(TRUFFLE, "truffle.printRuntime", false, "" +
"Print the name of the Truffle runtime on startup.");
public static final Option<Boolean> TRUFFLE_RUNTIME_VERSION_CHECK = bool(TRUFFLE, "truffle.runtime.version_check", true, "Check the version of Truffle supplied by the JVM before starting.");
public static final Option<Boolean> TRUFFLE_TRACE = bool(TRUFFLE, "truffle.trace", true, "Install trace probes needed for set_trace_func.");
public static final Option<Boolean> TRUFFLE_OBJECTSPACE = bool(TRUFFLE, "truffle.object_space", true, "Install safepoints needed for ObjectSpace.");
public static final Option<Boolean> TRUFFLE_PROC_BINDING = bool(TRUFFLE, "truffle.proc.binding", true, "Implements Proc#binding.");
public static final Option<Boolean> TRUFFLE_PROC_BINDING = bool(TRUFFLE, "truffle.proc.binding", true, "Enable Proc#binding.");
public static final Option<Boolean> TRUFFLE_EXCEPTIONS_PRINT_JAVA = bool(TRUFFLE, "truffle.exceptions.print_java", false, "Print Java exceptions at the point of translating them to Ruby exceptions.");
public static final Option<Integer> TRUFFLE_ARRAYS_UNINITIALIZED_SIZE = integer(TRUFFLE, "truffle.arrays.uninitialized_size", 32, "How large an array to allocate when we have no other information to go on.");
public static final Option<Boolean> TRUFFLE_ARRAYS_OPTIMISTIC_LONG = bool(TRUFFLE, "truffle.arrays.optimistic.long", true, "If we allocate an int[] for an Array and it has been converted to a long[], directly allocate a long[] next time.");
Expand Down

0 comments on commit ce10121

Please sign in to comment.