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/objects.cc

Issue 1433133003: [runtime] Make elements backing store for arguments non-holey. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix another case. Created 5 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
« no previous file with comments | « src/elements.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 14487 matching lines...) Expand 10 before | Expand all | Expand 10 after
14498 return used; 14498 return used;
14499 } 14499 }
14500 14500
14501 14501
14502 int JSObject::GetFastElementsUsage() { 14502 int JSObject::GetFastElementsUsage() {
14503 FixedArrayBase* store = elements(); 14503 FixedArrayBase* store = elements();
14504 switch (GetElementsKind()) { 14504 switch (GetElementsKind()) {
14505 case FAST_SMI_ELEMENTS: 14505 case FAST_SMI_ELEMENTS:
14506 case FAST_DOUBLE_ELEMENTS: 14506 case FAST_DOUBLE_ELEMENTS:
14507 case FAST_ELEMENTS: 14507 case FAST_ELEMENTS:
14508 // Only JSArray have packed elements. 14508 return IsJSArray() ? Smi::cast(JSArray::cast(this)->length())->value()
14509 return Smi::cast(JSArray::cast(this)->length())->value(); 14509 : store->length();
14510 case FAST_SLOPPY_ARGUMENTS_ELEMENTS: 14510 case FAST_SLOPPY_ARGUMENTS_ELEMENTS:
14511 store = FixedArray::cast(FixedArray::cast(store)->get(1)); 14511 store = FixedArray::cast(FixedArray::cast(store)->get(1));
14512 // Fall through. 14512 // Fall through.
14513 case FAST_HOLEY_SMI_ELEMENTS: 14513 case FAST_HOLEY_SMI_ELEMENTS:
14514 case FAST_HOLEY_ELEMENTS: 14514 case FAST_HOLEY_ELEMENTS:
14515 return FastHoleyElementsUsage(this, FixedArray::cast(store)); 14515 return FastHoleyElementsUsage(this, FixedArray::cast(store));
14516 case FAST_HOLEY_DOUBLE_ELEMENTS: 14516 case FAST_HOLEY_DOUBLE_ELEMENTS:
14517 if (elements()->length() == 0) return 0; 14517 if (elements()->length() == 0) return 0;
14518 return FastHoleyElementsUsage(this, FixedDoubleArray::cast(store)); 14518 return FastHoleyElementsUsage(this, FixedDoubleArray::cast(store));
14519 14519
(...skipping 3381 matching lines...) Expand 10 before | Expand all | Expand 10 after
17901 if (cell->value() != *new_value) { 17901 if (cell->value() != *new_value) {
17902 cell->set_value(*new_value); 17902 cell->set_value(*new_value);
17903 Isolate* isolate = cell->GetIsolate(); 17903 Isolate* isolate = cell->GetIsolate();
17904 cell->dependent_code()->DeoptimizeDependentCodeGroup( 17904 cell->dependent_code()->DeoptimizeDependentCodeGroup(
17905 isolate, DependentCode::kPropertyCellChangedGroup); 17905 isolate, DependentCode::kPropertyCellChangedGroup);
17906 } 17906 }
17907 } 17907 }
17908 17908
17909 } // namespace internal 17909 } // namespace internal
17910 } // namespace v8 17910 } // namespace v8
OLDNEW
« no previous file with comments | « src/elements.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698