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

Unified Diff: pkg/compiler/lib/src/ssa/nodes.dart

Issue 2422003002: Enable GVN on HForeignNew (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | sdk/lib/_internal/js_runtime/lib/js_number.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/nodes.dart
diff --git a/pkg/compiler/lib/src/ssa/nodes.dart b/pkg/compiler/lib/src/ssa/nodes.dart
index 64e12387c5807762a746cc6b90d910d7876e28bf..1b06943251b20d45cd1608838019d5e6c55dcd0b 100644
--- a/pkg/compiler/lib/src/ssa/nodes.dart
+++ b/pkg/compiler/lib/src/ssa/nodes.dart
@@ -873,6 +873,8 @@ abstract class HInstruction implements Spannable {
static const int TYPE_INFO_READ_VARIABLE_TYPECODE = 39;
static const int TYPE_INFO_EXPRESSION_TYPECODE = 40;
+ static const int FOREIGN_CODE_TYPECODE = 41;
+
HInstruction(this.inputs, this.instructionType)
: id = idCounter++,
usedBy = <HInstruction>[] {
@@ -1901,6 +1903,9 @@ class HForeignCode extends HForeign {
assert(this.throwBehavior != null);
if (effects != null) sideEffects.add(effects);
+ if (nativeBehavior != null && nativeBehavior.useGvn) {
+ setUseGvn();
+ }
}
HForeignCode.statement(js.Template codeTemplate, List<HInstruction> inputs,
@@ -1927,7 +1932,13 @@ class HForeignCode extends HForeign {
bool get isAllocation =>
nativeBehavior != null && nativeBehavior.isAllocation && !canBeNull();
- String toString() => 'HForeignCode("${codeTemplate.source}",$inputs)';
+ int typeCode() => HInstruction.FOREIGN_CODE_TYPECODE;
+ bool typeEquals(other) => other is HForeignCode;
+ bool dataEquals(HForeignCode other) {
+ return codeTemplate.source == other.codeTemplate.source;
+ }
+
+ String toString() => 'HForeignCode("${codeTemplate.source}", $inputs)';
}
abstract class HInvokeBinary extends HInstruction {
« no previous file with comments | « no previous file | sdk/lib/_internal/js_runtime/lib/js_number.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698