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

Unified Diff: src/runtime/runtime-collections.cc

Issue 2672213002: [inspector] introduced v8::debug::EntriesPreview for inspector (Closed)
Patch Set: rebased tests Created 3 years, 10 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/runtime/runtime.h ('k') | test/inspector/debugger/object-preview-internal-properties-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-collections.cc
diff --git a/src/runtime/runtime-collections.cc b/src/runtime/runtime-collections.cc
index 15c1fab76fdd3a22b59165840eb74e152152dee5..2f3de04106a94aafaa0807156767a0a95ceddc1d 100644
--- a/src/runtime/runtime-collections.cc
+++ b/src/runtime/runtime-collections.cc
@@ -226,14 +226,9 @@ RUNTIME_FUNCTION(Runtime_MapIteratorDetails) {
return *isolate->factory()->NewJSArrayWithElements(details);
}
-
-RUNTIME_FUNCTION(Runtime_GetWeakMapEntries) {
- HandleScope scope(isolate);
- DCHECK_EQ(2, args.length());
- CONVERT_ARG_HANDLE_CHECKED(JSWeakCollection, holder, 0);
- CONVERT_NUMBER_CHECKED(int, max_entries, Int32, args[1]);
- CHECK(max_entries >= 0);
-
+Handle<JSArray> Runtime::GetWeakMapEntries(Isolate* isolate,
+ Handle<JSWeakCollection> holder,
+ int max_entries) {
Handle<ObjectHashTable> table(ObjectHashTable::cast(holder->table()));
if (max_entries == 0 || max_entries > table->NumberOfElements()) {
max_entries = table->NumberOfElements();
@@ -258,7 +253,16 @@ RUNTIME_FUNCTION(Runtime_GetWeakMapEntries) {
}
DCHECK_EQ(max_entries * 2, count);
}
- return *isolate->factory()->NewJSArrayWithElements(entries);
+ return isolate->factory()->NewJSArrayWithElements(entries);
+}
+
+RUNTIME_FUNCTION(Runtime_GetWeakMapEntries) {
Yang 2017/02/06 10:41:30 Can we move that to JSWeakMap?
jgruber 2017/02/06 12:40:39 +1
kozy 2017/02/06 18:39:26 Done.
+ HandleScope scope(isolate);
+ DCHECK_EQ(2, args.length());
+ CONVERT_ARG_HANDLE_CHECKED(JSWeakCollection, holder, 0);
+ CONVERT_NUMBER_CHECKED(int, max_entries, Int32, args[1]);
+ CHECK(max_entries >= 0);
+ return *Runtime::GetWeakMapEntries(isolate, holder, max_entries);
}
@@ -341,14 +345,9 @@ RUNTIME_FUNCTION(Runtime_WeakCollectionSet) {
return *weak_collection;
}
-
-RUNTIME_FUNCTION(Runtime_GetWeakSetValues) {
- HandleScope scope(isolate);
- DCHECK_EQ(2, args.length());
- CONVERT_ARG_HANDLE_CHECKED(JSWeakCollection, holder, 0);
- CONVERT_NUMBER_CHECKED(int, max_values, Int32, args[1]);
- CHECK(max_values >= 0);
-
+Handle<JSArray> Runtime::GetWeakSetEntries(Isolate* isolate,
Yang 2017/02/06 10:41:30 Can we move that to JSWeakSet?
kozy 2017/02/06 18:39:26 Done.
+ Handle<JSWeakCollection> holder,
+ int max_values) {
Handle<ObjectHashTable> table(ObjectHashTable::cast(holder->table()));
if (max_values == 0 || max_values > table->NumberOfElements()) {
max_values = table->NumberOfElements();
@@ -367,7 +366,16 @@ RUNTIME_FUNCTION(Runtime_GetWeakSetValues) {
}
DCHECK_EQ(max_values, count);
}
- return *isolate->factory()->NewJSArrayWithElements(values);
+ return isolate->factory()->NewJSArrayWithElements(values);
+}
+
+RUNTIME_FUNCTION(Runtime_GetWeakSetValues) {
+ HandleScope scope(isolate);
+ DCHECK_EQ(2, args.length());
+ CONVERT_ARG_HANDLE_CHECKED(JSWeakCollection, holder, 0);
+ CONVERT_NUMBER_CHECKED(int, max_values, Int32, args[1]);
+ CHECK(max_values >= 0);
+ return *Runtime::GetWeakSetEntries(isolate, holder, max_values);
}
} // namespace internal
} // namespace v8
« no previous file with comments | « src/runtime/runtime.h ('k') | test/inspector/debugger/object-preview-internal-properties-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698