Fix assert triggered by constant folding.

Add<> asserts the return type, which might not be an HAdd in this case
because of constant folding.

BUG=
R=jkummerow@chromium.org

Review URL: https://codereview.chromium.org/23754002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@16414 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
Use V8_OS_* variables for platform detection in the sampler code

BUG=None
R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/23591006

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@16415 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
Cleanup Mutex and related classes.

Drop the previous Mutex and ScopedLock classes from platform files.

Add new Mutex, RecursiveMutex and LockGuard classes, which are
designed after their C++11 counterparts, so that at some point
we can simply drop our custom code and switch to the C++11
classes. We distinguish regular and recursive mutexes, as the
latter don't work well with condition variables, which will be
introduced by a followup CL.

R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/23625003

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@16416 ce2b1a6d-e550-0410-aec6-3dcde31c8c00