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

Side by Side Diff: runtime/vm/flow_graph_builder.cc

Issue 700843005: Improve type propagation for AssertAssignable. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/flow_graph_type_propagator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/flow_graph_builder.h" 5 #include "vm/flow_graph_builder.h"
6 6
7 #include "lib/invocation_mirror.h" 7 #include "lib/invocation_mirror.h"
8 #include "vm/ast_printer.h" 8 #include "vm/ast_printer.h"
9 #include "vm/bit_vector.h" 9 #include "vm/bit_vector.h"
10 #include "vm/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 3766 matching lines...) Expand 10 before | Expand all | Expand 10 after
3777 pos = 1; 3777 pos = 1;
3778 } 3778 }
3779 while (pos < num_params) { 3779 while (pos < num_params) {
3780 const LocalVariable& parameter = *scope->VariableAt(pos); 3780 const LocalVariable& parameter = *scope->VariableAt(pos);
3781 ASSERT(parameter.owner() == scope); 3781 ASSERT(parameter.owner() == scope);
3782 if (!CanSkipTypeCheck(parameter.token_pos(), 3782 if (!CanSkipTypeCheck(parameter.token_pos(),
3783 NULL, 3783 NULL,
3784 parameter.type(), 3784 parameter.type(),
3785 parameter.name())) { 3785 parameter.name())) {
3786 Value* parameter_value = Bind(BuildLoadLocal(parameter)); 3786 Value* parameter_value = Bind(BuildLoadLocal(parameter));
3787 AssertAssignableInstr* assert_assignable = 3787 Do(BuildAssertAssignable(parameter.token_pos(),
3788 BuildAssertAssignable(parameter.token_pos(), 3788 parameter_value,
3789 parameter_value, 3789 parameter.type(),
3790 parameter.type(), 3790 parameter.name()));
3791 parameter.name());
3792 parameter_value = Bind(assert_assignable);
3793 // Store the type checked argument back to its corresponding local
3794 // variable so that ssa renaming detects the dependency and makes use
3795 // of the checked type in type propagation.
3796 Do(BuildStoreLocal(parameter, parameter_value));
3797 } 3791 }
3798 pos++; 3792 pos++;
3799 } 3793 }
3800 } 3794 }
3801 3795
3802 // Continuation part: 3796 // Continuation part:
3803 // If this node sequence is the body of an async closure leave room for a 3797 // If this node sequence is the body of an async closure leave room for a
3804 // preamble. The preamble is generated after visiting the body. 3798 // preamble. The preamble is generated after visiting the body.
3805 GotoInstr* preamble_start = NULL; 3799 GotoInstr* preamble_start = NULL;
3806 if (is_top_level_sequence && 3800 if (is_top_level_sequence &&
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
4255 Report::MessageF(Report::kBailout, 4249 Report::MessageF(Report::kBailout,
4256 Script::Handle(function.script()), 4250 Script::Handle(function.script()),
4257 function.token_pos(), 4251 function.token_pos(),
4258 "FlowGraphBuilder Bailout: %s %s", 4252 "FlowGraphBuilder Bailout: %s %s",
4259 String::Handle(function.name()).ToCString(), 4253 String::Handle(function.name()).ToCString(),
4260 reason); 4254 reason);
4261 UNREACHABLE(); 4255 UNREACHABLE();
4262 } 4256 }
4263 4257
4264 } // namespace dart 4258 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_type_propagator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698