Boost logo

Boost :

Subject: Re: [boost] [Block Pointer] benchmark
From: Phil Bouchard (philippe_at_[hidden])
Date: 2011-05-26 19:42:04


On 5/26/2011 4:19 PM, Phil Bouchard wrote:
>
> I'm not sure what it is deleting.

If I examine worker_make used with block_ptr it's obvious it creates
temporaries all over the place and there is no such RVO:

push %r15
xor %r15d,%r15d
push %r14
push %r13
push %r12
push %rbp
push %rbx
sub $0x48,%rsp
lea 0x10(%rsp),%rax
mov %rax,%rdi
mov %rax,0x8(%rsp)
callq 0x408a30 <block_ptr>
lea 0x20(%rsp),%rax
mov %rax,(%rsp)
mov %rax,%rdi
nop
callq 0x4094f0 <boost::detail::bp::block_ptr<int>
boost::detail::bp::make_block<int>()>
callq 0x407c60 <boost::detail::bp::block_header::static_mutex()>
mov %rax,%rdi
mov %rax,%r14
callq 0x405258 <pthread_mutex_lock_at_plt>
test %eax,%eax
jne 0x409d34 <void worker_make<boost::detail::bp::block_ptr<int>,
&(boost::detail::bp::block_ptr<int>
boost::detail::bp::make_block<int>())>()+804>
mov 0x18(%rsp),%rdx
mov 0x8(%rdx),%rcx
mov 0x8(%rcx),%rax
cmp %rax,%rcx
jne 0x409a74 <void worker_make<boost::detail::bp::block_ptr<int>,
&(boost::detail::bp::block_ptr<int>
boost::detail::bp::make_block<int>())>()+100>
jmp 0x409a81 <void worker_make<boost::detail::bp::block_ptr<int>,
&(boost::detail::bp::block_ptr<int>
boost::detail::bp::make_block<int>())>()+113>
mov %rcx,%rax
mov %rax,0x8(%rdx)
mov 0x8(%rax),%rcx
cmp %rax,%rcx
jne 0x409a71 <void worker_make<boost::detail::bp::block_ptr<int>,
&(boost::detail::bp::block_ptr<int>
boost::detail::bp::make_block<int>())>()+97>
mov 0x28(%rsp),%rsi
mov 0x8(%rsi),%rdx
mov 0x8(%rdx),%rax
cmp %rax,%rdx
jne 0x409a98 <void worker_make<boost::detail::bp::block_ptr<int>,
&(boost::detail::bp::block_ptr<int>
boost::detail::bp::make_block<int>())>()+136>
jmp 0x409aa5 <void worker_make<boost::detail::bp::block_ptr<int>,
&(boost::detail::bp::block_ptr<int>
boost::detail::bp::make_block<int>())>()+149>
mov %rdx,%rax
mov %rax,0x8(%rsi)
mov 0x8(%rax),%rdx
cmp %rax,%rdx
jne 0x409a95 <void worker_make<boost::detail::bp::block_ptr<int>,
&(boost::detail::bp::block_ptr<int>
boost::detail::bp::make_block<int>())>()+133>
cmp %rdx,%rcx
je 0x409ba9 <void worker_make<boost::detail::bp::block_ptr<int>,
&(boost::detail::bp::block_ptr<int>
boost::detail::bp::make_block<int>())>()+409>
xor %esi,%esi
mov 0x8(%rsp),%rdi
callq 0x408500 <boost::detail::bp::block_ptr<int>::release(bool)>
mov 0x28(%rsp),%rcx
mov 0x8(%rcx),%rdx
mov 0x8(%rdx),%rax
cmp %rax,%rdx
jne 0x409ad3 <void worker_make<boost::detail::bp::block_ptr<int>,
&(boost::detail::bp::block_ptr<int>
boost::detail::bp::make_block<int>())>()+195>
jmp 0x409ae0 <void worker_make<boost::detail::bp::block_ptr<int>,
&(boost::detail::bp::block_ptr<int>
boost::detail::bp::make_block<int>())>()+208>
xchg %ax,%ax
mov %rdx,%rax
mov %rax,0x8(%rcx)
mov 0x8(%rax),%rdx
cmp %rax,%rdx
jne 0x409ad0 <void worker_make<boost::detail::bp::block_ptr<int>,
&(boost::detail::bp::block_ptr<int>
boost::detail::bp::make_block<int>())>()+192>
mov 0x18(%rsp),%rcx
mov 0x8(%rcx),%rsi
mov 0x8(%rsi),%rax
cmp %rax,%rsi
jne 0x409af7 <void worker_make<boost::detail::bp::block_ptr<int>,
&(boost::detail::bp::block_ptr<int>
boost::detail::bp::make_block<int>())>()+231>
jmp 0x409b04 <void worker_make<boost::detail::bp::block_ptr<int>,
&(boost::detail::bp::block_ptr<int>
boost::detail::bp::make_block<int>())>()+244>
mov %rsi,%rax
mov %rax,0x8(%rcx)
mov 0x8(%rax),%rsi
cmp %rax,%rsi
jne 0x409af4 <void worker_make<boost::detail::bp::block_ptr<int>,
&(boost::detail::bp::block_ptr<int>
boost::detail::bp::make_block<int>())>()+228>
cmp %rsi,%rdx
je 0x409ba9 <void worker_make<boost::detail::bp::block_ptr<int>,
&(boost::detail::bp::block_ptr<int>
boost::detail::bp::make_block<int>())>()+409>
lea 0x28(%rsi),%r8
...

-Phil


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk