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

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

Issue 24361003: Fix http://dartbug.com/13462 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add TODO. Created 7 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
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/types/inferrer_visitor.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 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 accumulator = new DartString.concat(accumulator, expressionString); 476 accumulator = new DartString.concat(accumulator, expressionString);
477 StringConstant partString = evaluate(part.string); 477 StringConstant partString = evaluate(part.string);
478 if (partString == null) return null; 478 if (partString == null) return null;
479 accumulator = new DartString.concat(accumulator, partString.value); 479 accumulator = new DartString.concat(accumulator, partString.value);
480 }; 480 };
481 handler.registerStringInstance(elements); 481 handler.registerStringInstance(elements);
482 return constantSystem.createString(accumulator, node); 482 return constantSystem.createString(accumulator, node);
483 } 483 }
484 484
485 Constant visitLiteralSymbol(LiteralSymbol node) { 485 Constant visitLiteralSymbol(LiteralSymbol node) {
486 handler.registerStringInstance(elements);
486 InterfaceType type = compiler.symbolClass.computeType(compiler); 487 InterfaceType type = compiler.symbolClass.computeType(compiler);
487 List<Constant> createArguments(_) { 488 List<Constant> createArguments(_) {
488 return [constantSystem.createString( 489 return [constantSystem.createString(
489 new DartString.literal(node.slowNameString), node)]; 490 new DartString.literal(node.slowNameString), node)];
490 } 491 }
491 return makeConstructedConstant( 492 return makeConstructedConstant(
492 node, type, compiler.symbolConstructor, createArguments); 493 node, type, compiler.symbolConstructor, createArguments);
493 } 494 }
494 495
495 Constant makeTypeConstant(Element element) { 496 Constant makeTypeConstant(Element element) {
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
960 if (fieldValue == null) { 961 if (fieldValue == null) {
961 // Use the default value. 962 // Use the default value.
962 fieldValue = handler.compileConstant(field); 963 fieldValue = handler.compileConstant(field);
963 } 964 }
964 jsNewArguments.add(fieldValue); 965 jsNewArguments.add(fieldValue);
965 }, 966 },
966 includeSuperAndInjectedMembers: true); 967 includeSuperAndInjectedMembers: true);
967 return jsNewArguments; 968 return jsNewArguments;
968 } 969 }
969 } 970 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/types/inferrer_visitor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698