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

Unified Diff: src/runtime.cc

Issue 28184: Avoids allocating a JSArray of capture information on each non-global... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 10 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
« src/macros.py ('K') | « src/runtime.h ('k') | src/string.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
===================================================================
--- src/runtime.cc (revision 1374)
+++ src/runtime.cc (working copy)
@@ -858,14 +858,16 @@
static Object* Runtime_RegExpExec(Arguments args) {
HandleScope scope;
- ASSERT(args.length() == 3);
+ ASSERT(args.length() == 4);
CONVERT_CHECKED(JSRegExp, raw_regexp, args[0]);
Handle<JSRegExp> regexp(raw_regexp);
CONVERT_CHECKED(String, raw_subject, args[1]);
Handle<String> subject(raw_subject);
- Handle<Object> index(args[2]);
+ CONVERT_CHECKED(Smi, index, args[2]);
Christian Plesner Hansen 2009/02/26 15:18:53 This looks suspect -- plain small integers sometim
+ CONVERT_CHECKED(JSArray, raw_captures, args[3]);
+ Handle<JSArray> captures(raw_captures);
ASSERT(index->IsNumber());
- Handle<Object> result = RegExpImpl::Exec(regexp, subject, index);
+ Handle<Object> result = RegExpImpl::Exec(regexp, subject, index, captures);
if (result.is_null()) return Failure::Exception();
return *result;
}
@@ -873,12 +875,15 @@
static Object* Runtime_RegExpExecGlobal(Arguments args) {
HandleScope scope;
- ASSERT(args.length() == 2);
+ ASSERT(args.length() == 3);
CONVERT_CHECKED(JSRegExp, raw_regexp, args[0]);
Handle<JSRegExp> regexp(raw_regexp);
CONVERT_CHECKED(String, raw_subject, args[1]);
Handle<String> subject(raw_subject);
- Handle<Object> result = RegExpImpl::ExecGlobal(regexp, subject);
+ CONVERT_CHECKED(JSArray, raw_captures, args[2]);
+ Handle<JSArray> captures(raw_captures);
+ Handle<Object> result =
+ RegExpImpl::ExecGlobal(regexp, subject, captures);
if (result.is_null()) return Failure::Exception();
return *result;
}
« src/macros.py ('K') | « src/runtime.h ('k') | src/string.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698