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

Unified Diff: src/jsregexp.cc

Issue 228093004: Implement handlified String::Flatten. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: even shorter Created 6 years, 8 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/json-stringifier.h ('k') | src/liveedit.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/jsregexp.cc
diff --git a/src/jsregexp.cc b/src/jsregexp.cc
index a30fc26ff0121d4aea7511469f3929625a52eb16..e7184acc1bc4d42c7bbf032d657d152f44e2fe95 100644
--- a/src/jsregexp.cc
+++ b/src/jsregexp.cc
@@ -184,7 +184,7 @@ Handle<Object> RegExpImpl::Compile(Handle<JSRegExp> re,
re->set_data(*cached);
return re;
}
- pattern = FlattenGetString(pattern);
+ pattern = String::Flatten(pattern);
PostponeInterruptsScope postpone(isolate);
RegExpCompileData parse_result;
FlatStringReader reader(isolate, pattern);
@@ -290,7 +290,7 @@ int RegExpImpl::AtomExecRaw(Handle<JSRegExp> regexp,
ASSERT(0 <= index);
ASSERT(index <= subject->length());
- if (!subject->IsFlat()) FlattenString(subject);
+ subject = String::Flatten(subject);
DisallowHeapAllocation no_gc; // ensure vectors stay valid
String* needle = String::cast(regexp->DataAt(JSRegExp::kAtomPatternIndex));
@@ -439,7 +439,7 @@ bool RegExpImpl::CompileIrregexp(Handle<JSRegExp> re,
JSRegExp::Flags flags = re->GetFlags();
Handle<String> pattern(re->Pattern());
- if (!pattern->IsFlat()) FlattenString(pattern);
+ pattern = String::Flatten(pattern);
RegExpCompileData compile_data;
FlatStringReader reader(isolate, pattern);
if (!RegExpParser::ParseRegExp(&reader, flags.is_multiline(),
@@ -528,7 +528,7 @@ void RegExpImpl::IrregexpInitialize(Handle<JSRegExp> re,
int RegExpImpl::IrregexpPrepare(Handle<JSRegExp> regexp,
Handle<String> subject) {
- if (!subject->IsFlat()) FlattenString(subject);
+ subject = String::Flatten(subject);
// Check the asciiness of the underlying storage.
bool is_ascii = subject->IsOneByteRepresentationUnderneath();
@@ -6015,7 +6015,7 @@ RegExpEngine::CompilationResult RegExpEngine::Compile(
// Sample some characters from the middle of the string.
static const int kSampleSize = 128;
- FlattenString(sample_subject);
+ sample_subject = String::Flatten(sample_subject);
int chars_sampled = 0;
int half_way = (sample_subject->length() - kSampleSize) / 2;
for (int i = Max(0, half_way);
« no previous file with comments | « src/json-stringifier.h ('k') | src/liveedit.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698