| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 | 787 |
| 788 // Factory method for getting an uninitialized compare stub. | 788 // Factory method for getting an uninitialized compare stub. |
| 789 static Handle<Code> GetUninitialized(Token::Value op); | 789 static Handle<Code> GetUninitialized(Token::Value op); |
| 790 | 790 |
| 791 // Helper function for computing the condition for a compare operation. | 791 // Helper function for computing the condition for a compare operation. |
| 792 static Condition ComputeCondition(Token::Value op); | 792 static Condition ComputeCondition(Token::Value op); |
| 793 | 793 |
| 794 // Helper function for determining the state of a compare IC. | 794 // Helper function for determining the state of a compare IC. |
| 795 static State ComputeState(Code* target); | 795 static State ComputeState(Code* target); |
| 796 | 796 |
| 797 // Helper function for determining the operation a compare IC is for. |
| 798 static Token::Value ComputeOperation(Code* target); |
| 799 |
| 797 static const char* GetStateName(State state); | 800 static const char* GetStateName(State state); |
| 798 | 801 |
| 799 private: | 802 private: |
| 800 State TargetState(State state, bool has_inlined_smi_code, | 803 State TargetState(State state, bool has_inlined_smi_code, |
| 801 Handle<Object> x, Handle<Object> y); | 804 Handle<Object> x, Handle<Object> y); |
| 802 | 805 |
| 803 bool strict() const { return op_ == Token::EQ_STRICT; } | 806 bool strict() const { return op_ == Token::EQ_STRICT; } |
| 804 Condition GetCondition() const { return ComputeCondition(op_); } | 807 Condition GetCondition() const { return ComputeCondition(op_); } |
| 805 State GetState() { return ComputeState(target()); } | 808 State GetState() { return ComputeState(target()); } |
| 806 | 809 |
| 810 static Code* initialize_stub(Token::Value op); |
| 811 |
| 812 static void Clear(Address address, Code* target); |
| 813 |
| 807 Token::Value op_; | 814 Token::Value op_; |
| 815 |
| 816 friend class IC; |
| 808 }; | 817 }; |
| 809 | 818 |
| 810 | 819 |
| 811 class ToBooleanIC: public IC { | 820 class ToBooleanIC: public IC { |
| 812 public: | 821 public: |
| 813 explicit ToBooleanIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) { } | 822 explicit ToBooleanIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) { } |
| 814 | 823 |
| 815 void patch(Code* code); | 824 void patch(Code* code); |
| 816 }; | 825 }; |
| 817 | 826 |
| 818 | 827 |
| 819 // Helper for BinaryOpIC and CompareIC. | 828 // Helper for BinaryOpIC and CompareIC. |
| 820 void PatchInlinedSmiCode(Address address); | 829 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; |
| 830 void PatchInlinedSmiCode(Address address, InlinedSmiCheck check); |
| 821 | 831 |
| 822 } } // namespace v8::internal | 832 } } // namespace v8::internal |
| 823 | 833 |
| 824 #endif // V8_IC_H_ | 834 #endif // V8_IC_H_ |
| OLD | NEW |