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

Unified Diff: src/objects-inl.h

Issue 2014343004: [runtime] Allow generic allocation of sloppy arguments. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 2293a54566abbc30d65d5fbc4ff809daa7f823f3..945157936bc87b00f9783652a5c9857916164739 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -2796,18 +2796,18 @@ void Map::SetEnumLength(int length) {
FixedArrayBase* Map::GetInitialElements() {
+ FixedArrayBase* result = nullptr;
if (has_fast_elements() || has_fast_string_wrapper_elements()) {
- DCHECK(!GetHeap()->InNewSpace(GetHeap()->empty_fixed_array()));
- return GetHeap()->empty_fixed_array();
+ result = GetHeap()->empty_fixed_array();
+ } else if (has_fast_sloppy_arguments_elements()) {
+ result = GetHeap()->empty_sloppy_arguments_elements();
} else if (has_fixed_typed_array_elements()) {
- FixedTypedArrayBase* empty_array =
- GetHeap()->EmptyFixedTypedArrayForMap(this);
- DCHECK(!GetHeap()->InNewSpace(empty_array));
- return empty_array;
+ result = GetHeap()->EmptyFixedTypedArrayForMap(this);
} else {
UNREACHABLE();
}
- return NULL;
+ DCHECK(!GetHeap()->InNewSpace(result));
+ return result;
}
@@ -4573,6 +4573,10 @@ bool Map::has_sloppy_arguments_elements() {
return IsSloppyArgumentsElements(elements_kind());
}
+bool Map::has_fast_sloppy_arguments_elements() {
+ return elements_kind() == FAST_SLOPPY_ARGUMENTS_ELEMENTS;
+}
+
bool Map::has_fast_string_wrapper_elements() {
return elements_kind() == FAST_STRING_WRAPPER_ELEMENTS;
}
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698