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

Side by Side Diff: src/code-stubs.h

Issue 197603002: Turn StringLengthStub (used by string wrappers only) into a hydrogen stub. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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/arm/stub-cache-arm.cc ('k') | src/code-stubs-hydrogen.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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 V(BinaryOpIC) \ 44 V(BinaryOpIC) \
45 V(BinaryOpICWithAllocationSite) \ 45 V(BinaryOpICWithAllocationSite) \
46 V(BinaryOpWithAllocationSite) \ 46 V(BinaryOpWithAllocationSite) \
47 V(StringAdd) \ 47 V(StringAdd) \
48 V(SubString) \ 48 V(SubString) \
49 V(StringCompare) \ 49 V(StringCompare) \
50 V(Compare) \ 50 V(Compare) \
51 V(CompareIC) \ 51 V(CompareIC) \
52 V(CompareNilIC) \ 52 V(CompareNilIC) \
53 V(MathPow) \ 53 V(MathPow) \
54 V(StringLength) \
55 V(FunctionPrototype) \ 54 V(FunctionPrototype) \
56 V(StoreArrayLength) \ 55 V(StoreArrayLength) \
57 V(RecordWrite) \ 56 V(RecordWrite) \
58 V(StoreBufferOverflow) \ 57 V(StoreBufferOverflow) \
59 V(RegExpExec) \ 58 V(RegExpExec) \
60 V(Instanceof) \ 59 V(Instanceof) \
61 V(ConvertToDouble) \ 60 V(ConvertToDouble) \
62 V(WriteInt32ToHeapNumber) \ 61 V(WriteInt32ToHeapNumber) \
63 V(StackCheck) \ 62 V(StackCheck) \
64 V(Interrupt) \ 63 V(Interrupt) \
(...skipping 26 matching lines...) Expand all
91 V(StoreArrayLiteralElement) \ 90 V(StoreArrayLiteralElement) \
92 V(StubFailureTrampoline) \ 91 V(StubFailureTrampoline) \
93 V(ArrayConstructor) \ 92 V(ArrayConstructor) \
94 V(InternalArrayConstructor) \ 93 V(InternalArrayConstructor) \
95 V(ProfileEntryHook) \ 94 V(ProfileEntryHook) \
96 V(StoreGlobal) \ 95 V(StoreGlobal) \
97 V(CallApiFunction) \ 96 V(CallApiFunction) \
98 V(CallApiGetter) \ 97 V(CallApiGetter) \
99 /* IC Handler stubs */ \ 98 /* IC Handler stubs */ \
100 V(LoadField) \ 99 V(LoadField) \
101 V(KeyedLoadField) 100 V(KeyedLoadField) \
101 V(StringLength) \
102 V(KeyedStringLength)
102 103
103 // List of code stubs only used on ARM platforms. 104 // List of code stubs only used on ARM platforms.
104 #if defined(V8_TARGET_ARCH_ARM) || defined(V8_TARGET_ARCH_A64) 105 #if defined(V8_TARGET_ARCH_ARM) || defined(V8_TARGET_ARCH_A64)
105 #define CODE_STUB_LIST_ARM(V) \ 106 #define CODE_STUB_LIST_ARM(V) \
106 V(GetProperty) \ 107 V(GetProperty) \
107 V(SetProperty) \ 108 V(SetProperty) \
108 V(InvokeBuiltin) \ 109 V(InvokeBuiltin) \
109 V(DirectCEntry) 110 V(DirectCEntry)
110 #else 111 #else
111 #define CODE_STUB_LIST_ARM(V) 112 #define CODE_STUB_LIST_ARM(V)
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 class FunctionPrototypeStub: public ICStub { 827 class FunctionPrototypeStub: public ICStub {
827 public: 828 public:
828 explicit FunctionPrototypeStub(Code::Kind kind) : ICStub(kind) { } 829 explicit FunctionPrototypeStub(Code::Kind kind) : ICStub(kind) { }
829 virtual void Generate(MacroAssembler* masm); 830 virtual void Generate(MacroAssembler* masm);
830 831
831 private: 832 private:
832 virtual CodeStub::Major MajorKey() { return FunctionPrototype; } 833 virtual CodeStub::Major MajorKey() { return FunctionPrototype; }
833 }; 834 };
834 835
835 836
836 class StringLengthStub: public ICStub {
837 public:
838 explicit StringLengthStub(Code::Kind kind) : ICStub(kind) { }
839 virtual void Generate(MacroAssembler* masm);
840
841 private:
842 STATIC_ASSERT(KindBits::kSize == 4);
843 virtual CodeStub::Major MajorKey() { return StringLength; }
844 };
845
846
847 class StoreICStub: public ICStub { 837 class StoreICStub: public ICStub {
848 public: 838 public:
849 StoreICStub(Code::Kind kind, StrictMode strict_mode) 839 StoreICStub(Code::Kind kind, StrictMode strict_mode)
850 : ICStub(kind), strict_mode_(strict_mode) { } 840 : ICStub(kind), strict_mode_(strict_mode) { }
851 841
852 protected: 842 protected:
853 virtual ExtraICState GetExtraICState() { 843 virtual ExtraICState GetExtraICState() {
854 return StoreIC::ComputeExtraICState(strict_mode_); 844 return StoreIC::ComputeExtraICState(strict_mode_);
855 } 845 }
856 846
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
952 942
953 private: 943 private:
954 STATIC_ASSERT(KindBits::kSize == 4); 944 STATIC_ASSERT(KindBits::kSize == 4);
955 class InobjectBits: public BitField<bool, 4, 1> {}; 945 class InobjectBits: public BitField<bool, 4, 1> {};
956 class IndexBits: public BitField<int, 5, 11> {}; 946 class IndexBits: public BitField<int, 5, 11> {};
957 class UnboxedDoubleBits: public BitField<bool, 16, 1> {}; 947 class UnboxedDoubleBits: public BitField<bool, 16, 1> {};
958 virtual CodeStub::Major MajorKey() { return LoadField; } 948 virtual CodeStub::Major MajorKey() { return LoadField; }
959 }; 949 };
960 950
961 951
952 class StringLengthStub: public HandlerStub {
953 public:
954 explicit StringLengthStub() : HandlerStub() {
955 Initialize(Code::LOAD_IC);
956 }
957 virtual Handle<Code> GenerateCode(Isolate* isolate);
958 virtual void InitializeInterfaceDescriptor(
959 Isolate* isolate,
960 CodeStubInterfaceDescriptor* descriptor);
961
962 protected:
963 virtual Code::Kind kind() const {
964 return KindBits::decode(bit_field_);
965 }
966
967 void Initialize(Code::Kind kind) {
968 bit_field_ = KindBits::encode(kind);
969 }
970
971 private:
972 virtual CodeStub::Major MajorKey() { return StringLength; }
973 };
974
975
976 class KeyedStringLengthStub: public StringLengthStub {
977 public:
978 explicit KeyedStringLengthStub() : StringLengthStub() {
979 Initialize(Code::KEYED_LOAD_IC);
980 }
981 virtual void InitializeInterfaceDescriptor(
982 Isolate* isolate,
983 CodeStubInterfaceDescriptor* descriptor);
984
985 private:
986 virtual CodeStub::Major MajorKey() { return KeyedStringLength; }
987 };
988
989
962 class StoreGlobalStub : public HandlerStub { 990 class StoreGlobalStub : public HandlerStub {
963 public: 991 public:
964 explicit StoreGlobalStub(bool is_constant, bool check_global) { 992 explicit StoreGlobalStub(bool is_constant, bool check_global) {
965 bit_field_ = IsConstantBits::encode(is_constant) | 993 bit_field_ = IsConstantBits::encode(is_constant) |
966 CheckGlobalBits::encode(check_global); 994 CheckGlobalBits::encode(check_global);
967 } 995 }
968 996
969 static Handle<HeapObject> global_placeholder(Isolate* isolate) { 997 static Handle<HeapObject> global_placeholder(Isolate* isolate) {
970 return isolate->factory()->uninitialized_value(); 998 return isolate->factory()->uninitialized_value();
971 } 999 }
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
1065 public: 1093 public:
1066 KeyedLoadFieldStub(bool inobject, int index, Representation representation) 1094 KeyedLoadFieldStub(bool inobject, int index, Representation representation)
1067 : LoadFieldStub() { 1095 : LoadFieldStub() {
1068 Initialize(Code::KEYED_LOAD_IC, inobject, index, representation); 1096 Initialize(Code::KEYED_LOAD_IC, inobject, index, representation);
1069 } 1097 }
1070 1098
1071 virtual void InitializeInterfaceDescriptor( 1099 virtual void InitializeInterfaceDescriptor(
1072 Isolate* isolate, 1100 Isolate* isolate,
1073 CodeStubInterfaceDescriptor* descriptor); 1101 CodeStubInterfaceDescriptor* descriptor);
1074 1102
1075 virtual Handle<Code> GenerateCode(Isolate* isolate);
1076
1077 private: 1103 private:
1078 virtual CodeStub::Major MajorKey() { return KeyedLoadField; } 1104 virtual CodeStub::Major MajorKey() { return KeyedLoadField; }
1079 }; 1105 };
1080 1106
1081 1107
1082 class BinaryOpICStub : public HydrogenCodeStub { 1108 class BinaryOpICStub : public HydrogenCodeStub {
1083 public: 1109 public:
1084 BinaryOpICStub(Token::Value op, OverwriteMode mode) 1110 BinaryOpICStub(Token::Value op, OverwriteMode mode)
1085 : HydrogenCodeStub(UNINITIALIZED), state_(op, mode) {} 1111 : HydrogenCodeStub(UNINITIALIZED), state_(op, mode) {}
1086 1112
(...skipping 1401 matching lines...) Expand 10 before | Expand all | Expand 10 after
2488 2514
2489 2515
2490 class CallDescriptors { 2516 class CallDescriptors {
2491 public: 2517 public:
2492 static void InitializeForIsolate(Isolate* isolate); 2518 static void InitializeForIsolate(Isolate* isolate);
2493 }; 2519 };
2494 2520
2495 } } // namespace v8::internal 2521 } } // namespace v8::internal
2496 2522
2497 #endif // V8_CODE_STUBS_H_ 2523 #endif // V8_CODE_STUBS_H_
OLDNEW
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/code-stubs-hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698