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

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

Issue 1394213002: Split RuntimesTypes into RuntimeTypes and RuntimeTypesEncoder (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 5 years, 2 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') | no next file » | 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 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 final SourceInformationStrategy sourceInformationFactory; 10 final SourceInformationStrategy sourceInformationFactory;
(...skipping 2809 matching lines...) Expand 10 before | Expand all | Expand 10 after
2820 } 2820 }
2821 2821
2822 void visitReadTypeVariable(HReadTypeVariable node) { 2822 void visitReadTypeVariable(HReadTypeVariable node) {
2823 TypeVariableElement element = node.dartType.element; 2823 TypeVariableElement element = node.dartType.element;
2824 Element helperElement = backend.findHelper('convertRtiToRuntimeType'); 2824 Element helperElement = backend.findHelper('convertRtiToRuntimeType');
2825 registry.registerStaticUse(helperElement); 2825 registry.registerStaticUse(helperElement);
2826 2826
2827 use(node.inputs[0]); 2827 use(node.inputs[0]);
2828 if (node.hasReceiver) { 2828 if (node.hasReceiver) {
2829 if (backend.isInterceptorClass(element.enclosingClass)) { 2829 if (backend.isInterceptorClass(element.enclosingClass)) {
2830 int index = RuntimeTypes.getTypeVariableIndex(element); 2830 int index = element.index;
2831 js.Expression receiver = pop(); 2831 js.Expression receiver = pop();
2832 js.Expression helper = backend.emitter 2832 js.Expression helper = backend.emitter
2833 .staticFunctionAccess(helperElement); 2833 .staticFunctionAccess(helperElement);
2834 push(js.js(r'#(#.$builtinTypeInfo && #.$builtinTypeInfo[#])', 2834 push(js.js(r'#(#.$builtinTypeInfo && #.$builtinTypeInfo[#])',
2835 [helper, receiver, receiver, js.js.number(index)])); 2835 [helper, receiver, receiver, js.js.number(index)]));
2836 } else { 2836 } else {
2837 backend.emitter.registerReadTypeVariable(element); 2837 backend.emitter.registerReadTypeVariable(element);
2838 push(js.js('#.#()', 2838 push(js.js('#.#()',
2839 [pop(), backend.namer.nameForReadTypeVariable(element)])); 2839 [pop(), backend.namer.nameForReadTypeVariable(element)]));
2840 } 2840 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
2877 } 2877 }
2878 registry.registerStaticUse(helper); 2878 registry.registerStaticUse(helper);
2879 return backend.emitter.staticFunctionAccess(helper); 2879 return backend.emitter.staticFunctionAccess(helper);
2880 } 2880 }
2881 2881
2882 @override 2882 @override
2883 void visitRef(HRef node) { 2883 void visitRef(HRef node) {
2884 visit(node.value); 2884 visit(node.value);
2885 } 2885 }
2886 } 2886 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698