| 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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 void UpdateCaches(LookupIterator* lookup); | 304 void UpdateCaches(LookupIterator* lookup); |
| 305 | 305 |
| 306 Handle<Object> GetMapIndependentHandler(LookupIterator* lookup) override; | 306 Handle<Object> GetMapIndependentHandler(LookupIterator* lookup) override; |
| 307 | 307 |
| 308 Handle<Code> CompileHandler(LookupIterator* lookup, Handle<Object> unused, | 308 Handle<Code> CompileHandler(LookupIterator* lookup, Handle<Object> unused, |
| 309 CacheHolderFlag cache_holder) override; | 309 CacheHolderFlag cache_holder) override; |
| 310 | 310 |
| 311 private: | 311 private: |
| 312 Handle<Object> SimpleFieldLoad(FieldIndex index); | 312 Handle<Object> SimpleFieldLoad(FieldIndex index); |
| 313 | 313 |
| 314 // Returns true if the validity cell check is enough to ensure that the | 314 // Returns 0 if the validity cell check is enough to ensure that the |
| 315 // prototype chain from |receiver_map| till |holder| did not change. | 315 // prototype chain from |receiver_map| till |holder| did not change. |
| 316 bool IsPrototypeValidityCellCheckEnough(Handle<Map> receiver_map, | 316 // Returns -1 if the handler has to be compiled or the number of prototype |
| 317 Handle<JSObject> holder); | 317 // checks otherwise. |
| 318 int GetPrototypeCheckCount(Handle<Map> receiver_map, Handle<JSObject> holder); |
| 318 | 319 |
| 319 // Creates a data handler that represents a prototype chain check followed | 320 // Creates a data handler that represents a prototype chain check followed |
| 320 // by given Smi-handler that encoded a load from the holder. | 321 // by given Smi-handler that encoded a load from the holder. |
| 321 // Can be used only if IsPrototypeValidityCellCheckEnough() predicate is true. | 322 // Can be used only if IsPrototypeValidityCellCheckEnough() predicate is true. |
| 322 Handle<Object> SimpleLoadFromPrototype(Handle<Map> receiver_map, | 323 Handle<Object> SimpleLoadFromPrototype(Handle<Map> receiver_map, |
| 323 Handle<JSObject> holder, | 324 Handle<JSObject> holder, |
| 325 Handle<Name> name, |
| 324 Handle<Object> smi_handler); | 326 Handle<Object> smi_handler); |
| 325 | 327 |
| 326 friend class IC; | 328 friend class IC; |
| 327 }; | 329 }; |
| 328 | 330 |
| 329 class LoadGlobalIC : public LoadIC { | 331 class LoadGlobalIC : public LoadIC { |
| 330 public: | 332 public: |
| 331 LoadGlobalIC(FrameDepth depth, Isolate* isolate, FeedbackNexus* nexus = NULL) | 333 LoadGlobalIC(FrameDepth depth, Isolate* isolate, FeedbackNexus* nexus = NULL) |
| 332 : LoadIC(depth, isolate, nexus) {} | 334 : LoadIC(depth, isolate, nexus) {} |
| 333 | 335 |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 | 514 |
| 513 // Helper for BinaryOpIC and CompareIC. | 515 // Helper for BinaryOpIC and CompareIC. |
| 514 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; | 516 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; |
| 515 void PatchInlinedSmiCode(Isolate* isolate, Address address, | 517 void PatchInlinedSmiCode(Isolate* isolate, Address address, |
| 516 InlinedSmiCheck check); | 518 InlinedSmiCheck check); |
| 517 | 519 |
| 518 } // namespace internal | 520 } // namespace internal |
| 519 } // namespace v8 | 521 } // namespace v8 |
| 520 | 522 |
| 521 #endif // V8_IC_H_ | 523 #endif // V8_IC_H_ |
| OLD | NEW |