76

Re: Virtual method + Exceptions in A C ++

semen.s.semen wrote:

As there the environment of did not conduct - the method of the child

will be caused When break spears for (not) virtuality under an efficiency banner crucify an overhead charge of the virtual call.
In a situation when the execution environment  a method call and even built in a method body in usage place -  that there in a byte-code.
The result of execution will be identical, and speed will be reached without additional efforts from the programmer.

77

Re: Virtual method + Exceptions in A C ++

Basil A. Sidorov wrote:

it is passed...
When break spears for (not) virtuality under an efficiency banner crucify an overhead charge of the virtual call.
In a situation when the execution environment  a method call and even built in a method body in usage place -  that there in a byte-code.
The result of execution will be identical, and speed will be reached without additional efforts from the programmer.

Here in Java on  a method  smilelol

78

Re: Virtual method + Exceptions in A C ++

that sensation when came to ask to teach pluses in summary all planted on  smile

79

Re: Virtual method + Exceptions in A C ++

Anatoly Moskovsky wrote:

invokevirtual for a call final a method, which ostensibly not virtual.
Miracles))

See, even in Java there are the virtual methods!

80

Re: Virtual method + Exceptions in A C ++

Basil A. Sidorov wrote:

it is passed...
The execution environment can and  and build in a call of a final method.
It is provided already in JLS.

Can. It all can. Even  can.
It makes a method not VIRTUAL? No.
In Java ALL calls of nonstatic methods become on the basis of the dynamic
Object type with which it is caused.
I.e. ALL nonstatic methods of classes "virtual" though even concepts such at them in language are not present.
P.S. With final I did not understand an example. I am assured that will be caused final a method from B, from the successor as final forbids to redefine the given method more low on hierarchy, but in the ancestor this method remains same to "virtual", as well as was.
Here if in A, in the ancestor it was final it would be possible to expect not virtual call (absence of dispatching on dynamic type of object)

81

Re: Virtual method + Exceptions in A C ++

MasterZiv wrote:

Can. It all can. Even  can.
It makes a method not VIRTUAL? No.

If,  to read the specification there it is specified that "the compiler or a runtime environment".
On a byte-code, nevertheless, it is visible that the compiler puts invokevirtual. The reason of it is simple.
For the environment with dynamic configuration on demand it is impossible to prove statically that  and embedding are admissible in all scenarios of execution.
Thus, the compiler simply is not manufactured, trying to prove the indemonstrable.
Let's present that somebody possessing a sufficient level of qualification and persistence, generates correct byte-code in which will be invokespecial with a lambda or something such.
The method ceases to be virtual?
P.S. As far as I know, for pluses too there can be a similar optimization.
To consider methods optimized thus as virtual upon the declaration and to presence at the virtual method table or not virtual on a method of an actual call?

82

Re: Virtual method + Exceptions in A C ++

Basil A. Sidorov wrote:

P.S. As far as I know, for pluses too there can be a similar optimization.
To consider methods optimized thus as virtual upon the declaration and to presence at the virtual method table or not virtual on a method of an actual call?

If to me does not change storage, decomposition in "pluses" is used on-O3.

83

Re: Virtual method + Exceptions in A C ++

Basil A. Sidorov wrote:

we Present that somebody possessing a sufficient level of qualification and persistence, generates correct byte-code in which will be invokespecial with a lambda or something such.
The method ceases to be virtual?

No, does not cease.
But you already in my opinion grew exited  all reverse so I will not argue with you.