Mercurial > hg > truffle
comparison graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/local/SLReadArgumentNode.java @ 14991:64dcb92ee75a
Truffle: Change signature for Truffle calls from (PackedFrame, Arguments) to (Object[]).
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Sun, 06 Apr 2014 17:46:24 +0200 |
parents | afd6fa5e8229 |
children | abe7128ca473 |
comparison
equal
deleted
inserted
replaced
14989:a0dbb3628f2a | 14991:64dcb92ee75a |
---|---|
20 * or visit www.oracle.com if you need additional information or have any | 20 * or visit www.oracle.com if you need additional information or have any |
21 * questions. | 21 * questions. |
22 */ | 22 */ |
23 package com.oracle.truffle.sl.nodes.local; | 23 package com.oracle.truffle.sl.nodes.local; |
24 | 24 |
25 import com.oracle.truffle.api.*; | |
26 import com.oracle.truffle.api.frame.*; | 25 import com.oracle.truffle.api.frame.*; |
27 import com.oracle.truffle.api.utilities.*; | 26 import com.oracle.truffle.api.utilities.*; |
28 import com.oracle.truffle.sl.nodes.*; | 27 import com.oracle.truffle.sl.nodes.*; |
29 import com.oracle.truffle.sl.parser.*; | 28 import com.oracle.truffle.sl.parser.*; |
30 import com.oracle.truffle.sl.runtime.*; | 29 import com.oracle.truffle.sl.runtime.*; |
31 | 30 |
32 /** | 31 /** |
33 * Reads a function argument. Arguments are passed in as a {@link SLArguments} object, which | 32 * Reads a function argument. Arguments are passed in as an object array. |
34 * encapsulates an {@link SLArguments#getFromFrame Object[] array}. Language-defined subclasses of | |
35 * {@link Arguments} are the standard Truffle way to pass values between functions. | |
36 * <p> | 33 * <p> |
37 * Arguments are not type-specialized. To ensure that repeated accesses within a method are | 34 * Arguments are not type-specialized. To ensure that repeated accesses within a method are |
38 * specialized and can, e.g., be accessed without unboxing, all arguments are loaded into local | 35 * specialized and can, e.g., be accessed without unboxing, all arguments are loaded into local |
39 * variables {@link SLNodeFactory#addFormalParameter in the method prologue}. | 36 * variables {@link SLNodeFactory#addFormalParameter in the method prologue}. |
40 */ | 37 */ |
53 this.index = index; | 50 this.index = index; |
54 } | 51 } |
55 | 52 |
56 @Override | 53 @Override |
57 public Object executeGeneric(VirtualFrame frame) { | 54 public Object executeGeneric(VirtualFrame frame) { |
58 Object[] args = SLArguments.getFromFrame(frame); | 55 Object[] args = frame.getArguments(); |
59 if (index < args.length) { | 56 if (index < args.length) { |
60 return args[index]; | 57 return args[index]; |
61 } else { | 58 } else { |
62 /* In the interpreter, record profiling information that the branch was used. */ | 59 /* In the interpreter, record profiling information that the branch was used. */ |
63 outOfBoundsTaken.enter(); | 60 outOfBoundsTaken.enter(); |