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

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

Issue 14071003: Fix first part on liveness analysis of bug https://code.google.com/p/dart/issues/detail?id=9687: a … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
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 part of ssa; 5 part of ssa;
6 6
7 class SsaCodeGeneratorTask extends CompilerTask { 7 class SsaCodeGeneratorTask extends CompilerTask {
8 8
9 final JavaScriptBackend backend; 9 final JavaScriptBackend backend;
10 10
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 allocator.visitGraph(graph); 330 allocator.visitGraph(graph);
331 variableNames = allocator.names; 331 variableNames = allocator.names;
332 shouldGroupVarDeclarations = allocator.names.numberOfVariables > 1; 332 shouldGroupVarDeclarations = allocator.names.numberOfVariables > 1;
333 333
334 // Don't register a return type for lazily initialized variables. 334 // Don't register a return type for lazily initialized variables.
335 if (work.element is! FunctionElement) return; 335 if (work.element is! FunctionElement) return;
336 336
337 // Register return types to the backend. 337 // Register return types to the backend.
338 graph.exit.predecessors.forEach((HBasicBlock block) { 338 graph.exit.predecessors.forEach((HBasicBlock block) {
339 HInstruction last = block.last; 339 HInstruction last = block.last;
340 assert(last is HGoto || last is HReturn); 340 assert(last is HGoto || last is HReturn || last is HThrow);
341 if (last is HReturn) { 341 if (last is HReturn) {
342 backend.registerReturnType( 342 backend.registerReturnType(
343 work.element, last.inputs[0].instructionType); 343 work.element, last.inputs[0].instructionType);
344 } else { 344 } else if (last is HGoto) {
345 backend.registerReturnType(work.element, HType.NULL); 345 backend.registerReturnType(work.element, HType.NULL);
346 } 346 }
347 }); 347 });
348 } 348 }
349 349
350 void handleDelayedVariableDeclarations() { 350 void handleDelayedVariableDeclarations() {
351 // If we have only one variable declaration and the first statement is an 351 // If we have only one variable declaration and the first statement is an
352 // assignment to that variable then we can merge the two. We count the 352 // assignment to that variable then we can merge the two. We count the
353 // number of variables in the variable allocator to try to avoid this issue, 353 // number of variables in the variable allocator to try to avoid this issue,
354 // but it sometimes happens that the variable allocator introduces a 354 // but it sometimes happens that the variable allocator introduces a
(...skipping 2606 matching lines...) Expand 10 before | Expand all | Expand 10 after
2961 if (leftType.canBeNull() && rightType.canBeNull()) { 2961 if (leftType.canBeNull() && rightType.canBeNull()) {
2962 if (left.isConstantNull() || right.isConstantNull() || 2962 if (left.isConstantNull() || right.isConstantNull() ||
2963 (leftType.isPrimitive() && leftType == rightType)) { 2963 (leftType.isPrimitive() && leftType == rightType)) {
2964 return '=='; 2964 return '==';
2965 } 2965 }
2966 return null; 2966 return null;
2967 } else { 2967 } else {
2968 return '==='; 2968 return '===';
2969 } 2969 }
2970 } 2970 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698