From 27df758e2e7baebb6e3f393f9732fd0d064420c8 Mon Sep 17 00:00:00 2001 From: Calin Juravle Date: Fri, 17 Apr 2015 19:12:31 +0100 Subject: [optimizing] Add memory barriers in constructors when needed If a class has final fields we must add a memory barrier before returning from constructor. This makes sure the fields are visible to other threads. Bug: 19851497 Change-Id: If8c485092fc512efb9636cd568cb0543fb27688e --- compiler/optimizing/graph_visualizer.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'compiler/optimizing/graph_visualizer.cc') diff --git a/compiler/optimizing/graph_visualizer.cc b/compiler/optimizing/graph_visualizer.cc index 4c283788b5..ca9cbc3d01 100644 --- a/compiler/optimizing/graph_visualizer.cc +++ b/compiler/optimizing/graph_visualizer.cc @@ -192,6 +192,10 @@ class HGraphVisualizerPrinter : public HGraphVisitor { output_ << " " << phi->GetRegNumber(); } + void VisitMemoryBarrier(HMemoryBarrier* barrier) OVERRIDE { + output_ << " " << barrier->GetBarrierKind(); + } + bool IsPass(const char* name) { return strcmp(pass_name_, name) == 0; } -- cgit v1.2.3-59-g8ed1b