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 // 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<Code> CompileHandler(LookupIterator* lookup, Handle<Object> unused, |
311 CacheHolderFlag cache_holder) override; | 311 CacheHolderFlag cache_holder) override; |
312 | 312 |
313 private: | 313 private: |
| 314 // Creates a data handler that represents a load of a field by given index. |
314 Handle<Object> SimpleFieldLoad(FieldIndex index); | 315 Handle<Object> SimpleFieldLoad(FieldIndex index); |
315 | 316 |
316 // Returns 0 if the validity cell check is enough to ensure that the | 317 // Returns 0 if the validity cell check is enough to ensure that the |
317 // prototype chain from |receiver_map| till |holder| did not change. | 318 // prototype chain from |receiver_map| till |holder| did not change. |
| 319 // If the |holder| is an empty handle then the full prototype chain is |
| 320 // checked. |
318 // Returns -1 if the handler has to be compiled or the number of prototype | 321 // Returns -1 if the handler has to be compiled or the number of prototype |
319 // checks otherwise. | 322 // checks otherwise. |
320 int GetPrototypeCheckCount(Handle<Map> receiver_map, Handle<JSObject> holder); | 323 int GetPrototypeCheckCount(Handle<Map> receiver_map, Handle<JSObject> holder); |
321 | 324 |
322 // Creates a data handler that represents a prototype chain check followed | 325 // Creates a data handler that represents a prototype chain check followed |
323 // by given Smi-handler that encoded a load from the holder. | 326 // by given Smi-handler that encoded a load from the holder. |
324 // Can be used only if IsPrototypeValidityCellCheckEnough() predicate is true. | 327 // Can be used only if GetPrototypeCheckCount() returns non negative value. |
325 Handle<Object> SimpleLoadFromPrototype(Handle<Map> receiver_map, | 328 Handle<Object> SimpleLoadFromPrototype(Handle<Map> receiver_map, |
326 Handle<JSObject> holder, | 329 Handle<JSObject> holder, |
327 Handle<Name> name, | 330 Handle<Name> name, |
328 Handle<Object> smi_handler); | 331 Handle<Object> smi_handler); |
329 | 332 |
| 333 // Creates a data handler that represents a load of a non-existent property. |
| 334 Handle<Object> SimpleLoadNonExistent(Handle<Map> receiver_map, |
| 335 Handle<Name> name); |
330 friend class IC; | 336 friend class IC; |
331 }; | 337 }; |
332 | 338 |
333 class LoadGlobalIC : public LoadIC { | 339 class LoadGlobalIC : public LoadIC { |
334 public: | 340 public: |
335 LoadGlobalIC(FrameDepth depth, Isolate* isolate, FeedbackNexus* nexus = NULL) | 341 LoadGlobalIC(FrameDepth depth, Isolate* isolate, FeedbackNexus* nexus = NULL) |
336 : LoadIC(depth, isolate, nexus) {} | 342 : LoadIC(depth, isolate, nexus) {} |
337 | 343 |
338 MUST_USE_RESULT MaybeHandle<Object> Load(Handle<Name> name); | 344 MUST_USE_RESULT MaybeHandle<Object> Load(Handle<Name> name); |
339 | 345 |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 | 522 |
517 // Helper for BinaryOpIC and CompareIC. | 523 // Helper for BinaryOpIC and CompareIC. |
518 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; | 524 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; |
519 void PatchInlinedSmiCode(Isolate* isolate, Address address, | 525 void PatchInlinedSmiCode(Isolate* isolate, Address address, |
520 InlinedSmiCheck check); | 526 InlinedSmiCheck check); |
521 | 527 |
522 } // namespace internal | 528 } // namespace internal |
523 } // namespace v8 | 529 } // namespace v8 |
524 | 530 |
525 #endif // V8_IC_H_ | 531 #endif // V8_IC_H_ |
OLD | NEW |