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

Side by Side Diff: pkg/compiler/lib/src/ssa/builder_kernel.dart

Issue 2838453002: Redo "dart2js: use ResolutionInterfaceType in SSA builders" (Closed)
Patch Set: fix unused import hint Created 3 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
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | pkg/compiler/lib/src/ssa/codegen.dart » ('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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 import 'package:kernel/ast.dart' as ir; 5 import 'package:kernel/ast.dart' as ir;
6 6
7 import '../closure.dart'; 7 import '../closure.dart';
8 import '../common.dart'; 8 import '../common.dart';
9 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; 9 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem;
10 import '../common/names.dart'; 10 import '../common/names.dart';
11 import '../common/tasks.dart' show CompilerTask; 11 import '../common/tasks.dart' show CompilerTask;
12 import '../compiler.dart'; 12 import '../compiler.dart';
13 import '../constants/values.dart' 13 import '../constants/values.dart'
14 show 14 show
15 ConstantValue, 15 ConstantValue,
16 InterceptorConstantValue, 16 InterceptorConstantValue,
17 StringConstantValue, 17 StringConstantValue,
18 TypeConstantValue; 18 TypeConstantValue;
19 import '../elements/elements.dart'; 19 import '../elements/elements.dart';
20 import '../elements/entities.dart'; 20 import '../elements/entities.dart';
21 import '../elements/resolution_types.dart'; 21 import '../elements/resolution_types.dart';
22 import '../elements/types.dart';
23 import '../io/source_information.dart'; 22 import '../io/source_information.dart';
24 import '../js/js.dart' as js; 23 import '../js/js.dart' as js;
25 import '../js_backend/backend.dart' show JavaScriptBackend; 24 import '../js_backend/backend.dart' show JavaScriptBackend;
26 import '../kernel/kernel.dart'; 25 import '../kernel/kernel.dart';
27 import '../native/native.dart' as native; 26 import '../native/native.dart' as native;
28 import '../resolution/tree_elements.dart'; 27 import '../resolution/tree_elements.dart';
29 import '../tree/dartstring.dart'; 28 import '../tree/dartstring.dart';
30 import '../tree/nodes.dart' show Node; 29 import '../tree/nodes.dart' show Node;
31 import '../types/masks.dart'; 30 import '../types/masks.dart';
32 import '../universe/selector.dart'; 31 import '../universe/selector.dart';
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 constructorArguments.add(value); 269 constructorArguments.add(value);
271 }, includeSuperAndInjectedMembers: true); 270 }, includeSuperAndInjectedMembers: true);
272 271
273 // TODO(het): If the class needs runtime type information, add it as a 272 // TODO(het): If the class needs runtime type information, add it as a
274 // constructor argument. 273 // constructor argument.
275 HInstruction newObject = new HCreate( 274 HInstruction newObject = new HCreate(
276 astAdapter.getClass(constructor.enclosingClass), 275 astAdapter.getClass(constructor.enclosingClass),
277 constructorArguments, 276 constructorArguments,
278 new TypeMask.nonNullExact( 277 new TypeMask.nonNullExact(
279 astAdapter.getClass(constructor.enclosingClass), closedWorld), 278 astAdapter.getClass(constructor.enclosingClass), closedWorld),
280 instantiatedTypes: <DartType>[ 279 instantiatedTypes: <ResolutionInterfaceType>[
281 astAdapter.getClass(constructor.enclosingClass).thisType 280 astAdapter.getClass(constructor.enclosingClass).thisType
282 ], 281 ],
283 hasRtiInput: false); 282 hasRtiInput: false);
284 283
285 add(newObject); 284 add(newObject);
286 285
287 // Generate calls to the constructor bodies. 286 // Generate calls to the constructor bodies.
288 287
289 for (ir.Constructor body in constructorChain.reversed) { 288 for (ir.Constructor body in constructorChain.reversed) {
290 if (_isEmptyStatement(body.function.body)) continue; 289 if (_isEmptyStatement(body.function.body)) continue;
(...skipping 2219 matching lines...) Expand 10 before | Expand all | Expand 10 after
2510 push(new HStringConcat(inputs[0], inputs[1], commonMasks.stringType)); 2509 push(new HStringConcat(inputs[0], inputs[1], commonMasks.stringType));
2511 } 2510 }
2512 2511
2513 void _pushStaticInvocation( 2512 void _pushStaticInvocation(
2514 ir.Member target, List<HInstruction> arguments, TypeMask typeMask) { 2513 ir.Member target, List<HInstruction> arguments, TypeMask typeMask) {
2515 HInvokeStatic instruction = new HInvokeStatic( 2514 HInvokeStatic instruction = new HInvokeStatic(
2516 astAdapter.getMember(target), arguments, typeMask, 2515 astAdapter.getMember(target), arguments, typeMask,
2517 targetCanThrow: astAdapter.getCanThrow(target, closedWorld)); 2516 targetCanThrow: astAdapter.getCanThrow(target, closedWorld));
2518 if (currentImplicitInstantiations.isNotEmpty) { 2517 if (currentImplicitInstantiations.isNotEmpty) {
2519 instruction.instantiatedTypes = 2518 instruction.instantiatedTypes =
2520 new List<ResolutionDartType>.from(currentImplicitInstantiations); 2519 new List<ResolutionInterfaceType>.from(currentImplicitInstantiations);
2521 } 2520 }
2522 instruction.sideEffects = astAdapter.getSideEffects(target, closedWorld); 2521 instruction.sideEffects = astAdapter.getSideEffects(target, closedWorld);
2523 2522
2524 push(instruction); 2523 push(instruction);
2525 } 2524 }
2526 2525
2527 void _pushDynamicInvocation( 2526 void _pushDynamicInvocation(
2528 ir.Node node, TypeMask mask, List<HInstruction> arguments, 2527 ir.Node node, TypeMask mask, List<HInstruction> arguments,
2529 {Selector selector}) { 2528 {Selector selector}) {
2530 HInstruction receiver = arguments.first; 2529 HInstruction receiver = arguments.first;
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after
3219 enterBlock.setBlockFlow( 3218 enterBlock.setBlockFlow(
3220 new HTryBlockInformation( 3219 new HTryBlockInformation(
3221 kernelBuilder.wrapStatementGraph(bodyGraph), 3220 kernelBuilder.wrapStatementGraph(bodyGraph),
3222 exception, 3221 exception,
3223 kernelBuilder.wrapStatementGraph(catchGraph), 3222 kernelBuilder.wrapStatementGraph(catchGraph),
3224 kernelBuilder.wrapStatementGraph(finallyGraph)), 3223 kernelBuilder.wrapStatementGraph(finallyGraph)),
3225 exitBlock); 3224 exitBlock);
3226 kernelBuilder.inTryStatement = previouslyInTryStatement; 3225 kernelBuilder.inTryStatement = previouslyInTryStatement;
3227 } 3226 }
3228 } 3227 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | pkg/compiler/lib/src/ssa/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698