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

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

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.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 c7b0f71dac7873e96e6dc3954254890c1250633a..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,21 +123,7 @@
int LayoutDescriptor::capacity() {
- return IsSlowLayout() ? (Smi::cast(length())->value() * kNumberOfBits)
- : kSmiValueSize;
-}
-
-
-uint32_t LayoutDescriptor::get_scalar(int index) {
- DCHECK(IsSlowLayout());
- return FixedTypedArray<Uint32ArrayTraits>::cast(elements())
- ->get_scalar(index);
-}
-
-
-void LayoutDescriptor::set(int index, uint32_t value) {
- DCHECK(IsSlowLayout());
- FixedTypedArray<Uint32ArrayTraits>::cast(elements())->set(index, value);
+ return IsSlowLayout() ? (length() * kNumberOfBits) : kSmiValueSize;
}
« 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