Questions tagged [calling-conventions]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-1 votes
1 answer
83 views

What specifies the agreement (i.e. the convention) of which registers are used to pass which arguments and to return which values?

In Computer Systems: a Programmer's Perspective: procedure calls may involve passing data as arguments, and returning from a procedure may also involve returning a value. With x86-64, most of these ...
Tim's user avatar
  • 5,425
4 votes
1 answer
229 views

Is there a programming language which requires argument qualifiers (reference/value) to be specified at the call point?

For quite a long time now, I have been using a calling convention from C++ google style guide, which boils down to the following: "[for a function] arguments are values or const references while ...
Anton Daneyko's user avatar
7 votes
2 answers
5k views

What's the REAL benefit of using CDECL? (more specifically pushing instead of reg-ing)

So, I'm learning assembly, and I've come to know the ABIs and i got some basics tests working using the cdecl calling convention to use the c's stdlib under nasm. But I've seen other Calling ...
Nande's user avatar
  • 173
33 votes
6 answers
9k views

Why do programs use call stacks, if nested function calls can be inlined?

Why not have the compiler take a program like this: function a(b) { return b^2 }; function c(b) { return a(b) + 5 }; and convert it into a program like this: function c(b) { return b^2 + 5 }; ...
moonman239's user avatar
  • 2,043
5 votes
4 answers
4k views

What argument passing mechanism does python use, and where is this officially documented?

As far as I am aware, python is generally referred to as 'call-by-sharing', but does it implement this with call-by-value (like Java) or call-by-reference? or something else? I would appreciate if ...
Tim Atkinson's user avatar
5 votes
2 answers
1k views

Where is it specified that Java is call by value?

I know that Java is by default call-by-value but I am not sure where in the Java Language Specification this is addressed. Google searching only seems to find me unofficial sources but never points to ...
Tim Atkinson's user avatar
5 votes
2 answers
8k views

Where does `this` go in a x64 thiscall?

So I understand that thiscall doesn't really exist in x64 programming. However, I can't really find any definitive explanation as to where the this pointer is put to be passed to the callee. Is a x64 ...
Qix - MONICA WAS MISTREATED's user avatar
9 votes
2 answers
14k views

Which arguments pass by value and which pass by reference in Java?

I am starting to learn Java with the Java Trails tutorials offered by Oracle. I am in the section where it talks about passing arguments to methods The Java™ Tutorials: Passing Information to a Method ...
Daniel Scocco's user avatar