Index: src/regexp-macro-assembler.cc |
diff --git a/src/regexp-macro-assembler.cc b/src/regexp-macro-assembler.cc |
index 7f830fe4855ec909e1975edb1ad732cdbdd05174..d4d105b007ffe058462af3332fb2cc4ba2d2de9b 100644 |
--- a/src/regexp-macro-assembler.cc |
+++ b/src/regexp-macro-assembler.cc |
@@ -30,6 +30,13 @@ |
#include "assembler.h" |
#include "regexp-stack.h" |
#include "regexp-macro-assembler.h" |
+#if V8_TARGET_ARCH_ARM |
+#include "arm/simulator-arm.h" |
+#elif V8_TARGET_ARCH_IA32 |
+#include "ia32/simulator-ia32.h" |
+#elif V8_TARGET_ARCH_X64 |
+#include "x64/simulator-x64.h" |
+#endif |
namespace v8 { |
namespace internal { |
@@ -51,6 +58,7 @@ NativeRegExpMacroAssembler::NativeRegExpMacroAssembler() { |
NativeRegExpMacroAssembler::~NativeRegExpMacroAssembler() { |
} |
+ |
const byte* NativeRegExpMacroAssembler::StringCharacterPosition( |
String* subject, |
int start_index) { |
@@ -162,13 +170,14 @@ NativeRegExpMacroAssembler::Result NativeRegExpMacroAssembler::Execute( |
RegExpStack stack; |
Address stack_base = RegExpStack::stack_base(); |
- int result = matcher_func(input, |
- start_offset, |
- input_start, |
- input_end, |
- output, |
- at_start_val, |
- stack_base); |
+ int result = CALL_GENERATED_REGEXP_CODE(matcher_func, |
+ input, |
+ start_offset, |
+ input_start, |
+ input_end, |
+ output, |
+ at_start_val, |
+ stack_base); |
ASSERT(result <= SUCCESS); |
ASSERT(result >= RETRY); |
@@ -213,5 +222,22 @@ int NativeRegExpMacroAssembler::CaseInsensitiveCompareUC16( |
return 1; |
} |
+ |
+Address NativeRegExpMacroAssembler::GrowStack(Address stack_pointer, |
+ Address* stack_base) { |
+ size_t size = RegExpStack::stack_capacity(); |
+ Address old_stack_base = RegExpStack::stack_base(); |
+ ASSERT(old_stack_base == *stack_base); |
+ ASSERT(stack_pointer <= old_stack_base); |
+ ASSERT(static_cast<size_t>(old_stack_base - stack_pointer) <= size); |
+ Address new_stack_base = RegExpStack::EnsureCapacity(size * 2); |
+ if (new_stack_base == NULL) { |
+ return NULL; |
+ } |
+ *stack_base = new_stack_base; |
+ intptr_t stack_content_size = old_stack_base - stack_pointer; |
+ return new_stack_base - stack_content_size; |
+} |
+ |
#endif // V8_NATIVE_REGEXP |
} } // namespace v8::internal |