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

Unified Diff: src/context-measure.cc

Issue 2780773002: [heap] Two minor fixes in EstimatedSize (Closed)
Patch Set: Skip objects which have a different receiver context, rather than skipping maps Created 3 years, 9 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 | « no previous file | test/cctest/heap/test-heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/context-measure.cc
diff --git a/src/context-measure.cc b/src/context-measure.cc
index 00c11eebc2cf40a548d16270c4173242f0e78322..2ff528b5750c5508c60f2d17a8f32811e60eec3c 100644
--- a/src/context-measure.cc
+++ b/src/context-measure.cc
@@ -19,6 +19,8 @@ ContextMeasure::ContextMeasure(Context* context)
size_(0) {
DCHECK(context_->IsNativeContext());
Object* next_link = context_->next_context_link();
+ context_->set(Context::NEXT_CONTEXT_LINK,
+ context->GetIsolate()->heap()->undefined_value());
MeasureObject(context_);
MeasureDeferredObjects();
context_->set(Context::NEXT_CONTEXT_LINK, next_link);
@@ -40,6 +42,9 @@ void ContextMeasure::MeasureObject(HeapObject* object) {
if (reference_map_.Lookup(object).is_valid()) return;
if (root_index_map_.Lookup(object) != RootIndexMap::kInvalidRootIndex) return;
if (IsShared(object)) return;
+ if (object->IsJSReceiver() &&
+ *JSReceiver::cast(object)->GetCreationContext() != context_)
+ return;
reference_map_.Add(object, SerializerReference::DummyReference());
recursion_depth_++;
if (recursion_depth_ > kMaxRecursion) {
« no previous file with comments | « no previous file | test/cctest/heap/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698