diff options
author | Steve Block <steveblock@google.com> | 2011-05-26 01:26:41 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2011-06-02 15:09:56 +0100 |
commit | 44f0eee88ff00398ff7f715fab053374d808c90d (patch) | |
tree | addd100e906cd43f843f3aaf64b445f17f46fe0f /src/regexp-macro-assembler.cc | |
parent | 1b63b9ad386abd62f61af0e29246a687f5311b53 (diff) | |
download | android_external_v8-44f0eee88ff00398ff7f715fab053374d808c90d.tar.gz android_external_v8-44f0eee88ff00398ff7f715fab053374d808c90d.tar.bz2 android_external_v8-44f0eee88ff00398ff7f715fab053374d808c90d.zip |
Update V8 to r7427: Initial merge by git
As required by WebKit r82507
Change-Id: I7ae83ef3f689356043b4929255b7c1dd31d8c5df
Diffstat (limited to 'src/regexp-macro-assembler.cc')
-rw-r--r-- | src/regexp-macro-assembler.cc | 47 |
1 files changed, 28 insertions, 19 deletions
diff --git a/src/regexp-macro-assembler.cc b/src/regexp-macro-assembler.cc index 51f4015f..ea41db63 100644 --- a/src/regexp-macro-assembler.cc +++ b/src/regexp-macro-assembler.cc @@ -105,7 +105,8 @@ NativeRegExpMacroAssembler::Result NativeRegExpMacroAssembler::Match( 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 @@ NativeRegExpMacroAssembler::Result NativeRegExpMacroAssembler::Match( start_offset, input_start, input_end, - offsets_vector); + offsets_vector, + isolate); return res; } @@ -153,10 +155,12 @@ NativeRegExpMacroAssembler::Result NativeRegExpMacroAssembler::Execute( 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 @@ NativeRegExpMacroAssembler::Result NativeRegExpMacroAssembler::Execute( 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 @@ byte NativeRegExpMacroAssembler::word_character_map[] = { 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 @@ int NativeRegExpMacroAssembler::CaseInsensitiveCompareUC16( 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 @@ int NativeRegExpMacroAssembler::CaseInsensitiveCompareUC16( 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; } |