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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/ssa/builder.dart

Issue 409473002: A bit of element model cleanup. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 years, 5 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 /// A synthetic local variable only used with the SSA graph. 7 /// A synthetic local variable only used with the SSA graph.
8 /// 8 ///
9 /// For instance used for holding return value of function or the exception of a 9 /// For instance used for holding return value of function or the exception of a
10 /// try-catch statement. 10 /// try-catch statement.
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 } else { 49 } else {
50 graph = builder.buildLazyInitializer(element); 50 graph = builder.buildLazyInitializer(element);
51 } 51 }
52 } else { 52 } else {
53 compiler.internalError(element, 'Unexpected element kind $kind.'); 53 compiler.internalError(element, 'Unexpected element kind $kind.');
54 } 54 }
55 assert(graph.isValid()); 55 assert(graph.isValid());
56 if (!identical(kind, ElementKind.FIELD)) { 56 if (!identical(kind, ElementKind.FIELD)) {
57 FunctionElement function = element; 57 FunctionElement function = element;
58 FunctionSignature signature = function.functionSignature; 58 FunctionSignature signature = function.functionSignature;
59 signature.forEachOptionalParameter((Element parameter) { 59 signature.forEachOptionalParameter((ParameterElement parameter) {
60 // This ensures the default value will be computed. 60 // This ensures the default value will be computed.
61 Constant constant = 61 Constant constant =
62 backend.constants.getConstantForVariable(parameter); 62 backend.constants.getConstantForVariable(parameter);
63 CodegenRegistry registry = work.registry; 63 CodegenRegistry registry = work.registry;
64 registry.registerCompileTimeConstant(constant); 64 registry.registerCompileTimeConstant(constant);
65 }); 65 });
66 } 66 }
67 if (compiler.tracer.isEnabled) { 67 if (compiler.tracer.isEnabled) {
68 String name; 68 String name;
69 if (element.isClassMember) { 69 if (element.isClassMember) {
(...skipping 6334 matching lines...) Expand 10 before | Expand all | Expand 10 after
6404 if (unaliased is TypedefType) throw 'unable to unalias $type'; 6404 if (unaliased is TypedefType) throw 'unable to unalias $type';
6405 unaliased.accept(this, builder); 6405 unaliased.accept(this, builder);
6406 } 6406 }
6407 6407
6408 void visitDynamicType(DynamicType type, SsaBuilder builder) { 6408 void visitDynamicType(DynamicType type, SsaBuilder builder) {
6409 JavaScriptBackend backend = builder.compiler.backend; 6409 JavaScriptBackend backend = builder.compiler.backend;
6410 ClassElement cls = backend.findHelper('DynamicRuntimeType'); 6410 ClassElement cls = backend.findHelper('DynamicRuntimeType');
6411 builder.push(new HDynamicType(type, new TypeMask.exact(cls))); 6411 builder.push(new HDynamicType(type, new TypeMask.exact(cls)));
6412 } 6412 }
6413 } 6413 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698