comparison graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/NodeCost.java @ 14566:6681b9eb3f4c

Truffle: API cleanup and javadoc for CallNodes.
author Christian Humer <christian.humer@gmail.com>
date Mon, 17 Mar 2014 14:29:45 +0100
parents 5d1308c78ddc
children fe5d4383b505
comparison
equal deleted inserted replaced
14565:9c01fabfb167 14566:6681b9eb3f4c
22 * or visit www.oracle.com if you need additional information or have any 22 * or visit www.oracle.com if you need additional information or have any
23 * questions. 23 * questions.
24 */ 24 */
25 package com.oracle.truffle.api.nodes; 25 package com.oracle.truffle.api.nodes;
26 26
27 import com.oracle.truffle.api.*;
28
29 /**
30 * Represents a rough estimate for the cost of a {@link Node}. This estimate can be used by runtime
31 * systems or guest languages to implement heuristics based on Truffle ASTs.
32 *
33 * @see Node#getCost()
34 */
27 public enum NodeCost { 35 public enum NodeCost {
28 36
29 NONE, UNINITIALIZED, MONOMORPHIC, POLYMORPHIC, MEGAMORPHIC; 37 /**
38 * This node has literally no costs and should be ignored for heuristics. This is particularly
39 * useful for wrapper and profiling nodes which should not influence the heuristics.
40 */
41 NONE,
42
43 /**
44 * This node has a {@link CompilerDirectives#transferToInterpreter()} or
45 * {@link CompilerDirectives#transferToInterpreterAndInvalidate()} as its first unconditional
46 * statement.
47 */
48 UNINITIALIZED,
49
50 /**
51 * This node represents a specialized monomorphic version of an operation.
52 */
53 MONOMORPHIC,
54
55 /**
56 * This node represents a polymorphic version of an operation. For multiple chained polymorphic
57 * nodes the first may return {@link #MONOMORPHIC} and all addtional nodes should return
58 * {@link #POLYMORPHIC}.
59 */
60 POLYMORPHIC,
61
62 /**
63 * This node represents a megamorphic version of an operation. This value should only be used if
64 * the operation implementation supports monomorphism and polymorphism otherwise
65 * {@link #MONOMORPHIC} should be used instead.
66 */
67 MEGAMORPHIC;
30 68
31 } 69 }