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

Side by Side Diff: src/x64/code-stubs-x64.cc

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/stub-cache.h ('k') | src/x64/stub-cache-x64.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 void KeyedLoadFieldStub::InitializeInterfaceDescriptor( 159 void KeyedLoadFieldStub::InitializeInterfaceDescriptor(
160 Isolate* isolate, 160 Isolate* isolate,
161 CodeStubInterfaceDescriptor* descriptor) { 161 CodeStubInterfaceDescriptor* descriptor) {
162 static Register registers[] = { rdx }; 162 static Register registers[] = { rdx };
163 descriptor->register_param_count_ = 1; 163 descriptor->register_param_count_ = 1;
164 descriptor->register_params_ = registers; 164 descriptor->register_params_ = registers;
165 descriptor->deoptimization_handler_ = NULL; 165 descriptor->deoptimization_handler_ = NULL;
166 } 166 }
167 167
168 168
169 void StringLengthStub::InitializeInterfaceDescriptor(
170 Isolate* isolate,
171 CodeStubInterfaceDescriptor* descriptor) {
172 static Register registers[] = { rax, rcx };
173 descriptor->register_param_count_ = 2;
174 descriptor->register_params_ = registers;
175 descriptor->deoptimization_handler_ = NULL;
176 }
177
178
179 void KeyedStringLengthStub::InitializeInterfaceDescriptor(
180 Isolate* isolate,
181 CodeStubInterfaceDescriptor* descriptor) {
182 static Register registers[] = { rdx, rax };
183 descriptor->register_param_count_ = 2;
184 descriptor->register_params_ = registers;
185 descriptor->deoptimization_handler_ = NULL;
186 }
187
188
169 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor( 189 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor(
170 Isolate* isolate, 190 Isolate* isolate,
171 CodeStubInterfaceDescriptor* descriptor) { 191 CodeStubInterfaceDescriptor* descriptor) {
172 static Register registers[] = { rdx, rcx, rax }; 192 static Register registers[] = { rdx, rcx, rax };
173 descriptor->register_param_count_ = 3; 193 descriptor->register_param_count_ = 3;
174 descriptor->register_params_ = registers; 194 descriptor->register_params_ = registers;
175 descriptor->deoptimization_handler_ = 195 descriptor->deoptimization_handler_ =
176 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure); 196 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure);
177 } 197 }
178 198
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
906 receiver = rax; 926 receiver = rax;
907 } 927 }
908 928
909 StubCompiler::GenerateLoadFunctionPrototype(masm, receiver, r8, r9, &miss); 929 StubCompiler::GenerateLoadFunctionPrototype(masm, receiver, r8, r9, &miss);
910 __ bind(&miss); 930 __ bind(&miss);
911 StubCompiler::TailCallBuiltin( 931 StubCompiler::TailCallBuiltin(
912 masm, BaseLoadStoreStubCompiler::MissBuiltin(kind())); 932 masm, BaseLoadStoreStubCompiler::MissBuiltin(kind()));
913 } 933 }
914 934
915 935
916 void StringLengthStub::Generate(MacroAssembler* masm) {
917 Label miss;
918 Register receiver;
919 if (kind() == Code::KEYED_LOAD_IC) {
920 // ----------- S t a t e -------------
921 // -- rax : key
922 // -- rdx : receiver
923 // -- rsp[0] : return address
924 // -----------------------------------
925 __ Cmp(rax, masm->isolate()->factory()->length_string());
926 __ j(not_equal, &miss);
927 receiver = rdx;
928 } else {
929 ASSERT(kind() == Code::LOAD_IC);
930 // ----------- S t a t e -------------
931 // -- rax : receiver
932 // -- rcx : name
933 // -- rsp[0] : return address
934 // -----------------------------------
935 receiver = rax;
936 }
937
938 StubCompiler::GenerateLoadStringLength(masm, receiver, r8, r9, &miss);
939 __ bind(&miss);
940 StubCompiler::TailCallBuiltin(
941 masm, BaseLoadStoreStubCompiler::MissBuiltin(kind()));
942 }
943
944
945 void StoreArrayLengthStub::Generate(MacroAssembler* masm) { 936 void StoreArrayLengthStub::Generate(MacroAssembler* masm) {
946 // ----------- S t a t e ------------- 937 // ----------- S t a t e -------------
947 // -- rax : value 938 // -- rax : value
948 // -- rcx : key 939 // -- rcx : key
949 // -- rdx : receiver 940 // -- rdx : receiver
950 // -- rsp[0] : return address 941 // -- rsp[0] : return address
951 // ----------------------------------- 942 // -----------------------------------
952 // 943 //
953 // This accepts as a receiver anything JSArray::SetElementsLength accepts 944 // This accepts as a receiver anything JSArray::SetElementsLength accepts
954 // (currently anything except for external arrays which means anything with 945 // (currently anything except for external arrays which means anything with
(...skipping 4369 matching lines...) Expand 10 before | Expand all | Expand 10 after
5324 return_value_operand, 5315 return_value_operand,
5325 NULL); 5316 NULL);
5326 } 5317 }
5327 5318
5328 5319
5329 #undef __ 5320 #undef __
5330 5321
5331 } } // namespace v8::internal 5322 } } // namespace v8::internal
5332 5323
5333 #endif // V8_TARGET_ARCH_X64 5324 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/stub-cache.h ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698