comparison graal/com.oracle.truffle.api/src/com/oracle/truffle/api/frame/VirtualFrame.java @ 7711:960a15fea39a

Make materialized frame also being usable as a packed frame.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Tue, 05 Feb 2013 15:19:17 +0100
parents 5e3d1a68664e
children 494b818b527c
comparison
equal deleted inserted replaced
7668:d19837d236e5 7711:960a15fea39a
33 * {@link VirtualFrame#pack()} method. 33 * {@link VirtualFrame#pack()} method.
34 */ 34 */
35 public interface VirtualFrame extends Frame { 35 public interface VirtualFrame extends Frame {
36 36
37 /** 37 /**
38 * Converts this virtual frame into a packed frame that has no longer direct access to the local
39 * variables. This packing is an important hint to the Truffle optimizer and therefore passing
40 * around a {@link PackedFrame} should be preferred over passing around a {@link VirtualFrame}
41 * when the probability that an unpacking will occur is low.
42 *
43 * @return the packed frame
44 */
45 PackedFrame pack();
46
47 /**
48 * Accesses the caller frame passed in via {@link CallTarget#call}. To get full access, it must 38 * Accesses the caller frame passed in via {@link CallTarget#call}. To get full access, it must
49 * be first unpacked using {@link PackedFrame#unpack()}. 39 * be first unpacked using {@link PackedFrame#unpack()}.
50 * 40 *
51 * @return the caller frame or null if this was a root method call 41 * @return the caller frame or null if this was a root method call
52 */ 42 */
53 PackedFrame getCaller(); 43 PackedFrame getCaller();
54
55 /**
56 * Materializes this frame, which allows it to be stored in a field or cast to
57 * {@link java.lang.Object}. The frame however looses the ability to be packed or to access the
58 * caller frame.
59 *
60 * @return the new materialized frame
61 */
62 MaterializedFrame materialize();
63 } 44 }