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

Unified Diff: lib/compiler/implementation/ssa/builder.dart

Issue 11052011: Fix some warnings. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/compiler/implementation/resolver.dart ('k') | lib/compiler/implementation/ssa/codegen.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/ssa/builder.dart
diff --git a/lib/compiler/implementation/ssa/builder.dart b/lib/compiler/implementation/ssa/builder.dart
index 03109eaf8858d4b900a8216a9c460d719831d0de..358daf16742c6c8baeadd5f25a178c95e32e7206 100644
--- a/lib/compiler/implementation/ssa/builder.dart
+++ b/lib/compiler/implementation/ssa/builder.dart
@@ -184,6 +184,9 @@ class SsaBuilderTask extends CompilerTask {
graph = builder.buildMethod(element);
} else if (kind === ElementKind.FIELD) {
graph = builder.buildLazyInitializer(element);
+ } else {
+ compiler.internalErrorOnElement(element,
+ 'unexpected element kind $kind');
}
assert(graph.isValid());
if (kind !== ElementKind.FIELD) {
@@ -196,8 +199,11 @@ class SsaBuilderTask extends CompilerTask {
// If there is an estimate of the parameter types assume these types
// when compiling.
+ // TODO(karlklose,ngeoffray): add a check to make sure that element is
+ // of type FunctionElement.
+ FunctionElement function = element;
OptionalParameterTypes defaultValueTypes = null;
- FunctionSignature signature = element.computeSignature(compiler);
+ FunctionSignature signature = function.computeSignature(compiler);
if (signature.optionalParameterCount > 0) {
defaultValueTypes =
new OptionalParameterTypes(signature.optionalParameterCount);
@@ -1345,7 +1351,8 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
// for us here?
LibraryElement library = body.getLibrary();
Selector selector = new Selector.call(name, library, arity);
- HInstruction invoke = new HInvokeDynamicMethod(selector, bodyCallInputs);
+ HInvokeDynamic invoke =
+ new HInvokeDynamicMethod(selector, bodyCallInputs);
invoke.element = body;
add(invoke);
}
@@ -2625,8 +2632,8 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
// TODO(johnniwinther): Try to eliminate the need to distinguish declaration
// and implementation signatures. Currently it is need because the
// signatures have different elements for parameters.
- FunctionSignature params
- = function.implementation.computeSignature(compiler);
+ FunctionElement implementation = function.implementation;
+ FunctionSignature params = implementation.computeSignature(compiler);
if (params.optionalParameterCount !== 0) {
compiler.cancel(
'JS_TO_CLOSURE does not handle closure with optional parameters',
« no previous file with comments | « lib/compiler/implementation/resolver.dart ('k') | lib/compiler/implementation/ssa/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698