summaryrefslogtreecommitdiff
path: root/chromium/v8/tools/gcmole/gcmole-test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/v8/tools/gcmole/gcmole-test.cc')
-rw-r--r--chromium/v8/tools/gcmole/gcmole-test.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/chromium/v8/tools/gcmole/gcmole-test.cc b/chromium/v8/tools/gcmole/gcmole-test.cc
index 92f7a9eda88..8512d7ab4cd 100644
--- a/chromium/v8/tools/gcmole/gcmole-test.cc
+++ b/chromium/v8/tools/gcmole/gcmole-test.cc
@@ -216,5 +216,18 @@ void TestNestedDeadVarAnalysis(Isolate* isolate) {
raw_obj.Print();
}
+// Test that putting a guard in the middle of the function doesn't
+// mistakenly cover the whole scope of the raw variable.
+void TestGuardedDeadVarAnalysisMidFunction(Isolate* isolate) {
+ JSObject raw_obj = *isolate->factory()->NewJSObjectWithNullProto();
+
+ CauseGCRaw(raw_obj, isolate);
+
+ // Guarding the rest of the function from triggering a GC.
+ DisallowHeapAllocation no_gc;
+ // Should cause warning.
+ raw_obj.Print();
+}
+
} // namespace internal
} // namespace v8