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