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

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

Issue 1913033002: dart2js: Pass type information to constructor rather than add later. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: rebase Created 4 years, 4 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
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 '../common.dart'; 5 import '../common.dart';
6 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; 6 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem;
7 import '../common/tasks.dart' show CompilerTask; 7 import '../common/tasks.dart' show CompilerTask;
8 import '../compiler.dart' show Compiler; 8 import '../compiler.dart' show Compiler;
9 import '../constants/constant_system.dart'; 9 import '../constants/constant_system.dart';
10 import '../constants/values.dart'; 10 import '../constants/values.dart';
(...skipping 2850 matching lines...) Expand 10 before | Expand all | Expand 10 after
2861 registry.registerStaticUse( 2861 registry.registerStaticUse(
2862 new StaticUse.staticInvoke(helperElement, CallStructure.ONE_ARG)); 2862 new StaticUse.staticInvoke(helperElement, CallStructure.ONE_ARG));
2863 2863
2864 use(node.inputs[0]); 2864 use(node.inputs[0]);
2865 if (node.hasReceiver) { 2865 if (node.hasReceiver) {
2866 if (backend.isInterceptorClass(element.enclosingClass)) { 2866 if (backend.isInterceptorClass(element.enclosingClass)) {
2867 int index = element.index; 2867 int index = element.index;
2868 js.Expression receiver = pop(); 2868 js.Expression receiver = pop();
2869 js.Expression helper = 2869 js.Expression helper =
2870 backend.emitter.staticFunctionAccess(helperElement); 2870 backend.emitter.staticFunctionAccess(helperElement);
2871 push(js.js(r'#(#.$builtinTypeInfo && #.$builtinTypeInfo[#])', 2871 push(js.js(r'#(#.$ti && #.$ti[#])',
2872 [helper, receiver, receiver, js.js.number(index)])); 2872 [helper, receiver, receiver, js.js.number(index)]));
2873 } else { 2873 } else {
2874 backend.emitter.registerReadTypeVariable(element); 2874 backend.emitter.registerReadTypeVariable(element);
2875 push(js.js( 2875 push(js.js(
2876 '#.#()', [pop(), backend.namer.nameForReadTypeVariable(element)])); 2876 '#.#()', [pop(), backend.namer.nameForReadTypeVariable(element)]));
2877 } 2877 }
2878 } else { 2878 } else {
2879 push(js.js('#(#)', 2879 push(js.js('#(#)',
2880 [backend.emitter.staticFunctionAccess(helperElement), pop()])); 2880 [backend.emitter.staticFunctionAccess(helperElement), pop()]));
2881 } 2881 }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
2914 registry.registerStaticUse(new StaticUse.staticInvoke( 2914 registry.registerStaticUse(new StaticUse.staticInvoke(
2915 helper, new CallStructure.unnamed(argumentCount))); 2915 helper, new CallStructure.unnamed(argumentCount)));
2916 return backend.emitter.staticFunctionAccess(helper); 2916 return backend.emitter.staticFunctionAccess(helper);
2917 } 2917 }
2918 2918
2919 @override 2919 @override
2920 void visitRef(HRef node) { 2920 void visitRef(HRef node) {
2921 visit(node.value); 2921 visit(node.value);
2922 } 2922 }
2923 } 2923 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698