| Index: pkg/compiler/lib/src/ssa/optimize.dart
|
| diff --git a/pkg/compiler/lib/src/ssa/optimize.dart b/pkg/compiler/lib/src/ssa/optimize.dart
|
| index a24b0c16d96c78a23105f4acd5a2d130ccb1af30..07611f654a3292066d02ec241076f47e28dc7c3b 100644
|
| --- a/pkg/compiler/lib/src/ssa/optimize.dart
|
| +++ b/pkg/compiler/lib/src/ssa/optimize.dart
|
| @@ -200,32 +200,6 @@ class SsaInstructionSimplifier extends HBaseVisitor
|
| return node;
|
| }
|
|
|
| - ConstantValue getConstantFromType(HInstruction node) {
|
| - if (node.isValue() && !node.canBeNull()) {
|
| - ValueTypeMask valueMask = node.instructionType;
|
| - if (valueMask.value.isBool) {
|
| - return valueMask.value;
|
| - }
|
| - // TODO(het): consider supporting other values (short strings?)
|
| - }
|
| - return null;
|
| - }
|
| -
|
| - void propagateConstantValueToUses(HInstruction known) {
|
| - if (known.usedBy.isEmpty) return;
|
| - ConstantValue value = getConstantFromType(known);
|
| - if (value != null) {
|
| - for (HInstruction user in known.usedBy.toList()) {
|
| - user.changeUse(known, graph.addConstant(value, compiler));
|
| - }
|
| - }
|
| - }
|
| -
|
| - HInstruction visitParameterValue(HParameterValue node) {
|
| - propagateConstantValueToUses(node);
|
| - return node;
|
| - }
|
| -
|
| HInstruction visitBoolify(HBoolify node) {
|
| List<HInstruction> inputs = node.inputs;
|
| assert(inputs.length == 1);
|
| @@ -398,7 +372,6 @@ class SsaInstructionSimplifier extends HBaseVisitor
|
| }
|
|
|
| HInstruction visitInvokeDynamicMethod(HInvokeDynamicMethod node) {
|
| - propagateConstantValueToUses(node);
|
| if (node.isInterceptedCall) {
|
| HInstruction folded = handleInterceptedCall(node);
|
| if (folded != node) return folded;
|
| @@ -833,7 +806,6 @@ class SsaInstructionSimplifier extends HBaseVisitor
|
| }
|
|
|
| HInstruction visitInvokeDynamicGetter(HInvokeDynamicGetter node) {
|
| - propagateConstantValueToUses(node);
|
| if (node.isInterceptedCall) {
|
| HInstruction folded = handleInterceptedCall(node);
|
| if (folded != node) return folded;
|
| @@ -895,7 +867,6 @@ class SsaInstructionSimplifier extends HBaseVisitor
|
| }
|
|
|
| HInstruction visitInvokeStatic(HInvokeStatic node) {
|
| - propagateConstantValueToUses(node);
|
| if (node.element == backend.getCheckConcurrentModificationError()) {
|
| if (node.inputs.length == 2) {
|
| HInstruction firstArgument = node.inputs[0];
|
| @@ -1335,6 +1306,13 @@ class SsaLiveBlockAnalyzer extends HBaseVisitor {
|
| } else {
|
| markBlockLive(instruction.elseBlock);
|
| }
|
| + } else if (condition.isValue()) {
|
| + ValueTypeMask valueType = condition.instructionType;
|
| + if (valueType.value == true) {
|
| + markBlockLive(instruction.thenBlock);
|
| + } else {
|
| + markBlockLive(instruction.elseBlock);
|
| + }
|
| } else {
|
| visitControlFlow(instruction);
|
| }
|
|
|