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

Side by Side Diff: src/runtime.cc

Issue 8495017: Merge r9917 into 3.6 branch. This fixes issue 103259. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.6
Patch Set: Created 9 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « src/array.js ('k') | src/version.cc » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 6822 matching lines...) Expand 10 before | Expand all | Expand 10 after
6833 RUNTIME_ASSERT(elements_array->HasFastElements()); 6833 RUNTIME_ASSERT(elements_array->HasFastElements());
6834 CONVERT_NUMBER_CHECKED(uint32_t, array_length, Uint32, args[1]); 6834 CONVERT_NUMBER_CHECKED(uint32_t, array_length, Uint32, args[1]);
6835 CONVERT_CHECKED(String, separator, args[2]); 6835 CONVERT_CHECKED(String, separator, args[2]);
6836 // elements_array is fast-mode JSarray of alternating positions 6836 // elements_array is fast-mode JSarray of alternating positions
6837 // (increasing order) and strings. 6837 // (increasing order) and strings.
6838 // array_length is length of original array (used to add separators); 6838 // array_length is length of original array (used to add separators);
6839 // separator is string to put between elements. Assumed to be non-empty. 6839 // separator is string to put between elements. Assumed to be non-empty.
6840 6840
6841 // Find total length of join result. 6841 // Find total length of join result.
6842 int string_length = 0; 6842 int string_length = 0;
6843 bool is_ascii = true; 6843 bool is_ascii = separator->IsAsciiRepresentation();
6844 int max_string_length = SeqAsciiString::kMaxLength; 6844 int max_string_length = SeqAsciiString::kMaxLength;
6845 bool overflow = false; 6845 bool overflow = false;
6846 CONVERT_NUMBER_CHECKED(int, elements_length, 6846 CONVERT_NUMBER_CHECKED(int, elements_length,
6847 Int32, elements_array->length()); 6847 Int32, elements_array->length());
6848 RUNTIME_ASSERT((elements_length & 1) == 0); // Even length. 6848 RUNTIME_ASSERT((elements_length & 1) == 0); // Even length.
6849 FixedArray* elements = FixedArray::cast(elements_array->elements()); 6849 FixedArray* elements = FixedArray::cast(elements_array->elements());
6850 for (int i = 0; i < elements_length; i += 2) { 6850 for (int i = 0; i < elements_length; i += 2) {
6851 RUNTIME_ASSERT(elements->get(i)->IsNumber()); 6851 RUNTIME_ASSERT(elements->get(i)->IsNumber());
6852 CONVERT_CHECKED(String, string, elements->get(i + 1)); 6852 CONVERT_CHECKED(String, string, elements->get(i + 1));
6853 int length = string->length(); 6853 int length = string->length();
(...skipping 6374 matching lines...) Expand 10 before | Expand all | Expand 10 after
13228 } else { 13228 } else {
13229 // Handle last resort GC and make sure to allow future allocations 13229 // Handle last resort GC and make sure to allow future allocations
13230 // to grow the heap without causing GCs (if possible). 13230 // to grow the heap without causing GCs (if possible).
13231 isolate->counters()->gc_last_resort_from_js()->Increment(); 13231 isolate->counters()->gc_last_resort_from_js()->Increment();
13232 isolate->heap()->CollectAllGarbage(false); 13232 isolate->heap()->CollectAllGarbage(false);
13233 } 13233 }
13234 } 13234 }
13235 13235
13236 13236
13237 } } // namespace v8::internal 13237 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/array.js ('k') | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698