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

Side by Side Diff: src/heap/heap.cc

Issue 1256283003: Fully deprecate FixedArray::CopySize method. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_issue-cr-513507
Patch Set: Rebased. Created 5 years, 4 months 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
« no previous file with comments | « src/heap/heap.h ('k') | src/isolate.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/base/once.h" 10 #include "src/base/once.h"
(...skipping 4439 matching lines...) Expand 10 before | Expand all | Expand 10 after
4450 return result; 4450 return result;
4451 } 4451 }
4452 4452
4453 4453
4454 AllocationResult Heap::AllocateEmptyFixedTypedArray( 4454 AllocationResult Heap::AllocateEmptyFixedTypedArray(
4455 ExternalArrayType array_type) { 4455 ExternalArrayType array_type) {
4456 return AllocateFixedTypedArray(0, array_type, false, TENURED); 4456 return AllocateFixedTypedArray(0, array_type, false, TENURED);
4457 } 4457 }
4458 4458
4459 4459
4460 AllocationResult Heap::CopyFixedArrayAndGrow(FixedArray* src, int grow_by) { 4460 AllocationResult Heap::CopyFixedArrayAndGrow(FixedArray* src, int grow_by,
4461 PretenureFlag pretenure) {
4461 int old_len = src->length(); 4462 int old_len = src->length();
4462 int new_len = old_len + grow_by; 4463 int new_len = old_len + grow_by;
4464 DCHECK(new_len >= old_len);
4463 HeapObject* obj; 4465 HeapObject* obj;
4464 { 4466 {
4465 AllocationResult allocation = AllocateRawFixedArray(new_len, NOT_TENURED); 4467 AllocationResult allocation = AllocateRawFixedArray(new_len, pretenure);
4466 if (!allocation.To(&obj)) return allocation; 4468 if (!allocation.To(&obj)) return allocation;
4467 } 4469 }
4468 obj->set_map_no_write_barrier(fixed_array_map()); 4470 obj->set_map_no_write_barrier(fixed_array_map());
4469 FixedArray* result = FixedArray::cast(obj); 4471 FixedArray* result = FixedArray::cast(obj);
4470 result->set_length(new_len); 4472 result->set_length(new_len);
4471 4473
4472 // Copy the content. 4474 // Copy the content.
4473 DisallowHeapAllocation no_gc; 4475 DisallowHeapAllocation no_gc;
4474 WriteBarrierMode mode = result->GetWriteBarrierMode(no_gc); 4476 WriteBarrierMode mode = result->GetWriteBarrierMode(no_gc);
4475 for (int i = 0; i < old_len; i++) result->set(i, src->get(i), mode); 4477 for (int i = 0; i < old_len; i++) result->set(i, src->get(i), mode);
(...skipping 2423 matching lines...) Expand 10 before | Expand all | Expand 10 after
6899 *object_type = "CODE_TYPE"; \ 6901 *object_type = "CODE_TYPE"; \
6900 *object_sub_type = "CODE_AGE/" #name; \ 6902 *object_sub_type = "CODE_AGE/" #name; \
6901 return true; 6903 return true;
6902 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) 6904 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME)
6903 #undef COMPARE_AND_RETURN_NAME 6905 #undef COMPARE_AND_RETURN_NAME
6904 } 6906 }
6905 return false; 6907 return false;
6906 } 6908 }
6907 } // namespace internal 6909 } // namespace internal
6908 } // namespace v8 6910 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/heap.h ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698