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

Unified Diff: src/regexp-macro-assembler-ia32.cc

Issue 10984: Fix native code Irregexp on MacOSX. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 1 month 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
Index: src/regexp-macro-assembler-ia32.cc
===================================================================
--- src/regexp-macro-assembler-ia32.cc (revision 853)
+++ src/regexp-macro-assembler-ia32.cc (working copy)
@@ -356,14 +356,23 @@
// Entry code:
__ bind(&entry_label_);
+ // Save callee-save registers. Order here should correspond to order of
+ // kBackup_ebx etc.
__ push(esi);
__ push(edi);
+ __ push(ebx); // Callee-save on MacOS.
__ enter(Immediate(num_registers_ * kPointerSize));
+ // Load string length.
__ mov(esi, Operand(ebp, kInputEndOffset));
+ // Load input position.
__ mov(edi, Operand(ebp, kInputStartOffset));
+ // Set up edi to be negative offset from string end.
__ sub(edi, Operand(esi));
+ // Set up esi to be end of string. First get location.
__ mov(edx, Operand(ebp, kInputBuffer));
+ // Dereference location to get string start.
__ mov(edx, Operand(edx, 0));
+ // Add start to length to complete esi setup.
__ add(esi, Operand(edx));
if (num_saved_registers_ > 0) {
// Fill saved registers with initial value = start offset - 1
@@ -398,6 +407,7 @@
__ bind(&exit_label_);
__ leave();
+ __ pop(ebx);
__ pop(edi);
__ pop(esi);
__ ret(0);

Powered by Google App Engine
This is Rietveld 408576698