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

Side by Side Diff: src/elements.cc

Issue 1834373003: [heap] Add optimized RecordWrites (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: adding helper macro Created 4 years, 8 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 | « no previous file | src/heap/heap.h » ('j') | src/heap/heap.h » ('J')
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/elements.h" 5 #include "src/elements.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/conversions.h" 8 #include "src/conversions.h"
9 #include "src/factory.h" 9 #include "src/factory.h"
10 #include "src/isolate-inl.h" 10 #include "src/isolate-inl.h"
(...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after
1004 for (uint32_t i = 0; i < nof_indices; i++) { 1004 for (uint32_t i = 0; i < nof_indices; i++) {
1005 Handle<Object> index_string = isolate->factory()->Uint32ToString( 1005 Handle<Object> index_string = isolate->factory()->Uint32ToString(
1006 combined_keys->get(i)->Number()); 1006 combined_keys->get(i)->Number());
1007 combined_keys->set(i, *index_string); 1007 combined_keys->set(i, *index_string);
1008 } 1008 }
1009 } else if (!(object->IsJSArray() && 1009 } else if (!(object->IsJSArray() &&
1010 JSArray::cast(*object)->length()->ToArrayLength( 1010 JSArray::cast(*object)->length()->ToArrayLength(
1011 &array_length) && 1011 &array_length) &&
1012 array_length <= Smi::kMaxValue)) { 1012 array_length <= Smi::kMaxValue)) {
1013 // Since we use std::sort above, the GC will no longer know where the 1013 // Since we use std::sort above, the GC will no longer know where the
1014 // HeapNumbers are, hence we have to write them again. 1014 // HeapNumbers are, hence we have to write them again.
Hannes Payer (out of office) 2016/04/01 11:34:39 Update this comment.
1015 // For Arrays with valid Smi length, we are sure to have no HeapNumber 1015 // For Arrays with valid Smi length, we are sure to have no HeapNumber
1016 // indices and thus we can skip this step. 1016 // indices and thus we can skip this step.
1017 for (uint32_t i = 0; i < nof_indices; i++) { 1017 FIXED_ARRAY_WRITE_BARRIER(isolate->heap(), *combined_keys, 0,
1018 Object* index = combined_keys->get(i); 1018 nof_indices);
1019 combined_keys->set(i, index);
1020 }
1021 } 1019 }
1022 } 1020 }
1023 1021
1024 // Copy over the passed-in property keys. 1022 // Copy over the passed-in property keys.
1025 CopyObjectToObjectElements(*keys, FAST_ELEMENTS, 0, *combined_keys, 1023 CopyObjectToObjectElements(*keys, FAST_ELEMENTS, 0, *combined_keys,
1026 FAST_ELEMENTS, nof_indices, nof_property_keys); 1024 FAST_ELEMENTS, nof_indices, nof_property_keys);
1027 1025
1028 if (IsHoleyElementsKind(kind())) { 1026 if (IsHoleyElementsKind(kind())) {
1029 // Shrink combined_keys to the final size. 1027 // Shrink combined_keys to the final size.
1030 int final_size = nof_indices + nof_property_keys; 1028 int final_size = nof_indices + nof_property_keys;
(...skipping 1998 matching lines...) Expand 10 before | Expand all | Expand 10 after
3029 insertion_index += len; 3027 insertion_index += len;
3030 } 3028 }
3031 3029
3032 DCHECK_EQ(insertion_index, result_len); 3030 DCHECK_EQ(insertion_index, result_len);
3033 return result_array; 3031 return result_array;
3034 } 3032 }
3035 3033
3036 ElementsAccessor** ElementsAccessor::elements_accessors_ = NULL; 3034 ElementsAccessor** ElementsAccessor::elements_accessors_ = NULL;
3037 } // namespace internal 3035 } // namespace internal
3038 } // namespace v8 3036 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/heap/heap.h » ('j') | src/heap/heap.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698