Re: [webkit-dev] Fix for Vector::m_inlineBuffer alignment?

2008-09-07 Thread Maciej Stachowiak
On Sep 7, 2008, at 10:20 AM, Paul Pedriana wrote: > I agree that a union is most portable, but there are two problems > with it: > > - The C++ Standard (section 9.5 p1) disallows union members that > have ctors, dtors, or assignment operators. This includes the > case > whereby th

Re: [webkit-dev] Fix for Vector::m_inlineBuffer alignment?

2008-09-07 Thread Paul Pedriana
I agree that a union is most portable, but there are two problems with it: - The C++ Standard (section 9.5 p1) disallows union members that have ctors, dtors, or assignment operators. This includes the case whereby the class is the only non-POD of the union. - It would creat

Re: [webkit-dev] Fix for Vector::m_inlineBuffer alignment?

2008-09-07 Thread Maciej Stachowiak
On Sep 4, 2008, at 1:20 AM, Paul Pedriana wrote: > Well the proposed solution in > doesn't work, as VC++ > doesn't accept that syntax. And the solutions in > whereby a uint32_t or > uint64_t buffer are

Re: [webkit-dev] Fix for Vector::m_inlineBuffer alignment?

2008-09-04 Thread Alexey Proskuryakov
That's a great list of subtle issues (I can add that atomicity guarantees are different for non-aligned access sometimes) - it would be fantastic if we could amend it with actual data, say SunSpider results and/or DOM performance tests on Intel Mac and/or Windows. If we got an improvement o

Re: [webkit-dev] Fix for Vector::m_inlineBuffer alignment?

2008-09-04 Thread Paul Pedriana
This is a hardware issue and can vary between different versions. Some hardware of course generates an unhandled exception on unaligned access; some hardware generates an internally handled exception and restarts the access with a different and more expensive pathway or with microcode; some har

Re: [webkit-dev] Fix for Vector::m_inlineBuffer alignment?

2008-09-04 Thread Alexey Proskuryakov
On Sep 4, 2008, at 12:20 PM, Paul Pedriana wrote: > I'll make a patch and attach it to > >, if that's OK. That would be great! One thing I'm not sure about is whether we want to enforce alignment on platforms that don't require it - performa

Re: [webkit-dev] Fix for Vector::m_inlineBuffer alignment?

2008-09-04 Thread Paul Pedriana
Well the proposed solution in doesn't work, as VC++ doesn't accept that syntax. And the solutions in whereby a uint32_t or uint64_t buffer are made don't work for larger types and use more memory th

Re: [webkit-dev] Fix for Vector::m_inlineBuffer alignment?

2008-09-04 Thread Alexey Proskuryakov
On Sep 4, 2008, at 2:05 AM, Paul Pedriana wrote: > I see that JavaScriptCore/wtf/Vector.h has this: > >// FIXME: Nothing guarantees this buffer is appropriately aligned > to > hold objects of type T. >char m_inlineBuffer[m_inlineBufferSize]; We have a bug for this:

Re: [webkit-dev] Fix for Vector::m_inlineBuffer alignment?

2008-09-03 Thread David Kilzer
It sounds like the first part should go in JavaScriptCore/wtf/Platform.h. Could you open a new bug on and post this as a patch for review? Thanks! Dave On Wed, 9/3/08, Paul Pedriana <[EMAIL PROTECTED]> wrote: > I see that JavaScriptCore/wtf/Vector.h has this: > >

[webkit-dev] Fix for Vector::m_inlineBuffer alignment?

2008-09-03 Thread Paul Pedriana
I see that JavaScriptCore/wtf/Vector.h has this: // FIXME: Nothing guarantees this buffer is appropriately aligned to hold objects of type T. char m_inlineBuffer[m_inlineBufferSize]; And I've heard reports about people having alignment crashes on some hardware. Something like the code b