annotate truffle/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/FinalFieldTest.java @ 22157:dc83cc1f94f2

Using fully qualified imports
author Jaroslav Tulach <jaroslav.tulach@oracle.com>
date Wed, 16 Sep 2015 11:33:22 +0200
parents 5bc7f7b867ab
children 14e6dfb1ef05
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7267
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
1 /*
11903
df1d665ca846 Truffle; remove uses of Node() constructor in test code
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 7530
diff changeset
2 * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
7267
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
4 *
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
8 *
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
13 * accompanied this code).
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
14 *
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
18 *
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
21 * questions.
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
22 */
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
23 package com.oracle.truffle.api.test;
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
24
22157
dc83cc1f94f2 Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22003
diff changeset
25 import com.oracle.truffle.api.CallTarget;
dc83cc1f94f2 Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22003
diff changeset
26 import com.oracle.truffle.api.Truffle;
dc83cc1f94f2 Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22003
diff changeset
27 import com.oracle.truffle.api.TruffleRuntime;
dc83cc1f94f2 Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22003
diff changeset
28 import com.oracle.truffle.api.frame.VirtualFrame;
dc83cc1f94f2 Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22003
diff changeset
29 import com.oracle.truffle.api.nodes.Node;
dc83cc1f94f2 Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22003
diff changeset
30 import com.oracle.truffle.api.nodes.RootNode;
dc83cc1f94f2 Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22003
diff changeset
31 import org.junit.Assert;
dc83cc1f94f2 Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22003
diff changeset
32 import org.junit.Test;
7267
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
33
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
34 /**
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
35 * <h3>Using Final Fields in Node Classes</h3>
14991
64dcb92ee75a Truffle: Change signature for Truffle calls from (PackedFrame, Arguments) to (Object[]).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 14628
diff changeset
36 *
7267
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
37 * <p>
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7267
diff changeset
38 * The usage of final fields in node classes is highly encouraged. It is beneficial for performance
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7267
diff changeset
39 * to declare every field that is not pointing to a child node as final. This gives the Truffle
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7267
diff changeset
40 * runtime an increased opportunity to optimize this node.
7267
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
41 * </p>
14991
64dcb92ee75a Truffle: Change signature for Truffle calls from (PackedFrame, Arguments) to (Object[]).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 14628
diff changeset
42 *
7267
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
43 * <p>
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7267
diff changeset
44 * If a node has a value which may change at run time, but will rarely do so, it is recommended to
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7267
diff changeset
45 * speculate on the field being final. This involves starting executing with a node where this field
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7267
diff changeset
46 * is final and only if this turns out to be no longer the case, the node is replaced with an
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7267
diff changeset
47 * alternative implementation of the operation (see {@link ReplaceTest}).
7267
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
48 * </p>
14991
64dcb92ee75a Truffle: Change signature for Truffle calls from (PackedFrame, Arguments) to (Object[]).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 14628
diff changeset
49 *
7267
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
50 * <p>
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7267
diff changeset
51 * The next part of the Truffle API introduction is at
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7267
diff changeset
52 * {@link com.oracle.truffle.api.test.ReplaceTest}.
7267
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
53 * </p>
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
54 */
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
55 public class FinalFieldTest {
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
56
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
57 @Test
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
58 public void test() {
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
59 TruffleRuntime runtime = Truffle.getRuntime();
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
60 TestRootNode rootNode = new TestRootNode(new TestChildNode[]{new TestChildNode(20), new TestChildNode(22)});
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
61 CallTarget target = runtime.createCallTarget(rootNode);
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
62 Object result = target.call();
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
63 Assert.assertEquals(42, result);
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
64 }
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
65
14628
a08b8694f556 Truffle: Node API changes
Andreas Woess <andreas.woess@jku.at>
parents: 11903
diff changeset
66 private static class TestRootNode extends RootNode {
7267
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
67
14628
a08b8694f556 Truffle: Node API changes
Andreas Woess <andreas.woess@jku.at>
parents: 11903
diff changeset
68 @Children private final TestChildNode[] children;
7267
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
69
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
70 public TestRootNode(TestChildNode[] children) {
22003
5bc7f7b867ab Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 21951
diff changeset
71 super(TestingLanguage.class, null, null);
14628
a08b8694f556 Truffle: Node API changes
Andreas Woess <andreas.woess@jku.at>
parents: 11903
diff changeset
72 this.children = children;
7267
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
73 }
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
74
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
75 @Override
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
76 public Object execute(VirtualFrame frame) {
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
77 int sum = 0;
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
78 for (int i = 0; i < children.length; ++i) {
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
79 sum += children[i].execute();
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
80 }
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
81 return sum;
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
82 }
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
83 }
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
84
14628
a08b8694f556 Truffle: Node API changes
Andreas Woess <andreas.woess@jku.at>
parents: 11903
diff changeset
85 private static class TestChildNode extends Node {
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7267
diff changeset
86
7267
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
87 private final int value;
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
88
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
89 public TestChildNode(int value) {
11903
df1d665ca846 Truffle; remove uses of Node() constructor in test code
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 7530
diff changeset
90 super(null);
7267
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
91 this.value = value;
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
92 }
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
93
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
94 public int execute() {
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
95 return value;
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
96 }
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
97 }
a4b84ba6dc2e Introduction of the Truffle API for efficient implementation of dynamic languages on top of the Graal VM. New projects com.oracle.truffle.api for the API definition and com.oracle.truffle.api.test for API tests and documentation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
98 }