| 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 6742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6753 } | 6753 } |
| 6754 increment = len; | 6754 increment = len; |
| 6755 } else if (elt->IsString()) { | 6755 } else if (elt->IsString()) { |
| 6756 String* element = String::cast(elt); | 6756 String* element = String::cast(elt); |
| 6757 int element_length = element->length(); | 6757 int element_length = element->length(); |
| 6758 increment = element_length; | 6758 increment = element_length; |
| 6759 if (ascii && !element->HasOnlyAsciiChars()) { | 6759 if (ascii && !element->HasOnlyAsciiChars()) { |
| 6760 ascii = false; | 6760 ascii = false; |
| 6761 } | 6761 } |
| 6762 } else { | 6762 } else { |
| 6763 ASSERT(!elt->IsTheHole()); |
| 6763 return isolate->Throw(isolate->heap()->illegal_argument_symbol()); | 6764 return isolate->Throw(isolate->heap()->illegal_argument_symbol()); |
| 6764 } | 6765 } |
| 6765 if (increment > String::kMaxLength - position) { | 6766 if (increment > String::kMaxLength - position) { |
| 6766 isolate->context()->mark_out_of_memory(); | 6767 isolate->context()->mark_out_of_memory(); |
| 6767 return Failure::OutOfMemoryException(); | 6768 return Failure::OutOfMemoryException(); |
| 6768 } | 6769 } |
| 6769 position += increment; | 6770 position += increment; |
| 6770 } | 6771 } |
| 6771 | 6772 |
| 6772 int length = position; | 6773 int length = position; |
| (...skipping 6548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13321 // Handle last resort GC and make sure to allow future allocations | 13322 // Handle last resort GC and make sure to allow future allocations |
| 13322 // to grow the heap without causing GCs (if possible). | 13323 // to grow the heap without causing GCs (if possible). |
| 13323 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13324 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 13324 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13325 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 13325 "Runtime::PerformGC"); | 13326 "Runtime::PerformGC"); |
| 13326 } | 13327 } |
| 13327 } | 13328 } |
| 13328 | 13329 |
| 13329 | 13330 |
| 13330 } } // namespace v8::internal | 13331 } } // namespace v8::internal |
| OLD | NEW |