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

Unified Diff: test/cctest/heap/test-heap.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 | « src/context-measure.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/heap/test-heap.cc
diff --git a/test/cctest/heap/test-heap.cc b/test/cctest/heap/test-heap.cc
index c331a4030f5b66de05f8958959eb1085abb96fde..ebc39d25b2a6a70aabb89dbe52dec5095c1625aa 100644
--- a/test/cctest/heap/test-heap.cc
+++ b/test/cctest/heap/test-heap.cc
@@ -5899,6 +5899,26 @@ TEST(ContextMeasure) {
CHECK_LE(measure.Size(), size_upper_limit);
}
+TEST(ContextMeasureNoMap) {
+ CcTest::InitializeVM();
+ v8::HandleScope scope(CcTest::isolate());
+
+ Local<v8::Context> current_context = CcTest::isolate()->GetCurrentContext();
+ Local<v8::Context> other_context = v8::Context::New(CcTest::isolate());
+
+ CompileRun(current_context, "var x = []");
+
+ size_t original_size_current = current_context->EstimatedSize();
+ size_t original_size_other = other_context->EstimatedSize();
+
+ CompileRun(current_context, "x.a = 1;");
+
+ size_t new_size_current = current_context->EstimatedSize();
+ size_t new_size_other = other_context->EstimatedSize();
+
+ CHECK_LT(original_size_current, new_size_current);
+ CHECK_EQ(original_size_other, new_size_other);
+}
TEST(ScriptIterator) {
CcTest::InitializeVM();
« no previous file with comments | « src/context-measure.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698