74 public static final int GET_METHOD_ELEMENT = 3; |
75 public static final int GET_METHOD_ELEMENT = 3; |
75 /** Property setter operation {@code obj.prop = value} */ |
76 /** Property setter operation {@code obj.prop = value} */ |
76 public static final int SET_PROPERTY = 4; |
77 public static final int SET_PROPERTY = 4; |
77 /** Element setter operation {@code obj[index] = value} */ |
78 /** Element setter operation {@code obj[index] = value} */ |
78 public static final int SET_ELEMENT = 5; |
79 public static final int SET_ELEMENT = 5; |
|
80 /** Property remove operation {@code delete obj.prop} */ |
|
81 public static final int REMOVE_PROPERTY = 6; |
|
82 /** Element remove operation {@code delete obj[index]} */ |
|
83 public static final int REMOVE_ELEMENT = 7; |
79 /** Call operation {@code fn(args...)} */ |
84 /** Call operation {@code fn(args...)} */ |
80 public static final int CALL = 6; |
85 public static final int CALL = 8; |
81 /** New operation {@code new Constructor(args...)} */ |
86 /** New operation {@code new Constructor(args...)} */ |
82 public static final int NEW = 7; |
87 public static final int NEW = 9; |
83 |
88 |
84 private static final int OPERATION_MASK = 7; |
89 private static final int OPERATION_MASK = 15; |
85 |
90 |
86 // Correspond to the operation indices above. |
91 // Correspond to the operation indices above. |
87 private static final Operation[] OPERATIONS = new Operation[] { |
92 private static final Operation[] OPERATIONS = new Operation[] { |
88 GET.withNamespaces(PROPERTY, ELEMENT, METHOD), |
93 GET.withNamespaces(PROPERTY, ELEMENT, METHOD), |
89 GET.withNamespaces(ELEMENT, PROPERTY, METHOD), |
94 GET.withNamespaces(ELEMENT, PROPERTY, METHOD), |
90 GET.withNamespaces(METHOD, PROPERTY, ELEMENT), |
95 GET.withNamespaces(METHOD, PROPERTY, ELEMENT), |
91 GET.withNamespaces(METHOD, ELEMENT, PROPERTY), |
96 GET.withNamespaces(METHOD, ELEMENT, PROPERTY), |
92 SET.withNamespaces(PROPERTY, ELEMENT), |
97 SET.withNamespaces(PROPERTY, ELEMENT), |
93 SET.withNamespaces(ELEMENT, PROPERTY), |
98 SET.withNamespaces(ELEMENT, PROPERTY), |
|
99 REMOVE.withNamespaces(PROPERTY, ELEMENT), |
|
100 REMOVE.withNamespaces(ELEMENT, PROPERTY), |
94 StandardOperation.CALL, |
101 StandardOperation.CALL, |
95 StandardOperation.NEW |
102 StandardOperation.NEW |
96 }; |
103 }; |
97 |
104 |
98 /** Flags that the call site references a scope variable (it's an identifier reference or a var declaration, not a |
105 /** Flags that the call site references a scope variable (it's an identifier reference or a var declaration, not a |
99 * property access expression. */ |
106 * property access expression. */ |
100 public static final int CALLSITE_SCOPE = 1 << 3; |
107 public static final int CALLSITE_SCOPE = 1 << 4; |
101 /** Flags that the call site is in code that uses ECMAScript strict mode. */ |
108 /** Flags that the call site is in code that uses ECMAScript strict mode. */ |
102 public static final int CALLSITE_STRICT = 1 << 4; |
109 public static final int CALLSITE_STRICT = 1 << 5; |
103 /** Flags that a property getter or setter call site references a scope variable that is located at a known distance |
110 /** Flags that a property getter or setter call site references a scope variable that is located at a known distance |
104 * in the scope chain. Such getters and setters can often be linked more optimally using these assumptions. */ |
111 * in the scope chain. Such getters and setters can often be linked more optimally using these assumptions. */ |
105 public static final int CALLSITE_FAST_SCOPE = 1 << 5; |
112 public static final int CALLSITE_FAST_SCOPE = 1 << 6; |
106 /** Flags that a callsite type is optimistic, i.e. we might get back a wider return value than encoded in the |
113 /** Flags that a callsite type is optimistic, i.e. we might get back a wider return value than encoded in the |
107 * descriptor, and in that case we have to throw an UnwarrantedOptimismException */ |
114 * descriptor, and in that case we have to throw an UnwarrantedOptimismException */ |
108 public static final int CALLSITE_OPTIMISTIC = 1 << 6; |
115 public static final int CALLSITE_OPTIMISTIC = 1 << 7; |
109 /** Is this really an apply that we try to call as a call? */ |
116 /** Is this really an apply that we try to call as a call? */ |
110 public static final int CALLSITE_APPLY_TO_CALL = 1 << 7; |
117 public static final int CALLSITE_APPLY_TO_CALL = 1 << 8; |
111 /** Does this a callsite for a variable declaration? */ |
118 /** Does this a callsite for a variable declaration? */ |
112 public static final int CALLSITE_DECLARE = 1 << 8; |
119 public static final int CALLSITE_DECLARE = 1 << 9; |
113 |
120 |
114 /** Flags that the call site is profiled; Contexts that have {@code "profile.callsites"} boolean property set emit |
121 /** Flags that the call site is profiled; Contexts that have {@code "profile.callsites"} boolean property set emit |
115 * code where call sites have this flag set. */ |
122 * code where call sites have this flag set. */ |
116 public static final int CALLSITE_PROFILE = 1 << 9; |
123 public static final int CALLSITE_PROFILE = 1 << 10; |
117 /** Flags that the call site is traced; Contexts that have {@code "trace.callsites"} property set emit code where |
124 /** Flags that the call site is traced; Contexts that have {@code "trace.callsites"} property set emit code where |
118 * call sites have this flag set. */ |
125 * call sites have this flag set. */ |
119 public static final int CALLSITE_TRACE = 1 << 10; |
126 public static final int CALLSITE_TRACE = 1 << 11; |
120 /** Flags that the call site linkage miss (and thus, relinking) is traced; Contexts that have the keyword |
127 /** Flags that the call site linkage miss (and thus, relinking) is traced; Contexts that have the keyword |
121 * {@code "miss"} in their {@code "trace.callsites"} property emit code where call sites have this flag set. */ |
128 * {@code "miss"} in their {@code "trace.callsites"} property emit code where call sites have this flag set. */ |
122 public static final int CALLSITE_TRACE_MISSES = 1 << 11; |
129 public static final int CALLSITE_TRACE_MISSES = 1 << 12; |
123 /** Flags that entry/exit to/from the method linked at call site are traced; Contexts that have the keyword |
130 /** Flags that entry/exit to/from the method linked at call site are traced; Contexts that have the keyword |
124 * {@code "enterexit"} in their {@code "trace.callsites"} property emit code where call sites have this flag set. */ |
131 * {@code "enterexit"} in their {@code "trace.callsites"} property emit code where call sites have this flag set. */ |
125 public static final int CALLSITE_TRACE_ENTEREXIT = 1 << 12; |
132 public static final int CALLSITE_TRACE_ENTEREXIT = 1 << 13; |
126 /** Flags that values passed as arguments to and returned from the method linked at call site are traced; Contexts |
133 /** Flags that values passed as arguments to and returned from the method linked at call site are traced; Contexts |
127 * that have the keyword {@code "values"} in their {@code "trace.callsites"} property emit code where call sites |
134 * that have the keyword {@code "values"} in their {@code "trace.callsites"} property emit code where call sites |
128 * have this flag set. */ |
135 * have this flag set. */ |
129 public static final int CALLSITE_TRACE_VALUES = 1 << 13; |
136 public static final int CALLSITE_TRACE_VALUES = 1 << 14; |
130 |
137 |
131 //we could have more tracing flags here, for example CALLSITE_TRACE_SCOPE, but bits are a bit precious |
138 //we could have more tracing flags here, for example CALLSITE_TRACE_SCOPE, but bits are a bit precious |
132 //right now given the program points |
139 //right now given the program points |
133 |
140 |
134 /** |
141 /** |