[Webkit-unassigned] [Bug 44329] SH4 JIT SUPPORT

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Feb 19 04:14:09 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=44329





--- Comment #62 from Patrick R. Gansterer <paroga at paroga.com>  2011-02-19 04:14:08 PST ---
(From update of attachment 82973)
View in context: https://bugs.webkit.org/attachment.cgi?id=82973&action=review

> Source/JavaScriptCore/jit/ExecutableAllocator.h:326
> +#ifndef __NR_cacheflush
> +#define __NR_cacheflush __NR_modify_ldt
> +#endif
> +
> +static const unsigned defaultLinuxPageSize = 4096;

Please move this lines to the other #defines at the top of the file. 
Can you use getpagesize() instead? Or at least add an assertion?

> Source/JavaScriptCore/jit/ExecutableAllocator.h:332
> +        unsigned int a, b;
> +        a = reinterpret_cast<unsigned int>(code) & ~(defaultLinuxPageSize - 1);
> +        b = (reinterpret_cast<unsigned int>(code) + size + (defaultLinuxPageSize - 1)) & ~(defaultLinuxPageSize - 1);

Use better names for your variables: e.g. currentAddress and endAddress. Also do the variable declaration and assignment in one step:
unsigned int currentAddress = reinterpret_cast<unsigned int>(code) & ~(defaultLinuxPageSize - 1);
unsigned int endAddress = (reinterpret_cast<unsigned int>(code) + size + (defaultLinuxPageSize - 1)) & ~(defaultLinuxPageSize - 1);

Is the memory alignment required?

> Source/JavaScriptCore/jit/ExecutableAllocator.h:342
> +        int res = syscall(__NR_cacheflush, a, defaultLinuxPageSize, CACHEFLUSH_D_WB | CACHEFLUSH_I);
> +        ASSERT(!res);
> +
> +        while (b - a > defaultLinuxPageSize) {
> +            a = a + defaultLinuxPageSize;
> +            res = syscall(__NR_cacheflush, a, defaultLinuxPageSize, CACHEFLUSH_D_WB | CACHEFLUSH_I);
> +
> +            ASSERT(!res);
> +        }

You do the syscall twice with the same arguments. Can you rewrite it with a do while instead?


BTW: Did you try if a simple cachflush works on SH4?
The man page seams outdated: http://git.kernel.org/?p=docs/man-pages/man-pages.git;a=blob;f=man2/cacheflush.2;h=426331ba12646838880901afb4f4215762491ea3;hb=c84860e9ca1c89bfc42591d3320e568d4656f1d4#l76

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list