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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/codegen.dart

Issue 11414057: Fix bug in dart2js where the return type in a bailout version was not registered. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/language/bailout3_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/codegen.dart (revision 15066)
+++ sdk/lib/_internal/compiler/implementation/ssa/codegen.dart (working copy)
@@ -65,16 +65,6 @@
CodeBuffer generateMethod(WorkItem work, HGraph graph) {
return measure(() {
- JavaScriptItemCompilationContext context = work.compilationContext;
- HTypeMap types = context.types;
- graph.exit.predecessors.forEach((block) {
- assert(block.last is HGoto || block.last is HReturn);
- if (block.last is HReturn) {
- backend.registerReturnType(work.element, types[block.last.inputs[0]]);
- } else {
- backend.registerReturnType(work.element, HType.NULL);
- }
- });
compiler.tracer.traceGraph("codegen", graph);
SsaOptimizedCodeGenerator codegen =
new SsaOptimizedCodeGenerator(backend, work);
@@ -382,6 +372,17 @@
allocator.visitGraph(graph);
variableNames = allocator.names;
shouldGroupVarDeclarations = allocator.names.numberOfVariables > 1;
+
+ // Register return types to the backend.
+ graph.exit.predecessors.forEach((HBasicBlock block) {
+ HInstruction last = block.last;
+ assert(last is HGoto || last is HReturn);
+ if (last is HReturn) {
+ backend.registerReturnType(work.element, types[last.inputs[0]]);
+ } else {
+ backend.registerReturnType(work.element, HType.NULL);
+ }
+ });
}
void handleDelayedVariableDeclarations() {
« no previous file with comments | « no previous file | tests/language/bailout3_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698