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

Unified Diff: src/objects.cc

Issue 1237953002: Simplify PrepareForDataProperty in the IsElement case (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Only used to modify an existing value, so don't make holey 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/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 0eefbec2ab7fb568312a7282649ebb5b9d9bfbfa..a202320357cb8ee39e66355adf948fece8fc9e20 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -6960,43 +6960,6 @@ bool DescriptorArray::CanHoldValue(int descriptor, Object* value) {
// static
-Handle<Map> Map::PrepareForDataElement(Handle<Map> map, Handle<Object> value) {
- ElementsKind kind = map->elements_kind();
- bool holey = IsHoleyElementsKind(kind);
-
- switch (kind) {
- case FAST_SMI_ELEMENTS:
- case FAST_HOLEY_SMI_ELEMENTS:
- if (value->IsSmi()) return map;
- kind = value->IsNumber() ? FAST_DOUBLE_ELEMENTS : FAST_ELEMENTS;
- break;
-
- case FAST_DOUBLE_ELEMENTS:
- case FAST_HOLEY_DOUBLE_ELEMENTS:
- if (value->IsNumber()) return map;
- kind = FAST_ELEMENTS;
- break;
-
- case FAST_ELEMENTS:
- case FAST_HOLEY_ELEMENTS:
- case DICTIONARY_ELEMENTS:
- case FAST_SLOPPY_ARGUMENTS_ELEMENTS:
- case SLOW_SLOPPY_ARGUMENTS_ELEMENTS:
-#define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \
- case EXTERNAL_##TYPE##_ELEMENTS: \
- case TYPE##_ELEMENTS:
-
- TYPED_ARRAYS(TYPED_ARRAY_CASE)
-#undef TYPED_ARRAY_CASE
- return map;
- }
-
- if (holey) kind = GetHoleyElementsKind(kind);
- return Map::AsElementsKind(map, kind);
-}
-
-
-// static
Handle<Map> Map::PrepareForDataProperty(Handle<Map> map, int descriptor,
Handle<Object> value) {
// Dictionaries can store any property value.
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698