From 3b5c1541386a71ea1c3715298710a82dab1ce4d9 Mon Sep 17 00:00:00 2001 From: Stephen Adams Date: Wed, 19 Oct 2016 14:46:54 -0700 Subject: [PATCH] Don't gvn HForeignCode without source text There are a few synthetic templates that are generated from trees instead of source text. I don't think any are marked for GVN, but this is a hazard so best fix it. TBR=sigmund@google.com BUG= Review URL: https://codereview.chromium.org/2431103003 . --- pkg/compiler/lib/src/ssa/nodes.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/compiler/lib/src/ssa/nodes.dart b/pkg/compiler/lib/src/ssa/nodes.dart index c53d6b94b5e..adc207662fe 100644 --- a/pkg/compiler/lib/src/ssa/nodes.dart +++ b/pkg/compiler/lib/src/ssa/nodes.dart @@ -1940,10 +1940,11 @@ class HForeignCode extends HForeign { int typeCode() => HInstruction.FOREIGN_CODE_TYPECODE; bool typeEquals(other) => other is HForeignCode; bool dataEquals(HForeignCode other) { - return codeTemplate.source == other.codeTemplate.source; + return codeTemplate.source != null && + codeTemplate.source == other.codeTemplate.source; } - String toString() => 'HForeignCode("${codeTemplate.source}", $inputs)'; + String toString() => 'HForeignCode("${codeTemplate.source}")'; } abstract class HInvokeBinary extends HInstruction {