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

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

Issue 302703002: Version 1.4.2 (Closed) Base URL: http://dart.googlecode.com/svn/branches/1.4/
Patch Set: Created 6 years, 6 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 js_backend; 5 part of js_backend;
6 6
7 class ConstantEmitter { 7 class ConstantEmitter {
8 ConstantReferenceEmitter _referenceEmitter; 8 ConstantReferenceEmitter _referenceEmitter;
9 ConstantInitializerEmitter _initializerEmitter; 9 ConstantInitializerEmitter _initializerEmitter;
10 10
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 205
206 jsAst.Expression visitString(StringConstant constant) { 206 jsAst.Expression visitString(StringConstant constant) {
207 // TODO(sra): Some larger strings are worth sharing. 207 // TODO(sra): Some larger strings are worth sharing.
208 return _reference(constant); 208 return _reference(constant);
209 } 209 }
210 210
211 jsAst.Expression visitList(ListConstant constant) { 211 jsAst.Expression visitList(ListConstant constant) {
212 jsAst.Expression value = new jsAst.Call( 212 jsAst.Expression value = new jsAst.Call(
213 new jsAst.PropertyAccess.field( 213 new jsAst.PropertyAccess.field(
214 new jsAst.VariableUse(namer.isolateName), 214 new jsAst.VariableUse(namer.isolateName),
215 namer.getMappedInstanceName('makeConstantList')), 215 'makeConstantList'),
216 [new jsAst.ArrayInitializer.from(_array(constant.entries))]); 216 [new jsAst.ArrayInitializer.from(_array(constant.entries))]);
217 return maybeAddTypeArguments(constant.type, value); 217 return maybeAddTypeArguments(constant.type, value);
218 } 218 }
219 219
220 jsAst.Expression getJsConstructor(ClassElement element) { 220 jsAst.Expression getJsConstructor(ClassElement element) {
221 return namer.elementAccess(element); 221 return namer.elementAccess(element);
222 } 222 }
223 223
224 jsAst.Expression visitMap(MapConstant constant) { 224 jsAst.Expression visitMap(MapConstant constant) {
225 jsAst.Expression jsMap() { 225 jsAst.Expression jsMap() {
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 .map((DartType type) => 357 .map((DartType type) =>
358 rti.getTypeRepresentationWithHashes(type, (_){})); 358 rti.getTypeRepresentationWithHashes(type, (_){}));
359 jsAst.Expression argumentList = 359 jsAst.Expression argumentList =
360 new jsAst.LiteralString('[${arguments.join(', ')}]'); 360 new jsAst.LiteralString('[${arguments.join(', ')}]');
361 return new jsAst.Call(getHelperProperty(backend.getSetRuntimeTypeInfo()), 361 return new jsAst.Call(getHelperProperty(backend.getSetRuntimeTypeInfo()),
362 [value, argumentList]); 362 [value, argumentList]);
363 } 363 }
364 return value; 364 return value;
365 } 365 }
366 } 366 }
OLDNEW
« no previous file with comments | « dart/runtime/bin/main.cc ('k') | dart/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698