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

Side by Side Diff: src/objects.cc

Issue 1690953002: [runtime/heap] Introduce CopyFixedArrayUpTo to match CopyFixedArrayAndGrow, copying to a smaller ar… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/objects.h" 5 #include "src/objects.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <iomanip> 8 #include <iomanip>
9 #include <sstream> 9 #include <sstream>
10 10
(...skipping 8512 matching lines...) Expand 10 before | Expand all | Expand 10 after
8523 for (int i = 0; i < len; i++) { 8523 for (int i = 0; i < len; i++) {
8524 Object* e = array->get(i); 8524 Object* e = array->get(i);
8525 if (!(e->IsName() || e->IsNumber())) return false; 8525 if (!(e->IsName() || e->IsNumber())) return false;
8526 } 8526 }
8527 return true; 8527 return true;
8528 } 8528 }
8529 8529
8530 8530
8531 static Handle<FixedArray> ReduceFixedArrayTo( 8531 static Handle<FixedArray> ReduceFixedArrayTo(
8532 Handle<FixedArray> array, int length) { 8532 Handle<FixedArray> array, int length) {
8533 DCHECK(array->length() >= length); 8533 DCHECK_LE(length, array->length());
8534 if (array->length() == length) return array; 8534 if (array->length() == length) return array;
8535 8535 return array->GetIsolate()->factory()->CopyFixedArrayUpTo(array, length);
8536 Handle<FixedArray> new_array =
8537 array->GetIsolate()->factory()->NewFixedArray(length);
8538 for (int i = 0; i < length; ++i) new_array->set(i, array->get(i));
8539 return new_array;
8540 } 8536 }
8541 8537
8542 bool Map::OnlyHasSimpleProperties() { 8538 bool Map::OnlyHasSimpleProperties() {
8543 // Wrapped string elements aren't explicitly stored in the elements backing 8539 // Wrapped string elements aren't explicitly stored in the elements backing
8544 // store, but are loaded indirectly from the underlying string. 8540 // store, but are loaded indirectly from the underlying string.
8545 return !IsStringWrapperElementsKind(elements_kind()) && 8541 return !IsStringWrapperElementsKind(elements_kind()) &&
8546 !is_access_check_needed() && !has_named_interceptor() && 8542 !is_access_check_needed() && !has_named_interceptor() &&
8547 !has_indexed_interceptor() && !has_hidden_prototype() && 8543 !has_indexed_interceptor() && !has_hidden_prototype() &&
8548 !is_dictionary_map(); 8544 !is_dictionary_map();
8549 } 8545 }
(...skipping 11425 matching lines...) Expand 10 before | Expand all | Expand 10 after
19975 if (cell->value() != *new_value) { 19971 if (cell->value() != *new_value) {
19976 cell->set_value(*new_value); 19972 cell->set_value(*new_value);
19977 Isolate* isolate = cell->GetIsolate(); 19973 Isolate* isolate = cell->GetIsolate();
19978 cell->dependent_code()->DeoptimizeDependentCodeGroup( 19974 cell->dependent_code()->DeoptimizeDependentCodeGroup(
19979 isolate, DependentCode::kPropertyCellChangedGroup); 19975 isolate, DependentCode::kPropertyCellChangedGroup);
19980 } 19976 }
19981 } 19977 }
19982 19978
19983 } // namespace internal 19979 } // namespace internal
19984 } // namespace v8 19980 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698