Congratulations on getting so far.  We would love to see patches if
you can sign the contributors' agreement.

That part of the code is very dependent on the ABI of the host
platform.  At the moment it works for the old-style Linux ABI, which
used the floating point registers and for the new ARM-specified EABI,
which uses integer registers to pass the arguments and return values.
For WinCE there may be a completely different ABI.

If you can't find the documentation for floating point values in the
ABI you might want to disassemble mul_two_doubles and see what your
compiler made of it.  You should be able to see from the assembly code
how it is expecting to receive the arguments and what it does with the
answer.

For a quick, but slow fix you could change the code so it always goes
into the runtime system.  That seems to work, or you wouldn't get as
far as you are getting.  The code in codegen-arm.cc will try to
allocate a heap number and will jump to the runtime system if the
allocation fails (eg because a garbage collection is due).  You could
alter the code so it always goes into the runtime system.

2009/10/9 mvv <[email protected]>:
>
>
> Hi all,
>
> I'm working on a project that tries to use V8 as a js engine on
> multiple platforms.
>
> I was able to compile and run app with V8 on WinCE. V8 was compiled
> with modified projects with visual studio 2005 without many problems.
> Some of the sources needed to be changed too, like platform_win32.cc
> and cpu_arm.cc function CPU::FlushICache(), which I implemented with
> FlushInstructionCache(GetCurrentProcess(), start, size); API call. So
> far so good. Even some pretty complex scripts run without any
> problems.
>
> Except ...
>
> Simple script:
>
> var x = 7;
> var z = x * 0.1;
>
> Generates exception 0xC0000001D in host application.
>
> After some investigation I found that this happens due to the code
> generated in function HandleBinaryOpSlowCases (codegen_arm.cc). Line
> in question is:
>
>  __ stc(p1, cr8, MemOperand(r5, HeapNumber::kValueOffset));
>
> It tries to emit stc (store from coprocessor to memory) instruction
> which is (obviously) not supported on my arm. Machine in question has
> MTK ARM11 @ 468MHz and runs Microsoft Windows CE version 5.0. This one
> obviously doesn't have fp coprocessor, like many others.
>
> Something else seems to be broken too. Actual multiplication ends up
> in mul_two_doubles(x,y) (assembler.cc). But in this particular case
> parameters are not correct. Instead of 7.0, x is 0.0.
>
> Is there any solution to this, or I'm doing something wrong?
>
> BTW. As far as I can tell __ stc is used only in this place and
> nowhere else.
>
> Any help is highly appreciated.
>
> Thanks,
>
> -mvv.
>
> >
>



-- 
Erik Corry, Software Engineer
Google Denmark ApS.  CVR nr. 28 86 69 84
c/o Philip & Partners, 7 Vognmagergade, P.O. Box 2227, DK-1018
Copenhagen K, Denmark.

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

Reply via email to