| Index: runtime/vm/flow_graph_builder.cc
|
| ===================================================================
|
| --- runtime/vm/flow_graph_builder.cc (revision 43472)
|
| +++ runtime/vm/flow_graph_builder.cc (working copy)
|
| @@ -889,7 +889,8 @@
|
|
|
|
|
| void TestGraphVisitor::ReturnValue(Value* value) {
|
| - if (FLAG_enable_type_checks || FLAG_enable_asserts) {
|
| + if (Isolate::Current()->TypeChecksEnabled() ||
|
| + Isolate::Current()->AssertsEnabled()) {
|
| value = Bind(new(I) AssertBooleanInstr(condition_token_pos(), value));
|
| }
|
| Value* constant_true = Bind(new(I) ConstantInstr(Bool::True()));
|
| @@ -924,7 +925,7 @@
|
| false)); // No number check.
|
| } else {
|
| branch = new(I) BranchInstr(comp);
|
| - branch->set_is_checked(FLAG_enable_type_checks);
|
| + branch->set_is_checked(Isolate::Current()->TypeChecksEnabled());
|
| }
|
| AddInstruction(branch);
|
| CloseFragment();
|
| @@ -934,7 +935,7 @@
|
|
|
|
|
| void TestGraphVisitor::MergeBranchWithNegate(BooleanNegateInstr* neg) {
|
| - ASSERT(!FLAG_enable_type_checks);
|
| + ASSERT(!Isolate::Current()->TypeChecksEnabled());
|
| Value* constant_true = Bind(new(I) ConstantInstr(Bool::True()));
|
| StrictCompareInstr* comp =
|
| new(I) StrictCompareInstr(condition_token_pos(),
|
| @@ -956,7 +957,7 @@
|
| MergeBranchWithComparison(comp);
|
| return;
|
| }
|
| - if (!FLAG_enable_type_checks) {
|
| + if (!Isolate::Current()->TypeChecksEnabled()) {
|
| BooleanNegateInstr* neg = definition->AsBooleanNegate();
|
| if (neg != NULL) {
|
| MergeBranchWithNegate(neg);
|
| @@ -1045,7 +1046,7 @@
|
| RawPcDescriptors::kRuntimeCall));
|
| }
|
|
|
| - if (FLAG_enable_type_checks) {
|
| + if (Isolate::Current()->TypeChecksEnabled()) {
|
| const bool is_implicit_dynamic_getter =
|
| (!function.is_static() &&
|
| ((function.kind() == RawFunction::kImplicitGetter) ||
|
| @@ -1244,7 +1245,8 @@
|
| TestGraphVisitor for_left(owner(), node->left()->token_pos());
|
| node->left()->Visit(&for_left);
|
| EffectGraphVisitor empty(owner());
|
| - if (FLAG_enable_type_checks || FLAG_enable_asserts) {
|
| + if (Isolate::Current()->TypeChecksEnabled() ||
|
| + Isolate::Current()->AssertsEnabled()) {
|
| ValueGraphVisitor for_right(owner());
|
| node->right()->Visit(&for_right);
|
| Value* right_value = for_right.value();
|
| @@ -1309,7 +1311,8 @@
|
| ValueGraphVisitor for_right(owner());
|
| node->right()->Visit(&for_right);
|
| Value* right_value = for_right.value();
|
| - if (FLAG_enable_type_checks|| FLAG_enable_asserts) {
|
| + if (Isolate::Current()->TypeChecksEnabled() ||
|
| + Isolate::Current()->AssertsEnabled()) {
|
| right_value =
|
| for_right.Bind(new(I) AssertBooleanInstr(node->right()->token_pos(),
|
| right_value));
|
| @@ -1782,7 +1785,8 @@
|
| 2,
|
| owner()->ic_data_array());
|
| if (node->kind() == Token::kNE) {
|
| - if (FLAG_enable_type_checks || FLAG_enable_asserts) {
|
| + if (Isolate::Current()->TypeChecksEnabled() ||
|
| + Isolate::Current()->AssertsEnabled()) {
|
| Value* value = Bind(result);
|
| result = new(I) AssertBooleanInstr(node->token_pos(), value);
|
| }
|
| @@ -1828,7 +1832,8 @@
|
| node->operand()->Visit(&for_value);
|
| Append(for_value);
|
| Value* value = for_value.value();
|
| - if (FLAG_enable_type_checks || FLAG_enable_asserts) {
|
| + if (Isolate::Current()->TypeChecksEnabled() ||
|
| + Isolate::Current()->AssertsEnabled()) {
|
| value =
|
| Bind(new(I) AssertBooleanInstr(node->operand()->token_pos(), value));
|
| }
|
| @@ -3431,7 +3436,7 @@
|
| node->value()->Visit(&for_value);
|
| Append(for_value);
|
| Value* store_value = for_value.value();
|
| - if (FLAG_enable_type_checks) {
|
| + if (Isolate::Current()->TypeChecksEnabled()) {
|
| store_value = BuildAssignableValue(node->value()->token_pos(),
|
| store_value,
|
| node->local().type(),
|
| @@ -3472,7 +3477,7 @@
|
| node->value()->Visit(&for_value);
|
| Append(for_value);
|
| Value* store_value = for_value.value();
|
| - if (FLAG_enable_type_checks) {
|
| + if (Isolate::Current()->TypeChecksEnabled()) {
|
| const AbstractType& type =
|
| AbstractType::ZoneHandle(I, node->field().type());
|
| const String& dst_name = String::ZoneHandle(I, node->field().name());
|
| @@ -3834,7 +3839,7 @@
|
| }
|
| }
|
|
|
| - if (FLAG_enable_type_checks && is_top_level_sequence) {
|
| + if (Isolate::Current()->TypeChecksEnabled() && is_top_level_sequence) {
|
| const Function& function = owner()->function();
|
| const int num_params = function.NumParameters();
|
| int pos = 0;
|
|
|