RFR: 8248411: [aarch64] Insufficient error handling when CodeBuffer is exhausted

Patric Hedlin phedlin at openjdk.java.net
Thu Oct 22 16:03:15 UTC 2020


On Thu, 22 Oct 2020 14:15:29 GMT, Patric Hedlin <phedlin at openjdk.org> wrote:

>>> The AArch64 changes are ok.
>>> <rant> I am not at all keen on the many format-only changes that are included in this patch since they introduce a lot of changed lines for the sole and rather specious benefit of adherence to a questionable orthographic authority. That's especially so with the relatively unscryable (sic) changes in output.cpp that modify declarations of the form `Foo *foo` to `Foo* foo`. One is initially left wondering what has changed only, at penny-drop, to replace that feeling with equal wonder as to why it was worth bothering, especially as there remain many thousands more such editorial opportunities. Meanwhile the substantive signal that constitutes the real patch is lost amid this noise. Of course, you may continue tilting at this windmill if you really wish to.</rant>
>> 
>> I agree. I'm happy enough with code being tidied up as we go along, but not with a patch like this one, where it's not even clear that the result is an improvement. Also, it doesn't make sense to "tidy up" code that is nothing to do with the patch. 
>> 
>> Changing  `Foo *foo` to `Foo* foo` is simply wrong. The * operator binds to the right, so something like `int* a, b` looks like a and b are pointers; they're not. That's why we write `int *a, b` : we should be writing for the reader.
>
> May I suggest the following to lessen the burden of mundane white-space edits.
> 
> ![image](https://user-images.githubusercontent.com/37185447/96883432-b3369400-1480-11eb-9bf9-2f1fd9ed9777.png)

So what about the `Foo* p` vs `Foo *p`? In short, I totally disagree. `Foo* p` supports the reading of `p` as Foo-pointer (or int-pointer, or void-pointer) which also emphasises the fact that the base type is vital to the operations available through/on `p`. This view is obscured by `Foo *p` (or `Foo p, *q`), suggesting "a pointer" is a more general concept, free of semantics imposed by its base type. For the same reason, I write `int* f()` not `int *f()`, not ever. And "we" don't write `int* p, q` nor do "we" write `int p, *q` since not only need pointers be initialised but more importantly, it's a truly bad idea to introduce different semantic entities in a single declaration. "We" write code to be read, and understood, by humans.

May I also offer the following explanation to why the `*` (pointer-decl) operator binds to the right. Is it perhaps due to the fact that the original K&R C-syntax predates the first official standard by roughly 20 years, syntax picked-up from the B language (which only had one "pointer type", the address of an array, and no type-system), that we use the unary prefix "indirection operator"; `*v` ?

In any case, I thank you both for reviewing the code (well, I guess 'aph' didn't actually review) even though it seems to upset the two of you, and despite the fact that I don't find the ranting particularly constructive.

Thanks also to Vladimir.

-------------

PR: https://git.openjdk.java.net/jdk/pull/765


More information about the hotspot-dev mailing list