| 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 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 enum TypeInfo { | 729 enum TypeInfo { |
| 730 UNINITIALIZED, | 730 UNINITIALIZED, |
| 731 SMI, | 731 SMI, |
| 732 INT32, | 732 INT32, |
| 733 NUMBER, | 733 NUMBER, |
| 734 ODDBALL, | 734 ODDBALL, |
| 735 STRING, // Only used for addition operation. | 735 STRING, // Only used for addition operation. |
| 736 GENERIC | 736 GENERIC |
| 737 }; | 737 }; |
| 738 | 738 |
| 739 static void StubInfoToType(int minor_key, | 739 explicit BinaryOpIC(Isolate* isolate) : IC(EXTRA_CALL_FRAME, isolate) { } |
| 740 Handle<Type>* left, | |
| 741 Handle<Type>* right, | |
| 742 Handle<Type>* result, | |
| 743 Isolate* isolate); | |
| 744 | 740 |
| 745 explicit BinaryOpIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) { } | 741 static Builtins::JavaScript TokenToJSBuiltin(Token::Value op); |
| 746 | |
| 747 void patch(Code* code); | |
| 748 | 742 |
| 749 static const char* GetName(TypeInfo type_info); | 743 static const char* GetName(TypeInfo type_info); |
| 750 | 744 |
| 751 static State ToState(TypeInfo type_info); | 745 MUST_USE_RESULT MaybeObject* Transition(Handle<Object> left, |
| 752 | 746 Handle<Object> right); |
| 753 private: | |
| 754 static Handle<Type> TypeInfoToType(TypeInfo binary_type, Isolate* isolate); | |
| 755 }; | 747 }; |
| 756 | 748 |
| 757 | 749 |
| 758 class CompareIC: public IC { | 750 class CompareIC: public IC { |
| 759 public: | 751 public: |
| 760 // The type/state lattice is defined by the following inequations: | 752 // The type/state lattice is defined by the following inequations: |
| 761 // UNINITIALIZED < ... | 753 // UNINITIALIZED < ... |
| 762 // ... < GENERIC | 754 // ... < GENERIC |
| 763 // SMI < NUMBER | 755 // SMI < NUMBER |
| 764 // INTERNALIZED_STRING < STRING | 756 // INTERNALIZED_STRING < STRING |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 851 | 843 |
| 852 // Helper for BinaryOpIC and CompareIC. | 844 // Helper for BinaryOpIC and CompareIC. |
| 853 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; | 845 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; |
| 854 void PatchInlinedSmiCode(Address address, InlinedSmiCheck check); | 846 void PatchInlinedSmiCode(Address address, InlinedSmiCheck check); |
| 855 | 847 |
| 856 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_MissFromStubFailure); | 848 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_MissFromStubFailure); |
| 857 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedStoreIC_MissFromStubFailure); | 849 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedStoreIC_MissFromStubFailure); |
| 858 DECLARE_RUNTIME_FUNCTION(MaybeObject*, UnaryOpIC_Miss); | 850 DECLARE_RUNTIME_FUNCTION(MaybeObject*, UnaryOpIC_Miss); |
| 859 DECLARE_RUNTIME_FUNCTION(MaybeObject*, StoreIC_MissFromStubFailure); | 851 DECLARE_RUNTIME_FUNCTION(MaybeObject*, StoreIC_MissFromStubFailure); |
| 860 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ElementsTransitionAndStoreIC_Miss); | 852 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ElementsTransitionAndStoreIC_Miss); |
| 853 DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_Miss); |
| 861 DECLARE_RUNTIME_FUNCTION(MaybeObject*, CompareNilIC_Miss); | 854 DECLARE_RUNTIME_FUNCTION(MaybeObject*, CompareNilIC_Miss); |
| 862 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ToBooleanIC_Miss); | 855 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ToBooleanIC_Miss); |
| 863 | 856 |
| 864 | 857 |
| 865 } } // namespace v8::internal | 858 } } // namespace v8::internal |
| 866 | 859 |
| 867 #endif // V8_IC_H_ | 860 #endif // V8_IC_H_ |
| OLD | NEW |