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

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

Issue 10982089: Remove AbstractVisitor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 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 [ConstantHandler] keeps track of compile-time constants, 6 * The [ConstantHandler] keeps track of compile-time constants,
7 * initializations of global and static fields, and default values of 7 * initializations of global and static fields, and default values of
8 * optional parameters. 8 * optional parameters.
9 */ 9 */
10 class ConstantHandler extends CompilerTask { 10 class ConstantHandler extends CompilerTask {
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 Constant getInitialValueFor(VariableElement element) { 232 Constant getInitialValueFor(VariableElement element) {
233 Constant initialValue = initialVariableValues[element]; 233 Constant initialValue = initialVariableValues[element];
234 if (initialValue === null) { 234 if (initialValue === null) {
235 compiler.internalError("No initial value for given element", 235 compiler.internalError("No initial value for given element",
236 element: element); 236 element: element);
237 } 237 }
238 return initialValue; 238 return initialValue;
239 } 239 }
240 } 240 }
241 241
242 class CompileTimeConstantEvaluator extends AbstractVisitor { 242 class CompileTimeConstantEvaluator extends Visitor {
243 bool isEvaluatingConstant; 243 bool isEvaluatingConstant;
244 final ConstantSystem constantSystem; 244 final ConstantSystem constantSystem;
245 final TreeElements elements; 245 final TreeElements elements;
246 final Compiler compiler; 246 final Compiler compiler;
247 247
248 CompileTimeConstantEvaluator(this.constantSystem, 248 CompileTimeConstantEvaluator(this.constantSystem,
249 this.elements, 249 this.elements,
250 this.compiler, 250 this.compiler,
251 [bool isConst]) 251 [bool isConst])
252 : this.isEvaluatingConstant = isConst; 252 : this.isEvaluatingConstant = isConst;
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 Constant fieldValue = fieldValues[field]; 808 Constant fieldValue = fieldValues[field];
809 if (fieldValue === null) { 809 if (fieldValue === null) {
810 // Use the default value. 810 // Use the default value.
811 fieldValue = compiler.compileConstant(field); 811 fieldValue = compiler.compileConstant(field);
812 } 812 }
813 jsNewArguments.add(fieldValue); 813 jsNewArguments.add(fieldValue);
814 }); 814 });
815 return jsNewArguments; 815 return jsNewArguments;
816 } 816 }
817 } 817 }
OLDNEW
« no previous file with comments | « dart/lib/compiler/implementation/closure.dart ('k') | dart/lib/compiler/implementation/dart_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698