OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_COMPILER_NODE_PROPERTIES_H_ | 5 #ifndef V8_COMPILER_NODE_PROPERTIES_H_ |
6 #define V8_COMPILER_NODE_PROPERTIES_H_ | 6 #define V8_COMPILER_NODE_PROPERTIES_H_ |
7 | 7 |
8 #include "src/compiler/node.h" | 8 #include "src/compiler/node.h" |
9 #include "src/compiler/types.h" | 9 #include "src/compiler/types.h" |
10 | 10 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 124 |
125 // --------------------------------------------------------------------------- | 125 // --------------------------------------------------------------------------- |
126 // Context. | 126 // Context. |
127 | 127 |
128 // Try to retrieve the specialization context from the given {node}, | 128 // Try to retrieve the specialization context from the given {node}, |
129 // optionally utilizing the knowledge about the (outermost) function | 129 // optionally utilizing the knowledge about the (outermost) function |
130 // {context}. | 130 // {context}. |
131 static MaybeHandle<Context> GetSpecializationContext( | 131 static MaybeHandle<Context> GetSpecializationContext( |
132 Node* node, MaybeHandle<Context> context = MaybeHandle<Context>()); | 132 Node* node, MaybeHandle<Context> context = MaybeHandle<Context>()); |
133 | 133 |
134 // Try to retrieve the specialization native context from the given | |
135 // {node}, optionally utilizing the knowledge about the (outermost) | |
136 // {native_context}. | |
137 static MaybeHandle<Context> GetSpecializationNativeContext( | |
138 Node* node, MaybeHandle<Context> native_context = MaybeHandle<Context>()); | |
139 | |
140 // Try to retrieve the specialization global object from the given | |
141 // {node}, optionally utilizing the knowledge about the (outermost) | |
142 // {native_context}. | |
143 static MaybeHandle<JSGlobalObject> GetSpecializationGlobalObject( | |
144 Node* node, MaybeHandle<Context> native_context = MaybeHandle<Context>()); | |
145 | |
146 // --------------------------------------------------------------------------- | 134 // --------------------------------------------------------------------------- |
147 // Type. | 135 // Type. |
148 | 136 |
149 static bool IsTyped(Node* node) { return node->type() != nullptr; } | 137 static bool IsTyped(Node* node) { return node->type() != nullptr; } |
150 static Type* GetType(Node* node) { | 138 static Type* GetType(Node* node) { |
151 DCHECK(IsTyped(node)); | 139 DCHECK(IsTyped(node)); |
152 return node->type(); | 140 return node->type(); |
153 } | 141 } |
154 static Type* GetTypeOrAny(Node* node); | 142 static Type* GetTypeOrAny(Node* node); |
155 static void SetType(Node* node, Type* type) { | 143 static void SetType(Node* node, Type* type) { |
156 DCHECK_NOT_NULL(type); | 144 DCHECK_NOT_NULL(type); |
157 node->set_type(type); | 145 node->set_type(type); |
158 } | 146 } |
159 static void RemoveType(Node* node) { node->set_type(nullptr); } | 147 static void RemoveType(Node* node) { node->set_type(nullptr); } |
160 static bool AllValueInputsAreTyped(Node* node); | 148 static bool AllValueInputsAreTyped(Node* node); |
161 | 149 |
162 private: | 150 private: |
163 static inline bool IsInputRange(Edge edge, int first, int count); | 151 static inline bool IsInputRange(Edge edge, int first, int count); |
164 }; | 152 }; |
165 | 153 |
166 } // namespace compiler | 154 } // namespace compiler |
167 } // namespace internal | 155 } // namespace internal |
168 } // namespace v8 | 156 } // namespace v8 |
169 | 157 |
170 #endif // V8_COMPILER_NODE_PROPERTIES_H_ | 158 #endif // V8_COMPILER_NODE_PROPERTIES_H_ |
OLD | NEW |