| Index: frog/leg/ssa/codegen.dart
|
| diff --git a/frog/leg/ssa/codegen.dart b/frog/leg/ssa/codegen.dart
|
| index fad8f53490ea5fd45fb44311d6566a5880cb33f8..b1f1da582c8014fe3ad17fff18c77bd76e20d4cd 100644
|
| --- a/frog/leg/ssa/codegen.dart
|
| +++ b/frog/leg/ssa/codegen.dart
|
| @@ -33,6 +33,7 @@ class SsaCodeGeneratorTask extends CompilerTask {
|
| // since we don't do code motion after this point.
|
| new SsaCheckInstructionUnuser().visitGraph(graph);
|
| new SsaConditionMerger().visitGraph(graph);
|
| + // JavaScript only supports characters in the BMP.
|
| new SsaPhiEliminator().visitGraph(graph);
|
| if (GENERATE_SSA_TRACE) {
|
| new HTracer.singleton().traceGraph("no-phi", graph);
|
| @@ -460,11 +461,6 @@ class SsaCodeGenerator implements HVisitor {
|
| buffer.add(')');
|
| }
|
|
|
| - static String makeStringLiteral(SourceString literal) {
|
| - // TODO(lrn): Escape string content.
|
| - return literal.toString();
|
| - }
|
| -
|
| visitLiteral(HLiteral node) {
|
| if (node.isLiteralNull()) {
|
| buffer.add("(void 0)");
|
| @@ -472,7 +468,13 @@ class SsaCodeGenerator implements HVisitor {
|
| buffer.add('(${node.value})');
|
| } else if (node.isLiteralString()) {
|
| QuotedString string = node.value;
|
| - string.printOn(buffer);
|
| + String quote = string.quoteChar;
|
| + buffer.add(quote);
|
| + string.writeEscaped(buffer, string.quoteCharCode,
|
| + (String reason) {
|
| + compiler.cancel(reason, instruction: node);
|
| + });
|
| + buffer.add(quote);
|
| } else {
|
| buffer.add(node.value);
|
| }
|
|
|