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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 | 120 |
121 // Construct an appropriate heap object check. | 121 // Construct an appropriate heap object check. |
122 Node* BuildCheckTaggedPointer(Node* receiver, Node* effect, Node* control); | 122 Node* BuildCheckTaggedPointer(Node* receiver, Node* effect, Node* control); |
123 | 123 |
124 // Adds stability dependencies on all prototypes of every class in | 124 // Adds stability dependencies on all prototypes of every class in |
125 // {receiver_type} up to (and including) the {holder}. | 125 // {receiver_type} up to (and including) the {holder}. |
126 void AssumePrototypesStable(std::vector<Handle<Map>> const& receiver_maps, | 126 void AssumePrototypesStable(std::vector<Handle<Map>> const& receiver_maps, |
127 Handle<Context> native_context, | 127 Handle<Context> native_context, |
128 Handle<JSObject> holder); | 128 Handle<JSObject> holder); |
129 | 129 |
| 130 // Checks if we can turn the hole into undefined when loading an element |
| 131 // from an object with one of the {receiver_maps}; sets up appropriate |
| 132 // code dependencies and might use the array protector cell. |
| 133 bool CanTreatHoleAsUndefined(std::vector<Handle<Map>> const& receiver_maps, |
| 134 Handle<Context> native_context); |
| 135 |
130 // Extract receiver maps from {nexus} and filter based on {receiver} if | 136 // Extract receiver maps from {nexus} and filter based on {receiver} if |
131 // possible. | 137 // possible. |
132 bool ExtractReceiverMaps(Node* receiver, Node* effect, | 138 bool ExtractReceiverMaps(Node* receiver, Node* effect, |
133 FeedbackNexus const& nexus, | 139 FeedbackNexus const& nexus, |
134 MapHandleList* receiver_maps); | 140 MapHandleList* receiver_maps); |
135 | 141 |
136 // Try to infer a map for the given {receiver} at the current {effect}. | 142 // Try to infer a map for the given {receiver} at the current {effect}. |
137 // If a map is returned then you can be sure that the {receiver} definitely | 143 // If a map is returned then you can be sure that the {receiver} definitely |
138 // has the returned map at this point in the program (identified by {effect}). | 144 // has the returned map at this point in the program (identified by {effect}). |
139 MaybeHandle<Map> InferReceiverMap(Node* receiver, Node* effect); | 145 MaybeHandle<Map> InferReceiverMap(Node* receiver, Node* effect); |
(...skipping 27 matching lines...) Expand all Loading... |
167 DISALLOW_COPY_AND_ASSIGN(JSNativeContextSpecialization); | 173 DISALLOW_COPY_AND_ASSIGN(JSNativeContextSpecialization); |
168 }; | 174 }; |
169 | 175 |
170 DEFINE_OPERATORS_FOR_FLAGS(JSNativeContextSpecialization::Flags) | 176 DEFINE_OPERATORS_FOR_FLAGS(JSNativeContextSpecialization::Flags) |
171 | 177 |
172 } // namespace compiler | 178 } // namespace compiler |
173 } // namespace internal | 179 } // namespace internal |
174 } // namespace v8 | 180 } // namespace v8 |
175 | 181 |
176 #endif // V8_COMPILER_JS_NATIVE_CONTEXT_SPECIALIZATION_H_ | 182 #endif // V8_COMPILER_JS_NATIVE_CONTEXT_SPECIALIZATION_H_ |
OLD | NEW |