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

Side by Side Diff: src/ic/ic.h

Issue 1974793002: [IC] Only cache handlers on a map that were compiled for that map (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: make gcc happy Created 4 years, 7 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 | « no previous file | src/ic/ic.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_IC_H_ 5 #ifndef V8_IC_H_
6 #define V8_IC_H_ 6 #define V8_IC_H_
7 7
8 #include "src/ic/ic-state.h" 8 #include "src/ic/ic-state.h"
9 #include "src/macro-assembler.h" 9 #include "src/macro-assembler.h"
10 #include "src/messages.h" 10 #include "src/messages.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 Address constant_pool); 133 Address constant_pool);
134 static inline void SetTargetAtAddress(Address address, Code* target, 134 static inline void SetTargetAtAddress(Address address, Code* target,
135 Address constant_pool); 135 Address constant_pool);
136 // As a vector-based IC, type feedback must be updated differently. 136 // As a vector-based IC, type feedback must be updated differently.
137 static void OnTypeFeedbackChanged(Isolate* isolate, Code* host); 137 static void OnTypeFeedbackChanged(Isolate* isolate, Code* host);
138 static void PostPatching(Address address, Code* target, Code* old_target); 138 static void PostPatching(Address address, Code* target, Code* old_target);
139 139
140 // Compute the handler either by compiling or by retrieving a cached version. 140 // Compute the handler either by compiling or by retrieving a cached version.
141 Handle<Code> ComputeHandler(LookupIterator* lookup, 141 Handle<Code> ComputeHandler(LookupIterator* lookup,
142 Handle<Object> value = Handle<Code>::null()); 142 Handle<Object> value = Handle<Code>::null());
143 virtual Handle<Code> GetMapIndependentHandler(LookupIterator* lookup) {
144 UNREACHABLE();
145 return Handle<Code>::null();
146 }
143 virtual Handle<Code> CompileHandler(LookupIterator* lookup, 147 virtual Handle<Code> CompileHandler(LookupIterator* lookup,
144 Handle<Object> value, 148 Handle<Object> value,
145 CacheHolderFlag cache_holder) { 149 CacheHolderFlag cache_holder) {
146 UNREACHABLE(); 150 UNREACHABLE();
147 return Handle<Code>::null(); 151 return Handle<Code>::null();
148 } 152 }
149 153
150 void UpdateMonomorphicIC(Handle<Code> handler, Handle<Name> name); 154 void UpdateMonomorphicIC(Handle<Code> handler, Handle<Name> name);
151 bool UpdatePolymorphicIC(Handle<Name> name, Handle<Code> code); 155 bool UpdatePolymorphicIC(Handle<Name> name, Handle<Code> code);
152 void UpdateMegamorphicCache(Map* map, Name* name, Code* code); 156 void UpdateMegamorphicCache(Map* map, Name* name, Code* code);
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 301
298 protected: 302 protected:
299 Handle<Code> slow_stub() const { 303 Handle<Code> slow_stub() const {
300 return isolate()->builtins()->LoadIC_Slow(); 304 return isolate()->builtins()->LoadIC_Slow();
301 } 305 }
302 306
303 // Update the inline cache and the global stub cache based on the 307 // Update the inline cache and the global stub cache based on the
304 // lookup result. 308 // lookup result.
305 void UpdateCaches(LookupIterator* lookup); 309 void UpdateCaches(LookupIterator* lookup);
306 310
311 Handle<Code> GetMapIndependentHandler(LookupIterator* lookup) override;
312
307 Handle<Code> CompileHandler(LookupIterator* lookup, Handle<Object> unused, 313 Handle<Code> CompileHandler(LookupIterator* lookup, Handle<Object> unused,
308 CacheHolderFlag cache_holder) override; 314 CacheHolderFlag cache_holder) override;
309 315
310 private: 316 private:
311 Handle<Code> SimpleFieldLoad(FieldIndex index); 317 Handle<Code> SimpleFieldLoad(FieldIndex index);
312 318
313 friend class IC; 319 friend class IC;
314 }; 320 };
315 321
316 322
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 static void Clear(Isolate* isolate, Code* host, StoreICNexus* nexus); 385 static void Clear(Isolate* isolate, Code* host, StoreICNexus* nexus);
380 386
381 protected: 387 protected:
382 // Stub accessors. 388 // Stub accessors.
383 Handle<Code> slow_stub() const; 389 Handle<Code> slow_stub() const;
384 390
385 // Update the inline cache and the global stub cache based on the 391 // Update the inline cache and the global stub cache based on the
386 // lookup result. 392 // lookup result.
387 void UpdateCaches(LookupIterator* lookup, Handle<Object> value, 393 void UpdateCaches(LookupIterator* lookup, Handle<Object> value,
388 JSReceiver::StoreFromKeyed store_mode); 394 JSReceiver::StoreFromKeyed store_mode);
395 Handle<Code> GetMapIndependentHandler(LookupIterator* lookup) override;
389 Handle<Code> CompileHandler(LookupIterator* lookup, Handle<Object> value, 396 Handle<Code> CompileHandler(LookupIterator* lookup, Handle<Object> value,
390 CacheHolderFlag cache_holder) override; 397 CacheHolderFlag cache_holder) override;
391 398
392 private: 399 private:
393 friend class IC; 400 friend class IC;
394 }; 401 };
395 402
396 403
397 enum KeyedStoreCheckMap { kDontCheckMap, kCheckMap }; 404 enum KeyedStoreCheckMap { kDontCheckMap, kCheckMap };
398 405
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 498
492 // Helper for BinaryOpIC and CompareIC. 499 // Helper for BinaryOpIC and CompareIC.
493 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; 500 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK };
494 void PatchInlinedSmiCode(Isolate* isolate, Address address, 501 void PatchInlinedSmiCode(Isolate* isolate, Address address,
495 InlinedSmiCheck check); 502 InlinedSmiCheck check);
496 503
497 } // namespace internal 504 } // namespace internal
498 } // namespace v8 505 } // namespace v8
499 506
500 #endif // V8_IC_H_ 507 #endif // V8_IC_H_
OLDNEW
« no previous file with comments | « no previous file | src/ic/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698