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 .
This commit is contained in:
Stephen Adams 2016-10-19 14:46:54 -07:00
parent b3f66b03a1
commit 3b5c154138

View file

@ -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 {