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 |
5 |
# |
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/ |
10 |
# |
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. |
15 |
# |
16 |
# The Original Code is the TraceMonkey IMacro Assembler. |
17 |
# |
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. |
22 |
# |
23 |
# Contributor(s): |
24 |
# |
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. |
36 |
# |
37 |
# ***** END LICENSE BLOCK ***** |
38 |
|
39 |
.igroup equality JSOP_EQ-JSOP_NE |
40 |
|
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 |
62 |
|
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 |
86 |
|
87 |
.end equality |
88 |
|
89 |
.igroup binary JSOP_BITOR-JSOP_MOD |
90 |
|
91 |
.imacro any_obj # any obj |
92 |
dup # any obj obj |
93 |
dup # any obj obj obj |
94 |
getprop valueOf # any obj obj valueOf |
95 |
ifprimtop 1 # any obj obj valueOf |
96 |
swap # any obj valueOf obj |
97 |
string number # any obj valueOf obj "number" |
98 |
call 1 # any obj rval |
99 |
ifprimtop 3 # any obj rval |
100 |
pop # any obj |
101 |
dup # any obj obj |
102 |
goto 2 |
103 |
1: pop # any obj obj |
104 |
2: callprop toString # any obj toString obj |
105 |
call 0 # any obj rval |
106 |
primtop (JSTYPE_NUMBER) # any obj rval |
107 |
3: swap # any rval obj |
108 |
pop # any rval |
109 |
imacop # bval |
110 |
stop |
111 |
.end |
112 |
|
113 |
.imacro obj_any # obj any |
114 |
swap # any obj |
115 |
dup # any obj obj |
116 |
dup # any obj obj obj |
117 |
getprop valueOf # any obj obj valueOf |
118 |
ifprimtop 1 # any obj obj valueOf |
119 |
swap # any obj valueOf obj |
120 |
string number # any obj valueOf obj "number" |
121 |
call 1 # any obj lval |
122 |
ifprimtop 3 # any obj lval |
123 |
pop # any obj |
124 |
dup # any obj obj |
125 |
goto 2 |
126 |
1: pop # any obj obj |
127 |
2: callprop toString # any obj toString obj |
128 |
call 0 # any obj lval |
129 |
primtop (JSTYPE_NUMBER) # any obj lval |
130 |
3: swap # any lval obj |
131 |
pop # any lval |
132 |
swap # lval any |
133 |
imacop # bval |
134 |
stop |
135 |
.end |
136 |
|
137 |
.imacro obj_obj # obj1 obj2 |
138 |
swap # obj2 obj1 |
139 |
dup # obj2 obj1 obj1 |
140 |
dup # obj2 obj1 obj1 obj1 |
141 |
getprop valueOf # obj2 obj1 obj1 valueOf |
142 |
ifprimtop 1 # obj2 obj1 obj1 valueOf |
143 |
swap # obj2 obj1 valueOf obj1 |
144 |
string number # obj2 obj1 valueOf obj1 "number" |
145 |
call 1 # obj2 obj1 lval |
146 |
ifprimtop 3 # obj2 obj1 lval |
147 |
pop # obj2 obj1 |
148 |
dup # obj2 obj1 obj1 |
149 |
goto 2 |
150 |
1: pop # obj2 obj1 obj1 |
151 |
2: callprop toString # obj2 obj1 toString obj1 |
152 |
call 0 # obj2 obj1 lval |
153 |
primtop (JSTYPE_NUMBER) # obj2 obj1 lval |
154 |
3: swap # obj2 lval obj1 |
155 |
pop # obj2 lval |
156 |
swap # lval obj2 |
157 |
dup # lval obj1 obj1 |
158 |
dup # lval obj obj obj |
159 |
getprop valueOf # lval obj obj valueOf |
160 |
ifprimtop 4 # lval obj obj valueOf |
161 |
swap # lval obj valueOf obj |
162 |
string number # lval obj valueOf obj "number" |
163 |
call 1 # lval obj rval |
164 |
ifprimtop 6 # lval obj rval |
165 |
pop # lval obj |
166 |
dup # lval obj obj |
167 |
goto 5 |
168 |
4: pop # lval obj obj |
169 |
5: callprop toString # lval obj toString obj |
170 |
call 0 # lval obj rval |
171 |
primtop (JSTYPE_NUMBER) # lval obj rval |
172 |
6: swap # lval rval obj |
173 |
pop # lval rval |
174 |
imacop # bval |
175 |
stop |
176 |
.end |
177 |
|
178 |
.end binary |
179 |
|
180 |
.igroup add JSOP_ADD |
181 |
|
182 |
.imacro any_obj # any obj |
183 |
dup # any obj obj |
184 |
dup # any obj obj obj |
185 |
getprop valueOf # any obj obj valueOf |
186 |
ifprimtop 1 # any obj obj valueOf |
187 |
swap # any obj valueOf obj |
188 |
string void # any obj valueOf obj "void" |
189 |
call 1 # any obj rval |
190 |
ifprimtop 3 # any obj rval |
191 |
pop # any obj |
192 |
dup # any obj obj |
193 |
goto 2 |
194 |
1: pop # any obj obj |
195 |
2: callprop toString # any obj toString obj |
196 |
call 0 # any obj rval |
197 |
primtop (JSTYPE_VOID) # any obj rval |
198 |
3: swap # any rval obj |
199 |
pop # any rval |
200 |
add # aval |
201 |
stop |
202 |
.end |
203 |
|
204 |
.imacro obj_any # obj any |
205 |
swap # any obj |
206 |
dup # any obj obj |
207 |
dup # any obj obj obj |
208 |
getprop valueOf # any obj obj valueOf |
209 |
ifprimtop 1 # any obj obj valueOf |
210 |
swap # any obj valueOf obj |
211 |
string void # any obj valueOf obj "void" |
212 |
call 1 # any obj lval |
213 |
ifprimtop 3 # any obj lval |
214 |
pop # any obj |
215 |
dup # any obj obj |
216 |
goto 2 |
217 |
1: pop # any obj obj |
218 |
2: callprop toString # any obj toString obj |
219 |
call 0 # any obj lval |
220 |
primtop (JSTYPE_VOID) # any obj lval |
221 |
3: swap # any lval obj |
222 |
pop # any lval |
223 |
swap # lval any |
224 |
add # aval |
225 |
stop |
226 |
.end |
227 |
|
228 |
.imacro obj_obj # obj1 obj2 |
229 |
swap # obj2 obj1 |
230 |
dup # obj2 obj1 obj1 |
231 |
dup # obj2 obj1 obj1 obj1 |
232 |
getprop valueOf # obj2 obj1 obj1 valueOf |
233 |
ifprimtop 1 # obj2 obj1 obj1 valueOf |
234 |
swap # obj2 obj1 valueOf obj1 |
235 |
string void # obj2 obj1 valueOf obj1 "void" |
236 |
call 1 # obj2 obj1 lval |
237 |
ifprimtop 3 # obj2 obj1 lval |
238 |
pop # obj2 obj1 |
239 |
dup # obj2 obj1 obj1 |
240 |
goto 2 |
241 |
1: pop # obj2 obj1 obj1 |
242 |
2: callprop toString # obj2 obj1 toString obj1 |
243 |
call 0 # obj2 obj1 lval |
244 |
primtop (JSTYPE_VOID) # obj2 obj1 lval |
245 |
3: swap # obj2 lval obj1 |
246 |
pop # obj2 lval |
247 |
swap # lval obj2 |
248 |
dup # lval obj obj |
249 |
dup # lval obj obj obj |
250 |
getprop valueOf # lval obj obj valueOf |
251 |
ifprimtop 4 # lval obj obj valueOf |
252 |
swap # lval obj valueOf obj |
253 |
string void # lval obj valueOf obj "void" |
254 |
call 1 # lval obj rval |
255 |
ifprimtop 6 # lval obj rval |
256 |
pop # lval obj |
257 |
dup # lval obj obj |
258 |
goto 5 |
259 |
4: pop # lval obj obj |
260 |
5: callprop toString # lval obj toString obj |
261 |
call 0 # lval obj rval |
262 |
primtop (JSTYPE_VOID) # lval obj rval |
263 |
6: swap # lval rval obj |
264 |
pop # lval rval |
265 |
add # aval |
266 |
stop |
267 |
.end |
268 |
|
269 |
.end add |
270 |
|
271 |
.igroup unary JSOP_NEG-JSOP_POS |
272 |
|
273 |
.imacro sign # obj |
274 |
dup # obj obj |
275 |
dup # obj obj obj |
276 |
getprop valueOf # obj obj valueOf |
277 |
ifprimtop 2 # obj obj valueOf |
278 |
swap # obj valueOf obj |
279 |
string number # obj valueOf obj "number" |
280 |
call 1 # obj lval |
281 |
ifprimtop 1 # obj lval |
282 |
pop # obj |
283 |
dup # obj obj |
284 |
goto 3 |
285 |
1: swap # lval obj |
286 |
pop # lval |
287 |
goto 4 |
288 |
2: pop # obj obj |
289 |
3: callprop toString # obj toString obj |
290 |
call 0 # obj lval |
291 |
primtop (JSTYPE_NUMBER) # obj lval |
292 |
swap # lval obj |
293 |
pop # lval |
294 |
4: imacop # aval |
295 |
stop |
296 |
.end |
297 |
|
298 |
.end unary |
299 |
|
300 |
.igroup call JSOP_CALL |
301 |
|
302 |
.imacro String # String this obj |
303 |
dup # String this obj obj |
304 |
dup # String this obj obj obj |
305 |
getprop toString # String this obj obj toString |
306 |
ifprimtop 1 # String this obj obj toString |
307 |
swap # String this obj toString obj |
308 |
call 0 # String this obj rval |
309 |
ifprimtop 3 # String this obj rval |
310 |
pop # String this obj |
311 |
dup # String this obj obj |
312 |
goto 2 |
313 |
1: pop # String this obj obj |
314 |
2: callprop valueOf # String this obj valueOf obj |
315 |
string string # String this obj valueOf obj "string" |
316 |
call 1 # String this obj rval |
317 |
primtop (JSTYPE_STRING) # String this obj rval |
318 |
3: swap # String this rval obj |
319 |
pop # String this rval |
320 |
call 1 # str |
321 |
stop # str |
322 |
.end |
323 |
|
324 |
.end call |
325 |
|
326 |
.igroup new JSOP_NEW |
327 |
|
328 |
.imacro String # String this obj |
329 |
dup # String this obj obj |
330 |
dup # String this obj obj obj |
331 |
getprop toString # String this obj obj toString |
332 |
ifprimtop 1 # String this obj obj toString |
333 |
swap # String this obj toString obj |
334 |
call 0 # String this obj rval |
335 |
ifprimtop 3 # String this obj rval |
336 |
pop # String this obj |
337 |
dup # String this obj obj |
338 |
goto 2 |
339 |
1: pop # String this obj obj |
340 |
2: callprop valueOf # String this obj valueOf obj |
341 |
string string # String this obj valueOf obj "string" |
342 |
call 1 # String this obj rval |
343 |
primtop (JSTYPE_STRING) # String this obj rval |
344 |
3: swap # String this rval obj |
345 |
pop # String this rval |
346 |
new 1 # strobj |
347 |
stop # strobj |
348 |
.end |
349 |
|
350 |
.end new |
351 |
|
352 |
.igroup apply JSOP_APPLY |
353 |
|
354 |
.imacro apply0 # apply fun this arr |
355 |
pick 3 # fun this arr apply |
356 |
pop # fun this arr |
357 |
pop # fun this |
358 |
call 0 # |
359 |
stop # |
360 |
.end # |
361 |
|
362 |
.imacro apply1 # apply fun this arr |
363 |
pick 3 # fun this arr apply |
364 |
pop # fun this arr |
365 |
dup # fun this arr arr |
366 |
zero # fun this arr arr 0 |
367 |
getelem # fun this arr arg0 |
368 |
swap # fun this arg0 arr |
369 |
pop # fun this arg0 |
370 |
call 1 # |
371 |
stop # |
372 |
.end # |
373 |
|
374 |
.imacro apply2 # apply fun this arr |
375 |
pick 3 # fun this arr apply |
376 |
pop # fun this arr |
377 |
dup # fun this arr arr |
378 |
zero # fun this arr arr 0 |
379 |
getelem # fun this arr arg0 |
380 |
swap # fun this arg0 arr |
381 |
dup # fun this arg0 arr arr |
382 |
one # fun this arg0 arr arr 1 |
383 |
getelem # fun this arg0 arr arg1 |
384 |
swap # fun this arg0 arg1 arr |
385 |
pop # fun this arg0 arg1 |
386 |
call 2 # |
387 |
stop # |
388 |
.end # |
389 |
|
390 |
.imacro apply3 # apply fun this arr |
391 |
pick 3 # fun this arr apply |
392 |
pop # fun this arr |
393 |
dup # fun this arr arr |
394 |
zero # fun this arr arr 0 |
395 |
getelem # fun this arr arg0 |
396 |
swap # fun this arg0 arr |
397 |
dup # fun this arg0 arr arr |
398 |
one # fun this arg0 arr arr 1 |
399 |
getelem # fun this arg0 arr arg1 |
400 |
swap # fun this arg0 arg1 arr |
401 |
dup # fun this arg0 arg1 arr arr |
402 |
int8 2 # fun this arg0 arg1 arr arr 2 |
403 |
getelem # fun this arg0 arg1 arr arg2 |
404 |
swap # fun this arg0 arg1 arg2 arr |
405 |
pop # fun this arg0 arg1 arg2 |
406 |
call 3 # |
407 |
stop # |
408 |
.end # |
409 |
|
410 |
.imacro apply4 # apply fun this arr |
411 |
pick 3 # fun this arr apply |
412 |
pop # fun this arr |
413 |
dup # fun this arr arr |
414 |
zero # fun this arr arr 0 |
415 |
getelem # fun this arr arg0 |
416 |
swap # fun this arg0 arr |
417 |
dup # fun this arg0 arr arr |
418 |
one # fun this arg0 arr arr 1 |
419 |
getelem # fun this arg0 arr arg1 |
420 |
swap # fun this arg0 arg1 arr |
421 |
dup # fun this arg0 arg1 arr arr |
422 |
int8 2 # fun this arg0 arg1 arr arr 2 |
423 |
getelem # fun this arg0 arg1 arr arg2 |
424 |
swap # fun this arg0 arg1 arg2 arr |
425 |
dup # fun this arg0 arg1 arg2 arr arr |
426 |
int8 3 # fun this arg0 arg1 arg2 arr arr 3 |
427 |
getelem # fun this arg0 arg1 arg2 arr arg3 |
428 |
swap # fun this arg0 arg1 arg2 arg3 arr |
429 |
pop # fun this arg0 arg1 arg2 arg3 |
430 |
call 4 # |
431 |
stop # |
432 |
.end # |
433 |
|
434 |
.imacro apply5 # apply fun this arr |
435 |
pick 3 # fun this arr apply |
436 |
pop # fun this arr |
437 |
dup # fun this arr arr |
438 |
zero # fun this arr arr 0 |
439 |
getelem # fun this arr arg0 |
440 |
swap # fun this arg0 arr |
441 |
dup # fun this arg0 arr arr |
442 |
one # fun this arg0 arr arr 1 |
443 |
getelem # fun this arg0 arr arg1 |
444 |
swap # fun this arg0 arg1 arr |
445 |
dup # fun this arg0 arg1 arr arr |
446 |
int8 2 # fun this arg0 arg1 arr arr 2 |
447 |
getelem # fun this arg0 arg1 arr arg2 |
448 |
swap # fun this arg0 arg1 arg2 arr |
449 |
dup # fun this arg0 arg1 arg2 arr arr |
450 |
int8 3 # fun this arg0 arg1 arg2 arr arr 3 |
451 |
getelem # fun this arg0 arg1 arg2 arr arg3 |
452 |
swap # fun this arg0 arg1 arg2 arg3 arr |
453 |
dup # fun this arg0 arg1 arg2 arg3 arr arr |
454 |
int8 4 # fun this arg0 arg1 arg2 arg3 arr arr 4 |
455 |
getelem # fun this arg0 arg1 arg2 arg3 arr arg4 |
456 |
swap # fun this arg0 arg1 arg2 arg3 arg4 arr |
457 |
pop # fun this arg0 arg1 arg2 arg3 arg4 |
458 |
call 5 # |
459 |
stop # |
460 |
.end # |
461 |
|
462 |
.imacro apply6 # apply fun this arr |
463 |
pick 3 # fun this arr apply |
464 |
pop # fun this arr |
465 |
dup # fun this arr arr |
466 |
zero # fun this arr arr 0 |
467 |
getelem # fun this arr arg0 |
468 |
swap # fun this arg0 arr |
469 |
dup # fun this arg0 arr arr |
470 |
one # fun this arg0 arr arr 1 |
471 |
getelem # fun this arg0 arr arg1 |
472 |
swap # fun this arg0 arg1 arr |
473 |
dup # fun this arg0 arg1 arr arr |
474 |
int8 2 # fun this arg0 arg1 arr arr 2 |
475 |
getelem # fun this arg0 arg1 arr arg2 |
476 |
swap # fun this arg0 arg1 arg2 arr |
477 |
dup # fun this arg0 arg1 arg2 arr arr |
478 |
int8 3 # fun this arg0 arg1 arg2 arr arr 3 |
479 |
getelem # fun this arg0 arg1 arg2 arr arg3 |
480 |
swap # fun this arg0 arg1 arg2 arg3 arr |
481 |
dup # fun this arg0 arg1 arg2 arg3 arr arr |
482 |
int8 4 # fun this arg0 arg1 arg2 arg3 arr arr 4 |
483 |
getelem # fun this arg0 arg1 arg2 arg3 arr arg4 |
484 |
swap # fun this arg0 arg1 arg2 arg3 arg4 arr |
485 |
dup # fun this arg0 arg1 arg2 arg3 arg4 arr arr |
486 |
int8 5 # fun this arg0 arg1 arg2 arg3 arg4 arr arr 5 |
487 |
getelem # fun this arg0 arg1 arg2 arg3 arg4 arr arg5 |
488 |
swap # fun this arg0 arg1 arg2 arg3 arg4 arg5 arr |
489 |
pop # fun this arg0 arg1 arg2 arg3 arg4 arg5 |
490 |
call 6 # |
491 |
stop # |
492 |
.end # |
493 |
|
494 |
.imacro apply7 # apply fun this arr |
495 |
pick 3 # fun this arr apply |
496 |
pop # fun this arr |
497 |
dup # fun this arr arr |
498 |
zero # fun this arr arr 0 |
499 |
getelem # fun this arr arg0 |
500 |
swap # fun this arg0 arr |
501 |
dup # fun this arg0 arr arr |
502 |
one # fun this arg0 arr arr 1 |
503 |
getelem # fun this arg0 arr arg1 |
504 |
swap # fun this arg0 arg1 arr |
505 |
dup # fun this arg0 arg1 arr arr |
506 |
int8 2 # fun this arg0 arg1 arr arr 2 |
507 |
getelem # fun this arg0 arg1 arr arg2 |
508 |
swap # fun this arg0 arg1 arg2 arr |
509 |
dup # fun this arg0 arg1 arg2 arr arr |
510 |
int8 3 # fun this arg0 arg1 arg2 arr arr 3 |
511 |
getelem # fun this arg0 arg1 arg2 arr arg3 |
512 |
swap # fun this arg0 arg1 arg2 arg3 arr |
513 |
dup # fun this arg0 arg1 arg2 arg3 arr arr |
514 |
int8 4 # fun this arg0 arg1 arg2 arg3 arr arr 4 |
515 |
getelem # fun this arg0 arg1 arg2 arg3 arr arg4 |
516 |
swap # fun this arg0 arg1 arg2 arg3 arg4 arr |
517 |
dup # fun this arg0 arg1 arg2 arg3 arg4 arr arr |
518 |
int8 5 # fun this arg0 arg1 arg2 arg3 arg4 arr arr 5 |
519 |
getelem # fun this arg0 arg1 arg2 arg3 arg4 arr arg5 |
520 |
swap # fun this arg0 arg1 arg2 arg3 arg4 arg5 arr |
521 |
dup # fun this arg0 arg1 arg2 arg3 arg4 arg5 arr arr |
522 |
int8 6 # fun this arg0 arg1 arg2 arg3 arg4 arg5 arr arr 6 |
523 |
getelem # fun this arg0 arg1 arg2 arg3 arg4 arg5 arr arg6 |
524 |
swap # fun this arg0 arg1 arg2 arg3 arg4 arg5 arg6 arr |
525 |
pop # fun this arg0 arg1 arg2 arg3 arg4 arg5 arg6 |
526 |
call 7 # |
527 |
stop # |
528 |
.end # |
529 |
|
530 |
.imacro apply8 # apply fun this arr |
531 |
pick 3 # fun this arr apply |
532 |
pop # fun this arr |
533 |
dup # fun this arr arr |
534 |
zero # fun this arr arr 0 |
535 |
getelem # fun this arr arg0 |
536 |
swap # fun this arg0 arr |
537 |
dup # fun this arg0 arr arr |
538 |
one # fun this arg0 arr arr 1 |
539 |
getelem # fun this arg0 arr arg1 |
540 |
swap # fun this arg0 arg1 arr |
541 |
dup # fun this arg0 arg1 arr arr |
542 |
int8 2 # fun this arg0 arg1 arr arr 2 |
543 |
getelem # fun this arg0 arg1 arr arg2 |
544 |
swap # fun this arg0 arg1 arg2 arr |
545 |
dup # fun this arg0 arg1 arg2 arr arr |
546 |
int8 3 # fun this arg0 arg1 arg2 arr arr 3 |
547 |
getelem # fun this arg0 arg1 arg2 arr arg3 |
548 |
swap # fun this arg0 arg1 arg2 arg3 arr |
549 |
dup # fun this arg0 arg1 arg2 arg3 arr arr |
550 |
int8 4 # fun this arg0 arg1 arg2 arg3 arr arr 4 |
551 |
getelem # fun this arg0 arg1 arg2 arg3 arr arg4 |
552 |
swap # fun this arg0 arg1 arg2 arg3 arg4 arr |
553 |
dup # fun this arg0 arg1 arg2 arg3 arg4 arr arr |
554 |
int8 5 # fun this arg0 arg1 arg2 arg3 arg4 arr arr 5 |
555 |
getelem # fun this arg0 arg1 arg2 arg3 arg4 arr arg5 |
556 |
swap # fun this arg0 arg1 arg2 arg3 arg4 arg5 arr |
557 |
dup # fun this arg0 arg1 arg2 arg3 arg4 arg5 arr arr |
558 |
int8 6 # fun this arg0 arg1 arg2 arg3 arg4 arg5 arr arr 6 |
559 |
getelem # fun this arg0 arg1 arg2 arg3 arg4 arg5 arr arg6 |
560 |
swap # fun this arg0 arg1 arg2 arg3 arg4 arg5 arg6 arr |
561 |
dup # fun this arg0 arg1 arg2 arg3 arg4 arg5 arg6 arr arr |
562 |
int8 7 # fun this arg0 arg1 arg2 arg3 arg4 arg5 arg6 arr arr 7 |
563 |
getelem # fun this arg0 arg1 arg2 arg3 arg4 arg5 arg6 arr arg7 |
564 |
swap # fun this arg0 arg1 arg2 arg3 arg4 arg5 arg6 arg7 arr |
565 |
pop # fun this arg0 arg1 arg2 arg3 arg4 arg5 arg6 arg7 |
566 |
call 8 # |
567 |
stop # |
568 |
.end # |
569 |
|
570 |
.imacro call0 # call fun |
571 |
swap # fun call |
572 |
pop # fun |
573 |
null # fun this |
574 |
call 0 # |
575 |
stop # |
576 |
.end # |
577 |
|
578 |
.imacro call1 # call fun this |
579 |
pick 2 # fun this call |
580 |
pop # fun this |
581 |
call 0 # |
582 |
stop # |
583 |
.end # |
584 |
|
585 |
.imacro call2 # call fun this arg0 |
586 |
pick 3 # fun this arg0 call |
587 |
pop # fun this arg0 |
588 |
call 1 # |
589 |
stop # |
590 |
.end # |
591 |
|
592 |
.imacro call3 # call fun this arg0 arg1 |
593 |
pick 4 # fun this arg0 arg1 call |
594 |
pop # fun this arg0 arg1 |
595 |
call 2 # |
596 |
stop # |
597 |
.end # |
598 |
|
599 |
.imacro call4 # call fun this arg0 arg1 arg2 |
600 |
pick 5 # fun this arg0 arg1 arg2 call |
601 |
pop # fun this arg0 arg1 arg2 |
602 |
call 3 # |
603 |
stop # |
604 |
.end # |
605 |
|
606 |
.imacro call5 # call fun this arg0 arg1 arg2 arg3 |
607 |
pick 6 # fun this arg0 arg1 arg2 arg3 call |
608 |
pop # fun this arg0 arg1 arg2 arg3 |
609 |
call 4 # |
610 |
stop # |
611 |
.end # |
612 |
|
613 |
.imacro call6 # call fun this arg0 arg1 arg2 arg3 arg4 |
614 |
pick 7 # fun this arg0 arg1 arg2 arg3 arg4 call |
615 |
pop # fun this arg0 arg1 arg2 arg3 arg4 |
616 |
call 5 # |
617 |
stop # |
618 |
.end # |
619 |
|
620 |
.imacro call7 # call fun this arg0 arg1 arg2 arg3 arg4 arg5 |
621 |
pick 8 # fun this arg0 arg1 arg2 arg3 arg4 arg5 call |
622 |
pop # fun this arg0 arg1 arg2 arg3 arg4 arg5 |
623 |
call 6 # |
624 |
stop # |
625 |
.end # |
626 |
|
627 |
.imacro call8 # call fun this arg0 arg1 arg2 arg3 arg4 arg5 arg6 |
628 |
pick 9 # fun this arg0 arg1 arg2 arg3 arg4 arg5 arg6 call |
629 |
pop # fun this arg0 arg1 arg2 arg3 arg4 arg5 arg6 |
630 |
call 7 # |
631 |
stop # |
632 |
.end # |
633 |
|
634 |
.end apply |
635 |
|
636 |
.igroup iter JSOP_ITER |
637 |
|
638 |
.imacro for_in # obj |
639 |
callprop iterator # fun obj |
640 |
int8 (JSITER_ENUMERATE) # fun obj flags |
641 |
call 1 # iterobj |
642 |
objtop (JSMSG_BAD_ITERATOR_RETURN) # iterobj |
643 |
push # iterobj undef |
644 |
stop |
645 |
.end |
646 |
|
647 |
.imacro for_each # obj |
648 |
callprop iterator # fun obj |
649 |
int8 (JSITER_ENUMERATE|JSITER_FOREACH) # fun obj flags |
650 |
call 1 # iterobj |
651 |
objtop (JSMSG_BAD_ITERATOR_RETURN) # iterobj |
652 |
push # iterobj undef |
653 |
stop |
654 |
.end |
655 |
|
656 |
.imacro for_in_native # obj |
657 |
callbuiltin (JSBUILTIN_ObjectToIterator) # fun obj |
658 |
int8 (JSITER_ENUMERATE) # fun obj flags |
659 |
call 1 # iterobj |
660 |
push # iterobj undef |
661 |
stop |
662 |
.end |
663 |
|
664 |
.imacro for_each_native # obj |
665 |
callbuiltin (JSBUILTIN_ObjectToIterator) # fun obj |
666 |
int8 (JSITER_ENUMERATE|JSITER_FOREACH) # fun obj flags |
667 |
call 1 # iterobj |
668 |
push # iterobj undef |
669 |
stop |
670 |
.end |
671 |
|
672 |
.end iter |
673 |
|
674 |
.igroup nextiter JSOP_NEXTITER |
675 |
|
676 |
.imacro custom_iter_next # iterobj prevval |
677 |
pop # iterobj |
678 |
dup # iterobj iterobj |
679 |
callprop next # iterobj fun iterobj |
680 |
call 0 # iterobj nextval |
681 |
dup # iterobj nextval? nextval? |
682 |
hole # iterobj nextval? nextval? hole |
683 |
strictne # iterobj nextval? boolean |
684 |
stop |
685 |
.end |
686 |
|
687 |
.imacro native_iter_next # iterobj prevval |
688 |
pop # iterobj |
689 |
dup # iterobj iterobj |
690 |
callbuiltin (JSBUILTIN_CallIteratorNext) # iterobj fun iterobj |
691 |
call 0 # iterobj nextval? |
692 |
dup # iterobj nextval? nextval? |
693 |
hole # iterobj nextval? nextval? hole |
694 |
strictne # iterobj nextval? boolean |
695 |
stop |
696 |
.end |
697 |
|
698 |
.end nextiter |
699 |
|
700 |
|
701 |
# Force accounting for unused argument 'N' by touching it with 'swap'. |
702 |
.igroup defvalue JSOP_CONCATN |
703 |
|
704 |
.imacro string # [arg1..argN] argI I |
705 |
swap # [arg1..argN] I argI |
706 |
dup # [arg1..argN] I argI argI |
707 |
dup # [arg1..argN] I argI argI argI |
708 |
getprop valueOf # [arg1..argN] I argI argI valueOf |
709 |
ifprimtop 1 # [arg1..argN] I argI argI valueOf |
710 |
swap # [arg1..argN] I argI valueOf argI |
711 |
string void # [arg1..argN] I argI valueOf argI "void" |
712 |
call 1 # [arg1..argN] I argI val |
713 |
ifprimtop 3 # [arg1..argN] I argI val |
714 |
pop # [arg1..argN] I argI |
715 |
dup # [arg1..argN] I argI argI |
716 |
goto 2 |
717 |
1: pop # [arg1..argN] I argI argI |
718 |
2: callprop toString # [arg1..argN] I argI toString argI |
719 |
call 0 # [arg1..argN] I argI val |
720 |
primtop (JSTYPE_VOID) # [arg1..argN] I argI val |
721 |
3: swap # [arg1..argN] I val argI |
722 |
pop # [arg1..argN] I val |
723 |
swap # [arg1..argN] val I |
724 |
imacop # catstr |
725 |
stop |
726 |
.end |
727 |
|
728 |
.end defvalue |