Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(689)

Unified Diff: src/regexp-macro-assembler.cc

Issue 2807031: [Isolates] RegExpStack and memory allocation limits (statics #6) (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: -> is different than . Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/platform-win32.cc ('k') | src/regexp-stack.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/regexp-macro-assembler.cc
===================================================================
--- src/regexp-macro-assembler.cc (revision 5002)
+++ src/regexp-macro-assembler.cc (working copy)
@@ -156,13 +156,14 @@
const byte* input_start,
const byte* input_end,
int* output) {
+ Isolate* isolate = Isolate::Current();
typedef int (*matcher)(String*, int, const byte*,
const byte*, int*, Address, int);
matcher matcher_func = FUNCTION_CAST<matcher>(code->entry());
// 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(matcher_func,
@@ -176,10 +177,10 @@
ASSERT(result <= SUCCESS);
ASSERT(result >= RETRY);
- if (result == EXCEPTION && !Isolate::Current()->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.
- Isolate::Current()->StackOverflow();
+ isolate->StackOverflow();
}
return static_cast<Result>(result);
}
@@ -243,12 +244,13 @@
Address NativeRegExpMacroAssembler::GrowStack(Address stack_pointer,
Address* stack_base) {
- size_t size = RegExpStack::stack_capacity();
- Address old_stack_base = RegExpStack::stack_base();
+ RegExpStack* regexp_stack = Isolate::Current()->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;
}
« no previous file with comments | « src/platform-win32.cc ('k') | src/regexp-stack.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698