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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 246293008: Do not ignore side effects of a type test or type cast as expression, such (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 8 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
Index: runtime/vm/flow_graph_builder.cc
===================================================================
--- runtime/vm/flow_graph_builder.cc (revision 35268)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -1381,14 +1381,6 @@
void EffectGraphVisitor::BuildTypeTest(ComparisonNode* node) {
ASSERT(Token::IsTypeTestOperator(node->kind()));
- EffectGraphVisitor for_left_value(owner());
- node->left()->Visit(&for_left_value);
- Append(for_left_value);
-}
-
-
-void ValueGraphVisitor::BuildTypeTest(ComparisonNode* node) {
- ASSERT(Token::IsTypeTestOperator(node->kind()));
const AbstractType& type = node->right()->AsTypeNode()->type();
ASSERT(type.IsFinalized() && !type.IsMalformedOrMalbounded());
const bool negate_result = (node->kind() == Token::kISNOT);
@@ -1465,27 +1457,6 @@
void EffectGraphVisitor::BuildTypeCast(ComparisonNode* node) {
ASSERT(Token::IsTypeCastOperator(node->kind()));
- const AbstractType& type = node->right()->AsTypeNode()->type();
- ASSERT(type.IsFinalized() && !type.IsMalformedOrMalbounded());
- ValueGraphVisitor for_value(owner());
- node->left()->Visit(&for_value);
- Append(for_value);
- const String& dst_name = String::ZoneHandle(
- Symbols::New(Exceptions::kCastErrorDstName));
- if (CanSkipTypeCheck(node->token_pos(), for_value.value(), type, dst_name)) {
- // Drop the value and 0 additional temporaries.
- Do(new DropTempsInstr(0, for_value.value()));
- } else {
- Do(BuildAssertAssignable(node->token_pos(),
- for_value.value(),
- type,
- dst_name));
- }
-}
-
-
-void ValueGraphVisitor::BuildTypeCast(ComparisonNode* node) {
- ASSERT(Token::IsTypeCastOperator(node->kind()));
ASSERT(!node->right()->AsTypeNode()->type().IsNull());
const AbstractType& type = node->right()->AsTypeNode()->type();
ASSERT(type.IsFinalized() && !type.IsMalformed() && !type.IsMalbounded());

Powered by Google App Engine
This is Rietveld 408576698