Skip to content

Commit 8b9f920

Browse files
aamcommit-bot@chromium.org
authored andcommitted
[vm/isolates] Clean up redundant SafepointOperationScope when installing allocation stub.
The SafepointOperationScope is provided by RunWithStoppedMutators. Change-Id: Ib0f3a86de58b074a0b5b84b05631ecc59d62de36 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153640 Reviewed-by: Martin Kustermann <[email protected]> Commit-Queue: Alexander Aprelev <[email protected]>
1 parent 8e3b375 commit 8b9f920

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

runtime/vm/compiler/jit/compiler.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ CodePtr CompileParsedFunctionHelper::Compile(CompilationPipeline* pipeline) {
659659
// those writes are observed atomically.
660660
//
661661
thread()->isolate_group()->RunWithStoppedMutators(
662-
install_code_fun, install_code_fun, /*use_force_growth=*/true);
662+
install_code_fun, /*use_force_growth=*/true);
663663
}
664664
if (!result->IsNull()) {
665665
// Must be called outside of safepoint.

runtime/vm/stub_code.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ CodePtr StubCode::GetAllocationStubForClass(const Class& cls) {
220220
}
221221
};
222222
auto bg_compiler_fun = [&]() {
223-
ForceGrowthSafepointOperationScope safepoint_scope(thread);
223+
ASSERT(Thread::Current()->IsAtSafepoint());
224224
stub = cls.allocation_stub();
225225
// Check if stub was already generated.
226226
if (!stub.IsNull()) {

runtime/vm/type_testing_stubs.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ CodePtr TypeTestingStubGenerator::BuildCodeForType(const Type& type) {
226226
// a) We allocate an instructions object, which might cause us to
227227
// temporarily flip page protections from (RX -> RW -> RX).
228228
//
229-
thread->isolate_group()->RunWithStoppedMutators(
230-
install_code_fun, install_code_fun, /*use_force_growth=*/true);
229+
thread->isolate_group()->RunWithStoppedMutators(install_code_fun,
230+
/*use_force_growth=*/true);
231231

232232
Code::NotifyCodeObservers(name, code, /*optimized=*/false);
233233

0 commit comments

Comments
 (0)