Don't call dlsym from signal context in signal chain

It is dangerous to call dlsym from within a signal context
since it takes a lock and can lead to a mutex reentry attempt if
timing is bad.

This change adds an initialization function to the signal chain
that calls dlsym for sigaction and sigprocmask from outside the
signal context (from Runtime::Init()).  The results are cached
in a static variable and used from within the signal context if
necessary.

However, tests don't necessarily call Runtime::Init() so we also
need to deal with the case where the signal chain is not initialized
and perform a lazy initialization from inside sigaction or sigprocmask.
This is always outside a signal context since we have not initialized
the runtime.

Bug: 17498571
Change-Id: I59eebfc67cc91c6f1d781a73e5d432ca5269ee48
Update comment about disabling vmap dump.

Change-Id: If5d09b0d5cb9a8039b0037e6eedaae6785b1ded2
Ensure the first predecessor of a loop is the pre header.

Note that the check in ssa_phi_elimination.cc was very defensive:
it does not affect the outcome of the algorithm whether the
loop phi takes itself as the first input.

It makes things consistent to always have the pre header as first
input.

Change-Id: Ic86248c1f38af67f7432782f6deefae1f4bf1ab6
Move spammy logs to JDWP verbose mode

We are spammed by warning messages when debugging, especially each time we
suspend/resume all threads (to update instrumentation or collect monitor info).
It's common to get into the cases where these warnings are logged so they
shouldn't be warning but debug messages.

This CL moves these LOG(WARNING) to VLOG(jdwp) to not disturb developers when
debugging their app (especially when looking for specific messages in logcat).
We keep them in JDWP verbose mode because they help knowing when we initiate
these sequences of "suspend/resume all threads".

Also adds debug suspend count in the log message for more context.

Bug: 17524544
Bug: 17170697
Change-Id: Ic87985ac6913151d15fd89849e41bde61092c3dd
It can be that no method has been compiled.

Therefore do not divide by 0, but log it.

Change-Id: Iee7760ab7f31c73e90d62387e5fb6fb7aa2c56e2
Merge "It can be that no method has been compiled."
Update JDWP event filtering to avoid useless ids

To reduce the number of JDWP ids in the debugger, we update the event filtering
support to work with runtime objects (Thread, Class, Object, ...) instead of
JDWP ids (ThreadId, RefTypeId, ObjectId, ...).

We used to create useless JDWP ids for events even if they were not reported
because of event filtering (thread only, class only, instance only, ...). Now
we only create JDWP ids when we know we're going to report an event.

Bug: 17343664
(cherry picked from commit d539167b7f11136fe570a77aff2ee4935842007a)

Change-Id: I8619e219733fc2fa3569f473b7bd8d9af4181f2b
Merge "Update JDWP event filtering to avoid useless ids"
Initiate a constant propagation pass in the optimizing compiler.

- Perform constant folding on int and long additions and subtractions in
  the optimizing compiler.
- Apply constant folding to conditions and comparisons.

Change-Id: Ic88783a3c975fda777c74c531e257fa777be42eb
Merge "Ensure the first predecessor of a loop is the pre header."
Fix a lint error and update a test after the phi fix.

Change-Id: I6e9ab2a8300c2493a8d3e93ab4ced3d7c9552fc5
Merge "Fix a lint error and update a test after the phi fix."
Merge "Initiate a constant propagation pass in the optimizing compiler."
Merge "Don't call dlsym from signal context in signal chain"
Merge "Move spammy logs to JDWP verbose mode"
ART: Only allow the zygote to create the global boot image

Do not allow arbitrary processes, even when root, to write the
boot image in /data/dalvik-cache.

Bug: 17478752, 17510489, 17439961
Change-Id: Iba2b74be6d0752f4221f4ff5ee295b45a34cb2e1
(cherry picked from commit 33c36d4f22ab6a5e61eb47b654deaf647c34e49c)
Merge "ART: Only allow the zygote to create the global boot image"
Merge "Update comment about disabling vmap dump."