Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Side by Side Diff: src/ic.h

Issue 24072013: Hydrogenisation of binops (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix overwrite mode & better result typefeedback Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 692 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 enum TypeInfo { 764 enum TypeInfo {
765 UNINITIALIZED, 765 UNINITIALIZED,
766 SMI, 766 SMI,
767 INT32, 767 INT32,
768 NUMBER, 768 NUMBER,
769 ODDBALL, 769 ODDBALL,
770 STRING, // Only used for addition operation. 770 STRING, // Only used for addition operation.
771 GENERIC 771 GENERIC
772 }; 772 };
773 773
774 static void StubInfoToType(int minor_key, 774 explicit BinaryOpIC(Isolate* isolate) : IC(EXTRA_CALL_FRAME, isolate) { }
775 Handle<Type>* left,
776 Handle<Type>* right,
777 Handle<Type>* result,
778 Isolate* isolate);
779 775
780 explicit BinaryOpIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) { } 776 static Builtins::JavaScript TokenToJSBuiltin(Token::Value op);
781
782 void patch(Code* code);
783 777
784 static const char* GetName(TypeInfo type_info); 778 static const char* GetName(TypeInfo type_info);
785 779
786 static State ToState(TypeInfo type_info); 780 MUST_USE_RESULT MaybeObject* Transition(Handle<Object> left,
787 781 Handle<Object> right);
788 private:
789 static Handle<Type> TypeInfoToType(TypeInfo binary_type, Isolate* isolate);
790 }; 782 };
791 783
792 784
793 class CompareIC: public IC { 785 class CompareIC: public IC {
794 public: 786 public:
795 // The type/state lattice is defined by the following inequations: 787 // The type/state lattice is defined by the following inequations:
796 // UNINITIALIZED < ... 788 // UNINITIALIZED < ...
797 // ... < GENERIC 789 // ... < GENERIC
798 // SMI < NUMBER 790 // SMI < NUMBER
799 // INTERNALIZED_STRING < STRING 791 // INTERNALIZED_STRING < STRING
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
886 878
887 // Helper for BinaryOpIC and CompareIC. 879 // Helper for BinaryOpIC and CompareIC.
888 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; 880 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK };
889 void PatchInlinedSmiCode(Address address, InlinedSmiCheck check); 881 void PatchInlinedSmiCode(Address address, InlinedSmiCheck check);
890 882
891 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_MissFromStubFailure); 883 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_MissFromStubFailure);
892 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedStoreIC_MissFromStubFailure); 884 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedStoreIC_MissFromStubFailure);
893 DECLARE_RUNTIME_FUNCTION(MaybeObject*, UnaryOpIC_Miss); 885 DECLARE_RUNTIME_FUNCTION(MaybeObject*, UnaryOpIC_Miss);
894 DECLARE_RUNTIME_FUNCTION(MaybeObject*, StoreIC_MissFromStubFailure); 886 DECLARE_RUNTIME_FUNCTION(MaybeObject*, StoreIC_MissFromStubFailure);
895 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ElementsTransitionAndStoreIC_Miss); 887 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ElementsTransitionAndStoreIC_Miss);
888 DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_Miss);
896 DECLARE_RUNTIME_FUNCTION(MaybeObject*, CompareNilIC_Miss); 889 DECLARE_RUNTIME_FUNCTION(MaybeObject*, CompareNilIC_Miss);
897 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ToBooleanIC_Miss); 890 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ToBooleanIC_Miss);
898 891
899 892
900 } } // namespace v8::internal 893 } } // namespace v8::internal
901 894
902 #endif // V8_IC_H_ 895 #endif // V8_IC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698