CheckOddball is indeed a very specific function, so what I'm currently
trying to do is adding a CompareRoot method to the IA32 macro assembler (x64
and ARM have this already). The only downside is that the method is a bit
ugly and contains some code duplication from the ROOT_ACCESSOR macro in
factory.h, but I don't see a nice way around this:

void MacroAssembler::CompareRoot(Register with, Heap::RootListIndex index) {
  Handle<Object>
value(BitCast<Object**>(&isolate()->heap()->roots_address()[index]));
  __ cmp(with, value);
}

Would this be OK?

On Mon, Aug 1, 2011 at 13:51, <[email protected]> wrote:

>
> http://codereview.chromium.**org/7544012/diff/1/src/code-**stubs.h<http://codereview.chromium.org/7544012/diff/1/src/code-stubs.h>
> File src/code-stubs.h (right):
>
> http://codereview.chromium.**org/7544012/diff/1/src/code-**
> stubs.h#newcode958<http://codereview.chromium.org/7544012/diff/1/src/code-stubs.h#newcode958>
> src/code-stubs.h:958: #if V8_TARGET_ARCH_IA32
> On 2011/08/01 11:36:13, danno wrote:
>
>> Why don't you make CheckOddball a method in the MacroAssembler? Then
>>
> you don't
>
>> need the #if def at all
>>
>
> I thought it was because it needs the types_.  They could be passed in
> as an argument, but the function is still pretty specific to this stub.
>
>
> http://codereview.chromium.**org/7544012/<http://codereview.chromium.org/7544012/>
>

-- 
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to