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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/tracer.dart

Issue 218993003: Emit read-modify-write of fields as assignment op. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: add test Created 6 years, 9 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
Index: sdk/lib/_internal/compiler/implementation/ssa/tracer.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/tracer.dart b/sdk/lib/_internal/compiler/implementation/ssa/tracer.dart
index 4c86cb72d26cfc81b9ae25123a4052b70e8167f2..13056a6a74548b3c77df7d720f749aac80ff2a00 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/tracer.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/tracer.dart
@@ -275,6 +275,20 @@ class HInstructionStringifier implements HVisitor<String> {
return 'field set ${temporaryId(node.receiver)}.$fieldName to $valueId';
}
+ String visitReadModifyWrite(HReadModifyWrite node) {
+ String fieldName = node.element.name;
+ String receiverId = temporaryId(node.receiver);
+ String op = node.jsOp;
+ if (node.isAssignOp) {
+ String valueId = temporaryId(node.value);
+ return 'field-update $receiverId.$fieldName $op= $valueId';
+ } else if (node.isPreOp) {
+ return 'field-update $op$receiverId.$fieldName';
+ } else {
+ return 'field-update $receiverId.$fieldName$op';
+ }
+ }
+
String visitLocalGet(HLocalGet node) {
String localName = node.element.name;
return 'local get ${temporaryId(node.local)}.$localName';
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/nodes.dart ('k') | tests/compiler/dart2js/field_update_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698