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

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

Issue 11275316: Add a new interceptor class JsArray, and support intercepting some list methods with the new interc… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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 | « no previous file | sdk/lib/_internal/compiler/implementation/enqueue.dart » ('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 part of dart2js; 5 part of dart2js;
6 6
7 /** 7 /**
8 * The [ConstantHandler] keeps track of compile-time constants, 8 * The [ConstantHandler] keeps track of compile-time constants,
9 * initializations of global and static fields, and default values of 9 * initializations of global and static fields, and default values of
10 * optional parameters. 10 * optional parameters.
(...skipping 20 matching lines...) Expand all
31 31
32 ConstantHandler(Compiler compiler, this.constantSystem) 32 ConstantHandler(Compiler compiler, this.constantSystem)
33 : initialVariableValues = new Map<VariableElement, dynamic>(), 33 : initialVariableValues = new Map<VariableElement, dynamic>(),
34 compiledConstants = new Set<Constant>(), 34 compiledConstants = new Set<Constant>(),
35 pendingVariables = new Set<VariableElement>(), 35 pendingVariables = new Set<VariableElement>(),
36 lazyStatics = new Set<VariableElement>(), 36 lazyStatics = new Set<VariableElement>(),
37 super(compiler); 37 super(compiler);
38 String get name => 'ConstantHandler'; 38 String get name => 'ConstantHandler';
39 39
40 void registerCompileTimeConstant(Constant constant) { 40 void registerCompileTimeConstant(Constant constant) {
41 compiler.enqueuer.codegen.registerInstantiatedClass(
42 constant.computeType(compiler).element);
41 compiledConstants.add(constant); 43 compiledConstants.add(constant);
42 } 44 }
43 45
44 /** 46 /**
45 * Compiles the initial value of the given field and stores it in an internal 47 * Compiles the initial value of the given field and stores it in an internal
46 * map. Returns the initial value (a constant) if it can be computed 48 * map. Returns the initial value (a constant) if it can be computed
47 * statically. Returns [:null:] if the variable must be initialized lazily. 49 * statically. Returns [:null:] if the variable must be initialized lazily.
48 * 50 *
49 * [WorkItem] must contain a [VariableElement] refering to a global or 51 * [WorkItem] must contain a [VariableElement] refering to a global or
50 * static field. 52 * static field.
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after
821 // Use the default value. 823 // Use the default value.
822 fieldValue = compiler.compileConstant(field); 824 fieldValue = compiler.compileConstant(field);
823 } 825 }
824 jsNewArguments.add(fieldValue); 826 jsNewArguments.add(fieldValue);
825 }, 827 },
826 includeBackendMembers: true, 828 includeBackendMembers: true,
827 includeSuperMembers: true); 829 includeSuperMembers: true);
828 return jsNewArguments; 830 return jsNewArguments;
829 } 831 }
830 } 832 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/enqueue.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698