Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(29)

Issue 4997042: [pph] Fix method lookups (part 1) (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 10 months ago by Diego Novillo
Modified:
12 years, 8 months ago
Reviewers:
gcharette1
CC:
Lawrence Crowl, gcc-patches_gcc.gnu.org
Visibility:
Public.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+23 lines, -15 lines) Patch
M gcc/cp/class.c View 2 chunks +1 line, -2 lines 0 comments Download
M gcc/cp/cp-tree.h View 1 chunk +2 lines, -0 lines 0 comments Download
M gcc/cp/pph-streamer.h View 1 chunk +1 line, -0 lines 0 comments Download
M gcc/cp/pph-streamer-in.c View 1 chunk +9 lines, -0 lines 0 comments Download
M gcc/cp/pph-streamer-out.c View 2 chunks +6 lines, -1 line 0 comments Download
M gcc/testsuite/g++.dg/pph/x6dynarray3.cc View 1 chunk +2 lines, -3 lines 0 comments Download
M gcc/testsuite/g++.dg/pph/x6dynarray4.cc View 1 chunk +1 line, -2 lines 0 comments Download
M gcc/testsuite/g++.dg/pph/x6dynarray5.h View 1 chunk +0 lines, -4 lines 0 comments Download
M gcc/testsuite/g++.dg/pph/x6dynarray6.h View 1 chunk +0 lines, -2 lines 0 comments Download
M gcc/testsuite/g++.dg/pph/x7dynarray5.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 3
Diego Novillo
The main problem fixed here is that name lookups for class methods uses a binary ...
12 years, 10 months ago (2011-09-09 20:37:20 UTC) #1
gcharette1
On Fri, Sep 9, 2011 at 4:37 PM, Diego Novillo <dnovillo@google.com> wrote: > > The ...
12 years, 10 months ago (2011-09-10 15:30:38 UTC) #2
Diego Novillo
12 years, 10 months ago (2011-09-12 12:06:57 UTC) #3
On Sat, Sep 10, 2011 at 11:30, Gabriel Charette <gcharette1@gmail.com> wrote:
> On Fri, Sep 9, 2011 at 4:37 PM, Diego Novillo <dnovillo@google.com> wrote:
>>
>> The main problem fixed here is that name lookups for class methods
>> uses a binary search that assumes that the methods in
>> CLASSTYPE_METHOD_VEC are sorted by pointer value.
>>
>> Since the reader typically allocates trees in a different pattern than
>> the writer, it is common for the symbols in the vector to have
>> different pointer values, so the order used by the writer is different
>> than the reader.
>>
>> This was causing us to fail name lookups when generating the pph image
>> for x6dynarray5.h and x6dynarray6.h.
>>
>> To fix this, I am making finish_struct_methods an extern function and
>> calling it after reading a type that has a CLASSTYPE_METHOD_VEC.
>>
>> This exposed another failure that was simple enough to roll in
>> together with this patch.  We should not emit preloaded symbols when
>> writing the names in the global namespace.  This was causing a
>> DECL_CHAIN cycle.  I added a new filter PPHF_NO_PREFS to skip the
>> preloaded symbols when needed.
>>
>
> The loop in the DECL_CHAIN in x6dynarray5 was already there before.
> This is why I had introduced the preloaded cache to do something along
> those lines.
>
> However I don't think simply filtering it out is sufficient in this
> case.

It is for this case.  But you are right that it isn't for state
mutations like the one you describe later.  I'm trying to fix this by
detecting state changes between read-time and write-time.  I'm
thinking of checksumming the input tree and create a merge record when
we notice that the tree has mutated during write.  We would only
checksum the input when generating PPH images, so this would never
slow down the reader.

> Anyways, just can't help it, but keep reading all the patches coming in :)!

Heh.  I can send you the copyright assignments for you to fill out.
Don't think you can escape so easily ;)


Diego.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b