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

Side by Side Diff: src/ic.h

Issue 157503002: A64: Synchronize with r18444. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 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/stub-cache-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 11 matching lines...) Expand all
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 27
28 #ifndef V8_IC_H_ 28 #ifndef V8_IC_H_
29 #define V8_IC_H_ 29 #define V8_IC_H_
30 30
31 #include "macro-assembler.h" 31 #include "macro-assembler.h"
32 #include "type-info.h"
33 32
34 namespace v8 { 33 namespace v8 {
35 namespace internal { 34 namespace internal {
36 35
37 36
37 const int kMaxKeyedPolymorphism = 4;
38
39
38 // IC_UTIL_LIST defines all utility functions called from generated 40 // IC_UTIL_LIST defines all utility functions called from generated
39 // inline caching code. The argument for the macro, ICU, is the function name. 41 // inline caching code. The argument for the macro, ICU, is the function name.
40 #define IC_UTIL_LIST(ICU) \ 42 #define IC_UTIL_LIST(ICU) \
41 ICU(LoadIC_Miss) \ 43 ICU(LoadIC_Miss) \
42 ICU(KeyedLoadIC_Miss) \ 44 ICU(KeyedLoadIC_Miss) \
43 ICU(CallIC_Miss) \ 45 ICU(CallIC_Miss) \
44 ICU(KeyedCallIC_Miss) \ 46 ICU(KeyedCallIC_Miss) \
45 ICU(StoreIC_Miss) \ 47 ICU(StoreIC_Miss) \
46 ICU(StoreIC_ArrayLength) \ 48 ICU(StoreIC_ArrayLength) \
47 ICU(StoreIC_Slow) \ 49 ICU(StoreIC_Slow) \
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 291
290 Address address() const { return address_; } 292 Address address() const { return address_; }
291 293
292 IC::UtilityId id() const { return id_; } 294 IC::UtilityId id() const { return id_; }
293 private: 295 private:
294 Address address_; 296 Address address_;
295 IC::UtilityId id_; 297 IC::UtilityId id_;
296 }; 298 };
297 299
298 300
301 enum StringStubFeedback {
302 DEFAULT_STRING_STUB = 0,
303 STRING_INDEX_OUT_OF_BOUNDS = 1
304 };
305
306
299 class CallICBase: public IC { 307 class CallICBase: public IC {
300 public: 308 public:
301 // ExtraICState bits 309 // ExtraICState bits
302 class Contextual: public BitField<ContextualMode, 0, 1> {}; 310 class Contextual: public BitField<ContextualMode, 0, 1> {};
303 class StringStubState: public BitField<StringStubFeedback, 1, 1> {}; 311 class StringStubState: public BitField<StringStubFeedback, 1, 1> {};
304 static ExtraICState ComputeExtraICState(ContextualMode mode, 312 static ExtraICState ComputeExtraICState(ContextualMode mode,
305 StringStubFeedback feedback) { 313 StringStubFeedback feedback) {
306 return Contextual::encode(mode) | StringStubState::encode(feedback); 314 return Contextual::encode(mode) | StringStubState::encode(feedback);
307 } 315 }
308 316
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
846 Isolate*, void (*Generate)(Isolate*, const State&)); 854 Isolate*, void (*Generate)(Isolate*, const State&));
847 855
848 bool CanReuseDoubleBox() const { 856 bool CanReuseDoubleBox() const {
849 return (result_kind_ > SMI && result_kind_ <= NUMBER) && 857 return (result_kind_ > SMI && result_kind_ <= NUMBER) &&
850 ((mode_ == OVERWRITE_LEFT && 858 ((mode_ == OVERWRITE_LEFT &&
851 left_kind_ > SMI && left_kind_ <= NUMBER) || 859 left_kind_ > SMI && left_kind_ <= NUMBER) ||
852 (mode_ == OVERWRITE_RIGHT && 860 (mode_ == OVERWRITE_RIGHT &&
853 right_kind_ > SMI && right_kind_ <= NUMBER)); 861 right_kind_ > SMI && right_kind_ <= NUMBER));
854 } 862 }
855 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
856 bool HasSideEffects() const { 879 bool HasSideEffects() const {
857 return Max(left_kind_, right_kind_) == GENERIC; 880 return Max(left_kind_, right_kind_) == GENERIC;
858 } 881 }
859 882
883 // Returns true if the IC should enable the inline smi code (i.e. if either
884 // parameter may be a smi).
860 bool UseInlinedSmiCode() const { 885 bool UseInlinedSmiCode() const {
861 return KindMaybeSmi(left_kind_) || KindMaybeSmi(right_kind_); 886 return KindMaybeSmi(left_kind_) || KindMaybeSmi(right_kind_);
862 } 887 }
863 888
864 static const int FIRST_TOKEN = Token::BIT_OR; 889 static const int FIRST_TOKEN = Token::BIT_OR;
865 static const int LAST_TOKEN = Token::MOD; 890 static const int LAST_TOKEN = Token::MOD;
866 891
867 Token::Value op() const { return op_; } 892 Token::Value op() const { return op_; }
868 OverwriteMode mode() const { return mode_; } 893 OverwriteMode mode() const { return mode_; }
869 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
911 Kind left_kind_; 936 Kind left_kind_;
912 Kind right_kind_; 937 Kind right_kind_;
913 Kind result_kind_; 938 Kind result_kind_;
914 Maybe<int> fixed_right_arg_; 939 Maybe<int> fixed_right_arg_;
915 }; 940 };
916 941
917 explicit BinaryOpIC(Isolate* isolate) : IC(EXTRA_CALL_FRAME, isolate) { } 942 explicit BinaryOpIC(Isolate* isolate) : IC(EXTRA_CALL_FRAME, isolate) { }
918 943
919 static Builtins::JavaScript TokenToJSBuiltin(Token::Value op); 944 static Builtins::JavaScript TokenToJSBuiltin(Token::Value op);
920 945
921 MUST_USE_RESULT MaybeObject* Transition(Handle<Object> left, 946 MaybeObject* Transition(Handle<AllocationSite> allocation_site,
922 Handle<Object> right); 947 Handle<Object> left,
948 Handle<Object> right) V8_WARN_UNUSED_RESULT;
923 }; 949 };
924 950
925 951
926 class CompareIC: public IC { 952 class CompareIC: public IC {
927 public: 953 public:
928 // The type/state lattice is defined by the following inequations: 954 // The type/state lattice is defined by the following inequations:
929 // UNINITIALIZED < ... 955 // UNINITIALIZED < ...
930 // ... < GENERIC 956 // ... < GENERIC
931 // SMI < NUMBER 957 // SMI < NUMBER
932 // INTERNALIZED_STRING < STRING 958 // INTERNALIZED_STRING < STRING
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
1021 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; 1047 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK };
1022 void PatchInlinedSmiCode(Address address, InlinedSmiCheck check); 1048 void PatchInlinedSmiCode(Address address, InlinedSmiCheck check);
1023 1049
1024 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_MissFromStubFailure); 1050 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_MissFromStubFailure);
1025 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedStoreIC_MissFromStubFailure); 1051 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedStoreIC_MissFromStubFailure);
1026 DECLARE_RUNTIME_FUNCTION(MaybeObject*, UnaryOpIC_Miss); 1052 DECLARE_RUNTIME_FUNCTION(MaybeObject*, UnaryOpIC_Miss);
1027 DECLARE_RUNTIME_FUNCTION(MaybeObject*, StoreIC_MissFromStubFailure); 1053 DECLARE_RUNTIME_FUNCTION(MaybeObject*, StoreIC_MissFromStubFailure);
1028 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedCallIC_MissFromStubFailure); 1054 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedCallIC_MissFromStubFailure);
1029 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ElementsTransitionAndStoreIC_Miss); 1055 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ElementsTransitionAndStoreIC_Miss);
1030 DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_Miss); 1056 DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_Miss);
1057 DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_MissWithAllocationSite);
1031 DECLARE_RUNTIME_FUNCTION(MaybeObject*, CompareNilIC_Miss); 1058 DECLARE_RUNTIME_FUNCTION(MaybeObject*, CompareNilIC_Miss);
1032 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ToBooleanIC_Miss); 1059 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ToBooleanIC_Miss);
1033 1060
1034 1061
1035 } } // namespace v8::internal 1062 } } // namespace v8::internal
1036 1063
1037 #endif // V8_IC_H_ 1064 #endif // V8_IC_H_
OLDNEW
« no previous file with comments | « src/ia32/stub-cache-ia32.cc ('k') | src/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698