Commit dfcd2579 authored by Dominik Inführ's avatar Dominik Inführ Committed by Commit Bot

[gcmole] Add support for DisallowGarbageCollection

Add support for DisallowGarbageCollection scope. This scope will be
introduced once this CL landed.

DisallowGarbageCollection works like DisallowHeapAllocation but also
disallows safepoints.

Bug: v8:10315
Change-Id: Ia7d777d4104b32810dd481ad9dbdf0edd075b6cf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2395561
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69881}
parent d5cecd11
0af04ef475bc746a501fe17d3b56ccb03fc151fc
ffcb7a55a1310c139f83204a96c939beedf16df7
......@@ -685,6 +685,7 @@ class FunctionAnalyzer {
clang::CXXRecordDecl* maybe_object_decl,
clang::CXXRecordDecl* smi_decl,
clang::CXXRecordDecl* no_gc_decl,
clang::CXXRecordDecl* no_gc_or_safepoint_decl,
clang::CXXRecordDecl* no_heap_access_decl,
clang::DiagnosticsEngine& d, clang::SourceManager& sm)
: ctx_(ctx),
......@@ -692,6 +693,7 @@ class FunctionAnalyzer {
maybe_object_decl_(maybe_object_decl),
smi_decl_(smi_decl),
no_gc_decl_(no_gc_decl),
no_gc_or_safepoint_decl_(no_gc_or_safepoint_decl),
no_heap_access_decl_(no_heap_access_decl),
d_(d),
sm_(sm),
......@@ -1406,6 +1408,8 @@ class FunctionAnalyzer {
}
return (no_gc_decl_ && IsDerivedFrom(definition, no_gc_decl_)) ||
(no_gc_or_safepoint_decl_ &&
IsDerivedFrom(definition, no_gc_or_safepoint_decl_)) ||
(no_heap_access_decl_ &&
IsDerivedFrom(definition, no_heap_access_decl_));
}
......@@ -1491,6 +1495,7 @@ class FunctionAnalyzer {
clang::CXXRecordDecl* maybe_object_decl_;
clang::CXXRecordDecl* smi_decl_;
clang::CXXRecordDecl* no_gc_decl_;
clang::CXXRecordDecl* no_gc_or_safepoint_decl_;
clang::CXXRecordDecl* no_heap_access_decl_;
clang::DiagnosticsEngine& d_;
......@@ -1557,6 +1562,11 @@ class ProblemsFinder : public clang::ASTConsumer,
.ResolveNamespace("internal")
.ResolveTemplate("DisallowHeapAllocation");
clang::CXXRecordDecl* no_gc_or_safepoint_decl =
r.ResolveNamespace("v8")
.ResolveNamespace("internal")
.ResolveTemplate("DisallowGarbageCollection");
clang::CXXRecordDecl* no_heap_access_decl =
r.ResolveNamespace("v8")
.ResolveNamespace("internal")
......@@ -1586,10 +1596,10 @@ class ProblemsFinder : public clang::ASTConsumer,
no_heap_access_decl = no_heap_access_decl->getDefinition();
if (object_decl != NULL && smi_decl != NULL && maybe_object_decl != NULL) {
function_analyzer_ =
new FunctionAnalyzer(clang::ItaniumMangleContext::create(ctx, d_),
object_decl, maybe_object_decl, smi_decl,
no_gc_decl, no_heap_access_decl, d_, sm_);
function_analyzer_ = new FunctionAnalyzer(
clang::ItaniumMangleContext::create(ctx, d_), object_decl,
maybe_object_decl, smi_decl, no_gc_decl, no_gc_or_safepoint_decl,
no_heap_access_decl, d_, sm_);
TraverseDecl(ctx.getTranslationUnitDecl());
} else {
if (object_decl == NULL) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment