From 2b6b89a66eb8e3e366c95398a14d0efe643062fe Mon Sep 17 00:00:00 2001 From: Andreas Gal Date: Wed, 5 Nov 2008 14:26:51 -0800 Subject: [PATCH] Use GuardRecord/SideExit provided by the tracer in regexp (463281, r=danderson). --- js/src/jsregexp.cpp | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/js/src/jsregexp.cpp b/js/src/jsregexp.cpp index 2c4b68fbc89..68a963080f5 100644 --- a/js/src/jsregexp.cpp +++ b/js/src/jsregexp.cpp @@ -1966,20 +1966,6 @@ typedef List LInsList; /* Dummy GC for nanojit placement new. */ static GC gc; -/* - * Small guard record structure that contains just the fields needed - * for the LIR_loop. - * FIXME bug 463258 - */ -struct LoopGuardRecord { - void* jmp; - GuardRecord* next; - SideExit* exit; - GuardRecord* guards; - Fragment* from; - Fragment* target; -}; - class RegExpNativeCompiler { private: JSRegExp* re; /* Careful: not fully initialized */ @@ -2163,7 +2149,7 @@ class RegExpNativeCompiler { JSBool compile(JSContext* cx) { - LoopGuardRecord* guard; + GuardRecord* guard; LIns* skip; LIns* start; @@ -2196,11 +2182,11 @@ class RegExpNativeCompiler { } /* Create fake guard record for loop edge. */ - skip = lirb->skip(sizeof(LoopGuardRecord)); - guard = (LoopGuardRecord *) skip->payload(); + skip = lirb->skip(sizeof(GuardRecord) + sizeof(SideExit)); + guard = (GuardRecord *) skip->payload(); memset(guard, 0, sizeof(*guard)); - guard->exit = (SideExit *) &guard->guards; - guard->from = guard->target = fragment; + guard->exit = (SideExit *) guard+1; + guard->exit->target = fragment; fragment->lastIns = lir->insGuard(LIR_loop, lir->insImm(1), skip); ::compile(fragmento->assm(), fragment);