OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_JS_NATIVE_CONTEXT_SPECIALIZATION_H_ | 5 #ifndef V8_COMPILER_JS_NATIVE_CONTEXT_SPECIALIZATION_H_ |
6 #define V8_COMPILER_JS_NATIVE_CONTEXT_SPECIALIZATION_H_ | 6 #define V8_COMPILER_JS_NATIVE_CONTEXT_SPECIALIZATION_H_ |
7 | 7 |
8 #include "src/base/flags.h" | 8 #include "src/base/flags.h" |
9 #include "src/compiler/graph-reducer.h" | 9 #include "src/compiler/graph-reducer.h" |
10 #include "src/deoptimize-reason.h" | 10 #include "src/deoptimize-reason.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 // Adds stability dependencies on all prototypes of every class in | 138 // Adds stability dependencies on all prototypes of every class in |
139 // {receiver_type} up to (and including) the {holder}. | 139 // {receiver_type} up to (and including) the {holder}. |
140 void AssumePrototypesStable(MapHandles const& receiver_maps, | 140 void AssumePrototypesStable(MapHandles const& receiver_maps, |
141 Handle<JSObject> holder); | 141 Handle<JSObject> holder); |
142 | 142 |
143 // Checks if we can turn the hole into undefined when loading an element | 143 // Checks if we can turn the hole into undefined when loading an element |
144 // from an object with one of the {receiver_maps}; sets up appropriate | 144 // from an object with one of the {receiver_maps}; sets up appropriate |
145 // code dependencies and might use the array protector cell. | 145 // code dependencies and might use the array protector cell. |
146 bool CanTreatHoleAsUndefined(MapHandles const& receiver_maps); | 146 bool CanTreatHoleAsUndefined(MapHandles const& receiver_maps); |
147 | 147 |
148 // Checks if we know at compile time that the {receiver} either definitely | |
149 // has the {prototype} in it's prototype chain, or the {receiver} definitely | |
150 // doesn't have the {prototype} in it's prototype chain. | |
151 enum InferHasInPrototypeChainResult { | |
152 kIsInPrototypeChain, | |
153 kIsNotInPrototypeChain, | |
154 kMayBeInPrototypeChain | |
155 }; | |
156 InferHasInPrototypeChainResult InferHasInPrototypeChain( | |
157 Node* receiver, Node* effect, Handle<JSReceiver> prototype); | |
158 | |
159 // Extract receiver maps from {nexus} and filter based on {receiver} if | 148 // Extract receiver maps from {nexus} and filter based on {receiver} if |
160 // possible. | 149 // possible. |
161 bool ExtractReceiverMaps(Node* receiver, Node* effect, | 150 bool ExtractReceiverMaps(Node* receiver, Node* effect, |
162 FeedbackNexus const& nexus, | 151 FeedbackNexus const& nexus, |
163 MapHandles* receiver_maps); | 152 MapHandles* receiver_maps); |
164 | 153 |
165 // Try to infer maps for the given {receiver} at the current {effect}. | 154 // Try to infer maps for the given {receiver} at the current {effect}. |
166 // If maps are returned then you can be sure that the {receiver} definitely | 155 // If maps are returned then you can be sure that the {receiver} definitely |
167 // has one of the returned maps at this point in the program (identified | 156 // has one of the returned maps at this point in the program (identified |
168 // by {effect}). | 157 // by {effect}). |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 DISALLOW_COPY_AND_ASSIGN(JSNativeContextSpecialization); | 199 DISALLOW_COPY_AND_ASSIGN(JSNativeContextSpecialization); |
211 }; | 200 }; |
212 | 201 |
213 DEFINE_OPERATORS_FOR_FLAGS(JSNativeContextSpecialization::Flags) | 202 DEFINE_OPERATORS_FOR_FLAGS(JSNativeContextSpecialization::Flags) |
214 | 203 |
215 } // namespace compiler | 204 } // namespace compiler |
216 } // namespace internal | 205 } // namespace internal |
217 } // namespace v8 | 206 } // namespace v8 |
218 | 207 |
219 #endif // V8_COMPILER_JS_NATIVE_CONTEXT_SPECIALIZATION_H_ | 208 #endif // V8_COMPILER_JS_NATIVE_CONTEXT_SPECIALIZATION_H_ |
OLD | NEW |