Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 dart2js; | 5 part of dart2js; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * If true, print a warning for each method that was resolved, but not | 8 * If true, print a warning for each method that was resolved, but not |
| 9 * compiled. | 9 * compiled. |
| 10 */ | 10 */ |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 44 bool allowSpeculativeOptimization = true; | 44 bool allowSpeculativeOptimization = true; |
| 45 List<HTypeGuard> guards = const <HTypeGuard>[]; | 45 List<HTypeGuard> guards = const <HTypeGuard>[]; |
| 46 | 46 |
| 47 WorkItem(this.element, this.resolutionTree, this.compilationContext) { | 47 WorkItem(this.element, this.resolutionTree, this.compilationContext) { |
| 48 assert(invariant(element, element.isDeclaration)); | 48 assert(invariant(element, element.isDeclaration)); |
| 49 } | 49 } |
| 50 | 50 |
| 51 bool isAnalyzed() => resolutionTree != null; | 51 bool isAnalyzed() => resolutionTree != null; |
| 52 | 52 |
| 53 void run(Compiler compiler, Enqueuer world) { | 53 void run(Compiler compiler, Enqueuer world) { |
| 54 CodeBuffer codeBuffer = world.universe.generatedCode[element]; | 54 js.Expression code = world.universe.generatedCode[element]; |
|
ngeoffray
2013/01/10 10:40:07
Did you measure the memory impact of this change?
sra1
2013/01/10 16:32:42
Is there a convenient way to do this?
| |
| 55 if (codeBuffer != null) return; | 55 if (code != null) return; |
| 56 resolutionTree = compiler.analyze(this, world); | 56 resolutionTree = compiler.analyze(this, world); |
| 57 compiler.codegen(this, world); | 57 compiler.codegen(this, world); |
| 58 } | 58 } |
| 59 } | 59 } |
| 60 | 60 |
| 61 class ReadingFilesTask extends CompilerTask { | 61 class ReadingFilesTask extends CompilerTask { |
| 62 ReadingFilesTask(Compiler compiler) : super(compiler); | 62 ReadingFilesTask(Compiler compiler) : super(compiler); |
| 63 String get name => 'Reading input files'; | 63 String get name => 'Reading input files'; |
| 64 } | 64 } |
| 65 | 65 |
| (...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 987 // TODO(johnniwinther): Use [spannable] and [message] to provide better | 987 // TODO(johnniwinther): Use [spannable] and [message] to provide better |
| 988 // information on assertion errors. | 988 // information on assertion errors. |
| 989 if (condition is Function){ | 989 if (condition is Function){ |
| 990 condition = condition(); | 990 condition = condition(); |
| 991 } | 991 } |
| 992 if (spannable == null || !condition) { | 992 if (spannable == null || !condition) { |
| 993 throw new SpannableAssertionFailure(spannable, message); | 993 throw new SpannableAssertionFailure(spannable, message); |
| 994 } | 994 } |
| 995 return true; | 995 return true; |
| 996 } | 996 } |
| OLD | NEW |