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

Side by Side Diff: pkg/compiler/lib/src/js_backend/constant_emitter.dart

Issue 891673003: dart2js: Refactoring, documentation, and a few bugfixes in Namer class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase Created 5 years, 9 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 ConstantLiteralEmitter _literalEmitter; 9 ConstantLiteralEmitter _literalEmitter;
10 10
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 380
381 JavaScriptBackend get backend => compiler.backend; 381 JavaScriptBackend get backend => compiler.backend;
382 382
383 jsAst.PropertyAccess getHelperProperty(Element helper) { 383 jsAst.PropertyAccess getHelperProperty(Element helper) {
384 return backend.emitter.staticFunctionAccess(helper); 384 return backend.emitter.staticFunctionAccess(helper);
385 } 385 }
386 386
387 @override 387 @override
388 jsAst.Expression visitType(TypeConstantValue constant, [_]) { 388 jsAst.Expression visitType(TypeConstantValue constant, [_]) {
389 DartType type = constant.representedType; 389 DartType type = constant.representedType;
390 String name = namer.getRuntimeTypeName(type.element); 390 String name = namer.runtimeTypeName(type.element);
391 jsAst.Expression typeName = new jsAst.LiteralString("'$name'"); 391 jsAst.Expression typeName = new jsAst.LiteralString("'$name'");
392 return new jsAst.Call(getHelperProperty(backend.getCreateRuntimeType()), 392 return new jsAst.Call(getHelperProperty(backend.getCreateRuntimeType()),
393 [typeName]); 393 [typeName]);
394 } 394 }
395 395
396 @override 396 @override
397 jsAst.Expression visitInterceptor(InterceptorConstantValue constant, [_]) { 397 jsAst.Expression visitInterceptor(InterceptorConstantValue constant, [_]) {
398 ClassElement interceptorClass = constant.dispatchedType.element; 398 ClassElement interceptorClass = constant.dispatchedType.element;
399 return backend.emitter.interceptorPrototypeAccess(interceptorClass); 399 return backend.emitter.interceptorPrototypeAccess(interceptorClass);
400 } 400 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 [value, argumentList]); 444 [value, argumentList]);
445 } 445 }
446 return value; 446 return value;
447 } 447 }
448 448
449 @override 449 @override
450 jsAst.Expression visitDeferred(DeferredConstantValue constant, [_]) { 450 jsAst.Expression visitDeferred(DeferredConstantValue constant, [_]) {
451 return constantEmitter.reference(constant.referenced); 451 return constantEmitter.reference(constant.referenced);
452 } 452 }
453 } 453 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/codegen/glue.dart ('k') | pkg/compiler/lib/src/js_backend/minify_namer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698