Skip to content

Commit c433fe1

Browse files
osa1Commit Queue
authored andcommitted
[dart2wasm] Remove unused Globals.updateGlobal member
Change-Id: Icabe29c7a407e933eb6a26159bf699f0bd1ea154 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/391580 Commit-Queue: Ömer Ağacan <[email protected]> Reviewed-by: Slava Egorov <[email protected]>
1 parent f46aa56 commit c433fe1

File tree

1 file changed

+0
-34
lines changed

1 file changed

+0
-34
lines changed

pkg/dart2wasm/lib/globals.dart

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ class Globals {
1414

1515
final Map<Field, w.GlobalBuilder> _globals = {};
1616
final Map<w.Global, w.BaseFunction> _globalGetters = {};
17-
final Map<w.Global, w.BaseFunction> _globalSetters = {};
1817
final Map<Field, w.BaseFunction> _globalInitializers = {};
1918
final Map<Field, w.Global> _globalInitializedFlag = {};
2019
late final WasmGlobalImporter _globalsModuleMap =
@@ -63,39 +62,6 @@ class Globals {
6362
return global.type.type;
6463
}
6564

66-
/// Sets the value of [w.Global] in [b].
67-
///
68-
/// Takes into account the calling module and the module the global belongs
69-
/// to. If they are not the same then sets the global indirectly, either
70-
/// through an import or a setter call.
71-
void updateGlobal(w.InstructionsBuilder b,
72-
void Function(w.InstructionsBuilder b) pushValue, w.Global global) {
73-
final owningModule = global.enclosingModule;
74-
final callingModule = b.module;
75-
if (owningModule == callingModule) {
76-
pushValue(b);
77-
b.global_set(global);
78-
} else if (translator.isMainModule(owningModule)) {
79-
final importedGlobal = _globalsModuleMap.get(global, callingModule);
80-
pushValue(b);
81-
b.global_set(importedGlobal);
82-
} else {
83-
final setter = _globalSetters.putIfAbsent(global, () {
84-
final setterType =
85-
owningModule.types.defineFunction([global.type.type], const []);
86-
final setterFunction = owningModule.functions.define(setterType);
87-
final setterBody = setterFunction.body;
88-
setterBody.local_get(setterBody.locals.single);
89-
setterBody.global_set(global);
90-
setterBody.end();
91-
return setterFunction;
92-
});
93-
94-
pushValue(b);
95-
translator.callFunction(setter, b);
96-
}
97-
}
98-
9965
/// Return (and if needed create) the Wasm global corresponding to a static
10066
/// field.
10167
w.Global getGlobalForStaticField(Field field) {

0 commit comments

Comments
 (0)