diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2013-04-29 22:35:21 +0200 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2013-04-29 22:35:21 +0200 |
commit | 2f75785c015fecc33565fe5ee3a483b0d4e5cc6d (patch) | |
tree | ad66b4eaba8cedfeb7cfb40b0871307ae08d25e8 /deps/v8/src/store-buffer.cc | |
parent | 5ddf7f4200894a7304d7c07bbbd8773fac3509d1 (diff) | |
download | node-new-2f75785c015fecc33565fe5ee3a483b0d4e5cc6d.tar.gz |
deps: upgrade v8 to 3.18.4
Diffstat (limited to 'deps/v8/src/store-buffer.cc')
-rw-r--r-- | deps/v8/src/store-buffer.cc | 38 |
1 files changed, 5 insertions, 33 deletions
diff --git a/deps/v8/src/store-buffer.cc b/deps/v8/src/store-buffer.cc index 8a69164039..7d73dd5ed1 100644 --- a/deps/v8/src/store-buffer.cc +++ b/deps/v8/src/store-buffer.cc @@ -25,9 +25,11 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "v8.h" - #include "store-buffer.h" + +#include <algorithm> + +#include "v8.h" #include "store-buffer-inl.h" #include "v8-counters.h" @@ -122,33 +124,6 @@ void StoreBuffer::StoreBufferOverflow(Isolate* isolate) { } -#if V8_TARGET_ARCH_X64 -static int CompareAddresses(const void* void_a, const void* void_b) { - intptr_t a = - reinterpret_cast<intptr_t>(*reinterpret_cast<const Address*>(void_a)); - intptr_t b = - reinterpret_cast<intptr_t>(*reinterpret_cast<const Address*>(void_b)); - // Unfortunately if int is smaller than intptr_t there is no branch-free - // way to return a number with the same sign as the difference between the - // pointers. - if (a == b) return 0; - if (a < b) return -1; - ASSERT(a > b); - return 1; -} -#else -static int CompareAddresses(const void* void_a, const void* void_b) { - intptr_t a = - reinterpret_cast<intptr_t>(*reinterpret_cast<const Address*>(void_a)); - intptr_t b = - reinterpret_cast<intptr_t>(*reinterpret_cast<const Address*>(void_b)); - ASSERT(sizeof(1) == sizeof(a)); - // Shift down to avoid wraparound. - return (a >> kPointerSizeLog2) - (b >> kPointerSizeLog2); -} -#endif - - void StoreBuffer::Uniq() { // Remove adjacent duplicates and cells that do not point at new space. Address previous = NULL; @@ -283,10 +258,7 @@ void StoreBuffer::Filter(int flag) { void StoreBuffer::SortUniq() { Compact(); if (old_buffer_is_sorted_) return; - qsort(reinterpret_cast<void*>(old_start_), - old_top_ - old_start_, - sizeof(*old_top_), - &CompareAddresses); + std::sort(old_start_, old_top_); Uniq(); old_buffer_is_sorted_ = true; |