mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 16:41:07 +00:00
[dart2wasm] Mark static variables initialized on assignment
New passing tests: - co19/LibTest/core/Stopwatch/stop_A01_t01 - language/getter/setter_getters_setters_test - language/identifier/naming_test - language/lazy/static3_test - language/lazy/static7_test - language/lazy/static_test - language/loop/for_in2_test - language/new/statement_test - language/nnbd/inference/variables_initialized_to_null_test - language/operator/operator_test - language/setter/setter0_test - language/setter/setter1_test - language/super/call2_test - language/unsorted/inv_cse_licm_test Change-Id: Id7dd53228f1476190dffe3b22ba91d04ed4c2a14 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275320 Reviewed-by: Aske Simon Christensen <askesc@google.com> Commit-Queue: Ömer Ağacan <omersa@google.com>
This commit is contained in:
parent
77e24a6736
commit
af5c53b087
|
@ -1805,8 +1805,13 @@ class CodeGenerator extends ExpressionVisitor1<w.ValueType, w.ValueType>
|
|||
Member target = node.target;
|
||||
if (target is Field) {
|
||||
w.Global global = translator.globals.getGlobal(target);
|
||||
w.Global? flag = translator.globals.getGlobalInitializedFlag(target);
|
||||
wrap(node.value, global.type.type);
|
||||
b.global_set(global);
|
||||
if (flag != null) {
|
||||
b.i32_const(1); // true
|
||||
b.global_set(flag);
|
||||
}
|
||||
if (preserved) {
|
||||
b.global_get(global);
|
||||
return global.type.type;
|
||||
|
|
Loading…
Reference in a new issue