OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |