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

Side by Side Diff: src/runtime.cc

Issue 669159: Fixed filling of char array in StringToArray. (Closed)
Patch Set: Fix typo Created 10 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | test/mjsunit/string-split-cache.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 4215 matching lines...) Expand 10 before | Expand all | Expand 10 after
4226 Object* undefined = Heap::undefined_value(); 4226 Object* undefined = Heap::undefined_value();
4227 int i; 4227 int i;
4228 for (i = 0; i < length; ++i) { 4228 for (i = 0; i < length; ++i) {
4229 Object* value = ascii_cache->get(chars[i]); 4229 Object* value = ascii_cache->get(chars[i]);
4230 if (value == undefined) break; 4230 if (value == undefined) break;
4231 ASSERT(!Heap::InNewSpace(value)); 4231 ASSERT(!Heap::InNewSpace(value));
4232 elements->set(i, value, SKIP_WRITE_BARRIER); 4232 elements->set(i, value, SKIP_WRITE_BARRIER);
4233 } 4233 }
4234 if (i < length) { 4234 if (i < length) {
4235 ASSERT(Smi::FromInt(0) == 0); 4235 ASSERT(Smi::FromInt(0) == 0);
4236 memset(elements->data_start() + i, 0, length - i); 4236 memset(elements->data_start() + i, 0, kPointerSize * (length - i));
4237 } 4237 }
4238 #ifdef DEBUG 4238 #ifdef DEBUG
4239 for (int j = 0; j < length; ++j) { 4239 for (int j = 0; j < length; ++j) {
4240 Object* element = elements->get(j); 4240 Object* element = elements->get(j);
4241 ASSERT(element == Smi::FromInt(0) || 4241 ASSERT(element == Smi::FromInt(0) ||
4242 (element->IsString() && String::cast(element)->LooksValid())); 4242 (element->IsString() && String::cast(element)->LooksValid()));
4243 } 4243 }
4244 #endif 4244 #endif
4245 return i; 4245 return i;
4246 } 4246 }
(...skipping 4311 matching lines...) Expand 10 before | Expand all | Expand 10 after
8558 } else { 8558 } else {
8559 // Handle last resort GC and make sure to allow future allocations 8559 // Handle last resort GC and make sure to allow future allocations
8560 // to grow the heap without causing GCs (if possible). 8560 // to grow the heap without causing GCs (if possible).
8561 Counters::gc_last_resort_from_js.Increment(); 8561 Counters::gc_last_resort_from_js.Increment();
8562 Heap::CollectAllGarbage(false); 8562 Heap::CollectAllGarbage(false);
8563 } 8563 }
8564 } 8564 }
8565 8565
8566 8566
8567 } } // namespace v8::internal 8567 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/string-split-cache.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698