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

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

Issue 11267018: Make getKeys, getValues getters (keys, values). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status files with co19 issue number. Created 8 years, 1 month 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 /** 5 /**
6 * The [LiveRange] class covers a range where an instruction is live. 6 * The [LiveRange] class covers a range where an instruction is live.
7 */ 7 */
8 class LiveRange { 8 class LiveRange {
9 final int start; 9 final int start;
10 // [end] is not final because it can be updated due to loops. 10 // [end] is not final because it can be updated due to loops.
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 382
383 VariableNames(Map<Element, String> parameterNames) 383 VariableNames(Map<Element, String> parameterNames)
384 : ownName = new Map<HInstruction, String>(), 384 : ownName = new Map<HInstruction, String>(),
385 copyHandlers = new Map<HBasicBlock, CopyHandler>(), 385 copyHandlers = new Map<HBasicBlock, CopyHandler>(),
386 swapTemp = computeFreshWithPrefix("t", parameterNames), 386 swapTemp = computeFreshWithPrefix("t", parameterNames),
387 stateName = computeFreshWithPrefix("state", parameterNames); 387 stateName = computeFreshWithPrefix("state", parameterNames);
388 388
389 /** Returns a fresh variable with the given prefix. */ 389 /** Returns a fresh variable with the given prefix. */
390 static String computeFreshWithPrefix(String prefix, 390 static String computeFreshWithPrefix(String prefix,
391 Map<Element, String> parameterNames) { 391 Map<Element, String> parameterNames) {
392 Set<String> parameters = new Set<String>.from(parameterNames.getValues()); 392 Set<String> parameters = new Set<String>.from(parameterNames.values);
393 String name = '${prefix}0'; 393 String name = '${prefix}0';
394 int i = 1; 394 int i = 1;
395 while (parameters.contains(name)) name = '$prefix${i++}'; 395 while (parameters.contains(name)) name = '$prefix${i++}';
396 return name; 396 return name;
397 } 397 }
398 398
399 String getName(HInstruction instruction) { 399 String getName(HInstruction instruction) {
400 return ownName[instruction]; 400 return ownName[instruction];
401 } 401 }
402 402
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 if (!needsName(input)) { 650 if (!needsName(input)) {
651 names.addAssignment(predecessor, input, phi); 651 names.addAssignment(predecessor, input, phi);
652 } else { 652 } else {
653 names.addCopy(predecessor, input, phi); 653 names.addCopy(predecessor, input, phi);
654 } 654 }
655 } 655 }
656 656
657 namer.allocateName(phi); 657 namer.allocateName(phi);
658 } 658 }
659 } 659 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/ssa/codegen.dart ('k') | lib/compiler/implementation/types/concrete_types_inferrer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698