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

Unified Diff: src/layout-descriptor-inl.h

Issue 1080403004: Revert of Reland "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.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/layout-descriptor-inl.h
diff --git a/src/layout-descriptor-inl.h b/src/layout-descriptor-inl.h
index e682cd6eeb672874890c3bc0f39d28a6eaf4fb60..ba76704d5fc1f5c8883838a61de046268129c0d9 100644
--- a/src/layout-descriptor-inl.h
+++ b/src/layout-descriptor-inl.h
@@ -22,7 +22,7 @@
}
length = GetSlowModeBackingStoreLength(length);
return Handle<LayoutDescriptor>::cast(
- isolate->factory()->NewJSTypedArray(UINT32_ELEMENTS, length));
+ isolate->factory()->NewFixedTypedArray(length, kExternalUint32Array));
}
@@ -48,7 +48,7 @@
}
*layout_word_index = field_index / kNumberOfBits;
- CHECK((!IsSmi() && (*layout_word_index < Smi::cast(length())->value())) ||
+ CHECK((!IsSmi() && (*layout_word_index < length())) ||
(IsSmi() && (*layout_word_index < 1)));
*layout_bit_index = field_index % kNumberOfBits;
@@ -123,20 +123,7 @@
int LayoutDescriptor::capacity() {
- return IsSlowLayout() ? (Smi::cast(length())->value() * kNumberOfBits)
- : kSmiValueSize;
-}
-
-
-uint32_t LayoutDescriptor::get_scalar(int index) {
- DCHECK(IsSlowLayout());
- return GcSafeElements()->get_scalar(index);
-}
-
-
-void LayoutDescriptor::set(int index, uint32_t value) {
- DCHECK(IsSlowLayout());
- GcSafeElements()->set(index, value);
+ return IsSlowLayout() ? (length() * kNumberOfBits) : kSmiValueSize;
}
@@ -227,16 +214,6 @@
}
-FixedTypedArray<Uint32ArrayTraits>* LayoutDescriptor::GcSafeElements() {
- MapWord map_word = HeapObject::cast(elements())->map_word();
- if (map_word.IsForwardingAddress()) {
- return FixedTypedArray<Uint32ArrayTraits>::cast(
- map_word.ToForwardingAddress());
- }
- return FixedTypedArray<Uint32ArrayTraits>::cast(elements());
-}
-
-
// InobjectPropertiesHelper is a helper class for querying whether inobject
// property at offset is Double or not.
LayoutDescriptorHelper::LayoutDescriptorHelper(Map* map)
« no previous file with comments | « src/layout-descriptor.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698