From 2d89015a4c90ab4758da47c9a5fdcadc2928dd2e Mon Sep 17 00:00:00 2001 From: "zhengxing.li" Date: Wed, 27 Jan 2016 20:20:12 -0800 Subject: [PATCH] X87: [regexp] implement case-insensitive unicode regexps. port a2baaaac93efbdd3f2e19e66907a39a7197b8305 (r33538) original commit message: BUG= Review URL: https://codereview.chromium.org/1644863002 Cr-Commit-Position: refs/heads/master@{#33568} --- src/regexp/x87/regexp-macro-assembler-x87.cc | 16 +++++++++++----- src/regexp/x87/regexp-macro-assembler-x87.h | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/regexp/x87/regexp-macro-assembler-x87.cc b/src/regexp/x87/regexp-macro-assembler-x87.cc index 01d0b249b6..ed4006b0bf 100644 --- a/src/regexp/x87/regexp-macro-assembler-x87.cc +++ b/src/regexp/x87/regexp-macro-assembler-x87.cc @@ -187,9 +187,8 @@ void RegExpMacroAssemblerX87::CheckGreedyLoop(Label* on_equal) { __ bind(&fallthrough); } - void RegExpMacroAssemblerX87::CheckNotBackReferenceIgnoreCase( - int start_reg, bool read_backward, Label* on_no_match) { + int start_reg, bool read_backward, bool unicode, Label* on_no_match) { Label fallthrough; __ mov(edx, register_location(start_reg)); // Index of start of capture __ mov(ebx, register_location(start_reg + 1)); // Index of end of capture @@ -296,11 +295,18 @@ void RegExpMacroAssemblerX87::CheckNotBackReferenceIgnoreCase( // Address byte_offset1 - Address captured substring's start. // Address byte_offset2 - Address of current character position. // size_t byte_length - length of capture in bytes(!) - // Isolate* isolate +// Isolate* isolate or 0 if unicode flag. // Set isolate. - __ mov(Operand(esp, 3 * kPointerSize), - Immediate(ExternalReference::isolate_address(isolate()))); +#ifdef V8_I18N_SUPPORT + if (unicode) { + __ mov(Operand(esp, 3 * kPointerSize), Immediate(0)); + } else // NOLINT +#endif // V8_I18N_SUPPORT + { + __ mov(Operand(esp, 3 * kPointerSize), + Immediate(ExternalReference::isolate_address(isolate()))); + } // Set byte_length. __ mov(Operand(esp, 2 * kPointerSize), ebx); // Set byte_offset2. diff --git a/src/regexp/x87/regexp-macro-assembler-x87.h b/src/regexp/x87/regexp-macro-assembler-x87.h index c95541224f..2f689612b7 100644 --- a/src/regexp/x87/regexp-macro-assembler-x87.h +++ b/src/regexp/x87/regexp-macro-assembler-x87.h @@ -37,7 +37,7 @@ class RegExpMacroAssemblerX87: public NativeRegExpMacroAssembler { virtual void CheckNotBackReference(int start_reg, bool read_backward, Label* on_no_match); virtual void CheckNotBackReferenceIgnoreCase(int start_reg, - bool read_backward, + bool read_backward, bool unicode, Label* on_no_match); virtual void CheckNotCharacter(uint32_t c, Label* on_not_equal); virtual void CheckNotCharacterAfterAnd(uint32_t c,