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

Side by Side Diff: src/ic.h

Issue 106453003: Allocation site support for monomorphic StringAdds in BinaryOps. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE Created 6 years, 11 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
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/ic.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 843 matching lines...) Expand 10 before | Expand all | Expand 10 after
854 Isolate*, void (*Generate)(Isolate*, const State&)); 854 Isolate*, void (*Generate)(Isolate*, const State&));
855 855
856 bool CanReuseDoubleBox() const { 856 bool CanReuseDoubleBox() const {
857 return (result_kind_ > SMI && result_kind_ <= NUMBER) && 857 return (result_kind_ > SMI && result_kind_ <= NUMBER) &&
858 ((mode_ == OVERWRITE_LEFT && 858 ((mode_ == OVERWRITE_LEFT &&
859 left_kind_ > SMI && left_kind_ <= NUMBER) || 859 left_kind_ > SMI && left_kind_ <= NUMBER) ||
860 (mode_ == OVERWRITE_RIGHT && 860 (mode_ == OVERWRITE_RIGHT &&
861 right_kind_ > SMI && right_kind_ <= NUMBER)); 861 right_kind_ > SMI && right_kind_ <= NUMBER));
862 } 862 }
863 863
864 // Returns true if the IC _could_ create allocation mementos.
865 bool CouldCreateAllocationMementos() const {
866 if (left_kind_ == STRING || right_kind_ == STRING) {
867 ASSERT_EQ(Token::ADD, op_);
868 return true;
869 }
870 return false;
871 }
872
873 // Returns true if the IC _should_ create allocation mementos.
874 bool ShouldCreateAllocationMementos() const {
875 return FLAG_allocation_site_pretenuring &&
876 CouldCreateAllocationMementos();
877 }
878
864 bool HasSideEffects() const { 879 bool HasSideEffects() const {
865 return Max(left_kind_, right_kind_) == GENERIC; 880 return Max(left_kind_, right_kind_) == GENERIC;
866 } 881 }
867 882
883 // Returns true if the IC should enable the inline smi code (i.e. if either
884 // parameter may be a smi).
868 bool UseInlinedSmiCode() const { 885 bool UseInlinedSmiCode() const {
869 return KindMaybeSmi(left_kind_) || KindMaybeSmi(right_kind_); 886 return KindMaybeSmi(left_kind_) || KindMaybeSmi(right_kind_);
870 } 887 }
871 888
872 static const int FIRST_TOKEN = Token::BIT_OR; 889 static const int FIRST_TOKEN = Token::BIT_OR;
873 static const int LAST_TOKEN = Token::MOD; 890 static const int LAST_TOKEN = Token::MOD;
874 891
875 Token::Value op() const { return op_; } 892 Token::Value op() const { return op_; }
876 OverwriteMode mode() const { return mode_; } 893 OverwriteMode mode() const { return mode_; }
877 Maybe<int> fixed_right_arg() const { return fixed_right_arg_; } 894 Maybe<int> fixed_right_arg() const { return fixed_right_arg_; }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
919 Kind left_kind_; 936 Kind left_kind_;
920 Kind right_kind_; 937 Kind right_kind_;
921 Kind result_kind_; 938 Kind result_kind_;
922 Maybe<int> fixed_right_arg_; 939 Maybe<int> fixed_right_arg_;
923 }; 940 };
924 941
925 explicit BinaryOpIC(Isolate* isolate) : IC(EXTRA_CALL_FRAME, isolate) { } 942 explicit BinaryOpIC(Isolate* isolate) : IC(EXTRA_CALL_FRAME, isolate) { }
926 943
927 static Builtins::JavaScript TokenToJSBuiltin(Token::Value op); 944 static Builtins::JavaScript TokenToJSBuiltin(Token::Value op);
928 945
929 MUST_USE_RESULT MaybeObject* Transition(Handle<Object> left, 946 MaybeObject* Transition(Handle<AllocationSite> allocation_site,
930 Handle<Object> right); 947 Handle<Object> left,
948 Handle<Object> right) V8_WARN_UNUSED_RESULT;
931 }; 949 };
932 950
933 951
934 class CompareIC: public IC { 952 class CompareIC: public IC {
935 public: 953 public:
936 // The type/state lattice is defined by the following inequations: 954 // The type/state lattice is defined by the following inequations:
937 // UNINITIALIZED < ... 955 // UNINITIALIZED < ...
938 // ... < GENERIC 956 // ... < GENERIC
939 // SMI < NUMBER 957 // SMI < NUMBER
940 // INTERNALIZED_STRING < STRING 958 // INTERNALIZED_STRING < STRING
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
1029 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; 1047 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK };
1030 void PatchInlinedSmiCode(Address address, InlinedSmiCheck check); 1048 void PatchInlinedSmiCode(Address address, InlinedSmiCheck check);
1031 1049
1032 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_MissFromStubFailure); 1050 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_MissFromStubFailure);
1033 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedStoreIC_MissFromStubFailure); 1051 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedStoreIC_MissFromStubFailure);
1034 DECLARE_RUNTIME_FUNCTION(MaybeObject*, UnaryOpIC_Miss); 1052 DECLARE_RUNTIME_FUNCTION(MaybeObject*, UnaryOpIC_Miss);
1035 DECLARE_RUNTIME_FUNCTION(MaybeObject*, StoreIC_MissFromStubFailure); 1053 DECLARE_RUNTIME_FUNCTION(MaybeObject*, StoreIC_MissFromStubFailure);
1036 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedCallIC_MissFromStubFailure); 1054 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedCallIC_MissFromStubFailure);
1037 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ElementsTransitionAndStoreIC_Miss); 1055 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ElementsTransitionAndStoreIC_Miss);
1038 DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_Miss); 1056 DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_Miss);
1057 DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_MissWithAllocationSite);
1039 DECLARE_RUNTIME_FUNCTION(MaybeObject*, CompareNilIC_Miss); 1058 DECLARE_RUNTIME_FUNCTION(MaybeObject*, CompareNilIC_Miss);
1040 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ToBooleanIC_Miss); 1059 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ToBooleanIC_Miss);
1041 1060
1042 1061
1043 } } // namespace v8::internal 1062 } } // namespace v8::internal
1044 1063
1045 #endif // V8_IC_H_ 1064 #endif // V8_IC_H_
OLDNEW
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698