1 !/**************************************************************
2 ! *
3 ! * Licensed to the Apache Software Foundation (ASF) under one
4 ! * or more contributor license agreements.  See the NOTICE file
5 ! * distributed with this work for additional information
6 ! * regarding copyright ownership.  The ASF licenses this file
7 ! * to you under the Apache License, Version 2.0 (the
8 ! * "License"); you may not use this file except in compliance
9 ! * with the License.  You may obtain a copy of the License at
10 ! *
11 ! *   http://www.apache.org/licenses/LICENSE-2.0
12 ! *
13 ! * Unless required by applicable law or agreed to in writing,
14 ! * software distributed under the License is distributed on an
15 ! * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 ! * KIND, either express or implied.  See the License for the
17 ! * specific language governing permissions and limitations
18 ! * under the License.
19 ! *
20 ! *************************************************************/
21 
22 
23 
24 .global callVirtualMethod
25 .align 8
26 callVirtualMethod:
27     ! %o0: unsigned long function
28     ! %o1: unsigned long * stack
29     ! %o2: sal_Int32 excess
30     add %o2, 176, %o3
31     neg %o3
32     save %sp, %o3, %sp
33     ldx [%i1 + 0 * 8], %o0
34     ldx [%i1 + 1 * 8], %o1
35     ldx [%i1 + 2 * 8], %o2
36     ldx [%i1 + 3 * 8], %o3
37     tst %i2
38     bz,pt %xcc, 1f
39     ldx [%i1 + 4 * 8], %o4
40     add %i1, 6 * 8, %l0
41     add %sp, 2047 + 176, %l1
42 0:  deccc 8, %i2
43     ldx [%l0 + %i2], %l2
44     bnz,pt %xcc, 0b
45     stx %l2, [%l1 + %i2]
46 1:  call %i0
47     ldx [%i1 + 5 * 8], %o5
48     stx %o0, [%i1 + 0 * 8]
49     stx %o1, [%i1 + 1 * 8]
50     stx %o2, [%i1 + 2 * 8]
51     stx %o3, [%i1 + 3 * 8]
52     ret
53     restore
54 .size callVirtualMethod, . - callVirtualMethod
55 .type callVirtualMethod, #function
56