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

Unified Diff: src/elements-kind.cc

Issue 1262583002: Reland of "Remove ExternalArray, derived types, and element kinds" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years, 5 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/elements-kind.h ('k') | src/factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/elements-kind.cc
diff --git a/src/elements-kind.cc b/src/elements-kind.cc
index 07d2837bdc86ca747d1e4468887f6bfa6b049dfd..0d29c3047238cbcfe6b0df71b196441686fa3e48 100644
--- a/src/elements-kind.cc
+++ b/src/elements-kind.cc
@@ -15,26 +15,17 @@ namespace internal {
int ElementsKindToShiftSize(ElementsKind elements_kind) {
switch (elements_kind) {
- case EXTERNAL_INT8_ELEMENTS:
- case EXTERNAL_UINT8_CLAMPED_ELEMENTS:
- case EXTERNAL_UINT8_ELEMENTS:
case UINT8_ELEMENTS:
case INT8_ELEMENTS:
case UINT8_CLAMPED_ELEMENTS:
return 0;
- case EXTERNAL_INT16_ELEMENTS:
- case EXTERNAL_UINT16_ELEMENTS:
case UINT16_ELEMENTS:
case INT16_ELEMENTS:
return 1;
- case EXTERNAL_INT32_ELEMENTS:
- case EXTERNAL_UINT32_ELEMENTS:
- case EXTERNAL_FLOAT32_ELEMENTS:
case UINT32_ELEMENTS:
case INT32_ELEMENTS:
case FLOAT32_ELEMENTS:
return 2;
- case EXTERNAL_FLOAT64_ELEMENTS:
case FAST_DOUBLE_ELEMENTS:
case FAST_HOLEY_DOUBLE_ELEMENTS:
case FLOAT64_ELEMENTS:
@@ -53,16 +44,10 @@ int ElementsKindToShiftSize(ElementsKind elements_kind) {
}
-static bool IsTypedArrayElementsKind(ElementsKind elements_kind) {
- return IsFixedTypedArrayElementsKind(elements_kind) ||
- IsExternalArrayElementsKind(elements_kind);
-}
-
-
int GetDefaultHeaderSizeForElementsKind(ElementsKind elements_kind) {
STATIC_ASSERT(FixedArray::kHeaderSize == FixedDoubleArray::kHeaderSize);
- if (IsTypedArrayElementsKind(elements_kind)) {
+ if (IsFixedTypedArrayElementsKind(elements_kind)) {
return 0;
} else {
return FixedArray::kHeaderSize - kHeapObjectTag;
@@ -125,17 +110,8 @@ int GetSequenceIndexFromFastElementsKind(ElementsKind elements_kind) {
ElementsKind GetNextTransitionElementsKind(ElementsKind kind) {
- switch (kind) {
-#define FIXED_TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \
- case TYPE##_ELEMENTS: return EXTERNAL_##TYPE##_ELEMENTS;
-
- TYPED_ARRAYS(FIXED_TYPED_ARRAY_CASE)
-#undef FIXED_TYPED_ARRAY_CASE
- default: {
- int index = GetSequenceIndexFromFastElementsKind(kind);
- return GetFastElementsKindFromSequenceIndex(index + 1);
- }
- }
+ int index = GetSequenceIndexFromFastElementsKind(kind);
+ return GetFastElementsKindFromSequenceIndex(index + 1);
}
@@ -146,18 +122,9 @@ static inline bool IsFastTransitionTarget(ElementsKind elements_kind) {
bool IsMoreGeneralElementsKindTransition(ElementsKind from_kind,
ElementsKind to_kind) {
- if (IsTypedArrayElementsKind(from_kind) ||
- IsTypedArrayElementsKind(to_kind)) {
- switch (from_kind) {
-#define FIXED_TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \
- case TYPE##_ELEMENTS: \
- return to_kind == EXTERNAL_##TYPE##_ELEMENTS;
-
- TYPED_ARRAYS(FIXED_TYPED_ARRAY_CASE);
-#undef FIXED_TYPED_ARRAY_CASE
- default:
- return false;
- }
+ if (IsFixedTypedArrayElementsKind(from_kind) ||
+ IsFixedTypedArrayElementsKind(to_kind)) {
+ return false;
}
if (IsFastElementsKind(from_kind) && IsFastTransitionTarget(to_kind)) {
switch (from_kind) {
« no previous file with comments | « src/elements-kind.h ('k') | src/factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698