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

Unified Diff: src/elements-kind.h

Issue 1612323003: Introduce {FAST,SLOW}_STRING_WRAPPER_ELEMENTS (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: one more DCHECK fix Created 4 years, 11 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.cc ('k') | src/elements-kind.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/elements-kind.h
diff --git a/src/elements-kind.h b/src/elements-kind.h
index 5f6cd62c46e00a3d3f935f725a99b2f29a258610..3ebc9ad287ccc6a664d63f4877e2c37eb4da44e2 100644
--- a/src/elements-kind.h
+++ b/src/elements-kind.h
@@ -30,10 +30,16 @@ enum ElementsKind {
// The "slow" kind.
DICTIONARY_ELEMENTS,
+ // Elements kind of the "arguments" object (only in sloppy mode).
FAST_SLOPPY_ARGUMENTS_ELEMENTS,
SLOW_SLOPPY_ARGUMENTS_ELEMENTS,
- // Fixed typed arrays
+ // For string wrapper objects ("new String('...')"), the string's characters
+ // are overlaid onto a regular elements backing store.
+ FAST_STRING_WRAPPER_ELEMENTS,
+ SLOW_STRING_WRAPPER_ELEMENTS,
+
+ // Fixed typed arrays.
UINT8_ELEMENTS,
INT8_ELEMENTS,
UINT16_ELEMENTS,
@@ -44,7 +50,10 @@ enum ElementsKind {
FLOAT64_ELEMENTS,
UINT8_CLAMPED_ELEMENTS,
- // Derived constants from ElementsKind
+ // Sentinel ElementsKind for objects with no elements.
+ NO_ELEMENTS,
+
+ // Derived constants from ElementsKind.
FIRST_ELEMENTS_KIND = FAST_SMI_ELEMENTS,
LAST_ELEMENTS_KIND = UINT8_CLAMPED_ELEMENTS,
FIRST_FAST_ELEMENTS_KIND = FAST_SMI_ELEMENTS,
@@ -83,6 +92,10 @@ inline bool IsSloppyArgumentsElements(ElementsKind kind) {
kind == SLOW_SLOPPY_ARGUMENTS_ELEMENTS;
}
+inline bool IsStringWrapperElementsKind(ElementsKind kind) {
+ return kind == FAST_STRING_WRAPPER_ELEMENTS ||
+ kind == SLOW_STRING_WRAPPER_ELEMENTS;
+}
inline bool IsFixedTypedArrayElementsKind(ElementsKind kind) {
return kind >= FIRST_FIXED_TYPED_ARRAY_ELEMENTS_KIND &&
@@ -104,7 +117,8 @@ inline bool IsFastElementsKind(ElementsKind kind) {
inline bool IsTransitionElementsKind(ElementsKind kind) {
return IsFastElementsKind(kind) || IsFixedTypedArrayElementsKind(kind) ||
- kind == FAST_SLOPPY_ARGUMENTS_ELEMENTS;
+ kind == FAST_SLOPPY_ARGUMENTS_ELEMENTS ||
+ kind == FAST_STRING_WRAPPER_ELEMENTS;
}
« no previous file with comments | « src/elements.cc ('k') | src/elements-kind.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698