| Index: runtime/vm/flow_graph_type_propagator.cc
|
| ===================================================================
|
| --- runtime/vm/flow_graph_type_propagator.cc (revision 43426)
|
| +++ runtime/vm/flow_graph_type_propagator.cc (working copy)
|
| @@ -19,6 +19,11 @@
|
| DECLARE_FLAG(bool, use_cha);
|
|
|
|
|
| +static bool TypeChecksEnabled() {
|
| + return FLAG_enable_type_checks || Isolate::Current()->checked_mode();
|
| +}
|
| +
|
| +
|
| void FlowGraphTypePropagator::Propagate(FlowGraph* flow_graph) {
|
| FlowGraphTypePropagator propagator(flow_graph);
|
| propagator.Propagate();
|
| @@ -39,7 +44,7 @@
|
| types_.Add(NULL);
|
| }
|
|
|
| - if (FLAG_enable_type_checks) {
|
| + if (TypeChecksEnabled()) {
|
| asserts_ = new ZoneGrowableArray<AssertAssignableInstr*>(
|
| flow_graph->current_ssa_temp_index());
|
| for (intptr_t i = 0; i < flow_graph->current_ssa_temp_index(); i++) {
|
| @@ -121,7 +126,7 @@
|
|
|
| const intptr_t rollback_point = rollback_.length();
|
|
|
| - if (FLAG_enable_type_checks) {
|
| + if (TypeChecksEnabled()) {
|
| StrengthenAsserts(block);
|
| }
|
|
|
| @@ -895,7 +900,7 @@
|
| return CompileType::FromCid(result_cid_);
|
| }
|
|
|
| - if (FLAG_enable_type_checks) {
|
| + if (TypeChecksEnabled()) {
|
| // Void functions are known to return null, which is checked at the return
|
| // from the function.
|
| const AbstractType& result_type =
|
| @@ -910,7 +915,7 @@
|
|
|
|
|
| CompileType LoadLocalInstr::ComputeType() const {
|
| - if (FLAG_enable_type_checks) {
|
| + if (TypeChecksEnabled()) {
|
| return CompileType::FromAbstractType(local().type());
|
| }
|
| return CompileType::Dynamic();
|
| @@ -954,7 +959,7 @@
|
| intptr_t cid = kDynamicCid;
|
| AbstractType* abstract_type = NULL;
|
| const Field& field = this->StaticField();
|
| - if (FLAG_enable_type_checks) {
|
| + if (TypeChecksEnabled()) {
|
| cid = kIllegalCid;
|
| abstract_type = &AbstractType::ZoneHandle(field.type());
|
| }
|
| @@ -1009,7 +1014,7 @@
|
| }
|
|
|
| const AbstractType* abstract_type = NULL;
|
| - if (FLAG_enable_type_checks) {
|
| + if (TypeChecksEnabled()) {
|
| ASSERT(!type().HasResolvedTypeClass() ||
|
| !Field::IsExternalizableCid(Class::Handle(
|
| type().type_class()).id()));
|
|
|