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

Unified Diff: src/layout-descriptor.cc

Issue 1073053006: Revert of LayoutDescriptor should inherit from JSTypedArray (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/layout-descriptor.h ('k') | src/layout-descriptor-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/layout-descriptor.cc
diff --git a/src/layout-descriptor.cc b/src/layout-descriptor.cc
index 312429f0c6d40a63811f9fafdfd045e2e1aaaba6..66a1f0fb07950404a4d36c9bca9b5c4a6be15014 100644
--- a/src/layout-descriptor.cc
+++ b/src/layout-descriptor.cc
@@ -106,12 +106,8 @@
DCHECK(new_layout_descriptor->IsSlowLayout());
if (layout_descriptor->IsSlowLayout()) {
- DisallowHeapAllocation no_gc;
- Handle<FixedTypedArrayBase> elements(
- FixedTypedArrayBase::cast(layout_descriptor->elements()));
- Handle<FixedTypedArrayBase> new_elements(
- FixedTypedArrayBase::cast(new_layout_descriptor->elements()));
- memcpy(new_elements->DataPtr(), elements->DataPtr(), elements->DataSize());
+ memcpy(new_layout_descriptor->DataPtr(), layout_descriptor->DataPtr(),
+ layout_descriptor->DataSize());
return new_layout_descriptor;
} else {
// Fast layout.
@@ -154,7 +150,7 @@
// This is a contiguous sequence till the end of current word, proceed
// counting in the subsequent words.
if (IsSlowLayout()) {
- int len = Smi::cast(length())->value();
+ int len = length();
++layout_word_index;
for (; layout_word_index < len; layout_word_index++) {
value = get_scalar(layout_word_index);
@@ -245,20 +241,13 @@
// Trim, clean and reinitialize this slow-mode layout descriptor.
int array_length = GetSlowModeBackingStoreLength(layout_descriptor_length);
- int current_length = Smi::cast(length())->value();
+ int current_length = length();
if (current_length != array_length) {
DCHECK_LT(array_length, current_length);
int delta = current_length - array_length;
- heap->RightTrimFixedArray<Heap::SEQUENTIAL_TO_SWEEPER>(elements(), delta);
- set_byte_length(Smi::FromInt(array_length * 4));
- set_length(Smi::FromInt(array_length));
- }
- {
- DisallowHeapAllocation no_gc;
- Handle<FixedTypedArrayBase> fixed_array(
- FixedTypedArrayBase::cast(elements()));
- memset(fixed_array->DataPtr(), 0, fixed_array->DataSize());
- }
+ heap->RightTrimFixedArray<Heap::SEQUENTIAL_TO_SWEEPER>(this, delta);
+ }
+ memset(DataPtr(), 0, DataSize());
LayoutDescriptor* layout_descriptor =
Initialize(this, map, descriptors, num_descriptors);
DCHECK_EQ(this, layout_descriptor);
« no previous file with comments | « src/layout-descriptor.h ('k') | src/layout-descriptor-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698