Skip to main content

Phoneme Advanced Questions

4 replies [Last post]
fivecat
Offline
Joined: 2007-02-07

Hi, Everyone:
There are the following C Language codes in the PhoneMe Advanced Vision. But i did

not understand the mean of "&&". Please teach me. thanks a lot.

the Code:

enum CVMOpcode {
opc_nop = 0,
...
};

#define opc_0 opc_nop
...

const static void* const opclabels_data[256] = {
&&opc_0,
...
};

const void* const *opclabels = &opclabels_data[0];

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
cjplummer
Offline
Joined: 2006-10-16

Very old measurements (about 7 years ago) I believe showed a 5% to 10% interperter performance gain when using &&. Note that with the JIT enable, I doubt you will noticed any gains, excpect maybe very slight startup time improvements.

Chris

fivecat
Offline
Joined: 2007-02-07

HI:
Thank you very much!
if we did not use the method of "&&" while we used the method of "switch" sentence, how much is the influence to performance of programme between the obove two methods?

Hinkmond Wong

Hi Fivecat,

phonemeadvanced@mobileandembedded.org wrote:
> HI:
> Thank you very much!
> if we did not use the method of "&&" while we used the method of "switch" sentence, how much is the influence to performance of programme between the obove two methods?

I have no idea. Please try some experiments on your own and let us all
know what you find out.

Thanks,
Hinkmond

---------------------------------------------------------------------
To unsubscribe, e-mail: advanced-unsubscribe@phoneme.dev.java.net
For additional commands, e-mail: advanced-help@phoneme.dev.java.net

Hinkmond Wong

Hi Fivecat,

phonemeadvanced@mobileandembedded.org wrote:
> Hi, Everyone:
> There are the following C Language codes in the PhoneMe Advanced Vision. But i did
>
> not understand the mean of "&&". Please teach me. thanks a lot.
>
> the Code:
>
> enum CVMOpcode {
> opc_nop = 0,
> ...
> };
>
> #define opc_0 opc_nop
> ...
>
> const static void* const opclabels_data[256] = {
> &&opc_0,
> ...
> };
>
>
> const void* const *opclabels = &opclabels_data[0];
>
>

From the Web:
-----
The label value operator && returns the address of its operand, which
must be a label defined in the current function or a containing
function. The value is a constant of type void* and should be used only
in a computed goto statement. The feature is an extension to C and C++,
implemented to facilitate porting programs developed with GNU C...
-----

Hinkmond

---------------------------------------------------------------------
To unsubscribe, e-mail: advanced-unsubscribe@phoneme.dev.java.net
For additional commands, e-mail: advanced-help@phoneme.dev.java.net