Permalink
Browse files

Merge barriers in FoldPassthroughAssignments.

  • Loading branch information...
1 parent 3924878 commit d3ee145c5b6c53409b1a7f46ffed02abdd6b3596 @whitequark committed Aug 18, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/furnace-avm2/transform/fold_passthrough_assignments.rb
@@ -25,8 +25,14 @@ def transform(cfg)
# Fold the constructs.
set_node = block.metadata.set_map[id]
_, set_value = set_node.children
+
sorted_nodes.reduce(set_value) do |prev, (node, upper)|
+ [ :read_barrier, :write_barrier ].each do |key|
+ upper.metadata[key].merge prev.metadata[key]
+ end
+
node.update(prev.type, prev.children)
+
upper
end

0 comments on commit d3ee145

Please sign in to comment.