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

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

Issue 891673003: dart2js: Refactoring, documentation, and a few bugfixes in Namer class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Typo and TODO about clash in named parameters Created 5 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 | Annotate | Revision Log
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 SsaFunctionCompiler implements FunctionCompiler { 7 class SsaFunctionCompiler implements FunctionCompiler {
8 SsaCodeGeneratorTask generator; 8 SsaCodeGeneratorTask generator;
9 SsaBuilderTask builder; 9 SsaBuilderTask builder;
10 SsaOptimizerTask optimizer; 10 SsaOptimizerTask optimizer;
(...skipping 4070 matching lines...) Expand 10 before | Expand all | Expand 10 after
4081 4081
4082 HInstruction target = localsHandler.readThis(); 4082 HInstruction target = localsHandler.readThis();
4083 HConstant index = graph.addConstantInt( 4083 HConstant index = graph.addConstantInt(
4084 RuntimeTypes.getTypeVariableIndex(variable), 4084 RuntimeTypes.getTypeVariableIndex(variable),
4085 compiler); 4085 compiler);
4086 4086
4087 if (needsSubstitutionForTypeVariableAccess(cls)) { 4087 if (needsSubstitutionForTypeVariableAccess(cls)) {
4088 // TODO(ahe): Creating a string here is unfortunate. It is slow (due to 4088 // TODO(ahe): Creating a string here is unfortunate. It is slow (due to
4089 // string concatenation in the implementation), and may prevent 4089 // string concatenation in the implementation), and may prevent
4090 // segmentation of '$'. 4090 // segmentation of '$'.
4091 String substitutionNameString = backend.namer.getNameForRti(cls); 4091 String substitutionNameString = backend.namer.getRuntimeTypeName(cls);
4092 HInstruction substitutionName = graph.addConstantString( 4092 HInstruction substitutionName = graph.addConstantString(
4093 new ast.LiteralDartString(substitutionNameString), compiler); 4093 new ast.LiteralDartString(substitutionNameString), compiler);
4094 pushInvokeStatic(null, 4094 pushInvokeStatic(null,
4095 backend.getGetRuntimeTypeArgument(), 4095 backend.getGetRuntimeTypeArgument(),
4096 [target, substitutionName, index], 4096 [target, substitutionName, index],
4097 backend.dynamicType); 4097 backend.dynamicType);
4098 } else { 4098 } else {
4099 pushInvokeStatic(null, backend.getGetTypeArgumentByIndex(), 4099 pushInvokeStatic(null, backend.getGetTypeArgumentByIndex(),
4100 [target, index], 4100 [target, index],
4101 backend.dynamicType); 4101 backend.dynamicType);
(...skipping 2569 matching lines...) Expand 10 before | Expand all | Expand 10 after
6671 if (unaliased is TypedefType) throw 'unable to unalias $type'; 6671 if (unaliased is TypedefType) throw 'unable to unalias $type';
6672 unaliased.accept(this, builder); 6672 unaliased.accept(this, builder);
6673 } 6673 }
6674 6674
6675 void visitDynamicType(DynamicType type, SsaBuilder builder) { 6675 void visitDynamicType(DynamicType type, SsaBuilder builder) {
6676 JavaScriptBackend backend = builder.compiler.backend; 6676 JavaScriptBackend backend = builder.compiler.backend;
6677 ClassElement cls = backend.findHelper('DynamicRuntimeType'); 6677 ClassElement cls = backend.findHelper('DynamicRuntimeType');
6678 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); 6678 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld)));
6679 } 6679 }
6680 } 6680 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698