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

Side by Side Diff: lib/compiler/implementation/ssa/codegen.dart

Issue 10363003: Compute function types together with the parameters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Move computation of function type. Created 8 years, 7 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 class SsaCodeGeneratorTask extends CompilerTask { 5 class SsaCodeGeneratorTask extends CompilerTask {
6 SsaCodeGeneratorTask(Compiler compiler) : super(compiler); 6 SsaCodeGeneratorTask(Compiler compiler) : super(compiler);
7 String get name() => 'SSA code generator'; 7 String get name() => 'SSA code generator';
8 8
9 9
10 String buildJavaScriptFunction(FunctionElement element, 10 String buildJavaScriptFunction(FunctionElement element,
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 }); 88 });
89 } 89 }
90 90
91 Map<Element, String> getParameterNames(WorkItem work) { 91 Map<Element, String> getParameterNames(WorkItem work) {
92 Map<Element, String> parameterNames = new LinkedHashMap<Element, String>(); 92 Map<Element, String> parameterNames = new LinkedHashMap<Element, String>();
93 FunctionElement function = work.element; 93 FunctionElement function = work.element;
94 94
95 // The dom/html libraries have inline JS code that reference 95 // The dom/html libraries have inline JS code that reference
96 // parameter names directly. Long-term such code will be rejected. 96 // parameter names directly. Long-term such code will be rejected.
97 // Now, just don't mangle the parameter name. 97 // Now, just don't mangle the parameter name.
98 function.computeParameters(compiler).forEachParameter((Element element) { 98 function.computeSignature(compiler).forEachParameter((Element element) {
99 parameterNames[element] = function.isNative() 99 parameterNames[element] = function.isNative()
100 ? element.name.slowToString() 100 ? element.name.slowToString()
101 : JsNames.getValid('${element.name.slowToString()}'); 101 : JsNames.getValid('${element.name.slowToString()}');
102 }); 102 });
103 return parameterNames; 103 return parameterNames;
104 } 104 }
105 } 105 }
106 106
107 typedef void ElementAction(Element element); 107 typedef void ElementAction(Element element);
108 108
(...skipping 2185 matching lines...) Expand 10 before | Expand all | Expand 10 after
2294 startBailoutSwitch(); 2294 startBailoutSwitch();
2295 } 2295 }
2296 } 2296 }
2297 2297
2298 void endLabeledBlock(HLabeledBlockInformation labeledBlockInfo) { 2298 void endLabeledBlock(HLabeledBlockInformation labeledBlockInfo) {
2299 if (labeledBlockInfo.body.start.hasGuards()) { 2299 if (labeledBlockInfo.body.start.hasGuards()) {
2300 endBailoutSwitch(); 2300 endBailoutSwitch();
2301 } 2301 }
2302 } 2302 }
2303 } 2303 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/ssa/builder.dart ('k') | lib/compiler/implementation/ssa/optimize.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698