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

Side by Side Diff: pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart

Issue 1474713002: dart2js cps: Clean up and avoid processing unreachable code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Merge Created 5 years 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library tree_ir_builder; 5 library tree_ir_builder;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../constants/values.dart'; 8 import '../constants/values.dart';
9 import '../cps_ir/cps_ir_nodes.dart' as cps_ir; 9 import '../cps_ir/cps_ir_nodes.dart' as cps_ir;
10 import '../elements/elements.dart'; 10 import '../elements/elements.dart';
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 getVariableUse(node.entries[index].key), 493 getVariableUse(node.entries[index].key),
494 getVariableUse(node.entries[index].value)); 494 getVariableUse(node.entries[index].value));
495 }) 495 })
496 ); 496 );
497 } 497 }
498 498
499 FunctionDefinition makeSubFunction(cps_ir.FunctionDefinition function) { 499 FunctionDefinition makeSubFunction(cps_ir.FunctionDefinition function) {
500 return createInnerBuilder().buildFunction(function); 500 return createInnerBuilder().buildFunction(function);
501 } 501 }
502 502
503 Expression visitCreateFunction(cps_ir.CreateFunction node) {
504 FunctionDefinition def = makeSubFunction(node.definition);
505 return new FunctionExpression(def);
506 }
507
508 Expression visitReifyRuntimeType(cps_ir.ReifyRuntimeType node) { 503 Expression visitReifyRuntimeType(cps_ir.ReifyRuntimeType node) {
509 return new ReifyRuntimeType( 504 return new ReifyRuntimeType(
510 getVariableUse(node.value), node.sourceInformation); 505 getVariableUse(node.value), node.sourceInformation);
511 } 506 }
512 507
513 Expression visitReadTypeVariable(cps_ir.ReadTypeVariable node) { 508 Expression visitReadTypeVariable(cps_ir.ReadTypeVariable node) {
514 return new ReadTypeVariable( 509 return new ReadTypeVariable(
515 node.variable, 510 node.variable,
516 getVariableUse(node.target), 511 getVariableUse(node.target),
517 node.sourceInformation); 512 node.sourceInformation);
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 --enclosingFunctions; 697 --enclosingFunctions;
703 } 698 }
704 699
705 @override 700 @override
706 visitInterpolatedNode(js.InterpolatedNode node) { 701 visitInterpolatedNode(js.InterpolatedNode node) {
707 if (enclosingFunctions > 0) { 702 if (enclosingFunctions > 0) {
708 found = true; 703 found = true;
709 } 704 }
710 } 705 }
711 } 706 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/tree_ir/optimization/variable_merger.dart ('k') | pkg/compiler/lib/src/tree_ir/tree_ir_integrity.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698