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

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

Issue 2832193002: Revert of [regexp] Remove remainder of native RegExpExecStub (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | src/arm/interface-descriptors-arm.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_ARM 5 #if V8_TARGET_ARCH_ARM
6 6
7 #include "src/code-stubs.h" 7 #include "src/code-stubs.h"
8 8
9 #include "src/api-arguments.h" 9 #include "src/api-arguments.h"
10 #include "src/assembler-inl.h" 10 #include "src/assembler-inl.h"
(...skipping 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after
1138 __ mov(lr, Operand(pc)); 1138 __ mov(lr, Operand(pc));
1139 } 1139 }
1140 #endif 1140 #endif
1141 1141
1142 // Restore callee-saved vfp registers. 1142 // Restore callee-saved vfp registers.
1143 __ vldm(ia_w, sp, kFirstCalleeSavedDoubleReg, kLastCalleeSavedDoubleReg); 1143 __ vldm(ia_w, sp, kFirstCalleeSavedDoubleReg, kLastCalleeSavedDoubleReg);
1144 1144
1145 __ ldm(ia_w, sp, kCalleeSaved | pc.bit()); 1145 __ ldm(ia_w, sp, kCalleeSaved | pc.bit());
1146 } 1146 }
1147 1147
1148 void RegExpExecStub::Generate(MacroAssembler* masm) {
1149 #ifdef V8_INTERPRETED_REGEXP
1150 // This case is handled prior to the RegExpExecStub call.
1151 __ Abort(kUnexpectedRegExpExecCall);
1152 #else // V8_INTERPRETED_REGEXP
1153 // Isolates: note we add an additional parameter here (isolate pointer).
1154 const int kRegExpExecuteArguments = 9;
1155 const int kParameterRegisters = 4;
1156 __ EnterExitFrame(false, kRegExpExecuteArguments - kParameterRegisters);
1157
1158 // Stack pointer now points to cell where return address is to be written.
1159 // Arguments are before that on the stack or in registers.
1160
1161 // Argument 9 (sp[20]): Pass current isolate address.
1162 __ mov(r5, Operand(ExternalReference::isolate_address(isolate())));
1163 __ str(r5, MemOperand(sp, 5 * kPointerSize));
1164
1165 // Argument 8 (sp[16]): Indicate that this is a direct call from JavaScript.
1166 __ mov(r5, Operand(1));
1167 __ str(r5, MemOperand(sp, 4 * kPointerSize));
1168
1169 // Argument 7 (sp[12]): Start (high end) of backtracking stack memory area.
1170 ExternalReference address_of_regexp_stack_memory_address =
1171 ExternalReference::address_of_regexp_stack_memory_address(isolate());
1172 ExternalReference address_of_regexp_stack_memory_size =
1173 ExternalReference::address_of_regexp_stack_memory_size(isolate());
1174 __ mov(r5, Operand(address_of_regexp_stack_memory_address));
1175 __ ldr(r5, MemOperand(r5, 0));
1176 __ mov(r6, Operand(address_of_regexp_stack_memory_size));
1177 __ ldr(r6, MemOperand(r6, 0));
1178 __ add(r5, r5, Operand(r6));
1179 __ str(r5, MemOperand(sp, 3 * kPointerSize));
1180
1181 // Argument 6: Set the number of capture registers to zero to force global
1182 // regexps to behave as non-global. This does not affect non-global regexps.
1183 __ mov(r5, Operand::Zero());
1184 __ str(r5, MemOperand(sp, 2 * kPointerSize));
1185
1186 // Argument 5 (sp[4]): static offsets vector buffer.
1187 __ mov(
1188 r5,
1189 Operand(ExternalReference::address_of_static_offsets_vector(isolate())));
1190 __ str(r5, MemOperand(sp, 1 * kPointerSize));
1191
1192 // Argument 4: End of string data
1193 // Argument 3: Start of string data
1194 CHECK(r3.is(RegExpExecDescriptor::StringEndRegister()));
1195 CHECK(r2.is(RegExpExecDescriptor::StringStartRegister()));
1196
1197 // Argument 2 (r1): Previous index.
1198 CHECK(r1.is(RegExpExecDescriptor::LastIndexRegister()));
1199
1200 // Argument 1 (r0): Subject string.
1201 CHECK(r0.is(RegExpExecDescriptor::StringRegister()));
1202
1203 // Locate the code entry and call it.
1204 Register code_reg = RegExpExecDescriptor::CodeRegister();
1205 __ add(code_reg, code_reg, Operand(Code::kHeaderSize - kHeapObjectTag));
1206
1207 DirectCEntryStub stub(isolate());
1208 stub.GenerateCall(masm, code_reg);
1209
1210 __ LeaveExitFrame(false, no_reg, true);
1211
1212 __ SmiTag(r0);
1213 __ Ret();
1214 #endif // V8_INTERPRETED_REGEXP
1215 }
1216
1148 static void CallStubInRecordCallTarget(MacroAssembler* masm, CodeStub* stub) { 1217 static void CallStubInRecordCallTarget(MacroAssembler* masm, CodeStub* stub) {
1149 // r0 : number of arguments to the construct function 1218 // r0 : number of arguments to the construct function
1150 // r1 : the function to call 1219 // r1 : the function to call
1151 // r2 : feedback vector 1220 // r2 : feedback vector
1152 // r3 : slot in feedback vector (Smi) 1221 // r3 : slot in feedback vector (Smi)
1153 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); 1222 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
1154 1223
1155 // Number-of-arguments register must be smi-tagged to call out. 1224 // Number-of-arguments register must be smi-tagged to call out.
1156 __ SmiTag(r0); 1225 __ SmiTag(r0);
1157 __ Push(r3, r2, r1, r0); 1226 __ Push(r3, r2, r1, r0);
(...skipping 1763 matching lines...) Expand 10 before | Expand all | Expand 10 after
2921 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, 2990 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref,
2922 kStackUnwindSpace, NULL, return_value_operand, NULL); 2991 kStackUnwindSpace, NULL, return_value_operand, NULL);
2923 } 2992 }
2924 2993
2925 #undef __ 2994 #undef __
2926 2995
2927 } // namespace internal 2996 } // namespace internal
2928 } // namespace v8 2997 } // namespace v8
2929 2998
2930 #endif // V8_TARGET_ARCH_ARM 2999 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm/interface-descriptors-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698