- add sources.
[platform/framework/web/crosswalk.git] / src / third_party / tcmalloc / vendor / src / windows / shortproc.asm
1 ; Copyright (c) 2011, Google Inc.
2 ; All rights reserved.
3
4 ; Redistribution and use in source and binary forms, with or without
5 ; modification, are permitted provided that the following conditions are
6 ; met:
7
8 ;     * Redistributions of source code must retain the above copyright
9 ; notice, this list of conditions and the following disclaimer.
10 ;     * Redistributions in binary form must reproduce the above
11 ; copyright notice, this list of conditions and the following disclaimer
12 ; in the documentation and/or other materials provided with the
13 ; distribution.
14 ;     * Neither the name of Google Inc. nor the names of its
15 ; contributors may be used to endorse or promote products derived from
16 ; this software without specific prior written permission.
17
18 ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 ; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 ; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 ; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 ; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 ; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 ; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 ; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 ;
30 ; ---
31 ; Author: Scott Francis
32 ;
33 ; Unit tests for PreamblePatcher\r
34  \r
35 .MODEL small\r
36  \r
37 .CODE\r
38 \r
39 TooShortFunction PROC\r
40         ret\r
41 TooShortFunction ENDP\r
42 \r
43 JumpShortCondFunction PROC\r
44         test cl, 1\r
45         jnz jumpspot\r
46         int 3\r
47         int 3\r
48         int 3\r
49         int 3\r
50         int 3\r
51         int 3\r
52         int 3\r
53         int 3\r
54         int 3\r
55         int 3\r
56         int 3\r
57         int 3\r
58         int 3\r
59         int 3\r
60         int 3\r
61         int 3\r
62         int 3\r
63         int 3\r
64         int 3\r
65         int 3\r
66         int 3\r
67         int 3\r
68         int 3\r
69         int 3\r
70         int 3\r
71         int 3\r
72         int 3\r
73         int 3\r
74 jumpspot:\r
75         nop\r
76         nop\r
77         nop\r
78         nop\r
79         mov rax, 1\r
80         ret\r
81 JumpShortCondFunction ENDP\r
82 \r
83 JumpNearCondFunction PROC\r
84         test cl, 1\r
85         jnz jumpspot\r
86         mov rdx, 0ffff1111H\r
87         mov rdx, 0ffff1111H\r
88         mov rdx, 0ffff1111H\r
89         mov rdx, 0ffff1111H\r
90         mov rdx, 0ffff1111H\r
91         mov rdx, 0ffff1111H\r
92         mov rdx, 0ffff1111H\r
93         mov rdx, 0ffff1111H\r
94         mov rdx, 0ffff1111H\r
95         mov rdx, 0ffff1111H\r
96         mov rdx, 0ffff1111H\r
97         mov rdx, 0ffff1111H\r
98         mov rdx, 0ffff1111H\r
99         mov rdx, 0ffff1111H\r
100         mov rdx, 0ffff1111H\r
101         mov rdx, 0ffff1111H\r
102         mov rdx, 0ffff1111H\r
103         mov rdx, 0ffff1111H\r
104         mov rdx, 0ffff1111H\r
105         mov rdx, 0ffff1111H\r
106 jumpspot:\r
107         nop\r
108         nop\r
109         mov rax, 1\r
110         ret\r
111 JumpNearCondFunction ENDP\r
112 \r
113 JumpAbsoluteFunction PROC\r
114         test cl, 1\r
115         jmp jumpspot\r
116         mov rdx, 0ffff1111H\r
117         mov rdx, 0ffff1111H\r
118         mov rdx, 0ffff1111H\r
119         mov rdx, 0ffff1111H\r
120         mov rdx, 0ffff1111H\r
121         mov rdx, 0ffff1111H\r
122         mov rdx, 0ffff1111H\r
123         mov rdx, 0ffff1111H\r
124         mov rdx, 0ffff1111H\r
125         mov rdx, 0ffff1111H\r
126         mov rdx, 0ffff1111H\r
127         mov rdx, 0ffff1111H\r
128         mov rdx, 0ffff1111H\r
129         mov rdx, 0ffff1111H\r
130         mov rdx, 0ffff1111H\r
131         mov rdx, 0ffff1111H\r
132         mov rdx, 0ffff1111H\r
133         mov rdx, 0ffff1111H\r
134         mov rdx, 0ffff1111H\r
135         mov rdx, 0ffff1111H\r
136         mov rdx, 0ffff1111H\r
137         mov rdx, 0ffff1111H\r
138         mov rdx, 0ffff1111H\r
139         mov rdx, 0ffff1111H\r
140         mov rdx, 0ffff1111H\r
141         mov rdx, 0ffff1111H\r
142         mov rdx, 0ffff1111H\r
143 jumpspot:\r
144         nop\r
145         nop\r
146         mov rax, 1\r
147         ret\r
148 JumpAbsoluteFunction ENDP\r
149 \r
150 CallNearRelativeFunction PROC\r
151         test cl, 1\r
152         call TooShortFunction\r
153         mov rdx, 0ffff1111H\r
154         mov rdx, 0ffff1111H\r
155         mov rdx, 0ffff1111H\r
156         mov rdx, 0ffff1111H\r
157         mov rdx, 0ffff1111H\r
158         mov rdx, 0ffff1111H\r
159         mov rdx, 0ffff1111H\r
160         mov rdx, 0ffff1111H\r
161         mov rdx, 0ffff1111H\r
162         mov rdx, 0ffff1111H\r
163         nop\r
164         nop\r
165         nop\r
166         ret\r
167 CallNearRelativeFunction ENDP\r
168 \r
169 END\r