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

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

Issue 2675103003: Refactor BackendHelpers to be reusageable with KernelWorldBuilder (Closed)
Patch Set: Updated cf. comments Created 3 years, 10 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/kernel_ast_adapter.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) 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 import 'dart:math' as math; 5 import 'dart:math' as math;
6 import '../common.dart'; 6 import '../common.dart';
7 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; 7 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem;
8 import '../common/tasks.dart' show CompilerTask; 8 import '../common/tasks.dart' show CompilerTask;
9 import '../compiler.dart' show Compiler; 9 import '../compiler.dart' show Compiler;
10 import '../constants/constant_system.dart'; 10 import '../constants/constant_system.dart';
(...skipping 1619 matching lines...) Expand 10 before | Expand all | Expand 10 after
1630 js.Expression receiverExpression = pop(); 1630 js.Expression receiverExpression = pop();
1631 use(node.conditionalConstantInterceptor); 1631 use(node.conditionalConstantInterceptor);
1632 js.Expression constant = pop(); 1632 js.Expression constant = pop();
1633 push(js.js('# && #', [receiverExpression, constant])); 1633 push(js.js('# && #', [receiverExpression, constant]));
1634 } else { 1634 } else {
1635 assert(node.inputs.length == 1); 1635 assert(node.inputs.length == 1);
1636 registry.registerSpecializedGetInterceptor(node.interceptedClasses); 1636 registry.registerSpecializedGetInterceptor(node.interceptedClasses);
1637 js.Name name = 1637 js.Name name =
1638 backend.namer.nameForGetInterceptor(node.interceptedClasses); 1638 backend.namer.nameForGetInterceptor(node.interceptedClasses);
1639 var isolate = new js.VariableUse( 1639 var isolate = new js.VariableUse(
1640 backend.namer.globalObjectFor(helpers.interceptorsLibrary)); 1640 backend.namer.globalObjectForLibrary(helpers.interceptorsLibrary));
1641 use(node.receiver); 1641 use(node.receiver);
1642 List<js.Expression> arguments = <js.Expression>[pop()]; 1642 List<js.Expression> arguments = <js.Expression>[pop()];
1643 push(js 1643 push(js
1644 .propertyCall(isolate, name, arguments) 1644 .propertyCall(isolate, name, arguments)
1645 .withSourceInformation(node.sourceInformation)); 1645 .withSourceInformation(node.sourceInformation));
1646 registry.registerUseInterceptor(); 1646 registry.registerUseInterceptor();
1647 } 1647 }
1648 } 1648 }
1649 1649
1650 visitInvokeDynamicMethod(HInvokeDynamicMethod node) { 1650 visitInvokeDynamicMethod(HInvokeDynamicMethod node) {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
1695 push(js 1695 push(js
1696 .propertyCall(object, methodName, arguments) 1696 .propertyCall(object, methodName, arguments)
1697 .withSourceInformation(node.sourceInformation)); 1697 .withSourceInformation(node.sourceInformation));
1698 registry.registerStaticUse(new StaticUse.constructorBodyInvoke( 1698 registry.registerStaticUse(new StaticUse.constructorBodyInvoke(
1699 node.element, new CallStructure.unnamed(arguments.length))); 1699 node.element, new CallStructure.unnamed(arguments.length)));
1700 } 1700 }
1701 1701
1702 void visitOneShotInterceptor(HOneShotInterceptor node) { 1702 void visitOneShotInterceptor(HOneShotInterceptor node) {
1703 List<js.Expression> arguments = visitArguments(node.inputs); 1703 List<js.Expression> arguments = visitArguments(node.inputs);
1704 var isolate = new js.VariableUse( 1704 var isolate = new js.VariableUse(
1705 backend.namer.globalObjectFor(helpers.interceptorsLibrary)); 1705 backend.namer.globalObjectForLibrary(helpers.interceptorsLibrary));
1706 Selector selector = node.selector; 1706 Selector selector = node.selector;
1707 js.Name methodName = backend.registerOneShotInterceptor(selector); 1707 js.Name methodName = backend.registerOneShotInterceptor(selector);
1708 push(js 1708 push(js
1709 .propertyCall(isolate, methodName, arguments) 1709 .propertyCall(isolate, methodName, arguments)
1710 .withSourceInformation(node.sourceInformation)); 1710 .withSourceInformation(node.sourceInformation));
1711 if (selector.isGetter) { 1711 if (selector.isGetter) {
1712 registerGetter(node); 1712 registerGetter(node);
1713 } else if (selector.isSetter) { 1713 } else if (selector.isSetter) {
1714 registerSetter(node); 1714 registerSetter(node);
1715 } else { 1715 } else {
(...skipping 1399 matching lines...) Expand 10 before | Expand all | Expand 10 after
3115 registry.registerStaticUse(new StaticUse.staticInvoke( 3115 registry.registerStaticUse(new StaticUse.staticInvoke(
3116 helper, new CallStructure.unnamed(argumentCount))); 3116 helper, new CallStructure.unnamed(argumentCount)));
3117 return backend.emitter.staticFunctionAccess(helper); 3117 return backend.emitter.staticFunctionAccess(helper);
3118 } 3118 }
3119 3119
3120 @override 3120 @override
3121 void visitRef(HRef node) { 3121 void visitRef(HRef node) {
3122 visit(node.value); 3122 visit(node.value);
3123 } 3123 }
3124 } 3124 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698