Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1494)

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 883263004: Allows turning on checked mode on a per-isolate basis (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | runtime/vm/flow_graph_compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | runtime/vm/flow_graph_compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698