Call site
In programming, a call site of a function or subroutine is the location (line of code) where the function is called (or may be called, through dynamic dispatch). A call site is where zero or more arguments are passed to the function, and zero or more return values are received.
Example
// this is a function definition function sqr(x) { return x * x; }
function foo() { // these are two call sites of function sqr in this function a = sqr(b); c = sqr(b); }
Assembler example
IBM/360 or Z/Architecture
* (usually) external call.... R13 usually points to a save area for general purpose registers beforehand * and R1 points to a list of addresses of parameters (if any) LA R1,=A(B) point to (address of) variable 'B' L R15,=A(SQR) Load pointer (address constant) to separately compiled/assembled subroutine BALR R14,R15 Go to subroutine, which returns - usually at zero displacement on R14 * internal call (usually much smaller overhead and possibly 'known' parameters) BAL R14,SQR Go to program label and return
In some occasions, return is an efficient method of indicating success or failure. return may be accomplished by returning at +0 or +4,+8, +12, etc. requiring a small branch table at the return point - to go directly to process the case (as in HLL Switch statement).
BAL R14,SQR Go to program label and return (using offset on R14 as return address) B FAIL (RET+0) - SOMETHING WRONG * (RET+4) - O.K.
Conventionally however, a return code is set in R15 (0=OK, 4= failure, or similar ..) but requiring a separate instruction to test R15 or use directly as a branch index.
gollark: Or you didn't pray right.
gollark: I think the main objection is just lack of informed consent there.
gollark: I emailed god, but no response back yet.
gollark: If the software updates are made on a different continent and you can apply them in less than about 50ms, you don't even need the time travel - just transmit them directly to your computer via a trans-crustal neutrino beam. Neutrinos travel only very slightly slower than light, and can take a more direct path because they don't interact much with matter, while the fibre-optic lines for internet traffic only let light go at 0.6c or something, and use less direct paths, and have routing overhead.
gollark: You did not specify that they were stolen from evil people, and possibly yes.
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.