| 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 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 enum TypeInfo { | 741 enum TypeInfo { |
| 742 UNINITIALIZED, | 742 UNINITIALIZED, |
| 743 SMI, | 743 SMI, |
| 744 INT32, | 744 INT32, |
| 745 NUMBER, | 745 NUMBER, |
| 746 ODDBALL, | 746 ODDBALL, |
| 747 STRING, // Only used for addition operation. | 747 STRING, // Only used for addition operation. |
| 748 GENERIC | 748 GENERIC |
| 749 }; | 749 }; |
| 750 | 750 |
| 751 static void StubInfoToType(int minor_key, | 751 explicit BinaryOpIC(Isolate* isolate) : IC(EXTRA_CALL_FRAME, isolate) { } |
| 752 Handle<Type>* left, | |
| 753 Handle<Type>* right, | |
| 754 Handle<Type>* result, | |
| 755 Isolate* isolate); | |
| 756 | 752 |
| 757 explicit BinaryOpIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) { } | 753 static Builtins::JavaScript TokenToJSBuiltin(Token::Value op); |
| 758 | |
| 759 void patch(Code* code); | |
| 760 | 754 |
| 761 static const char* GetName(TypeInfo type_info); | 755 static const char* GetName(TypeInfo type_info); |
| 762 | 756 |
| 763 static State ToState(TypeInfo type_info); | 757 MUST_USE_RESULT MaybeObject* Transition(Handle<Object> left, |
| 764 | 758 Handle<Object> right); |
| 765 private: | |
| 766 static Handle<Type> TypeInfoToType(TypeInfo binary_type, Isolate* isolate); | |
| 767 }; | 759 }; |
| 768 | 760 |
| 769 | 761 |
| 770 class CompareIC: public IC { | 762 class CompareIC: public IC { |
| 771 public: | 763 public: |
| 772 // The type/state lattice is defined by the following inequations: | 764 // The type/state lattice is defined by the following inequations: |
| 773 // UNINITIALIZED < ... | 765 // UNINITIALIZED < ... |
| 774 // ... < GENERIC | 766 // ... < GENERIC |
| 775 // SMI < NUMBER | 767 // SMI < NUMBER |
| 776 // INTERNALIZED_STRING < STRING | 768 // INTERNALIZED_STRING < STRING |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 863 | 855 |
| 864 // Helper for BinaryOpIC and CompareIC. | 856 // Helper for BinaryOpIC and CompareIC. |
| 865 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; | 857 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; |
| 866 void PatchInlinedSmiCode(Address address, InlinedSmiCheck check); | 858 void PatchInlinedSmiCode(Address address, InlinedSmiCheck check); |
| 867 | 859 |
| 868 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_MissFromStubFailure); | 860 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_MissFromStubFailure); |
| 869 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedStoreIC_MissFromStubFailure); | 861 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedStoreIC_MissFromStubFailure); |
| 870 DECLARE_RUNTIME_FUNCTION(MaybeObject*, UnaryOpIC_Miss); | 862 DECLARE_RUNTIME_FUNCTION(MaybeObject*, UnaryOpIC_Miss); |
| 871 DECLARE_RUNTIME_FUNCTION(MaybeObject*, StoreIC_MissFromStubFailure); | 863 DECLARE_RUNTIME_FUNCTION(MaybeObject*, StoreIC_MissFromStubFailure); |
| 872 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ElementsTransitionAndStoreIC_Miss); | 864 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ElementsTransitionAndStoreIC_Miss); |
| 865 DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_Miss); |
| 873 DECLARE_RUNTIME_FUNCTION(MaybeObject*, CompareNilIC_Miss); | 866 DECLARE_RUNTIME_FUNCTION(MaybeObject*, CompareNilIC_Miss); |
| 874 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ToBooleanIC_Miss); | 867 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ToBooleanIC_Miss); |
| 875 | 868 |
| 876 | 869 |
| 877 } } // namespace v8::internal | 870 } } // namespace v8::internal |
| 878 | 871 |
| 879 #endif // V8_IC_H_ | 872 #endif // V8_IC_H_ |
| OLD | NEW |