Commit 1e83d2f9 authored by erik.corry@gmail.com's avatar erik.corry@gmail.com

Fix missing setting of array to copy-on-write in

optimized string split.
Review URL: http://codereview.chromium.org/7849012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9190 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 5f1b39e0
......@@ -2288,22 +2288,22 @@ void StringSplitCache::Enter(Heap* heap,
cache->set(index + kStringOffset, string);
cache->set(index + kPatternOffset, pattern);
cache->set(index + kArrayOffset, array);
return;
}
uint32_t index2 =
((index + kArrayEntriesPerCacheEntry) & (kStringSplitCacheSize - 1));
if (cache->get(index2 + kStringOffset) == Smi::FromInt(0)) {
cache->set(index2 + kStringOffset, string);
cache->set(index2 + kPatternOffset, pattern);
cache->set(index2 + kArrayOffset, array);
return;
} else {
uint32_t index2 =
((index + kArrayEntriesPerCacheEntry) & (kStringSplitCacheSize - 1));
if (cache->get(index2 + kStringOffset) == Smi::FromInt(0)) {
cache->set(index2 + kStringOffset, string);
cache->set(index2 + kPatternOffset, pattern);
cache->set(index2 + kArrayOffset, array);
} else {
cache->set(index2 + kStringOffset, Smi::FromInt(0));
cache->set(index2 + kPatternOffset, Smi::FromInt(0));
cache->set(index2 + kArrayOffset, Smi::FromInt(0));
cache->set(index + kStringOffset, string);
cache->set(index + kPatternOffset, pattern);
cache->set(index + kArrayOffset, array);
}
}
cache->set(index2 + kStringOffset, Smi::FromInt(0));
cache->set(index2 + kPatternOffset, Smi::FromInt(0));
cache->set(index2 + kArrayOffset, Smi::FromInt(0));
cache->set(index + kStringOffset, string);
cache->set(index + kPatternOffset, pattern);
cache->set(index + kArrayOffset, array);
if (array->length() < 100) { // Limit how many new symbols we want to make.
for (int i = 0; i < array->length(); i++) {
String* str = String::cast(array->get(i));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment