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

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

Issue 10888003: Change how runtime type information is being set in the backend. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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
« no previous file with comments | « lib/compiler/implementation/ssa/nodes.dart ('k') | tests/co19/co19-dart2js.status » ('j') | 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 #library('ssa'); 5 #library('ssa');
6 6
7 #import('../closure.dart'); 7 #import('../closure.dart');
8 #import('../js/js.dart', prefix: 'js'); 8 #import('../js/js.dart', prefix: 'js');
9 #import('../leg.dart'); 9 #import('../leg.dart');
10 #import('../source_file.dart'); 10 #import('../source_file.dart');
(...skipping 13 matching lines...) Expand all
24 #source('js_names.dart'); 24 #source('js_names.dart');
25 #source('nodes.dart'); 25 #source('nodes.dart');
26 #source('optimize.dart'); 26 #source('optimize.dart');
27 #source('types.dart'); 27 #source('types.dart');
28 #source('types_propagation.dart'); 28 #source('types_propagation.dart');
29 #source('validate.dart'); 29 #source('validate.dart');
30 #source('variable_allocator.dart'); 30 #source('variable_allocator.dart');
31 #source('value_set.dart'); 31 #source('value_set.dart');
32 32
33 class RuntimeTypeInformation { 33 class RuntimeTypeInformation {
34 String asJsString(InterfaceType type) {
35 ClassElement element = type.element;
36 StringBuffer buffer = new StringBuffer();
37 Link<Type> arguments = type.arguments;
38 Link<Type> typeVariables = element.typeVariables;
39 while (!typeVariables.isEmpty()) {
40 TypeVariableType typeVariable = typeVariables.head;
41 // TODO(johnniwinther): Retrieve the type name properly and not through
42 // [toString]. Note: Two cases below [typeVariable] and [arguments.head].
43 buffer.add("${typeVariable}: '${arguments.head}'");
44 typeVariables = typeVariables.tail;
45 if (!typeVariables.isEmpty()) {
46 buffer.add(', ');
47 }
48 }
49 return "{$buffer}";
50 }
51
52 bool hasTypeArguments(Type type) { 34 bool hasTypeArguments(Type type) {
53 if (type is InterfaceType) { 35 if (type is InterfaceType) {
54 InterfaceType interfaceType = type; 36 InterfaceType interfaceType = type;
55 return (!interfaceType.arguments.isEmpty() && 37 return !interfaceType.arguments.isEmpty();
56 interfaceType.arguments.tail.isEmpty());
57 } 38 }
58 return false; 39 return false;
59 } 40 }
60 } 41 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/ssa/nodes.dart ('k') | tests/co19/co19-dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698