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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 // lookup result. | 303 // lookup result. |
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 Handle<Object> SimpleFieldLoadFromPrototype(FieldIndex index, | 313 |
314 Handle<Map> receiver_map, | 314 // Returns true if the validity cell check is enough to ensure that the |
315 Handle<JSObject> holder); | 315 // prototype chain from |receiver_map| till |holder| did not change. |
| 316 bool IsPrototypeValidityCellCheckEnough(Handle<Map> receiver_map, |
| 317 Handle<JSObject> holder); |
| 318 |
| 319 // Creates a data handler that represents a prototype chain check followed |
| 320 // by given Smi-handler that encoded a load from the holder. |
| 321 // Can be used only if IsPrototypeValidityCellCheckEnough() predicate is true. |
| 322 Handle<Object> SimpleLoadFromPrototype(Handle<Map> receiver_map, |
| 323 Handle<JSObject> holder, |
| 324 Handle<Object> smi_handler); |
316 | 325 |
317 friend class IC; | 326 friend class IC; |
318 }; | 327 }; |
319 | 328 |
320 class LoadGlobalIC : public LoadIC { | 329 class LoadGlobalIC : public LoadIC { |
321 public: | 330 public: |
322 LoadGlobalIC(FrameDepth depth, Isolate* isolate, FeedbackNexus* nexus = NULL) | 331 LoadGlobalIC(FrameDepth depth, Isolate* isolate, FeedbackNexus* nexus = NULL) |
323 : LoadIC(depth, isolate, nexus) {} | 332 : LoadIC(depth, isolate, nexus) {} |
324 | 333 |
325 MUST_USE_RESULT MaybeHandle<Object> Load(Handle<Name> name); | 334 MUST_USE_RESULT MaybeHandle<Object> Load(Handle<Name> name); |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 | 516 |
508 // Helper for BinaryOpIC and CompareIC. | 517 // Helper for BinaryOpIC and CompareIC. |
509 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; | 518 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; |
510 void PatchInlinedSmiCode(Isolate* isolate, Address address, | 519 void PatchInlinedSmiCode(Isolate* isolate, Address address, |
511 InlinedSmiCheck check); | 520 InlinedSmiCheck check); |
512 | 521 |
513 } // namespace internal | 522 } // namespace internal |
514 } // namespace v8 | 523 } // namespace v8 |
515 | 524 |
516 #endif // V8_IC_H_ | 525 #endif // V8_IC_H_ |
OLD | NEW |