OLD | NEW |
---|---|
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include <map> | 5 #include <map> |
6 #include <set> | 6 #include <set> |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "vm/kernel_to_il.h" | 9 #include "vm/kernel_to_il.h" |
10 | 10 |
(...skipping 3533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3544 // initialization) and then call the implicit getter. Thus, the getter | 3544 // initialization) and then call the implicit getter. Thus, the getter |
3545 // cannot contain the InitStaticField instruction that normal static getters | 3545 // cannot contain the InitStaticField instruction that normal static getters |
3546 // contain because it would detect spurious circular initialization when it | 3546 // contain because it would detect spurious circular initialization when it |
3547 // checks for the transition sentinel. | 3547 // checks for the transition sentinel. |
3548 Expression* initializer = kernel_field->initializer(); | 3548 Expression* initializer = kernel_field->initializer(); |
3549 ASSERT(initializer != NULL); | 3549 ASSERT(initializer != NULL); |
3550 body += Constant(constant_evaluator_.EvaluateExpression(initializer)); | 3550 body += Constant(constant_evaluator_.EvaluateExpression(initializer)); |
3551 } else { | 3551 } else { |
3552 // The field always has an initializer because static fields without | 3552 // The field always has an initializer because static fields without |
3553 // initializers are initialized eagerly and do not have implicit getters. | 3553 // initializers are initialized eagerly and do not have implicit getters. |
3554 ASSERT(field.has_initializer()); | |
Kevin Millikin (Google)
2017/03/22 13:09:38
I think the ASSERT is indicating that something is
| |
3555 body += Constant(field); | 3554 body += Constant(field); |
3556 body += InitStaticField(field); | 3555 body += InitStaticField(field); |
3557 body += Constant(field); | 3556 body += Constant(field); |
3558 body += LoadStaticField(); | 3557 body += LoadStaticField(); |
3559 } | 3558 } |
3560 body += Return(TokenPosition::kNoSource); | 3559 body += Return(TokenPosition::kNoSource); |
3561 | 3560 |
3562 return new (Z) FlowGraph(*parsed_function_, graph_entry_, next_block_id_ - 1); | 3561 return new (Z) FlowGraph(*parsed_function_, graph_entry_, next_block_id_ - 1); |
3563 } | 3562 } |
3564 | 3563 |
(...skipping 2878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6443 thread->clear_sticky_error(); | 6442 thread->clear_sticky_error(); |
6444 return error.raw(); | 6443 return error.raw(); |
6445 } | 6444 } |
6446 } | 6445 } |
6447 | 6446 |
6448 | 6447 |
6449 } // namespace kernel | 6448 } // namespace kernel |
6450 } // namespace dart | 6449 } // namespace dart |
6451 | 6450 |
6452 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 6451 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
OLD | NEW |