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

Unified Diff: lib/compiler/implementation/ssa/codegen.dart

Issue 10915083: Change assert implementation to not depend on a top-level function called 'assert'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments. Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/compiler/implementation/resolver.dart ('k') | lib/compiler/implementation/universe.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/ssa/codegen.dart
diff --git a/lib/compiler/implementation/ssa/codegen.dart b/lib/compiler/implementation/ssa/codegen.dart
index f1bebc7d6573c6a3401121faf622f25e102da7f4..bd4ba4899d2cbe189bab0c22acce0f8b30152b56 100644
--- a/lib/compiler/implementation/ssa/codegen.dart
+++ b/lib/compiler/implementation/ssa/codegen.dart
@@ -1714,30 +1714,33 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
}
void generateConstant(Constant constant) {
- Namer namer = backend.namer;
- if (!constant.isObject()) {
+ ConstantHandler handler = compiler.constantHandler;
+ String name = handler.getNameForConstant(constant);
+ if (name === null) {
+ assert(!constant.isObject());
if (constant.isBool()) {
push(new js.LiteralBool((constant as BoolConstant).value));
} else if (constant.isNum()) {
// TODO(floitsch): get rid of the code buffer.
CodeBuffer buffer = new CodeBuffer();
- backend.emitter.writeConstantToBuffer(constant, buffer);
+ handler.writeConstant(buffer, constant);
push(new js.LiteralNumber(buffer.toString()));
} else if (constant.isNull()) {
push(new js.LiteralNull());
} else if (constant.isString()) {
// TODO(floitsch): get rid of the code buffer.
CodeBuffer buffer = new CodeBuffer();
- backend.emitter.writeConstantToBuffer(constant, buffer);
+ handler.writeConstant(buffer, constant);
push(new js.LiteralString(buffer.toString()));
} else if (constant.isFunction()) {
FunctionConstant function = constant;
world.registerStaticUse(function.element);
- push(new js.VariableUse(namer.isolateAccess(function.element)));
+ push(new js.VariableUse(
+ backend.namer.isolateAccess(function.element)));
} else if (constant.isSentinel()) {
// TODO(floitsch): get rid of the code buffer.
CodeBuffer buffer = new CodeBuffer();
- backend.emitter.writeConstantToBuffer(constant, buffer);
+ handler.writeConstant(buffer, constant);
push(new js.VariableUse(buffer.toString()));
} else {
compiler.internalError(
@@ -1745,7 +1748,6 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
"constant $constant");
}
} else {
- String name = namer.constantName(constant);
js.VariableUse currentIsolateUse =
new js.VariableUse(backend.namer.CURRENT_ISOLATE);
push(new js.PropertyAccess.field(currentIsolateUse, name));
« no previous file with comments | « lib/compiler/implementation/resolver.dart ('k') | lib/compiler/implementation/universe.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698