| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 Reduction ReduceJSLoadGlobal(Node* node); | 60 Reduction ReduceJSLoadGlobal(Node* node); |
| 61 Reduction ReduceJSStoreGlobal(Node* node); | 61 Reduction ReduceJSStoreGlobal(Node* node); |
| 62 Reduction ReduceJSLoadNamed(Node* node); | 62 Reduction ReduceJSLoadNamed(Node* node); |
| 63 Reduction ReduceJSStoreNamed(Node* node); | 63 Reduction ReduceJSStoreNamed(Node* node); |
| 64 Reduction ReduceJSLoadProperty(Node* node); | 64 Reduction ReduceJSLoadProperty(Node* node); |
| 65 Reduction ReduceJSStoreProperty(Node* node); | 65 Reduction ReduceJSStoreProperty(Node* node); |
| 66 Reduction ReduceJSStoreNamedOwn(Node* node); | 66 Reduction ReduceJSStoreNamedOwn(Node* node); |
| 67 Reduction ReduceJSStoreDataPropertyInLiteral(Node* node); | 67 Reduction ReduceJSStoreDataPropertyInLiteral(Node* node); |
| 68 | 68 |
| 69 Reduction ReduceElementAccess(Node* node, Node* index, Node* value, | 69 Reduction ReduceElementAccess(Node* node, Node* index, Node* value, |
| 70 MapHandleList const& receiver_maps, | 70 MapHandles const& receiver_maps, |
| 71 AccessMode access_mode, | 71 AccessMode access_mode, |
| 72 LanguageMode language_mode, | 72 LanguageMode language_mode, |
| 73 KeyedAccessStoreMode store_mode); | 73 KeyedAccessStoreMode store_mode); |
| 74 template <typename KeyedICNexus> | 74 template <typename KeyedICNexus> |
| 75 Reduction ReduceKeyedAccess(Node* node, Node* index, Node* value, | 75 Reduction ReduceKeyedAccess(Node* node, Node* index, Node* value, |
| 76 KeyedICNexus const& nexus, AccessMode access_mode, | 76 KeyedICNexus const& nexus, AccessMode access_mode, |
| 77 LanguageMode language_mode, | 77 LanguageMode language_mode, |
| 78 KeyedAccessStoreMode store_mode); | 78 KeyedAccessStoreMode store_mode); |
| 79 Reduction ReduceNamedAccessFromNexus(Node* node, Node* value, | 79 Reduction ReduceNamedAccessFromNexus(Node* node, Node* value, |
| 80 FeedbackNexus const& nexus, | 80 FeedbackNexus const& nexus, |
| 81 Handle<Name> name, | 81 Handle<Name> name, |
| 82 AccessMode access_mode, | 82 AccessMode access_mode, |
| 83 LanguageMode language_mode); | 83 LanguageMode language_mode); |
| 84 Reduction ReduceNamedAccess(Node* node, Node* value, | 84 Reduction ReduceNamedAccess(Node* node, Node* value, |
| 85 MapHandleList const& receiver_maps, | 85 MapHandles const& receiver_maps, |
| 86 Handle<Name> name, AccessMode access_mode, | 86 Handle<Name> name, AccessMode access_mode, |
| 87 LanguageMode language_mode, | 87 LanguageMode language_mode, |
| 88 Node* index = nullptr); | 88 Node* index = nullptr); |
| 89 Reduction ReduceGlobalAccess(Node* node, Node* receiver, Node* value, | 89 Reduction ReduceGlobalAccess(Node* node, Node* receiver, Node* value, |
| 90 Handle<Name> name, AccessMode access_mode, | 90 Handle<Name> name, AccessMode access_mode, |
| 91 Node* index = nullptr); | 91 Node* index = nullptr); |
| 92 | 92 |
| 93 Reduction ReduceSoftDeoptimize(Node* node, DeoptimizeReason reason); | 93 Reduction ReduceSoftDeoptimize(Node* node, DeoptimizeReason reason); |
| 94 | 94 |
| 95 // A triple of nodes that represents a continuation. | 95 // A triple of nodes that represents a continuation. |
| (...skipping 27 matching lines...) Expand all Loading... |
| 123 Node* control, | 123 Node* control, |
| 124 ElementAccessInfo const& access_info, | 124 ElementAccessInfo const& access_info, |
| 125 AccessMode access_mode, | 125 AccessMode access_mode, |
| 126 KeyedAccessStoreMode store_mode); | 126 KeyedAccessStoreMode store_mode); |
| 127 | 127 |
| 128 // Construct an appropriate heap object check. | 128 // Construct an appropriate heap object check. |
| 129 Node* BuildCheckHeapObject(Node* receiver, Node** effect, Node* control); | 129 Node* BuildCheckHeapObject(Node* receiver, Node** effect, Node* control); |
| 130 | 130 |
| 131 // Construct an appropriate map check. | 131 // Construct an appropriate map check. |
| 132 Node* BuildCheckMaps(Node* receiver, Node* effect, Node* control, | 132 Node* BuildCheckMaps(Node* receiver, Node* effect, Node* control, |
| 133 std::vector<Handle<Map>> const& maps); | 133 MapHandles const& maps); |
| 134 | 134 |
| 135 // Construct appropriate subgraph to extend properties backing store. | 135 // Construct appropriate subgraph to extend properties backing store. |
| 136 Node* BuildExtendPropertiesBackingStore(Handle<Map> map, Node* properties, | 136 Node* BuildExtendPropertiesBackingStore(Handle<Map> map, Node* properties, |
| 137 Node* effect, Node* control); | 137 Node* effect, Node* control); |
| 138 | 138 |
| 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(MapHandles 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(MapHandles const& receiver_maps); |
| 148 | 148 |
| 149 // Checks if we know at compile time that the {receiver} either definitely | 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 | 150 // has the {prototype} in it's prototype chain, or the {receiver} definitely |
| 151 // doesn't have the {prototype} in it's prototype chain. | 151 // doesn't have the {prototype} in it's prototype chain. |
| 152 enum InferHasInPrototypeChainResult { | 152 enum InferHasInPrototypeChainResult { |
| 153 kIsInPrototypeChain, | 153 kIsInPrototypeChain, |
| 154 kIsNotInPrototypeChain, | 154 kIsNotInPrototypeChain, |
| 155 kMayBeInPrototypeChain | 155 kMayBeInPrototypeChain |
| 156 }; | 156 }; |
| 157 InferHasInPrototypeChainResult InferHasInPrototypeChain( | 157 InferHasInPrototypeChainResult InferHasInPrototypeChain( |
| 158 Node* receiver, Node* effect, Handle<JSReceiver> prototype); | 158 Node* receiver, Node* effect, Handle<JSReceiver> prototype); |
| 159 | 159 |
| 160 // Extract receiver maps from {nexus} and filter based on {receiver} if | 160 // Extract receiver maps from {nexus} and filter based on {receiver} if |
| 161 // possible. | 161 // possible. |
| 162 bool ExtractReceiverMaps(Node* receiver, Node* effect, | 162 bool ExtractReceiverMaps(Node* receiver, Node* effect, |
| 163 FeedbackNexus const& nexus, | 163 FeedbackNexus const& nexus, |
| 164 MapHandleList* receiver_maps); | 164 MapHandles* receiver_maps); |
| 165 | 165 |
| 166 // 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}. |
| 167 // 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 |
| 168 // 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 |
| 169 // by {effect}). | 169 // by {effect}). |
| 170 bool InferReceiverMaps(Node* receiver, Node* effect, | 170 bool InferReceiverMaps(Node* receiver, Node* effect, |
| 171 MapHandleList* receiver_maps); | 171 MapHandles* receiver_maps); |
| 172 // Try to infer a root map for the {receiver} independent of the current | 172 // Try to infer a root map for the {receiver} independent of the current |
| 173 // program location. | 173 // program location. |
| 174 MaybeHandle<Map> InferReceiverRootMap(Node* receiver); | 174 MaybeHandle<Map> InferReceiverRootMap(Node* receiver); |
| 175 | 175 |
| 176 ValueEffectControl InlineApiCall( | 176 ValueEffectControl InlineApiCall( |
| 177 Node* receiver, Node* context, Node* target, Node* frame_state, | 177 Node* receiver, Node* context, Node* target, Node* frame_state, |
| 178 Node* parameter, Node* effect, Node* control, | 178 Node* parameter, Node* effect, Node* control, |
| 179 Handle<SharedFunctionInfo> shared_info, | 179 Handle<SharedFunctionInfo> shared_info, |
| 180 Handle<FunctionTemplateInfo> function_template_info); | 180 Handle<FunctionTemplateInfo> function_template_info); |
| 181 | 181 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 211 DISALLOW_COPY_AND_ASSIGN(JSNativeContextSpecialization); | 211 DISALLOW_COPY_AND_ASSIGN(JSNativeContextSpecialization); |
| 212 }; | 212 }; |
| 213 | 213 |
| 214 DEFINE_OPERATORS_FOR_FLAGS(JSNativeContextSpecialization::Flags) | 214 DEFINE_OPERATORS_FOR_FLAGS(JSNativeContextSpecialization::Flags) |
| 215 | 215 |
| 216 } // namespace compiler | 216 } // namespace compiler |
| 217 } // namespace internal | 217 } // namespace internal |
| 218 } // namespace v8 | 218 } // namespace v8 |
| 219 | 219 |
| 220 #endif // V8_COMPILER_JS_NATIVE_CONTEXT_SPECIALIZATION_H_ | 220 #endif // V8_COMPILER_JS_NATIVE_CONTEXT_SPECIALIZATION_H_ |
| OLD | NEW |