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

Unified Diff: src/x87/code-stubs-x87.cc

Issue 2827243005: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/x64/interface-descriptors-x64.cc ('k') | src/x87/interface-descriptors-x87.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x87/code-stubs-x87.cc
diff --git a/src/x87/code-stubs-x87.cc b/src/x87/code-stubs-x87.cc
index 8b6fbadcb920e31ed9a93c124cd5fad73622fbb8..4ec7a45926cea302fa4af259371bdd675537ea69 100644
--- a/src/x87/code-stubs-x87.cc
+++ b/src/x87/code-stubs-x87.cc
@@ -279,6 +279,69 @@
}
// Return value is in st(0) on ia32.
__ ret(0);
+}
+
+void RegExpExecStub::Generate(MacroAssembler* masm) {
+#ifdef V8_INTERPRETED_REGEXP
+ // This case is handled prior to the RegExpExecStub call.
+ __ Abort(kUnexpectedRegExpExecCall);
+#else // V8_INTERPRETED_REGEXP
+ // Isolates: note we add an additional parameter here (isolate pointer).
+ static const int kRegExpExecuteArguments = 9;
+ __ EnterApiExitFrame(kRegExpExecuteArguments);
+
+ // Argument 9: Pass current isolate address.
+ __ mov(Operand(esp, 8 * kPointerSize),
+ Immediate(ExternalReference::isolate_address(isolate())));
+
+ // Argument 8: Indicate that this is a direct call from JavaScript.
+ __ mov(Operand(esp, 7 * kPointerSize), Immediate(1));
+
+ // Argument 7: Start (high end) of backtracking stack memory area.
+ ExternalReference address_of_regexp_stack_memory_address =
+ ExternalReference::address_of_regexp_stack_memory_address(isolate());
+ ExternalReference address_of_regexp_stack_memory_size =
+ ExternalReference::address_of_regexp_stack_memory_size(isolate());
+ __ mov(esi, Operand::StaticVariable(address_of_regexp_stack_memory_address));
+ __ add(esi, Operand::StaticVariable(address_of_regexp_stack_memory_size));
+ __ mov(Operand(esp, 6 * kPointerSize), esi);
+
+ // Argument 6: Set the number of capture registers to zero to force global
+ // regexps to behave as non-global. This does not affect non-global regexps.
+ __ mov(Operand(esp, 5 * kPointerSize), Immediate(0));
+
+ // Argument 5: static offsets vector buffer.
+ __ mov(Operand(esp, 4 * kPointerSize),
+ Immediate(ExternalReference::address_of_static_offsets_vector(
+ isolate())));
+
+ // Argument 4: End of string data
+ // Argument 3: Start of string data
+ __ mov(Operand(esp, 3 * kPointerSize),
+ RegExpExecDescriptor::StringEndRegister());
+ __ mov(Operand(esp, 2 * kPointerSize),
+ RegExpExecDescriptor::StringStartRegister());
+
+ // Argument 2: Previous index.
+ __ mov(Operand(esp, 1 * kPointerSize),
+ RegExpExecDescriptor::LastIndexRegister());
+
+ // Argument 1: Original subject string.
+ __ mov(Operand(esp, 0 * kPointerSize),
+ RegExpExecDescriptor::StringRegister());
+
+ // Locate the code entry and call it.
+ __ add(RegExpExecDescriptor::CodeRegister(),
+ Immediate(Code::kHeaderSize - kHeapObjectTag));
+ __ call(RegExpExecDescriptor::CodeRegister());
+
+ // Drop arguments and come back to JS mode.
+ __ LeaveApiExitFrame(true);
+
+ // TODO(jgruber): Don't tag return value once this is supported by stubs.
+ __ SmiTag(eax);
+ __ ret(0 * kPointerSize);
+#endif // V8_INTERPRETED_REGEXP
}
« no previous file with comments | « src/x64/interface-descriptors-x64.cc ('k') | src/x87/interface-descriptors-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698