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

Side by Side Diff: src/s390/code-stubs-s390.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 | « src/regexp/x87/regexp-macro-assembler-x87.cc ('k') | src/s390/interface-descriptors-s390.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_S390 5 #if V8_TARGET_ARCH_S390
6 6
7 #include "src/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/api-arguments.h" 8 #include "src/api-arguments.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after
1198 // 31bit ABI requires you to store f4 and f6: 1198 // 31bit ABI requires you to store f4 and f6:
1199 // http://refspecs.linuxbase.org/ELF/zSeries/lzsabi0_s390.html#AEN417 1199 // http://refspecs.linuxbase.org/ELF/zSeries/lzsabi0_s390.html#AEN417
1200 __ ld(d4, MemOperand(sp)); 1200 __ ld(d4, MemOperand(sp));
1201 __ ld(d6, MemOperand(sp, kDoubleSize)); 1201 __ ld(d6, MemOperand(sp, kDoubleSize));
1202 __ la(sp, MemOperand(sp, 2 * kDoubleSize)); 1202 __ la(sp, MemOperand(sp, 2 * kDoubleSize));
1203 #endif 1203 #endif
1204 1204
1205 __ b(r14); 1205 __ b(r14);
1206 } 1206 }
1207 1207
1208 void RegExpExecStub::Generate(MacroAssembler* masm) {
1209 #ifdef V8_INTERPRETED_REGEXP
1210 // This case is handled prior to the RegExpExecStub call.
1211 __ Abort(kUnexpectedRegExpExecCall);
1212 #else // V8_INTERPRETED_REGEXP
1213 __ CleanseP(r14);
1214
1215 // Isolates: note we add an additional parameter here (isolate pointer).
1216 const int kRegExpExecuteArguments = 10;
1217 const int kParameterRegisters = 5;
1218 __ EnterExitFrame(false, kRegExpExecuteArguments - kParameterRegisters);
1219
1220 // Stack pointer now points to cell where return address is to be written.
1221 // Arguments are before that on the stack or in registers.
1222
1223 // Argument 10 (in stack parameter area): Pass current isolate address.
1224 __ mov(r6, Operand(ExternalReference::isolate_address(isolate())));
1225 __ StoreP(r6, MemOperand(sp, kStackFrameExtraParamSlot * kPointerSize +
1226 4 * kPointerSize));
1227
1228 // Argument 9 is a dummy that reserves the space used for
1229 // the return address added by the ExitFrame in native calls.
1230 __ mov(r6, Operand::Zero());
1231 __ StoreP(r6, MemOperand(sp, kStackFrameExtraParamSlot * kPointerSize +
1232 3 * kPointerSize));
1233
1234 // Argument 8: Indicate that this is a direct call from JavaScript.
1235 __ mov(r6, Operand(1));
1236 __ StoreP(r6, MemOperand(sp, kStackFrameExtraParamSlot * kPointerSize +
1237 2 * kPointerSize));
1238
1239 // Argument 7: Start (high end) of backtracking stack memory area.
1240 ExternalReference address_of_regexp_stack_memory_address =
1241 ExternalReference::address_of_regexp_stack_memory_address(isolate());
1242 ExternalReference address_of_regexp_stack_memory_size =
1243 ExternalReference::address_of_regexp_stack_memory_size(isolate());
1244 __ mov(r6, Operand(address_of_regexp_stack_memory_address));
1245 __ LoadP(r6, MemOperand(r6, 0));
1246 __ mov(r1, Operand(address_of_regexp_stack_memory_size));
1247 __ LoadP(r1, MemOperand(r1, 0));
1248 __ AddP(r6, r1);
1249 __ StoreP(r6, MemOperand(sp, kStackFrameExtraParamSlot * kPointerSize +
1250 1 * kPointerSize));
1251
1252 // Argument 6: Set the number of capture registers to zero to force
1253 // global egexps to behave as non-global. This does not affect non-global
1254 // regexps.
1255 __ mov(r6, Operand::Zero());
1256 __ StoreP(r6, MemOperand(sp, kStackFrameExtraParamSlot * kPointerSize +
1257 0 * kPointerSize));
1258
1259 // Argument 5 (r6): static offsets vector buffer.
1260 __ mov(
1261 r6,
1262 Operand(ExternalReference::address_of_static_offsets_vector(isolate())));
1263
1264 // Argument 4, r5: End of string data
1265 // Argument 3, r4: Start of string data
1266 CHECK(r5.is(RegExpExecDescriptor::StringEndRegister()));
1267 CHECK(r4.is(RegExpExecDescriptor::StringStartRegister()));
1268
1269 // Argument 2 (r3): Previous index.
1270 CHECK(r3.is(RegExpExecDescriptor::LastIndexRegister()));
1271
1272 // Argument 1 (r2): Subject string.
1273 CHECK(r2.is(RegExpExecDescriptor::StringRegister()));
1274
1275 // Locate the code entry and call it.
1276 Register code_reg = RegExpExecDescriptor::CodeRegister();
1277 __ AddP(code_reg, Operand(Code::kHeaderSize - kHeapObjectTag));
1278
1279 DirectCEntryStub stub(isolate());
1280 stub.GenerateCall(masm, code_reg);
1281
1282 __ LeaveExitFrame(false, no_reg, true);
1283
1284 // Return the smi-tagged result.
1285 __ SmiTag(r2);
1286 __ Ret();
1287 #endif // V8_INTERPRETED_REGEXP
1288 }
1208 1289
1209 static void CallStubInRecordCallTarget(MacroAssembler* masm, CodeStub* stub) { 1290 static void CallStubInRecordCallTarget(MacroAssembler* masm, CodeStub* stub) {
1210 // r2 : number of arguments to the construct function 1291 // r2 : number of arguments to the construct function
1211 // r3 : the function to call 1292 // r3 : the function to call
1212 // r4 : feedback vector 1293 // r4 : feedback vector
1213 // r5 : slot in feedback vector (Smi) 1294 // r5 : slot in feedback vector (Smi)
1214 FrameScope scope(masm, StackFrame::INTERNAL); 1295 FrameScope scope(masm, StackFrame::INTERNAL);
1215 1296
1216 // Number-of-arguments register must be smi-tagged to call out. 1297 // Number-of-arguments register must be smi-tagged to call out.
1217 __ SmiTag(r2); 1298 __ SmiTag(r2);
(...skipping 1816 matching lines...) Expand 10 before | Expand all | Expand 10 after
3034 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, 3115 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref,
3035 kStackUnwindSpace, NULL, return_value_operand, NULL); 3116 kStackUnwindSpace, NULL, return_value_operand, NULL);
3036 } 3117 }
3037 3118
3038 #undef __ 3119 #undef __
3039 3120
3040 } // namespace internal 3121 } // namespace internal
3041 } // namespace v8 3122 } // namespace v8
3042 3123
3043 #endif // V8_TARGET_ARCH_S390 3124 #endif // V8_TARGET_ARCH_S390
OLDNEW
« no previous file with comments | « src/regexp/x87/regexp-macro-assembler-x87.cc ('k') | src/s390/interface-descriptors-s390.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698