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

Side by Side Diff: src/ia32/code-stubs-ia32.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/code-stubs-hydrogen.cc ('k') | src/ia32/stub-cache-ia32.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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 void KeyedLoadFieldStub::InitializeInterfaceDescriptor( 163 void KeyedLoadFieldStub::InitializeInterfaceDescriptor(
164 Isolate* isolate, 164 Isolate* isolate,
165 CodeStubInterfaceDescriptor* descriptor) { 165 CodeStubInterfaceDescriptor* descriptor) {
166 static Register registers[] = { edx }; 166 static Register registers[] = { edx };
167 descriptor->register_param_count_ = 1; 167 descriptor->register_param_count_ = 1;
168 descriptor->register_params_ = registers; 168 descriptor->register_params_ = registers;
169 descriptor->deoptimization_handler_ = NULL; 169 descriptor->deoptimization_handler_ = NULL;
170 } 170 }
171 171
172 172
173 void StringLengthStub::InitializeInterfaceDescriptor(
174 Isolate* isolate,
175 CodeStubInterfaceDescriptor* descriptor) {
176 static Register registers[] = { edx, ecx };
177 descriptor->register_param_count_ = 2;
178 descriptor->register_params_ = registers;
179 descriptor->deoptimization_handler_ = NULL;
180 }
181
182
183 void KeyedStringLengthStub::InitializeInterfaceDescriptor(
184 Isolate* isolate,
185 CodeStubInterfaceDescriptor* descriptor) {
186 static Register registers[] = { edx, ecx };
187 descriptor->register_param_count_ = 2;
188 descriptor->register_params_ = registers;
189 descriptor->deoptimization_handler_ = NULL;
190 }
191
192
173 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor( 193 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor(
174 Isolate* isolate, 194 Isolate* isolate,
175 CodeStubInterfaceDescriptor* descriptor) { 195 CodeStubInterfaceDescriptor* descriptor) {
176 static Register registers[] = { edx, ecx, eax }; 196 static Register registers[] = { edx, ecx, eax };
177 descriptor->register_param_count_ = 3; 197 descriptor->register_param_count_ = 3;
178 descriptor->register_params_ = registers; 198 descriptor->register_params_ = registers;
179 descriptor->deoptimization_handler_ = 199 descriptor->deoptimization_handler_ =
180 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure); 200 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure);
181 } 201 }
182 202
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after
1039 __ j(not_equal, &miss); 1059 __ j(not_equal, &miss);
1040 } 1060 }
1041 1061
1042 StubCompiler::GenerateLoadFunctionPrototype(masm, edx, eax, ebx, &miss); 1062 StubCompiler::GenerateLoadFunctionPrototype(masm, edx, eax, ebx, &miss);
1043 __ bind(&miss); 1063 __ bind(&miss);
1044 StubCompiler::TailCallBuiltin( 1064 StubCompiler::TailCallBuiltin(
1045 masm, BaseLoadStoreStubCompiler::MissBuiltin(kind())); 1065 masm, BaseLoadStoreStubCompiler::MissBuiltin(kind()));
1046 } 1066 }
1047 1067
1048 1068
1049 void StringLengthStub::Generate(MacroAssembler* masm) {
1050 // ----------- S t a t e -------------
1051 // -- ecx : name
1052 // -- edx : receiver
1053 // -- esp[0] : return address
1054 // -----------------------------------
1055 Label miss;
1056
1057 if (kind() == Code::KEYED_LOAD_IC) {
1058 __ cmp(ecx, Immediate(masm->isolate()->factory()->length_string()));
1059 __ j(not_equal, &miss);
1060 }
1061
1062 StubCompiler::GenerateLoadStringLength(masm, edx, eax, ebx, &miss);
1063 __ bind(&miss);
1064 StubCompiler::TailCallBuiltin(
1065 masm, BaseLoadStoreStubCompiler::MissBuiltin(kind()));
1066 }
1067
1068
1069 void StoreArrayLengthStub::Generate(MacroAssembler* masm) { 1069 void StoreArrayLengthStub::Generate(MacroAssembler* masm) {
1070 // ----------- S t a t e ------------- 1070 // ----------- S t a t e -------------
1071 // -- eax : value 1071 // -- eax : value
1072 // -- ecx : name 1072 // -- ecx : name
1073 // -- edx : receiver 1073 // -- edx : receiver
1074 // -- esp[0] : return address 1074 // -- esp[0] : return address
1075 // ----------------------------------- 1075 // -----------------------------------
1076 // 1076 //
1077 // This accepts as a receiver anything JSArray::SetElementsLength accepts 1077 // This accepts as a receiver anything JSArray::SetElementsLength accepts
1078 // (currently anything except for external arrays which means anything with 1078 // (currently anything except for external arrays which means anything with
(...skipping 4372 matching lines...) Expand 10 before | Expand all | Expand 10 after
5451 Operand(ebp, 7 * kPointerSize), 5451 Operand(ebp, 7 * kPointerSize),
5452 NULL); 5452 NULL);
5453 } 5453 }
5454 5454
5455 5455
5456 #undef __ 5456 #undef __
5457 5457
5458 } } // namespace v8::internal 5458 } } // namespace v8::internal
5459 5459
5460 #endif // V8_TARGET_ARCH_IA32 5460 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/ia32/stub-cache-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698