| 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..211a61b029c1c2bcb95dbd333bee407bf1cb6bba 100644
|
| --- a/runtime/vm/kernel_to_il.h
|
| +++ b/runtime/vm/kernel_to_il.h
|
| @@ -474,6 +474,18 @@ class ConstantEvaluator : public ExpressionVisitor {
|
| const Function& constructor,
|
| const Object& argument);
|
|
|
| + void AssertBoolInCheckedMode() {
|
| + if (isolate_->type_checks() && !result_.IsBool()) {
|
| + translation_helper_.ReportError("Expected boolean expression.");
|
| + }
|
| + }
|
| +
|
| + bool EvaluateBooleanExpression(Expression* expression) {
|
| + EvaluateExpression(expression);
|
| + AssertBoolInCheckedMode();
|
| + return result_.raw() == Bool::True().raw();
|
| + }
|
| +
|
| // 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 +640,6 @@ class ScopeBuilder : public RecursiveVisitor {
|
| void LookupCapturedVariableByName(LocalVariable** variable,
|
| const dart::String& name);
|
|
|
| -
|
| struct DepthState {
|
| explicit DepthState(intptr_t function)
|
| : loop_(0),
|
| @@ -868,6 +879,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 CheckReturnTypeInCheckedMode();
|
| + Fragment CheckVariableTypeInCheckedMode(VariableDeclaration* variable);
|
| + Fragment CheckBooleanInCheckedMode();
|
| + Fragment CheckAssignableInCheckedMode(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);
|
|
|
|
|