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

Unified Diff: test/cctest/test-heap-profiler.cc

Issue 22852024: Track JS allocations as they arrive with no affection on performance when tracking is switched off (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Code style fixes after review #2 Created 7 years, 3 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
« test/cctest/test-heap.cc ('K') | « test/cctest/test-heap.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-heap-profiler.cc
diff --git a/test/cctest/test-heap-profiler.cc b/test/cctest/test-heap-profiler.cc
index 59f7a258b1094fa5a0ddb2b2e42a2170f2560f55..9ad043a257488bb8451046db26a8a0d7fb1827e7 100644
--- a/test/cctest/test-heap-profiler.cc
+++ b/test/cctest/test-heap-profiler.cc
@@ -2005,3 +2005,20 @@ TEST(JSFunctionHasCodeLink) {
GetProperty(foo_func, v8::HeapGraphEdge::kInternal, "code");
CHECK_NE(NULL, code);
}
+
+
+// This is an example of using checking of JS allocations tracking in a test.
Hannes Payer (out of office) 2013/10/02 18:00:29 Either remove the test if it is not testing anythi
Alexandra Mikhaylova 2013/10/03 16:27:55 This test checks that we don't miss some simplest
Hannes Payer (out of office) 2013/10/10 18:54:40 Sure, but wouldn't it make sense to check which ob
+TEST(HeapObjectsTracker) {
+ LocalContext env;
+ v8::HandleScope scope(env->GetIsolate());
+ HeapObjectsTracker tracker;
+ CompileRun("var a = 1.2");
+ CompileRun("var a = 1.2; var b = 1.0; var c = 1.0;");
+ CompileRun(
+ "var a = [];"
+ "for (var i = 0; i < 5; ++i)"
+ " a[i] = i;\n"
+ "for (var i = 0; i < 3; ++i)"
+ " a.shift();\n"
+ );
+}
« test/cctest/test-heap.cc ('K') | « test/cctest/test-heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698