Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: src/compiler/js-native-context-specialization.h

Issue 2934893002: [builtins] Properly optimize Object.prototype.isPrototypeOf. (Closed)
Patch Set: Address feedback. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/js-generic-lowering.cc ('k') | src/compiler/js-native-context-specialization.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « src/compiler/js-generic-lowering.cc ('k') | src/compiler/js-native-context-specialization.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698