~ubuntu-branches/ubuntu/gutsy/virtualbox-ose/gutsy

« back to all changes in this revision

Viewing changes to src/libs/xpcom18a4/xpcom/reflect/xptcall/src/md/win32/xptcinvoke_asm_alpha.s

  • Committer: Bazaar Package Importer
  • Author(s): Steve Kowalik
  • Date: 2007-09-08 16:44:58 UTC
  • Revision ID: james.westby@ubuntu.com-20070908164458-wao29470vqtr8ksy
Tags: upstream-1.5.0-dfsg2
ImportĀ upstreamĀ versionĀ 1.5.0-dfsg2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.text
 
2
.globl  invoke_count_words
 
3
.globl  invoke_copy_to_stack
 
4
 
 
5
#define v0 $0
 
6
#define t0 $1
 
7
#define t1 $2
 
8
#define t2 $3
 
9
#define t3 $4
 
10
#define s0 $9
 
11
#define fp $15
 
12
#define a0 $16
 
13
#define a1 $17
 
14
#define a2 $18
 
15
#define a3 $19
 
16
#define a4 $20
 
17
#define a5 $21
 
18
#define t9 $23
 
19
#define ra $26
 
20
#define gp $29
 
21
#define sp $30
 
22
#define zero $31
 
23
#define f0 $f0
 
24
 
 
25
#define LOCALSZ  7
 
26
#define NARG     2
 
27
#define SZREG    8
 
28
#define FRAMESZ  ((NARG+LOCALSZ)*SZREG)
 
29
RAOFF=FRAMESZ-(1*SZREG)
 
30
A0OFF=FRAMESZ-(2*SZREG)
 
31
A1OFF=FRAMESZ-(3*SZREG)
 
32
A2OFF=FRAMESZ-(4*SZREG)
 
33
A3OFF=FRAMESZ-(5*SZREG)
 
34
S0OFF=FRAMESZ-(6*SZREG)
 
35
GPOFF=FRAMESZ-(7*SZREG)
 
36
 
 
37
//
 
38
// Nested
 
39
// XPTC__InvokebyIndex( that, methodIndex, paramCount, params)
 
40
//                       a0       a1         a2          a3
 
41
//
 
42
 .text
 
43
 .align  4
 
44
 .globl  XPTC__InvokebyIndex
 
45
 .ent    XPTC__InvokebyIndex,0
 
46
XPTC__InvokebyIndex:
 
47
 .frame  sp, FRAMESZ, ra
 
48
 subl    sp,FRAMESZ,sp  // allocate stack space for structure
 
49
 stq ra, RAOFF(sp)
 
50
 stq a0, A0OFF(sp)
 
51
 stq a1, A1OFF(sp)
 
52
 stq a2, A2OFF(sp)
 
53
 stq a3, A3OFF(sp)
 
54
 stq s0, S0OFF(sp)
 
55
// stq gp, GPOFF(sp)  Don't think I am to save gp
 
56
 
 
57
 // invoke_count_words(paramCount, params)
 
58
 bis a2,zero,a0  // move a2 into a0
 
59
 bis a3,zero,a1  // move a3 into a1
 
60
 bsr ra,invoke_count_words
 
61
 
 
62
 // invoke_copy_to_stack
 
63
 ldq a1, A2OFF(sp)  // a1 = paramCount
 
64
 ldq a2, A3OFF(sp)  // a2 = params
 
65
 
 
66
 // save sp before we copy the params to the stack
 
67
 bis sp,zero,t0  // t0 = sp
 
68
 
 
69
 // assume full size of 8 bytes per param to be safe
 
70
 sll v0,4,v0   //v0 = 8 bytes * num params
 
71
 subl sp,v0,sp  //sp = sp - v0
 
72
 bis sp,zero,a0  //a0 = param stack address
 
73
 
 
74
 // create temporary stack space to write int and fp regs
 
75
 subl sp,64,sp  //sp = sp -64 // (64 = 8 regs of eight bytes)
 
76
 bis sp,zero,a3  // a3 = sp
 
77
 
 
78
 // save the old sp and save the arg stack
 
79
 subl sp,16,sp  //sp = sp -16
 
80
 stq t0,0(sp)
 
81
 stq a0,8(sp)
 
82
 // copy the param into the stack areas
 
83
 bsr ra,invoke_copy_to_stack
 
84
 
 
85
 ldq t3,8(sp)  // get previous a0
 
86
 ldq sp,0(sp)  // get orig sp back
 
87
 
 
88
 ldq a0,A0OFF(sp)  // a0 = that
 
89
 ldq a1,A1OFF(sp)  // a1 = methodIndex
 
90
 
 
91
 // calculate jmp address from method index
 
92
 ldl t1,0(a0) // t1 = *that
 
93
 sll a1,2,a1  // a1 = 4*index
 
94
 addl t1,a1,t9
 
95
 ldl t9,0(t9) // t9=*(that + 4*index)
 
96
 
 
97
 // get register save area from invoke_copy_to_stack
 
98
 subl t3,64,t1
 
99
 
 
100
 // a1..a5 and f17..f21 should now be set to what
 
101
 // invoke_copy_to_stack told us. skip a0 and f16
 
102
 // because that's the "this" pointer
 
103
 
 
104
 ldq a1,0(t1)
 
105
 ldq a2,8(t1)
 
106
 ldq a3,16(t1)
 
107
 ldq a4,24(t1)
 
108
 ldq a5,32(t1)
 
109
 
 
110
 ldt $f17,0(t1)
 
111
 ldt $f18,8(t1)
 
112
 ldt $f19,16(t1)
 
113
 ldt $f20,24(t1)
 
114
 ldt $f21,32(t1)
 
115
 
 
116
 // save away our stack point and create
 
117
 // the stack pointer for the function
 
118
 bis sp,zero,s0
 
119
 bis t3,zero,sp
 
120
 jsr ra,(t9)
 
121
 bis s0,zero,sp
 
122
 ldq ra,RAOFF(sp)
 
123
 ldq s0,S0OFF(sp)
 
124
 addl sp,FRAMESZ,sp
 
125
 ret
 
126
 
 
127
.end    XPTC__InvokebyIndex
 
128