| OLD | NEW |
| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 142 |
| 143 void TraceHandlerCacheHitStats(LookupIterator* lookup); | 143 void TraceHandlerCacheHitStats(LookupIterator* lookup); |
| 144 | 144 |
| 145 // Compute the handler either by compiling or by retrieving a cached version. | 145 // Compute the handler either by compiling or by retrieving a cached version. |
| 146 Handle<Object> ComputeHandler(LookupIterator* lookup, | 146 Handle<Object> ComputeHandler(LookupIterator* lookup, |
| 147 Handle<Object> value = Handle<Code>::null()); | 147 Handle<Object> value = Handle<Code>::null()); |
| 148 virtual Handle<Object> GetMapIndependentHandler(LookupIterator* lookup) { | 148 virtual Handle<Object> GetMapIndependentHandler(LookupIterator* lookup) { |
| 149 UNREACHABLE(); | 149 UNREACHABLE(); |
| 150 return Handle<Code>::null(); | 150 return Handle<Code>::null(); |
| 151 } | 151 } |
| 152 virtual Handle<Code> CompileHandler(LookupIterator* lookup, | 152 virtual Handle<Object> CompileHandler(LookupIterator* lookup, |
| 153 Handle<Object> value, | 153 Handle<Object> value, |
| 154 CacheHolderFlag cache_holder) { | 154 CacheHolderFlag cache_holder) { |
| 155 UNREACHABLE(); | 155 UNREACHABLE(); |
| 156 return Handle<Code>::null(); | 156 return Handle<Object>::null(); |
| 157 } | 157 } |
| 158 | 158 |
| 159 void UpdateMonomorphicIC(Handle<Object> handler, Handle<Name> name); | 159 void UpdateMonomorphicIC(Handle<Object> handler, Handle<Name> name); |
| 160 bool UpdatePolymorphicIC(Handle<Name> name, Handle<Object> code); | 160 bool UpdatePolymorphicIC(Handle<Name> name, Handle<Object> code); |
| 161 void UpdateMegamorphicCache(Map* map, Name* name, Object* code); | 161 void UpdateMegamorphicCache(Map* map, Name* name, Object* code); |
| 162 | 162 |
| 163 StubCache* stub_cache(); | 163 StubCache* stub_cache(); |
| 164 | 164 |
| 165 void CopyICToMegamorphicCache(Handle<Name> name); | 165 void CopyICToMegamorphicCache(Handle<Name> name); |
| 166 bool IsTransitionOfMonomorphicTarget(Map* source_map, Map* target_map); | 166 bool IsTransitionOfMonomorphicTarget(Map* source_map, Map* target_map); |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 virtual Handle<Code> slow_stub() const { | 300 virtual Handle<Code> slow_stub() const { |
| 301 return isolate()->builtins()->LoadIC_Slow(); | 301 return isolate()->builtins()->LoadIC_Slow(); |
| 302 } | 302 } |
| 303 | 303 |
| 304 // Update the inline cache and the global stub cache based on the | 304 // Update the inline cache and the global stub cache based on the |
| 305 // lookup result. | 305 // lookup result. |
| 306 void UpdateCaches(LookupIterator* lookup); | 306 void UpdateCaches(LookupIterator* lookup); |
| 307 | 307 |
| 308 Handle<Object> GetMapIndependentHandler(LookupIterator* lookup) override; | 308 Handle<Object> GetMapIndependentHandler(LookupIterator* lookup) override; |
| 309 | 309 |
| 310 Handle<Code> CompileHandler(LookupIterator* lookup, Handle<Object> unused, | 310 Handle<Object> CompileHandler(LookupIterator* lookup, Handle<Object> unused, |
| 311 CacheHolderFlag cache_holder) override; | 311 CacheHolderFlag cache_holder) override; |
| 312 | 312 |
| 313 private: | 313 private: |
| 314 Handle<Object> SimpleFieldLoad(FieldIndex index); | 314 Handle<Object> SimpleFieldLoad(FieldIndex index); |
| 315 | 315 |
| 316 // Returns 0 if the validity cell check is enough to ensure that the | 316 // Returns 0 if the validity cell check is enough to ensure that the |
| 317 // prototype chain from |receiver_map| till |holder| did not change. | 317 // prototype chain from |receiver_map| till |holder| did not change. |
| 318 // Returns -1 if the handler has to be compiled or the number of prototype | 318 // Returns -1 if the handler has to be compiled or the number of prototype |
| 319 // checks otherwise. | 319 // checks otherwise. |
| 320 int GetPrototypeCheckCount(Handle<Map> receiver_map, Handle<JSObject> holder); | 320 int GetPrototypeCheckCount(Handle<Map> receiver_map, Handle<JSObject> holder); |
| 321 | 321 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 UNREACHABLE(); | 409 UNREACHABLE(); |
| 410 return Handle<Code>(); | 410 return Handle<Code>(); |
| 411 } | 411 } |
| 412 } | 412 } |
| 413 | 413 |
| 414 // Update the inline cache and the global stub cache based on the | 414 // Update the inline cache and the global stub cache based on the |
| 415 // lookup result. | 415 // lookup result. |
| 416 void UpdateCaches(LookupIterator* lookup, Handle<Object> value, | 416 void UpdateCaches(LookupIterator* lookup, Handle<Object> value, |
| 417 JSReceiver::StoreFromKeyed store_mode); | 417 JSReceiver::StoreFromKeyed store_mode); |
| 418 Handle<Object> GetMapIndependentHandler(LookupIterator* lookup) override; | 418 Handle<Object> GetMapIndependentHandler(LookupIterator* lookup) override; |
| 419 Handle<Code> CompileHandler(LookupIterator* lookup, Handle<Object> value, | 419 Handle<Object> CompileHandler(LookupIterator* lookup, Handle<Object> value, |
| 420 CacheHolderFlag cache_holder) override; | 420 CacheHolderFlag cache_holder) override; |
| 421 | 421 |
| 422 private: | 422 private: |
| 423 friend class IC; | 423 friend class IC; |
| 424 }; | 424 }; |
| 425 | 425 |
| 426 | 426 |
| 427 enum KeyedStoreCheckMap { kDontCheckMap, kCheckMap }; | 427 enum KeyedStoreCheckMap { kDontCheckMap, kCheckMap }; |
| 428 | 428 |
| 429 | 429 |
| 430 enum KeyedStoreIncrementLength { kDontIncrementLength, kIncrementLength }; | 430 enum KeyedStoreIncrementLength { kDontIncrementLength, kIncrementLength }; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 | 516 |
| 517 // Helper for BinaryOpIC and CompareIC. | 517 // Helper for BinaryOpIC and CompareIC. |
| 518 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; | 518 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; |
| 519 void PatchInlinedSmiCode(Isolate* isolate, Address address, | 519 void PatchInlinedSmiCode(Isolate* isolate, Address address, |
| 520 InlinedSmiCheck check); | 520 InlinedSmiCheck check); |
| 521 | 521 |
| 522 } // namespace internal | 522 } // namespace internal |
| 523 } // namespace v8 | 523 } // namespace v8 |
| 524 | 524 |
| 525 #endif // V8_IC_H_ | 525 #endif // V8_IC_H_ |
| OLD | NEW |