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 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 friend class IC; | 645 friend class IC; |
646 }; | 646 }; |
647 | 647 |
648 | 648 |
649 // Type Recording BinaryOpIC, that records the types of the inputs and outputs. | 649 // Type Recording BinaryOpIC, that records the types of the inputs and outputs. |
650 class BinaryOpIC : public IC { | 650 class BinaryOpIC : public IC { |
651 public: | 651 public: |
652 explicit BinaryOpIC(Isolate* isolate) : IC(EXTRA_CALL_FRAME, isolate) {} | 652 explicit BinaryOpIC(Isolate* isolate) : IC(EXTRA_CALL_FRAME, isolate) {} |
653 | 653 |
654 static Builtins::JavaScript TokenToJSBuiltin(Token::Value op, | 654 static Builtins::JavaScript TokenToJSBuiltin(Token::Value op, |
655 LanguageMode language_mode); | 655 Strength strength); |
656 | 656 |
657 MaybeHandle<Object> Transition(Handle<AllocationSite> allocation_site, | 657 MaybeHandle<Object> Transition(Handle<AllocationSite> allocation_site, |
658 Handle<Object> left, | 658 Handle<Object> left, |
659 Handle<Object> right) WARN_UNUSED_RESULT; | 659 Handle<Object> right) WARN_UNUSED_RESULT; |
660 }; | 660 }; |
661 | 661 |
662 | 662 |
663 class CompareIC : public IC { | 663 class CompareIC : public IC { |
664 public: | 664 public: |
665 CompareIC(Isolate* isolate, Token::Value op) | 665 CompareIC(Isolate* isolate, Token::Value op) |
666 : IC(EXTRA_CALL_FRAME, isolate), op_(op) {} | 666 : IC(EXTRA_CALL_FRAME, isolate), op_(op) {} |
667 | 667 |
668 // Update the inline cache for the given operands. | 668 // Update the inline cache for the given operands. |
669 Code* UpdateCaches(Handle<Object> x, Handle<Object> y); | 669 Code* UpdateCaches(Handle<Object> x, Handle<Object> y); |
670 | 670 |
671 // Helper function for computing the condition for a compare operation. | 671 // Helper function for computing the condition for a compare operation. |
672 static Condition ComputeCondition(Token::Value op); | 672 static Condition ComputeCondition(Token::Value op); |
673 | 673 |
674 // Factory method for getting an uninitialized compare stub. | 674 // Factory method for getting an uninitialized compare stub. |
675 static Handle<Code> GetUninitialized(Isolate* isolate, Token::Value op, | 675 static Handle<Code> GetUninitialized(Isolate* isolate, Token::Value op, |
676 bool strong); | 676 Strength strength); |
677 | 677 |
678 private: | 678 private: |
679 static bool HasInlinedSmiCode(Address address); | 679 static bool HasInlinedSmiCode(Address address); |
680 | 680 |
681 bool strict() const { return op_ == Token::EQ_STRICT; } | 681 bool strict() const { return op_ == Token::EQ_STRICT; } |
682 Condition GetCondition() const { return ComputeCondition(op_); } | 682 Condition GetCondition() const { return ComputeCondition(op_); } |
683 | 683 |
684 static Code* GetRawUninitialized(Isolate* isolate, Token::Value op, | 684 static Code* GetRawUninitialized(Isolate* isolate, Token::Value op, |
685 bool strong); | 685 Strength strength); |
686 | 686 |
687 static void Clear(Isolate* isolate, Address address, Code* target, | 687 static void Clear(Isolate* isolate, Address address, Code* target, |
688 Address constant_pool); | 688 Address constant_pool); |
689 | 689 |
690 Token::Value op_; | 690 Token::Value op_; |
691 | 691 |
692 friend class IC; | 692 friend class IC; |
693 }; | 693 }; |
694 | 694 |
695 | 695 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
736 | 736 |
737 // Support functions for interceptor handlers. | 737 // Support functions for interceptor handlers. |
738 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptorOnly); | 738 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptorOnly); |
739 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptor); | 739 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptor); |
740 DECLARE_RUNTIME_FUNCTION(LoadElementWithInterceptor); | 740 DECLARE_RUNTIME_FUNCTION(LoadElementWithInterceptor); |
741 DECLARE_RUNTIME_FUNCTION(StorePropertyWithInterceptor); | 741 DECLARE_RUNTIME_FUNCTION(StorePropertyWithInterceptor); |
742 } | 742 } |
743 } // namespace v8::internal | 743 } // namespace v8::internal |
744 | 744 |
745 #endif // V8_IC_H_ | 745 #endif // V8_IC_H_ |
OLD | NEW |