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

Unified Diff: src/objects.cc

Issue 1844413002: Use EmbedderHeapTracer instead of object grouping when trace_embedder_heap flag is set (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Move logic from heap to mark compact Created 4 years, 8 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-body-descriptors-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 d441784df7217dca9bc964ec5ef301beeaee177e..bb645d55b3942d3d71f3c3c517ffc74bebf6229d 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -16018,6 +16018,24 @@ void JSObject::CollectOwnPropertyNames(KeyAccumulator* keys,
}
}
+bool JSObject::WasConstructedFromApiFunction() {
+ auto instance_type = map()->instance_type();
+ bool is_api_object = instance_type == JS_API_OBJECT_TYPE ||
+ instance_type == JS_SPECIAL_API_OBJECT_TYPE;
+#ifdef ENABLE_SLOW_DCHECKS
+ if (FLAG_enable_slow_asserts) {
+ Object* maybe_constructor = map()->GetConstructor();
+ if (!maybe_constructor->IsJSFunction()) return false;
+ JSFunction* constructor = JSFunction::cast(maybe_constructor);
+ if (constructor->shared()->IsApiFunction()) {
+ DCHECK(is_api_object);
+ } else {
+ DCHECK(!is_api_object);
+ }
+ }
+#endif
+ return is_api_object;
+}
int JSObject::NumberOfOwnElements(PropertyFilter filter) {
// Fast case for objects with no elements.
« no previous file with comments | « src/objects.h ('k') | src/objects-body-descriptors-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698