-
-
Notifications
You must be signed in to change notification settings - Fork 925
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Truffle] Add RubyStatement wrapper node.
1 parent
a378e52
commit 2786a43
Showing
5 changed files
with
42 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
truffle/src/main/java/org/jruby/truffle/nodes/RubyStatementNode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved. This | ||
* code is released under a tri EPL/GPL/LGPL license. You can use it, | ||
* redistribute it and/or modify it under the terms of the: | ||
* | ||
* Eclipse Public License version 1.0 | ||
* GNU General Public License version 2 | ||
* GNU Lesser General Public License version 2.1 | ||
*/ | ||
package org.jruby.truffle.nodes; | ||
|
||
import com.oracle.truffle.api.frame.VirtualFrame; | ||
import com.oracle.truffle.api.instrumentation.Instrumentable; | ||
import com.oracle.truffle.api.instrumentation.InstrumentationTag; | ||
|
||
@Instrumentable(tags = {InstrumentationTag.STATEMENT}, factory = RubyStatementNodeWrapper.class) | ||
public class RubyStatementNode extends RubyNode { | ||
|
||
@Child private RubyNode child; | ||
|
||
public RubyStatementNode(RubyNode child) { | ||
super(child.getContext(), child.getSourceSection()); | ||
this.child = child; | ||
} | ||
|
||
public RubyStatementNode(RubyStatementNode node) { | ||
this((RubyNode) node.child.deepCopy()); | ||
} | ||
|
||
@Override | ||
public Object execute(VirtualFrame frame) { | ||
return child.execute(frame); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters