Index: src/regexp-macro-assembler.cc |
=================================================================== |
--- src/regexp-macro-assembler.cc (revision 7267) |
+++ src/regexp-macro-assembler.cc (working copy) |
@@ -105,7 +105,8 @@ |
Handle<String> subject, |
int* offsets_vector, |
int offsets_vector_length, |
- int previous_index) { |
+ int previous_index, |
+ Isolate* isolate) { |
ASSERT(subject->IsFlat()); |
ASSERT(previous_index >= 0); |
@@ -142,7 +143,8 @@ |
start_offset, |
input_start, |
input_end, |
- offsets_vector); |
+ offsets_vector, |
+ isolate); |
return res; |
} |
@@ -153,10 +155,12 @@ |
int start_offset, |
const byte* input_start, |
const byte* input_end, |
- int* output) { |
+ int* output, |
+ Isolate* isolate) { |
+ ASSERT(isolate == Isolate::Current()); |
// Ensure that the minimum stack has been allocated. |
- RegExpStack stack; |
- Address stack_base = RegExpStack::stack_base(); |
+ RegExpStackScope stack_scope(isolate); |
+ Address stack_base = stack_scope.stack()->stack_base(); |
int direct_call = 0; |
int result = CALL_GENERATED_REGEXP_CODE(code->entry(), |
@@ -166,23 +170,21 @@ |
input_end, |
output, |
stack_base, |
- direct_call); |
+ direct_call, |
+ isolate); |
ASSERT(result <= SUCCESS); |
ASSERT(result >= RETRY); |
- if (result == EXCEPTION && !Top::has_pending_exception()) { |
+ if (result == EXCEPTION && !isolate->has_pending_exception()) { |
// We detected a stack overflow (on the backtrack stack) in RegExp code, |
// but haven't created the exception yet. |
- Top::StackOverflow(); |
+ isolate->StackOverflow(); |
} |
return static_cast<Result>(result); |
} |
-static unibrow::Mapping<unibrow::Ecma262Canonicalize> canonicalize; |
- |
- |
-byte NativeRegExpMacroAssembler::word_character_map[] = { |
+const byte NativeRegExpMacroAssembler::word_character_map[] = { |
0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, |
0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, |
0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, |
@@ -208,7 +210,11 @@ |
int NativeRegExpMacroAssembler::CaseInsensitiveCompareUC16( |
Address byte_offset1, |
Address byte_offset2, |
- size_t byte_length) { |
+ size_t byte_length, |
+ Isolate* isolate) { |
+ ASSERT(isolate == Isolate::Current()); |
+ unibrow::Mapping<unibrow::Ecma262Canonicalize>* canonicalize = |
+ isolate->regexp_macro_assembler_canonicalize(); |
// This function is not allowed to cause a garbage collection. |
// A GC might move the calling generated code and invalidate the |
// return address on the stack. |
@@ -222,10 +228,10 @@ |
unibrow::uchar c2 = substring2[i]; |
if (c1 != c2) { |
unibrow::uchar s1[1] = { c1 }; |
- canonicalize.get(c1, '\0', s1); |
+ canonicalize->get(c1, '\0', s1); |
if (s1[0] != c2) { |
unibrow::uchar s2[1] = { c2 }; |
- canonicalize.get(c2, '\0', s2); |
+ canonicalize->get(c2, '\0', s2); |
if (s1[0] != s2[0]) { |
return 0; |
} |
@@ -237,13 +243,16 @@ |
Address NativeRegExpMacroAssembler::GrowStack(Address stack_pointer, |
- Address* stack_base) { |
- size_t size = RegExpStack::stack_capacity(); |
- Address old_stack_base = RegExpStack::stack_base(); |
+ Address* stack_base, |
+ Isolate* isolate) { |
+ ASSERT(isolate == Isolate::Current()); |
+ RegExpStack* regexp_stack = isolate->regexp_stack(); |
+ size_t size = regexp_stack->stack_capacity(); |
+ Address old_stack_base = regexp_stack->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); |
+ Address new_stack_base = regexp_stack->EnsureCapacity(size * 2); |
if (new_stack_base == NULL) { |
return NULL; |
} |