Fix native code Irregexp on MacOSX.
Review URL: http://codereview.chromium.org/10984 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@855 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
80c0290714
commit
ef59fde8de
@ -356,14 +356,23 @@ Handle<Object> RegExpMacroAssemblerIA32::GetCode() {
|
|||||||
|
|
||||||
// Entry code:
|
// Entry code:
|
||||||
__ bind(&entry_label_);
|
__ bind(&entry_label_);
|
||||||
|
// Save callee-save registers. Order here should correspond to order of
|
||||||
|
// kBackup_ebx etc.
|
||||||
__ push(esi);
|
__ push(esi);
|
||||||
__ push(edi);
|
__ push(edi);
|
||||||
|
__ push(ebx); // Callee-save on MacOS.
|
||||||
__ enter(Immediate(num_registers_ * kPointerSize));
|
__ enter(Immediate(num_registers_ * kPointerSize));
|
||||||
|
// Load string length.
|
||||||
__ mov(esi, Operand(ebp, kInputEndOffset));
|
__ mov(esi, Operand(ebp, kInputEndOffset));
|
||||||
|
// Load input position.
|
||||||
__ mov(edi, Operand(ebp, kInputStartOffset));
|
__ mov(edi, Operand(ebp, kInputStartOffset));
|
||||||
|
// Set up edi to be negative offset from string end.
|
||||||
__ sub(edi, Operand(esi));
|
__ sub(edi, Operand(esi));
|
||||||
|
// Set up esi to be end of string. First get location.
|
||||||
__ mov(edx, Operand(ebp, kInputBuffer));
|
__ mov(edx, Operand(ebp, kInputBuffer));
|
||||||
|
// Dereference location to get string start.
|
||||||
__ mov(edx, Operand(edx, 0));
|
__ mov(edx, Operand(edx, 0));
|
||||||
|
// Add start to length to complete esi setup.
|
||||||
__ add(esi, Operand(edx));
|
__ add(esi, Operand(edx));
|
||||||
if (num_saved_registers_ > 0) {
|
if (num_saved_registers_ > 0) {
|
||||||
// Fill saved registers with initial value = start offset - 1
|
// Fill saved registers with initial value = start offset - 1
|
||||||
@ -398,6 +407,7 @@ Handle<Object> RegExpMacroAssemblerIA32::GetCode() {
|
|||||||
|
|
||||||
__ bind(&exit_label_);
|
__ bind(&exit_label_);
|
||||||
__ leave();
|
__ leave();
|
||||||
|
__ pop(ebx);
|
||||||
__ pop(edi);
|
__ pop(edi);
|
||||||
__ pop(esi);
|
__ pop(esi);
|
||||||
__ ret(0);
|
__ ret(0);
|
||||||
|
@ -88,12 +88,14 @@ class RegExpMacroAssemblerIA32: public RegExpMacroAssembler {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
// Offsets from ebp of arguments to function.
|
// Offsets from ebp of arguments to function.
|
||||||
static const int kBackup_edi = 1 * sizeof(uint32_t);
|
static const int kBackup_ebx = sizeof(uint32_t);
|
||||||
static const int kBackup_esi= 2 * sizeof(uint32_t);
|
static const int kBackup_edi = kBackup_ebx + sizeof(uint32_t);
|
||||||
static const int kInputBuffer = 4 * sizeof(uint32_t);
|
static const int kBackup_esi = kBackup_edi + sizeof(uint32_t);
|
||||||
static const int kInputStartOffset = 5 * sizeof(uint32_t);
|
static const int kReturn_eip = kBackup_esi + sizeof(uint32_t);
|
||||||
static const int kInputEndOffset = 6 * sizeof(uint32_t);
|
static const int kInputBuffer = kReturn_eip + sizeof(uint32_t);
|
||||||
static const int kRegisterOutput = 7 * sizeof(uint32_t);
|
static const int kInputStartOffset = kInputBuffer + sizeof(uint32_t);
|
||||||
|
static const int kInputEndOffset = kInputStartOffset + sizeof(uint32_t);
|
||||||
|
static const int kRegisterOutput = kInputEndOffset + sizeof(uint32_t);
|
||||||
|
|
||||||
// Initial size of code buffer.
|
// Initial size of code buffer.
|
||||||
static const size_t kRegExpCodeSize = 1024;
|
static const size_t kRegExpCodeSize = 1024;
|
||||||
|
@ -38,9 +38,3 @@ test-serialize: SKIP
|
|||||||
# BUG(113): Test seems flaky on ARM.
|
# BUG(113): Test seems flaky on ARM.
|
||||||
test-spaces/LargeObjectSpace: PASS || FAIL
|
test-spaces/LargeObjectSpace: PASS || FAIL
|
||||||
|
|
||||||
[ $system == macos ]
|
|
||||||
|
|
||||||
# TODO(lrn): Please fix this asap.
|
|
||||||
test-regexp/MacroAssemblerIA32Simple: PASS || CRASH
|
|
||||||
test-regexp/MacroAssemblerIA32Registers: PASS || CRASH
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user