| 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(UnaryOp_Patch) \ |
| 60 ICU(BinaryOp_Patch) \ | 61 ICU(BinaryOp_Patch) \ |
| 61 ICU(CompareIC_Miss) \ | 62 ICU(CompareIC_Miss) \ |
| 62 ICU(CompareNilIC_Miss) \ | 63 ICU(CompareNilIC_Miss) \ |
| 63 ICU(Unreachable) \ | 64 ICU(Unreachable) \ |
| 64 ICU(ToBooleanIC_Miss) | 65 ICU(ToBooleanIC_Miss) |
| 65 // | 66 // |
| 66 // IC is the base class for LoadIC, StoreIC, CallIC, KeyedLoadIC, | 67 // IC is the base class for LoadIC, StoreIC, CallIC, KeyedLoadIC, |
| 67 // and KeyedStoreIC. | 68 // and KeyedStoreIC. |
| 68 // | 69 // |
| 69 class IC { | 70 class IC { |
| (...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 | 674 |
| 674 Handle<Map> ComputeTransitionedMap(Handle<JSObject> receiver, | 675 Handle<Map> ComputeTransitionedMap(Handle<JSObject> receiver, |
| 675 KeyedAccessStoreMode store_mode); | 676 KeyedAccessStoreMode store_mode); |
| 676 | 677 |
| 677 friend class IC; | 678 friend class IC; |
| 678 }; | 679 }; |
| 679 | 680 |
| 680 | 681 |
| 681 class UnaryOpIC: public IC { | 682 class UnaryOpIC: public IC { |
| 682 public: | 683 public: |
| 683 explicit UnaryOpIC(Isolate* isolate) : IC(EXTRA_CALL_FRAME, isolate) { } | 684 // sorted: increasingly more unspecific (ignoring UNINITIALIZED) |
| 685 // TODO(svenpanne) Using enums+switch is an antipattern, use a class instead. |
| 686 enum TypeInfo { |
| 687 UNINITIALIZED, |
| 688 SMI, |
| 689 NUMBER, |
| 690 GENERIC |
| 691 }; |
| 684 | 692 |
| 685 MUST_USE_RESULT MaybeObject* Transition(Handle<Object> object); | 693 static Handle<Type> TypeInfoToType(TypeInfo info, Isolate* isolate); |
| 694 |
| 695 explicit UnaryOpIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) { } |
| 696 |
| 697 void patch(Code* code); |
| 698 |
| 699 static const char* GetName(TypeInfo type_info); |
| 700 |
| 701 static State ToState(TypeInfo type_info); |
| 702 |
| 703 static TypeInfo GetTypeInfo(Handle<Object> operand); |
| 704 |
| 705 static TypeInfo ComputeNewType(TypeInfo type, TypeInfo previous); |
| 686 }; | 706 }; |
| 687 | 707 |
| 688 | 708 |
| 689 // Type Recording BinaryOpIC, that records the types of the inputs and outputs. | 709 // Type Recording BinaryOpIC, that records the types of the inputs and outputs. |
| 690 class BinaryOpIC: public IC { | 710 class BinaryOpIC: public IC { |
| 691 public: | 711 public: |
| 692 enum TypeInfo { | 712 enum TypeInfo { |
| 693 UNINITIALIZED, | 713 UNINITIALIZED, |
| 694 SMI, | 714 SMI, |
| 695 INT32, | 715 INT32, |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 MaybeObject* ToBoolean(Handle<Object> object, Code::ExtraICState state); | 831 MaybeObject* ToBoolean(Handle<Object> object, Code::ExtraICState state); |
| 812 }; | 832 }; |
| 813 | 833 |
| 814 | 834 |
| 815 // Helper for BinaryOpIC and CompareIC. | 835 // Helper for BinaryOpIC and CompareIC. |
| 816 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; | 836 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; |
| 817 void PatchInlinedSmiCode(Address address, InlinedSmiCheck check); | 837 void PatchInlinedSmiCode(Address address, InlinedSmiCheck check); |
| 818 | 838 |
| 819 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_MissFromStubFailure); | 839 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_MissFromStubFailure); |
| 820 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedStoreIC_MissFromStubFailure); | 840 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedStoreIC_MissFromStubFailure); |
| 821 DECLARE_RUNTIME_FUNCTION(MaybeObject*, UnaryOpIC_Miss); | |
| 822 DECLARE_RUNTIME_FUNCTION(MaybeObject*, CompareNilIC_Miss); | 841 DECLARE_RUNTIME_FUNCTION(MaybeObject*, CompareNilIC_Miss); |
| 823 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ToBooleanIC_Miss); | 842 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ToBooleanIC_Miss); |
| 824 | 843 |
| 825 | 844 |
| 826 } } // namespace v8::internal | 845 } } // namespace v8::internal |
| 827 | 846 |
| 828 #endif // V8_IC_H_ | 847 #endif // V8_IC_H_ |
| OLD | NEW |