Chromium Code Reviews| Index: runtime/vm/kernel_to_il.h |
| diff --git a/runtime/vm/kernel_to_il.h b/runtime/vm/kernel_to_il.h |
| index 1f374f5aa453e6f085a97a1c150853a70f9c73ca..f81409d4b4e5c337ce917fc15e3af165a09e4e49 100644 |
| --- a/runtime/vm/kernel_to_il.h |
| +++ b/runtime/vm/kernel_to_il.h |
| @@ -474,6 +474,12 @@ class ConstantEvaluator : public ExpressionVisitor { |
| const Function& constructor, |
| const Object& argument); |
| + void MaybeCheckBool() { |
|
Vyacheslav Egorov (Google)
2017/01/30 18:30:28
I would call it AssertBoolInCheckedMode() to match
kustermann
2017/01/31 10:39:45
Done.
|
| + if (isolate_->type_checks() && !result_.IsBool()) { |
| + translation_helper_.ReportError("Expected boolean expression."); |
| + } |
| + } |
| + |
| // TODO(27590): Instead of using [dart::kernel::TreeNode]s as keys we |
| // should use [TokenPosition]s as well as the existing functionality in |
| // `Parser::CacheConstantValue`. |
| @@ -628,7 +634,6 @@ class ScopeBuilder : public RecursiveVisitor { |
| void LookupCapturedVariableByName(LocalVariable** variable, |
| const dart::String& name); |
| - |
| struct DepthState { |
| explicit DepthState(intptr_t function) |
| : loop_(0), |
| @@ -868,6 +873,17 @@ class FlowGraphBuilder : public ExpressionVisitor, public StatementVisitor { |
| Fragment GuardFieldLength(const dart::Field& field, intptr_t deopt_id); |
| Fragment GuardFieldClass(const dart::Field& field, intptr_t deopt_id); |
| + Fragment EvaluateAssertion(); |
| + Fragment MaybeCheckReturnType(); |
| + Fragment MaybeCheckVariableType(VariableDeclaration* variable); |
| + Fragment MaybeCheckBool(); |
| + Fragment MaybeCheckAssignable(const dart::AbstractType& dst_type, |
| + const dart::String& dst_name); |
| + |
| + Fragment AssertBool(); |
| + Fragment AssertAssignable(const dart::AbstractType& dst_type, |
| + const dart::String& dst_name); |
| + |
| dart::RawFunction* LookupMethodByMember(Member* target, |
| const dart::String& method_name); |