Index: src/layout-descriptor.cc |
diff --git a/src/layout-descriptor.cc b/src/layout-descriptor.cc |
index 1e3b7137246ab2f4fade8a63d39376a02e7ed03d..66a1f0fb07950404a4d36c9bca9b5c4a6be15014 100644 |
--- a/src/layout-descriptor.cc |
+++ b/src/layout-descriptor.cc |
@@ -106,11 +106,8 @@ |
DCHECK(new_layout_descriptor->IsSlowLayout()); |
if (layout_descriptor->IsSlowLayout()) { |
- DisallowHeapAllocation no_gc; |
- Handle<FixedTypedArrayBase> elements(layout_descriptor->GcSafeElements()); |
- Handle<FixedTypedArrayBase> new_elements( |
- new_layout_descriptor->GcSafeElements()); |
- 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. |
@@ -153,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); |
@@ -244,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); |