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

Side by Side Diff: src/elements.cc

Issue 1860443003: Revert of [heap] Add optimized RecordWrites (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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') | 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/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. For Arrays with valid Smi length, we are sure to 1014 // HeapNumbers are, hence we have to write them again.
1015 // have no HeapNumber indices and thus we can skip this step. 1015 // For Arrays with valid Smi length, we are sure to have no HeapNumber
1016 FIXED_ARRAY_ELEMENTS_WRITE_BARRIER(isolate->heap(), *combined_keys, 0, 1016 // indices and thus we can skip this step.
1017 nof_indices); 1017 for (uint32_t i = 0; i < nof_indices; i++) {
1018 Object* index = combined_keys->get(i);
1019 combined_keys->set(i, index);
1020 }
1018 } 1021 }
1019 } 1022 }
1020 1023
1021 // Copy over the passed-in property keys. 1024 // Copy over the passed-in property keys.
1022 CopyObjectToObjectElements(*keys, FAST_ELEMENTS, 0, *combined_keys, 1025 CopyObjectToObjectElements(*keys, FAST_ELEMENTS, 0, *combined_keys,
1023 FAST_ELEMENTS, nof_indices, nof_property_keys); 1026 FAST_ELEMENTS, nof_indices, nof_property_keys);
1024 1027
1025 if (IsHoleyElementsKind(kind())) { 1028 if (IsHoleyElementsKind(kind())) {
1026 // Shrink combined_keys to the final size. 1029 // Shrink combined_keys to the final size.
1027 int final_size = nof_indices + nof_property_keys; 1030 int final_size = nof_indices + nof_property_keys;
(...skipping 1998 matching lines...) Expand 10 before | Expand all | Expand 10 after
3026 insertion_index += len; 3029 insertion_index += len;
3027 } 3030 }
3028 3031
3029 DCHECK_EQ(insertion_index, result_len); 3032 DCHECK_EQ(insertion_index, result_len);
3030 return result_array; 3033 return result_array;
3031 } 3034 }
3032 3035
3033 ElementsAccessor** ElementsAccessor::elements_accessors_ = NULL; 3036 ElementsAccessor** ElementsAccessor::elements_accessors_ = NULL;
3034 } // namespace internal 3037 } // namespace internal
3035 } // namespace v8 3038 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/heap/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698