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

Unified Diff: src/objects-inl.h

Issue 1995263002: [keys] Simplify KeyAccumulator (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix handle dereferencing 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.cc ('k') | src/runtime/runtime-array.cc » ('j') | 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 ee6850b69827fb8cb0476ad89129843eac339c47..f873f9478bcf5964b0fa4b47967c01a772c420db 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -21,8 +21,9 @@
#include "src/handles-inl.h"
#include "src/heap/heap-inl.h"
#include "src/heap/heap.h"
-#include "src/isolate.h"
#include "src/isolate-inl.h"
+#include "src/isolate.h"
+#include "src/keys.h"
#include "src/layout-descriptor-inl.h"
#include "src/lookup.h"
#include "src/objects.h"
@@ -1110,6 +1111,12 @@ MaybeHandle<Object> JSReceiver::GetProperty(Isolate* isolate,
return GetProperty(receiver, str);
}
+// static
+MUST_USE_RESULT MaybeHandle<FixedArray> JSReceiver::OwnPropertyKeys(
+ Handle<JSReceiver> object) {
+ return KeyAccumulator::GetKeys(object, OWN_ONLY, ALL_PROPERTIES,
+ CONVERT_TO_STRING);
+}
#define FIELD_ADDR(p, offset) \
(reinterpret_cast<byte*>(p) + offset - kHeapObjectTag)
@@ -6640,16 +6647,18 @@ ElementsKind JSObject::GetElementsKind() {
// pointer may point to a one pointer filler map.
if (ElementsAreSafeToExamine()) {
Map* map = fixed_array->map();
- DCHECK((IsFastSmiOrObjectElementsKind(kind) &&
- (map == GetHeap()->fixed_array_map() ||
- map == GetHeap()->fixed_cow_array_map())) ||
- (IsFastDoubleElementsKind(kind) &&
- (fixed_array->IsFixedDoubleArray() ||
- fixed_array == GetHeap()->empty_fixed_array())) ||
- (kind == DICTIONARY_ELEMENTS &&
- fixed_array->IsFixedArray() &&
- fixed_array->IsDictionary()) ||
- (kind > DICTIONARY_ELEMENTS));
+ if (IsFastSmiOrObjectElementsKind(kind)) {
+ DCHECK(map == GetHeap()->fixed_array_map() ||
+ map == GetHeap()->fixed_cow_array_map());
+ } else if (IsFastDoubleElementsKind(kind)) {
+ DCHECK(fixed_array->IsFixedDoubleArray() ||
+ fixed_array == GetHeap()->empty_fixed_array());
+ } else if (kind == DICTIONARY_ELEMENTS) {
+ DCHECK(fixed_array->IsFixedArray());
+ DCHECK(fixed_array->IsDictionary());
+ } else {
+ DCHECK(kind > DICTIONARY_ELEMENTS);
+ }
DCHECK(!IsSloppyArgumentsElements(kind) ||
(elements()->IsFixedArray() && elements()->length() >= 2));
}
« no previous file with comments | « src/objects.cc ('k') | src/runtime/runtime-array.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698