| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 6751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6762 } | 6762 } |
| 6763 increment = len; | 6763 increment = len; |
| 6764 } else if (elt->IsString()) { | 6764 } else if (elt->IsString()) { |
| 6765 String* element = String::cast(elt); | 6765 String* element = String::cast(elt); |
| 6766 int element_length = element->length(); | 6766 int element_length = element->length(); |
| 6767 increment = element_length; | 6767 increment = element_length; |
| 6768 if (ascii && !element->HasOnlyAsciiChars()) { | 6768 if (ascii && !element->HasOnlyAsciiChars()) { |
| 6769 ascii = false; | 6769 ascii = false; |
| 6770 } | 6770 } |
| 6771 } else { | 6771 } else { |
| 6772 ASSERT(!elt->IsTheHole()); |
| 6772 return isolate->Throw(isolate->heap()->illegal_argument_symbol()); | 6773 return isolate->Throw(isolate->heap()->illegal_argument_symbol()); |
| 6773 } | 6774 } |
| 6774 if (increment > String::kMaxLength - position) { | 6775 if (increment > String::kMaxLength - position) { |
| 6775 isolate->context()->mark_out_of_memory(); | 6776 isolate->context()->mark_out_of_memory(); |
| 6776 return Failure::OutOfMemoryException(); | 6777 return Failure::OutOfMemoryException(); |
| 6777 } | 6778 } |
| 6778 position += increment; | 6779 position += increment; |
| 6779 } | 6780 } |
| 6780 | 6781 |
| 6781 int length = position; | 6782 int length = position; |
| (...skipping 6579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13361 // Handle last resort GC and make sure to allow future allocations | 13362 // Handle last resort GC and make sure to allow future allocations |
| 13362 // to grow the heap without causing GCs (if possible). | 13363 // to grow the heap without causing GCs (if possible). |
| 13363 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13364 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 13364 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13365 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 13365 "Runtime::PerformGC"); | 13366 "Runtime::PerformGC"); |
| 13366 } | 13367 } |
| 13367 } | 13368 } |
| 13368 | 13369 |
| 13369 | 13370 |
| 13370 } } // namespace v8::internal | 13371 } } // namespace v8::internal |
| OLD | NEW |