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

Side by Side Diff: src/elements.cc

Issue 11377132: Support all fast elements kinds in the major array operations. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments (and rebased) Created 8 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/elements.h ('k') | src/factory.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 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 139
140 140
141 static Failure* ThrowArrayLengthRangeError(Heap* heap) { 141 static Failure* ThrowArrayLengthRangeError(Heap* heap) {
142 HandleScope scope(heap->isolate()); 142 HandleScope scope(heap->isolate());
143 return heap->isolate()->Throw( 143 return heap->isolate()->Throw(
144 *heap->isolate()->factory()->NewRangeError("invalid_array_length", 144 *heap->isolate()->factory()->NewRangeError("invalid_array_length",
145 HandleVector<Object>(NULL, 0))); 145 HandleVector<Object>(NULL, 0)));
146 } 146 }
147 147
148 148
149 void CopyObjectToObjectElements(FixedArray* from, 149 static void CopyObjectToObjectElements(FixedArray* from,
150 ElementsKind from_kind, 150 ElementsKind from_kind,
151 uint32_t from_start, 151 uint32_t from_start,
152 FixedArray* to, 152 FixedArray* to,
153 ElementsKind to_kind, 153 ElementsKind to_kind,
154 uint32_t to_start, 154 uint32_t to_start,
155 int raw_copy_size) { 155 int raw_copy_size) {
156 ASSERT(to->map() != HEAP->fixed_cow_array_map()); 156 ASSERT(to->map() != HEAP->fixed_cow_array_map());
157 int copy_size = raw_copy_size; 157 int copy_size = raw_copy_size;
158 if (raw_copy_size < 0) { 158 if (raw_copy_size < 0) {
159 ASSERT(raw_copy_size == ElementsAccessor::kCopyToEnd || 159 ASSERT(raw_copy_size == ElementsAccessor::kCopyToEnd ||
160 raw_copy_size == ElementsAccessor::kCopyToEndAndInitializeToHole); 160 raw_copy_size == ElementsAccessor::kCopyToEndAndInitializeToHole);
161 copy_size = Min(from->length() - from_start, 161 copy_size = Min(from->length() - from_start,
162 to->length() - to_start); 162 to->length() - to_start);
163 #ifdef DEBUG 163 #ifdef DEBUG
164 // FAST_*_ELEMENTS arrays cannot be uninitialized. Ensure they are already 164 // FAST_*_ELEMENTS arrays cannot be uninitialized. Ensure they are already
165 // marked with the hole. 165 // marked with the hole.
(...skipping 1692 matching lines...) Expand 10 before | Expand all | Expand 10 after
1858 if (!maybe_obj->To(&new_backing_store)) return maybe_obj; 1858 if (!maybe_obj->To(&new_backing_store)) return maybe_obj;
1859 new_backing_store->set(0, length); 1859 new_backing_store->set(0, length);
1860 { MaybeObject* result = array->SetContent(new_backing_store); 1860 { MaybeObject* result = array->SetContent(new_backing_store);
1861 if (result->IsFailure()) return result; 1861 if (result->IsFailure()) return result;
1862 } 1862 }
1863 return array; 1863 return array;
1864 } 1864 }
1865 1865
1866 1866
1867 } } // namespace v8::internal 1867 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/elements.h ('k') | src/factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698