| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 ICU(KeyedStoreIC_Miss) \ | 50 ICU(KeyedStoreIC_Miss) \ |
| 51 ICU(KeyedStoreIC_MissForceGeneric) \ | 51 ICU(KeyedStoreIC_MissForceGeneric) \ |
| 52 ICU(KeyedStoreIC_Slow) \ | 52 ICU(KeyedStoreIC_Slow) \ |
| 53 /* Utilities for IC stubs. */ \ | 53 /* Utilities for IC stubs. */ \ |
| 54 ICU(StoreCallbackProperty) \ | 54 ICU(StoreCallbackProperty) \ |
| 55 ICU(LoadPropertyWithInterceptorOnly) \ | 55 ICU(LoadPropertyWithInterceptorOnly) \ |
| 56 ICU(LoadPropertyWithInterceptorForLoad) \ | 56 ICU(LoadPropertyWithInterceptorForLoad) \ |
| 57 ICU(LoadPropertyWithInterceptorForCall) \ | 57 ICU(LoadPropertyWithInterceptorForCall) \ |
| 58 ICU(KeyedLoadPropertyWithInterceptor) \ | 58 ICU(KeyedLoadPropertyWithInterceptor) \ |
| 59 ICU(StoreInterceptorProperty) \ | 59 ICU(StoreInterceptorProperty) \ |
| 60 ICU(BinaryOp_Patch) \ | |
| 61 ICU(CompareIC_Miss) \ | 60 ICU(CompareIC_Miss) \ |
| 61 ICU(BinaryOpIC_Miss) \ |
| 62 ICU(CompareNilIC_Miss) \ | 62 ICU(CompareNilIC_Miss) \ |
| 63 ICU(Unreachable) \ | 63 ICU(Unreachable) \ |
| 64 ICU(ToBooleanIC_Miss) | 64 ICU(ToBooleanIC_Miss) |
| 65 // | 65 // |
| 66 // IC is the base class for LoadIC, StoreIC, CallIC, KeyedLoadIC, | 66 // IC is the base class for LoadIC, StoreIC, CallIC, KeyedLoadIC, |
| 67 // and KeyedStoreIC. | 67 // and KeyedStoreIC. |
| 68 // | 68 // |
| 69 class IC { | 69 class IC { |
| 70 public: | 70 public: |
| 71 // The ids for utility called from the generated code. | 71 // The ids for utility called from the generated code. |
| (...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 728 enum TypeInfo { | 728 enum TypeInfo { |
| 729 UNINITIALIZED, | 729 UNINITIALIZED, |
| 730 SMI, | 730 SMI, |
| 731 INT32, | 731 INT32, |
| 732 NUMBER, | 732 NUMBER, |
| 733 ODDBALL, | 733 ODDBALL, |
| 734 STRING, // Only used for addition operation. | 734 STRING, // Only used for addition operation. |
| 735 GENERIC | 735 GENERIC |
| 736 }; | 736 }; |
| 737 | 737 |
| 738 static void StubInfoToType(int minor_key, | 738 explicit BinaryOpIC(Isolate* isolate) : IC(EXTRA_CALL_FRAME, isolate) { } |
| 739 Handle<Type>* left, | |
| 740 Handle<Type>* right, | |
| 741 Handle<Type>* result, | |
| 742 Isolate* isolate); | |
| 743 | 739 |
| 744 explicit BinaryOpIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) { } | 740 static Builtins::JavaScript TokenToJSBuiltin(Token::Value op); |
| 745 | |
| 746 void patch(Code* code); | |
| 747 | 741 |
| 748 static const char* GetName(TypeInfo type_info); | 742 static const char* GetName(TypeInfo type_info); |
| 749 | 743 |
| 750 static State ToState(TypeInfo type_info); | 744 MUST_USE_RESULT MaybeObject* Transition(Handle<Object> left, |
| 751 | 745 Handle<Object> right); |
| 752 private: | |
| 753 static Handle<Type> TypeInfoToType(TypeInfo binary_type, Isolate* isolate); | |
| 754 }; | 746 }; |
| 755 | 747 |
| 756 | 748 |
| 757 class CompareIC: public IC { | 749 class CompareIC: public IC { |
| 758 public: | 750 public: |
| 759 // The type/state lattice is defined by the following inequations: | 751 // The type/state lattice is defined by the following inequations: |
| 760 // UNINITIALIZED < ... | 752 // UNINITIALIZED < ... |
| 761 // ... < GENERIC | 753 // ... < GENERIC |
| 762 // SMI < NUMBER | 754 // SMI < NUMBER |
| 763 // INTERNALIZED_STRING < STRING | 755 // INTERNALIZED_STRING < STRING |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 850 | 842 |
| 851 // Helper for BinaryOpIC and CompareIC. | 843 // Helper for BinaryOpIC and CompareIC. |
| 852 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; | 844 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; |
| 853 void PatchInlinedSmiCode(Address address, InlinedSmiCheck check); | 845 void PatchInlinedSmiCode(Address address, InlinedSmiCheck check); |
| 854 | 846 |
| 855 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_MissFromStubFailure); | 847 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_MissFromStubFailure); |
| 856 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedStoreIC_MissFromStubFailure); | 848 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedStoreIC_MissFromStubFailure); |
| 857 DECLARE_RUNTIME_FUNCTION(MaybeObject*, UnaryOpIC_Miss); | 849 DECLARE_RUNTIME_FUNCTION(MaybeObject*, UnaryOpIC_Miss); |
| 858 DECLARE_RUNTIME_FUNCTION(MaybeObject*, StoreIC_MissFromStubFailure); | 850 DECLARE_RUNTIME_FUNCTION(MaybeObject*, StoreIC_MissFromStubFailure); |
| 859 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ElementsTransitionAndStoreIC_Miss); | 851 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ElementsTransitionAndStoreIC_Miss); |
| 852 DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_Miss); |
| 860 DECLARE_RUNTIME_FUNCTION(MaybeObject*, CompareNilIC_Miss); | 853 DECLARE_RUNTIME_FUNCTION(MaybeObject*, CompareNilIC_Miss); |
| 861 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ToBooleanIC_Miss); | 854 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ToBooleanIC_Miss); |
| 862 | 855 |
| 863 | 856 |
| 864 } } // namespace v8::internal | 857 } } // namespace v8::internal |
| 865 | 858 |
| 866 #endif // V8_IC_H_ | 859 #endif // V8_IC_H_ |
| OLD | NEW |