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

Unified Diff: runtime/vm/kernel_to_il.h

Issue 2659363003: VM: [Kernel] Partial support for checked mode. (Closed)
Patch Set: Revert changes to test Created 3 years, 11 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 | « no previous file | runtime/vm/kernel_to_il.cc » ('j') | runtime/vm/kernel_to_il.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | runtime/vm/kernel_to_il.cc » ('j') | runtime/vm/kernel_to_il.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698