Merge mozilla-central and tracemonkey. (a=blockers)
[mozilla-central.git] / js / src / imacros.jsasm
blob798adac78d598f9f0b1cecd31f02537ea71dc595
1 # -*- indent-tabs-mode: nil; -*-
2 # vim: set sw=4 ts=8 et tw=78 ft=asm:
3 # ***** BEGIN LICENSE BLOCK *****
4 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 # The contents of this file are subject to the Mozilla Public License Version
7 # 1.1 (the "License"); you may not use this file except in compliance with
8 # the License. You may obtain a copy of the License at
9 # http://www.mozilla.org/MPL/
11 # Software distributed under the License is distributed on an "AS IS" basis,
12 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 # for the specific language governing rights and limitations under the
14 # License.
16 # The Original Code is the TraceMonkey IMacro Assembler.
18 # The Initial Developer of the Original Code is
19 # Brendan Eich <brendan@mozilla.org>.
20 # Portions created by the Initial Developer are Copyright (C) 2008
21 # the Initial Developer. All Rights Reserved.
23 # Contributor(s):
25 # Alternatively, the contents of this file may be used under the terms of
26 # either the GNU General Public License Version 2 or later (the "GPL"), or
27 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 # in which case the provisions of the GPL or the LGPL are applicable instead
29 # of those above. If you wish to allow use of your version of this file only
30 # under the terms of either the GPL or the LGPL, and not to allow others to
31 # use your version of this file under the terms of the MPL, indicate your
32 # decision by deleting the provisions above and replace them with the notice
33 # and other provisions required by the GPL or the LGPL. If you do not delete
34 # the provisions above, a recipient may use your version of this file under
35 # the terms of any one of the MPL, the GPL or the LGPL.
37 # ***** END LICENSE BLOCK *****
39 .igroup equality JSOP_EQ-JSOP_NE
41     .imacro any_obj                     # any obj
42         dup                             # any obj obj
43         dup                             # any obj obj obj
44         getprop valueOf                 # any obj obj valueOf
45         ifprimtop 1                     # any obj obj valueOf
46         swap                            # any obj valueOf obj
47         string void                     # any obj valueOf obj "void"
48         call 1                          # any obj rval
49         ifprimtop 3                     # any obj rval
50         pop                             # any obj
51         dup                             # any obj obj
52         goto 2
53 1:      pop                             # any obj obj
54 2:      callprop toString               # any obj toString obj
55         call 0                          # any obj rval
56         primtop (JSTYPE_NUMBER)         # any obj rval
57 3:      swap                            # any rval obj
58         pop                             # any rval
59         imacop                          # eqval
60         stop
61     .end
63     .imacro obj_any                     # obj any
64         swap                            # any obj
65         dup                             # any obj obj
66         dup                             # any obj obj obj
67         getprop valueOf                 # any obj obj valueOf
68         ifprimtop 1                     # any obj obj valueOf
69         swap                            # any obj valueOf obj
70         string void                     # any obj valueOf obj "void"
71         call 1                          # any obj lval
72         ifprimtop 3                     # any obj lval
73         pop                             # any obj
74         dup                             # any obj obj
75         goto 2
76 1:      pop                             # any obj obj
77 2:      callprop toString               # any obj toString obj
78         call 0                          # any obj lval
79         primtop (JSTYPE_NUMBER)         # any obj rval
80 3:      swap                            # any lval obj
81         pop                             # any lval
82         swap                            # lval any
83         imacop                          # eqval
84         stop
85     .end
87 .end equality
89 # A single range, split up like so to test groups over multiple ranges of ops
90 .igroup binary JSOP_BITOR-JSOP_BITAND,JSOP_EQ-JSOP_DIV,JSOP_MOD
92     .imacro any_obj                     # any obj
93         dup                             # any obj obj
94         dup                             # any obj obj obj
95         getprop valueOf                 # any obj obj valueOf
96         ifprimtop 1                     # any obj obj valueOf
97         swap                            # any obj valueOf obj
98         string number                   # any obj valueOf obj "number"
99         call 1                          # any obj rval
100         ifprimtop 3                     # any obj rval
101         pop                             # any obj
102         dup                             # any obj obj
103         goto 2
104 1:      pop                             # any obj obj
105 2:      callprop toString               # any obj toString obj
106         call 0                          # any obj rval
107         primtop (JSTYPE_NUMBER)         # any obj rval
108 3:      swap                            # any rval obj
109         pop                             # any rval
110         imacop                          # bval
111         stop
112     .end
114     .imacro obj_any                     # obj any
115         swap                            # any obj
116         dup                             # any obj obj
117         dup                             # any obj obj obj
118         getprop valueOf                 # any obj obj valueOf
119         ifprimtop 1                     # any obj obj valueOf
120         swap                            # any obj valueOf obj
121         string number                   # any obj valueOf obj "number"
122         call 1                          # any obj lval
123         ifprimtop 3                     # any obj lval
124         pop                             # any obj
125         dup                             # any obj obj
126         goto 2
127 1:      pop                             # any obj obj
128 2:      callprop toString               # any obj toString obj
129         call 0                          # any obj lval
130         primtop (JSTYPE_NUMBER)         # any obj lval
131 3:      swap                            # any lval obj
132         pop                             # any lval
133         swap                            # lval any
134         imacop                          # bval
135         stop
136     .end
138     .imacro obj_obj                     # obj1 obj2
139         swap                            # obj2 obj1
140         dup                             # obj2 obj1 obj1
141         dup                             # obj2 obj1 obj1 obj1
142         getprop valueOf                 # obj2 obj1 obj1 valueOf
143         ifprimtop 1                     # obj2 obj1 obj1 valueOf
144         swap                            # obj2 obj1 valueOf obj1
145         string number                   # obj2 obj1 valueOf obj1 "number"
146         call 1                          # obj2 obj1 lval
147         ifprimtop 3                     # obj2 obj1 lval
148         pop                             # obj2 obj1
149         dup                             # obj2 obj1 obj1
150         goto 2
151 1:      pop                             # obj2 obj1 obj1
152 2:      callprop toString               # obj2 obj1 toString obj1
153         call 0                          # obj2 obj1 lval
154         primtop (JSTYPE_NUMBER)         # obj2 obj1 lval
155 3:      swap                            # obj2 lval obj1
156         pop                             # obj2 lval
157         swap                            # lval obj2
158         dup                             # lval obj1 obj1
159         dup                             # lval obj obj obj
160         getprop valueOf                 # lval obj obj valueOf
161         ifprimtop 4                     # lval obj obj valueOf
162         swap                            # lval obj valueOf obj
163         string number                   # lval obj valueOf obj "number"
164         call 1                          # lval obj rval
165         ifprimtop 6                     # lval obj rval
166         pop                             # lval obj
167         dup                             # lval obj obj
168         goto 5
169 4:      pop                             # lval obj obj
170 5:      callprop toString               # lval obj toString obj
171         call 0                          # lval obj rval
172         primtop (JSTYPE_NUMBER)         # lval obj rval
173 6:      swap                            # lval rval obj
174         pop                             # lval rval
175         imacop                          # bval
176         stop
177     .end
179 .end binary
181 .igroup add JSOP_ADD
183     .imacro any_obj                     # any obj
184         dup                             # any obj obj
185         dup                             # any obj obj obj
186         getprop valueOf                 # any obj obj valueOf
187         ifprimtop 1                     # any obj obj valueOf
188         swap                            # any obj valueOf obj
189         string void                     # any obj valueOf obj "void"
190         call 1                          # any obj rval
191         ifprimtop 3                     # any obj rval
192         pop                             # any obj
193         dup                             # any obj obj
194         goto 2
195 1:      pop                             # any obj obj
196 2:      callprop toString               # any obj toString obj
197         call 0                          # any obj rval
198         primtop (JSTYPE_VOID)           # any obj rval
199 3:      swap                            # any rval obj
200         pop                             # any rval
201         add                             # aval
202         stop
203     .end
205     .imacro obj_any                     # obj any
206         swap                            # any obj
207         dup                             # any obj obj
208         dup                             # any obj obj obj
209         getprop valueOf                 # any obj obj valueOf
210         ifprimtop 1                     # any obj obj valueOf
211         swap                            # any obj valueOf obj
212         string void                     # any obj valueOf obj "void"
213         call 1                          # any obj lval
214         ifprimtop 3                     # any obj lval
215         pop                             # any obj
216         dup                             # any obj obj
217         goto 2
218 1:      pop                             # any obj obj
219 2:      callprop toString               # any obj toString obj
220         call 0                          # any obj lval
221         primtop (JSTYPE_VOID)           # any obj lval
222 3:      swap                            # any lval obj
223         pop                             # any lval
224         swap                            # lval any
225         add                             # aval
226         stop
227     .end
229     .imacro obj_obj                     # obj1 obj2
230         swap                            # obj2 obj1
231         dup                             # obj2 obj1 obj1
232         dup                             # obj2 obj1 obj1 obj1
233         getprop valueOf                 # obj2 obj1 obj1 valueOf
234         ifprimtop 1                     # obj2 obj1 obj1 valueOf
235         swap                            # obj2 obj1 valueOf obj1
236         string void                     # obj2 obj1 valueOf obj1 "void"
237         call 1                          # obj2 obj1 lval
238         ifprimtop 3                     # obj2 obj1 lval
239         pop                             # obj2 obj1
240         dup                             # obj2 obj1 obj1
241         goto 2
242 1:      pop                             # obj2 obj1 obj1
243 2:      callprop toString               # obj2 obj1 toString obj1
244         call 0                          # obj2 obj1 lval
245         primtop (JSTYPE_VOID)           # obj2 obj1 lval
246 3:      swap                            # obj2 lval obj1
247         pop                             # obj2 lval
248         swap                            # lval obj2
249         dup                             # lval obj obj
250         dup                             # lval obj obj obj
251         getprop valueOf                 # lval obj obj valueOf
252         ifprimtop 4                     # lval obj obj valueOf
253         swap                            # lval obj valueOf obj
254         string void                     # lval obj valueOf obj "void"
255         call 1                          # lval obj rval
256         ifprimtop 6                     # lval obj rval
257         pop                             # lval obj
258         dup                             # lval obj obj
259         goto 5
260 4:      pop                             # lval obj obj
261 5:      callprop toString               # lval obj toString obj
262         call 0                          # lval obj rval
263         primtop (JSTYPE_VOID)           # lval obj rval
264 6:      swap                            # lval rval obj
265         pop                             # lval rval
266         add                             # aval
267         stop
268     .end
270 .end add
272 .igroup unary JSOP_NEG-JSOP_POS
274     .imacro sign                        # obj
275         dup                             # obj obj
276         dup                             # obj obj obj
277         getprop valueOf                 # obj obj valueOf
278         ifprimtop 2                     # obj obj valueOf
279         swap                            # obj valueOf obj
280         string number                   # obj valueOf obj "number"
281         call 1                          # obj lval
282         ifprimtop 1                     # obj lval
283         pop                             # obj
284         dup                             # obj obj
285         goto 3
286 1:      swap                            # lval obj
287         pop                             # lval
288         goto 4
289 2:      pop                             # obj obj
290 3:      callprop toString               # obj toString obj
291         call 0                          # obj lval
292         primtop (JSTYPE_NUMBER)         # obj lval
293         swap                            # lval obj
294         pop                             # lval
295 4:      imacop                          # aval
296         stop
297     .end
299 .end unary
301 .igroup incelem JSOP_INCELEM,JSOP_ELEMINC
302     .imacro incelem                     # obj id
303         dup2                            # obj id obj id
304         getelem                         # obj id val
305         pos                             # obj id n
306         one                             # obj id n 1
307         add                             # obj id m
308         setelem                         # m
309         stop
310     .end
312     .imacro eleminc                     # obj id
313         dup2                            # obj id obj id
314         getelem                         # obj id val
315         pos                             # obj id n
316         dup                             # obj id n n
317         one                             # obj id n n 1
318         add                             # obj id n m
319         pick 3                          # id n m obj
320         pick 3                          # n m obj id
321         pick 2                          # n obj id m
322         setelem                         # n m
323         pop                             # n
324         stop
325     .end
326 .end incelem
328 .igroup decelem JSOP_DECELEM,JSOP_ELEMDEC
329     .imacro decelem                     # obj id
330         dup2                            # obj id obj id
331         getelem                         # obj id val
332         pos                             # obj id n
333         one                             # obj id n 1
334         sub                             # obj id m
335         setelem                         # m
336         stop
337     .end
339     .imacro elemdec                     # obj id
340         dup2                            # obj id obj id
341         getelem                         # obj id val
342         pos                             # obj id n
343         dup                             # obj id n n
344         one                             # obj id n n 1
345         sub                             # obj id n m
346         pick 3                          # id n m obj
347         pick 3                          # n m obj id
348         pick 2                          # n obj id m
349         setelem                         # n m
350         pop                             # n
351         stop
352     .end
353 .end decelem
355 .igroup call JSOP_CALL
357     .imacro String                          # String this obj
358         dup                                 # String this obj obj
359         dup                                 # String this obj obj obj
360         getprop toString                    # String this obj obj toString
361         ifprimtop 1                         # String this obj obj toString
362         swap                                # String this obj toString obj
363         call 0                              # String this obj rval
364         ifprimtop 3                         # String this obj rval
365         pop                                 # String this obj
366         dup                                 # String this obj obj
367         goto 2
368 1:      pop                                 # String this obj obj
369 2:      callprop valueOf                    # String this obj valueOf obj
370         string string                       # String this obj valueOf obj "string"
371         call 1                              # String this obj rval
372         primtop (JSTYPE_STRING)             # String this obj rval
373 3:      swap                                # String this rval obj
374         pop                                 # String this rval
375         call 1                              # str
376         stop                                # str
377     .end
379 .end call
381 .igroup new JSOP_NEW
383     .imacro String                          # String this obj
384         dup                                 # String this obj obj
385         dup                                 # String this obj obj obj
386         getprop toString                    # String this obj obj toString
387         ifprimtop 1                         # String this obj obj toString
388         swap                                # String this obj toString obj
389         call 0                              # String this obj rval
390         ifprimtop 3                         # String this obj rval
391         pop                                 # String this obj
392         dup                                 # String this obj obj
393         goto 2
394 1:      pop                                 # String this obj obj
395 2:      callprop valueOf                    # String this obj valueOf obj
396         string string                       # String this obj valueOf obj "string"
397         call 1                              # String this obj rval
398         primtop (JSTYPE_STRING)             # String this obj rval
399 3:      swap                                # String this rval obj
400         pop                                 # String this rval
401         new 1                               # strobj
402         stop                                # strobj
403     .end
405 .end new
407 .igroup funapply JSOP_FUNAPPLY
409     .imacro apply0                          # apply fun this arr
410         pick 3                              # fun this arr apply
411         pop                                 # fun this arr
412         pop                                 # fun this
413         call 0                              #
414         stop                                #
415     .end                                    #
417     .imacro apply1                          # apply fun this arr
418         pick 3                              # fun this arr apply
419         pop                                 # fun this arr
420         dup                                 # fun this arr arr
421         zero                                # fun this arr arr 0
422         getelem                             # fun this arr arg0
423         swap                                # fun this arg0 arr
424         pop                                 # fun this arg0
425         call 1                              #
426         stop                                #
427     .end                                    #
429     .imacro apply2                          # apply fun this arr
430         pick 3                              # fun this arr apply
431         pop                                 # fun this arr
432         dup                                 # fun this arr arr
433         zero                                # fun this arr arr 0
434         getelem                             # fun this arr arg0
435         swap                                # fun this arg0 arr
436         dup                                 # fun this arg0 arr arr
437         one                                 # fun this arg0 arr arr 1
438         getelem                             # fun this arg0 arr arg1
439         swap                                # fun this arg0 arg1 arr
440         pop                                 # fun this arg0 arg1
441         call 2                              #
442         stop                                #
443     .end                                    #
445     .imacro apply3                          # apply fun this arr
446         pick 3                              # fun this arr apply
447         pop                                 # fun this arr
448         dup                                 # fun this arr arr
449         zero                                # fun this arr arr 0
450         getelem                             # fun this arr arg0
451         swap                                # fun this arg0 arr
452         dup                                 # fun this arg0 arr arr
453         one                                 # fun this arg0 arr arr 1
454         getelem                             # fun this arg0 arr arg1
455         swap                                # fun this arg0 arg1 arr
456         dup                                 # fun this arg0 arg1 arr arr
457         int8 2                              # fun this arg0 arg1 arr arr 2
458         getelem                             # fun this arg0 arg1 arr arg2
459         swap                                # fun this arg0 arg1 arg2 arr
460         pop                                 # fun this arg0 arg1 arg2
461         call 3                              #
462         stop                                #
463     .end                                    #
465     .imacro apply4                          # apply fun this arr
466         pick 3                              # fun this arr apply
467         pop                                 # fun this arr
468         dup                                 # fun this arr arr
469         zero                                # fun this arr arr 0
470         getelem                             # fun this arr arg0
471         swap                                # fun this arg0 arr
472         dup                                 # fun this arg0 arr arr
473         one                                 # fun this arg0 arr arr 1
474         getelem                             # fun this arg0 arr arg1
475         swap                                # fun this arg0 arg1 arr
476         dup                                 # fun this arg0 arg1 arr arr
477         int8 2                              # fun this arg0 arg1 arr arr 2
478         getelem                             # fun this arg0 arg1 arr arg2
479         swap                                # fun this arg0 arg1 arg2 arr
480         dup                                 # fun this arg0 arg1 arg2 arr arr
481         int8 3                              # fun this arg0 arg1 arg2 arr arr 3
482         getelem                             # fun this arg0 arg1 arg2 arr arg3
483         swap                                # fun this arg0 arg1 arg2 arg3 arr
484         pop                                 # fun this arg0 arg1 arg2 arg3
485         call 4                              #
486         stop                                #
487     .end                                    #
489     .imacro apply5                          # apply fun this arr
490         pick 3                              # fun this arr apply
491         pop                                 # fun this arr
492         dup                                 # fun this arr arr
493         zero                                # fun this arr arr 0
494         getelem                             # fun this arr arg0
495         swap                                # fun this arg0 arr
496         dup                                 # fun this arg0 arr arr
497         one                                 # fun this arg0 arr arr 1
498         getelem                             # fun this arg0 arr arg1
499         swap                                # fun this arg0 arg1 arr
500         dup                                 # fun this arg0 arg1 arr arr
501         int8 2                              # fun this arg0 arg1 arr arr 2
502         getelem                             # fun this arg0 arg1 arr arg2
503         swap                                # fun this arg0 arg1 arg2 arr
504         dup                                 # fun this arg0 arg1 arg2 arr arr
505         int8 3                              # fun this arg0 arg1 arg2 arr arr 3
506         getelem                             # fun this arg0 arg1 arg2 arr arg3
507         swap                                # fun this arg0 arg1 arg2 arg3 arr
508         dup                                 # fun this arg0 arg1 arg2 arg3 arr arr
509         int8 4                              # fun this arg0 arg1 arg2 arg3 arr arr 4
510         getelem                             # fun this arg0 arg1 arg2 arg3 arr arg4
511         swap                                # fun this arg0 arg1 arg2 arg3 arg4 arr
512         pop                                 # fun this arg0 arg1 arg2 arg3 arg4
513         call 5                              #
514         stop                                #
515     .end                                    #
517     .imacro apply6                          # apply fun this arr
518         pick 3                              # fun this arr apply
519         pop                                 # fun this arr
520         dup                                 # fun this arr arr
521         zero                                # fun this arr arr 0
522         getelem                             # fun this arr arg0
523         swap                                # fun this arg0 arr
524         dup                                 # fun this arg0 arr arr
525         one                                 # fun this arg0 arr arr 1
526         getelem                             # fun this arg0 arr arg1
527         swap                                # fun this arg0 arg1 arr
528         dup                                 # fun this arg0 arg1 arr arr
529         int8 2                              # fun this arg0 arg1 arr arr 2
530         getelem                             # fun this arg0 arg1 arr arg2
531         swap                                # fun this arg0 arg1 arg2 arr
532         dup                                 # fun this arg0 arg1 arg2 arr arr
533         int8 3                              # fun this arg0 arg1 arg2 arr arr 3
534         getelem                             # fun this arg0 arg1 arg2 arr arg3
535         swap                                # fun this arg0 arg1 arg2 arg3 arr
536         dup                                 # fun this arg0 arg1 arg2 arg3 arr arr
537         int8 4                              # fun this arg0 arg1 arg2 arg3 arr arr 4
538         getelem                             # fun this arg0 arg1 arg2 arg3 arr arg4
539         swap                                # fun this arg0 arg1 arg2 arg3 arg4 arr
540         dup                                 # fun this arg0 arg1 arg2 arg3 arg4 arr arr
541         int8 5                              # fun this arg0 arg1 arg2 arg3 arg4 arr arr 5
542         getelem                             # fun this arg0 arg1 arg2 arg3 arg4 arr arg5
543         swap                                # fun this arg0 arg1 arg2 arg3 arg4 arg5 arr
544         pop                                 # fun this arg0 arg1 arg2 arg3 arg4 arg5
545         call 6                              #
546         stop                                #
547     .end                                    #
549     .imacro apply7                          # apply fun this arr
550         pick 3                              # fun this arr apply
551         pop                                 # fun this arr
552         dup                                 # fun this arr arr
553         zero                                # fun this arr arr 0
554         getelem                             # fun this arr arg0
555         swap                                # fun this arg0 arr
556         dup                                 # fun this arg0 arr arr
557         one                                 # fun this arg0 arr arr 1
558         getelem                             # fun this arg0 arr arg1
559         swap                                # fun this arg0 arg1 arr
560         dup                                 # fun this arg0 arg1 arr arr
561         int8 2                              # fun this arg0 arg1 arr arr 2
562         getelem                             # fun this arg0 arg1 arr arg2
563         swap                                # fun this arg0 arg1 arg2 arr
564         dup                                 # fun this arg0 arg1 arg2 arr arr
565         int8 3                              # fun this arg0 arg1 arg2 arr arr 3
566         getelem                             # fun this arg0 arg1 arg2 arr arg3
567         swap                                # fun this arg0 arg1 arg2 arg3 arr
568         dup                                 # fun this arg0 arg1 arg2 arg3 arr arr
569         int8 4                              # fun this arg0 arg1 arg2 arg3 arr arr 4
570         getelem                             # fun this arg0 arg1 arg2 arg3 arr arg4
571         swap                                # fun this arg0 arg1 arg2 arg3 arg4 arr
572         dup                                 # fun this arg0 arg1 arg2 arg3 arg4 arr arr
573         int8 5                              # fun this arg0 arg1 arg2 arg3 arg4 arr arr 5
574         getelem                             # fun this arg0 arg1 arg2 arg3 arg4 arr arg5
575         swap                                # fun this arg0 arg1 arg2 arg3 arg4 arg5 arr
576         dup                                 # fun this arg0 arg1 arg2 arg3 arg4 arg5 arr arr
577         int8 6                              # fun this arg0 arg1 arg2 arg3 arg4 arg5 arr arr 6
578         getelem                             # fun this arg0 arg1 arg2 arg3 arg4 arg5 arr arg6
579         swap                                # fun this arg0 arg1 arg2 arg3 arg4 arg5 arg6 arr
580         pop                                 # fun this arg0 arg1 arg2 arg3 arg4 arg5 arg6
581         call 7                              #
582         stop                                #
583     .end                                    #
585     .imacro apply8                          # apply fun this arr
586         pick 3                              # fun this arr apply
587         pop                                 # fun this arr
588         dup                                 # fun this arr arr
589         zero                                # fun this arr arr 0
590         getelem                             # fun this arr arg0
591         swap                                # fun this arg0 arr
592         dup                                 # fun this arg0 arr arr
593         one                                 # fun this arg0 arr arr 1
594         getelem                             # fun this arg0 arr arg1
595         swap                                # fun this arg0 arg1 arr
596         dup                                 # fun this arg0 arg1 arr arr
597         int8 2                              # fun this arg0 arg1 arr arr 2
598         getelem                             # fun this arg0 arg1 arr arg2
599         swap                                # fun this arg0 arg1 arg2 arr
600         dup                                 # fun this arg0 arg1 arg2 arr arr
601         int8 3                              # fun this arg0 arg1 arg2 arr arr 3
602         getelem                             # fun this arg0 arg1 arg2 arr arg3
603         swap                                # fun this arg0 arg1 arg2 arg3 arr
604         dup                                 # fun this arg0 arg1 arg2 arg3 arr arr
605         int8 4                              # fun this arg0 arg1 arg2 arg3 arr arr 4
606         getelem                             # fun this arg0 arg1 arg2 arg3 arr arg4
607         swap                                # fun this arg0 arg1 arg2 arg3 arg4 arr
608         dup                                 # fun this arg0 arg1 arg2 arg3 arg4 arr arr
609         int8 5                              # fun this arg0 arg1 arg2 arg3 arg4 arr arr 5
610         getelem                             # fun this arg0 arg1 arg2 arg3 arg4 arr arg5
611         swap                                # fun this arg0 arg1 arg2 arg3 arg4 arg5 arr
612         dup                                 # fun this arg0 arg1 arg2 arg3 arg4 arg5 arr arr
613         int8 6                              # fun this arg0 arg1 arg2 arg3 arg4 arg5 arr arr 6
614         getelem                             # fun this arg0 arg1 arg2 arg3 arg4 arg5 arr arg6
615         swap                                # fun this arg0 arg1 arg2 arg3 arg4 arg5 arg6 arr
616         dup                                 # fun this arg0 arg1 arg2 arg3 arg4 arg5 arg6 arr arr
617         int8 7                              # fun this arg0 arg1 arg2 arg3 arg4 arg5 arg6 arr arr 7
618         getelem                             # fun this arg0 arg1 arg2 arg3 arg4 arg5 arg6 arr arg7
619         swap                                # fun this arg0 arg1 arg2 arg3 arg4 arg5 arg6 arg7 arr
620         pop                                 # fun this arg0 arg1 arg2 arg3 arg4 arg5 arg6 arg7
621         call 8                              #
622         stop                                #
623     .end                                    #
625 .end funapply
627 .igroup funcall JSOP_FUNCALL
629     .imacro call0                           # call fun
630         swap                                # fun call
631         pop                                 # fun
632         null                                # fun this
633         call 0                              #
634         stop                                #
635     .end                                    #
637     .imacro call1                           # call fun this
638         pick 2                              # fun this call
639         pop                                 # fun this
640         call 0                              #
641         stop                                #
642     .end                                    #
644     .imacro call2                           # call fun this arg0
645         pick 3                              # fun this arg0 call
646         pop                                 # fun this arg0
647         call 1                              #
648         stop                                #
649     .end                                    #
651     .imacro call3                           # call fun this arg0 arg1
652         pick 4                              # fun this arg0 arg1 call
653         pop                                 # fun this arg0 arg1
654         call 2                              #
655         stop                                #
656     .end                                    #
658     .imacro call4                           # call fun this arg0 arg1 arg2
659         pick 5                              # fun this arg0 arg1 arg2 call
660         pop                                 # fun this arg0 arg1 arg2
661         call 3                              #
662         stop                                #
663     .end                                    #
665     .imacro call5                           # call fun this arg0 arg1 arg2 arg3
666         pick 6                              # fun this arg0 arg1 arg2 arg3 call
667         pop                                 # fun this arg0 arg1 arg2 arg3
668         call 4                              #
669         stop                                #
670     .end                                    #
672     .imacro call6                           # call fun this arg0 arg1 arg2 arg3 arg4
673         pick 7                              # fun this arg0 arg1 arg2 arg3 arg4 call
674         pop                                 # fun this arg0 arg1 arg2 arg3 arg4
675         call 5                              #
676         stop                                #
677     .end                                    #
679     .imacro call7                           # call fun this arg0 arg1 arg2 arg3 arg4 arg5
680         pick 8                              # fun this arg0 arg1 arg2 arg3 arg4 arg5 call
681         pop                                 # fun this arg0 arg1 arg2 arg3 arg4 arg5
682         call 6                              #
683         stop                                #
684     .end                                    #
686     .imacro call8                           # call fun this arg0 arg1 arg2 arg3 arg4 arg5 arg6
687         pick 9                              # fun this arg0 arg1 arg2 arg3 arg4 arg5 arg6 call
688         pop                                 # fun this arg0 arg1 arg2 arg3 arg4 arg5 arg6
689         call 7                              #
690         stop                                #
691     .end                                    #
693 .end funcall
695 .igroup getprop JSOP_GETPROP
696     .imacro scriptgetter        # obj
697         .fixup +1               # getter obj
698         call 0                  # val
699         stop
700     .end
701 .end getprop
703 .igroup callprop JSOP_CALLPROP
704     .imacro scriptgetter        # obj
705         .fixup +2               # obj getter obj
706         call 0                  # obj method
707         swap                    # method obj
708         stop
709     .end
710 .end callprop
712 .igroup getthisprop JSOP_GETTHISPROP,JSOP_GETARGPROP,JSOP_GETLOCALPROP
713     .imacro scriptgetter        #
714         .fixup +2               # getter obj
715         call 0                  # val
716         stop
717     .end
718 .end getthisprop