Skip to content

Commit a2ae02e

Browse files
mralephCommit Queue
authored andcommitted
[vm] Add HANDLESCOPE in KernelLoader::LoadLibrary
This reduces amount of handles and live data kept around after each library is loaded which helps on large apps. TEST=ci Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-linux-debug-x64-try,vm-linux-debug-x64c-try,vm-mac-debug-arm64-try,vm-mac-debug-x64-try Change-Id: I9ae8f31a5912c589b4668f0937e4744315c21d19 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/420321 Reviewed-by: Ryan Macnak <[email protected]> Commit-Queue: Slava Egorov <[email protected]>
1 parent 0dde212 commit a2ae02e

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

runtime/vm/compiler/frontend/kernel_translation_helper.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,8 @@ class TranslationHelper {
199199

200200
void SetExpressionEvaluationFunction(const Function& function) {
201201
ASSERT(expression_evaluation_function_ == nullptr);
202-
expression_evaluation_function_ = &Function::Handle(zone_, function.ptr());
202+
expression_evaluation_function_ =
203+
&Function::ZoneHandle(zone_, function.ptr());
203204
}
204205
const Function& GetExpressionEvaluationFunction() {
205206
if (expression_evaluation_function_ == nullptr) {
@@ -210,7 +211,7 @@ class TranslationHelper {
210211
void SetExpressionEvaluationClass(const Class& cls) {
211212
ASSERT(expression_evaluation_class_ == nullptr);
212213
ASSERT(!cls.IsNull());
213-
expression_evaluation_class_ = &Class::Handle(zone_, cls.ptr());
214+
expression_evaluation_class_ = &Class::ZoneHandle(zone_, cls.ptr());
214215
}
215216
const Class& GetExpressionEvaluationClass() {
216217
if (expression_evaluation_class_ == nullptr) {
@@ -221,7 +222,8 @@ class TranslationHelper {
221222
void SetExpressionEvaluationRealClass(const Class& real_class) {
222223
ASSERT(expression_evaluation_real_class_ == nullptr);
223224
ASSERT(!real_class.IsNull());
224-
expression_evaluation_real_class_ = &Class::Handle(zone_, real_class.ptr());
225+
expression_evaluation_real_class_ =
226+
&Class::ZoneHandle(zone_, real_class.ptr());
225227
}
226228
const Class& GetExpressionEvaluationRealClass() {
227229
if (expression_evaluation_real_class_ == nullptr) {

runtime/vm/kernel_loader.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,7 @@ void KernelLoader::CheckForInitializer(const Field& field) {
790790
}
791791

792792
LibraryPtr KernelLoader::LoadLibrary(intptr_t index) {
793+
HANDLESCOPE(thread_);
793794
if (!program_->is_single_program()) {
794795
FATAL(
795796
"Trying to load a concatenated dill file at a time where that is "

0 commit comments

Comments
 (0)