· 8 years ago · Apr 16, 2018, 12:20 AM
1Index: WebKitSite/ChangeLog
2===================================================================
3--- WebKitSite/ChangeLog (revision 48015)
4+++ WebKitSite/ChangeLog (working copy)
5@@ -1,3 +1,11 @@
6+2009-09-03 Robert Agoston <Agoston.Robert@stud.u-szeged.hu>
7+
8+ Reviewed by NOBODY (OOPS!).
9+
10+ Update the Squirrelfish bytecode documentation.
11+
12+ * specs/squirrelfish-bytecode.html:
13+
14 2009-08-26 Mark Rowe <mrowe@apple.com>
15
16 Upgrade WordPress to the latest version.
17Index: WebKitSite/specs/squirrelfish-bytecode.html
18===================================================================
19--- WebKitSite/specs/squirrelfish-bytecode.html (revision 48015)
20+++ WebKitSite/specs/squirrelfish-bytecode.html (working copy)
21@@ -1,13 +1,4 @@
22 <style>p code { font-size: 14px; }</style>
23-<h2><code>load</code></h2>
24-<p><b>Format: </b><code>
25-load dst(r) src(k)
26-</code></p>
27-<p>
28-
29- Copies constant src to register dst.
30-
31-</p>
32 <h2><code>new_object</code></h2>
33 <p><b>Format: </b><code>
34 new_object dst(r)
35@@ -61,6 +52,16 @@ eq dst(r) src1(r) src2(r)
36 as a boolean in register dst.
37
38 </p>
39+<h2><code>eq_null</code></h2>
40+<p><b>Format: </b><code>
41+eq_null dst(r) src(r)
42+</code></p>
43+<p>
44+
45+ Checks whether register src is null, as with the ECMAScript '!='
46+ operator, and puts the result as a boolean in register dst.
47+
48+</p>
49 <h2><code>neq</code></h2>
50 <p><b>Format: </b><code>
51 neq dst(r) src1(r) src2(r)
52@@ -72,6 +73,16 @@ neq dst(r) src1(r) src2(r)
53 result as a boolean in register dst.
54
55 </p>
56+<h2><code>neq_null</code></h2>
57+<p><b>Format: </b><code>
58+neq_null dst(r) src(r)
59+</code></p>
60+<p>
61+
62+ Checks whether register src is not null, as with the ECMAScript '!='
63+ operator, and puts the result as a boolean in register dst.
64+
65+</p>
66 <h2><code>stricteq</code></h2>
67 <p><b>Format: </b><code>
68 stricteq dst(r) src1(r) src2(r)
69@@ -310,22 +321,26 @@ bitnot dst(r) src(r)
70 </p>
71 <h2><code>not</code></h2>
72 <p><b>Format: </b><code>
73-not dst(r) src1(r) src2(r)
74+not dst(r) src(r)
75 </code></p>
76 <p>
77
78- Computes logical NOT of register src1 (converted to
79+ Computes logical NOT of register src (converted to
80 boolean), and puts the result in register dst.
81
82 </p>
83 <h2><code>instanceof</code></h2>
84 <p><b>Format: </b><code>
85-instanceof dst(r) value(r) constructor(r)
86+instanceof dst(r) value(r) constructor(r) constructorProto(r)
87 </code></p>
88 <p>
89
90 Tests whether register value is an instance of register
91- constructor, and puts the boolean result in register dst.
92+ constructor, and puts the boolean result in register
93+ dst. Register constructorProto must contain the "prototype"
94+ property (not the actual prototype) of the object in
95+ register constructor. This lookup is separated so that
96+ polymorphic inline caching can apply.
97
98 Raises an exception if register constructor is not an
99 object.
100@@ -341,6 +356,72 @@ typeof dst(r) src(r)
101 rules, and puts the result in register dst.
102
103 </p>
104+<h2><code>is_undefined</code></h2>
105+<p><b>Format: </b><code>
106+is_undefined dst(r) src(r)
107+</code></p>
108+<p>
109+
110+ Determines whether the type string for src according to
111+ the ECMAScript rules is "undefined", and puts the result
112+ in register dst.
113+
114+</p>
115+<h2><code>is_boolean</code></h2>
116+<p><b>Format: </b><code>
117+is_boolean dst(r) src(r)
118+</code></p>
119+<p>
120+
121+ Determines whether the type string for src according to
122+ the ECMAScript rules is "boolean", and puts the result
123+ in register dst.
124+
125+</p>
126+<h2><code>is_number</code></h2>
127+<p><b>Format: </b><code>
128+is_number dst(r) src(r)
129+</code></p>
130+<p>
131+
132+ Determines whether the type string for src according to
133+ the ECMAScript rules is "number", and puts the result
134+ in register dst.
135+
136+</p>
137+<h2><code>is_string</code></h2>
138+<p><b>Format: </b><code>
139+is_string dst(r) src(r)
140+</code></p>
141+<p>
142+
143+ Determines whether the type string for src according to
144+ the ECMAScript rules is "string", and puts the result
145+ in register dst.
146+
147+</p>
148+<h2><code>is_object</code></h2>
149+<p><b>Format: </b><code>
150+is_object dst(r) src(r)
151+</code></p>
152+<p>
153+
154+ Determines whether the type string for src according to
155+ the ECMAScript rules is "object", and puts the result
156+ in register dst.
157+
158+</p>
159+<h2><code>is_function</code></h2>
160+<p><b>Format: </b><code>
161+is_function dst(r) src(r)
162+</code></p>
163+<p>
164+
165+ Determines whether the type string for src according to
166+ the ECMAScript rules is "function", and puts the result
167+ in register dst.
168+
169+</p>
170 <h2><code>in</code></h2>
171 <p><b>Format: </b><code>
172 in dst(r) property(r) base(r)
173@@ -376,6 +457,36 @@ resolve_skip dst(r) property(id) skip(n)
174 value to register dst. If the property is not found, raises an exception.
175
176 </p>
177+<h2><code>resolve_global</code></h2>
178+<p><b>Format: </b><code>
179+resolve_skip dst(r) globalObject(c) property(id) structure(sID) offset(n)
180+</code></p>
181+<p>
182+
183+ Performs a dynamic property lookup for the given property, on the provided
184+ global object. If structure matches the Structure of the global then perform
185+ a fast lookup using the case offset, otherwise fall back to a full resolve and
186+ cache the new structure and offset
187+
188+</p>
189+<h2><code>get_global_var</code></h2>
190+<p><b>Format: </b><code>
191+get_global_var dst(r) globalObject(c) index(n)
192+</code></p>
193+<p>
194+
195+ Gets the global var at global slot index and places it in register dst.
196+
197+</p>
198+<h2><code>put_global_var</code></h2>
199+<p><b>Format: </b><code>
200+put_global_var globalObject(c) index(n) value(r)
201+</code></p>
202+<p>
203+
204+ Puts value into global slot index.
205+
206+</p>
207 <h2><code>get_scoped_var</code></h2>
208 <p><b>Format: </b><code>
209 get_scoped_var dst(r) index(n) skip(n)
210@@ -422,44 +533,132 @@ resolve_with_base baseDst(r) propDst(r)
211 avoids duplicate hash lookups.
212
213 </p>
214-<h2><code>resolve_func</code></h2>
215+<h2><code>get_by_id</code></h2>
216+<p><b>Format: </b><code>
217+get_by_id dst(r) base(r) property(id) structure(sID) nop(n) nop(n) nop(n)
218+</code></p>
219+<p>
220+
221+ Generic property access: Gets the property named by identifier
222+ property from the value base, and puts the result in register dst.
223+
224+</p>
225+<h2><code>get_by_id_self</code></h2>
226 <p><b>Format: </b><code>
227-resolve_func baseDst(r) funcDst(r) property(id)
228+op_get_by_id_self dst(r) base(r) property(id) structure(sID) offset(n) nop(n) nop(n)
229 </code></p>
230 <p>
231
232- Searches the scope chain for an object containing
233- identifier property, and if one is found, writes the
234- appropriate object to use as "this" when calling its
235- properties to register baseDst; and the retrieved property
236- value to register propDst. If the property is not found,
237- raises an exception.
238-
239- This differs from resolve_with_base, because the
240- global this value will be substituted for activations or
241- the global object, which is the right behavior for function
242- calls but not for other property lookup.
243+ Cached property access: Attempts to get a cached property from the
244+ value base. If the cache misses, op_get_by_id_self reverts to
245+ op_get_by_id.
246
247 </p>
248-<h2><code>get_by_id</code></h2>
249+<h2><code>get_by_id_proto</code></h2>
250 <p><b>Format: </b><code>
251-get_by_id dst(r) base(r) property(id)
252+op_get_by_id_proto dst(r) base(r) property(id) structure(sID) prototypeStructure(sID) offset(n) nop(n)
253 </code></p>
254 <p>
255
256- Converts register base to Object, gets the property
257- named by identifier property from the object, and puts the
258- result in register dst.
259+ Cached property access: Attempts to get a cached property from the
260+ value base's prototype. If the cache misses, op_get_by_id_proto
261+ reverts to op_get_by_id.
262+
263+</p>
264+<h2><code>get_by_id_chain</code></h2>
265+<p><b>Format: </b><code>
266+op_get_by_id_chain dst(r) base(r) property(id) structure(sID) structureChain(chain) count(n) offset(n)
267+</code></p>
268+<p>
269+
270+ Cached property access: Attempts to get a cached property from the
271+ value base's prototype chain. If the cache misses, op_get_by_id_chain
272+ reverts to op_get_by_id.
273+
274+</p>
275+<h2><code>get_by_id_generic</code></h2>
276+<p><b>Format: </b><code>
277+op_get_by_id_generic dst(r) base(r) property(id) nop(sID) nop(n) nop(n) nop(n)
278+</code></p>
279+<p>
280+
281+ Generic property access: Gets the property named by identifier
282+ property from the value base, and puts the result in register dst.
283+
284+</p>
285+<h2><code>get_array_length</code></h2>
286+<p><b>Format: </b><code>
287+op_get_array_length dst(r) base(r) property(id) nop(sID) nop(n) nop(n) nop(n)
288+</code></p>
289+<p>
290+
291+ Cached property access: Gets the length of the array in register base,
292+ and puts the result in register dst. If register base does not hold
293+ an array, op_get_array_length reverts to op_get_by_id.
294+
295+</p>
296+<h2><code>get_string_length</code></h2>
297+<p><b>Format: </b><code>
298+op_get_string_length dst(r) base(r) property(id) nop(sID) nop(n) nop(n) nop(n)
299+</code></p>
300+<p>
301+
302+ Cached property access: Gets the length of the string in register base,
303+ and puts the result in register dst. If register base does not hold
304+ a string, op_get_string_length reverts to op_get_by_id.
305
306 </p>
307 <h2><code>put_by_id</code></h2>
308 <p><b>Format: </b><code>
309-put_by_id base(r) property(id) value(r)
310+put_by_id base(r) property(id) value(r) nop(n) nop(n) nop(n) nop(n)
311 </code></p>
312 <p>
313
314- Sets register value on register base as the property named
315- by identifier property. Base is converted to object first.
316+ Generic property access: Sets the property named by identifier
317+ property, belonging to register base, to register value.
318+
319+ Unlike many opcodes, this one does not write any output to
320+ the register file.
321+
322+</p>
323+<h2><code>put_by_id_transition</code></h2>
324+<p><b>Format: </b><code>
325+op_put_by_id_transition base(r) property(id) value(r) oldStructure(sID) newStructure(sID) structureChain(chain) offset(n)
326+</code></p>
327+<p>
328+
329+ Cached property access: Attempts to set a new property with a cached transition
330+ property named by identifier property, belonging to register base,
331+ to register value. If the cache misses, op_put_by_id_transition
332+ reverts to op_put_by_id_generic.
333+
334+ Unlike many opcodes, this one does not write any output to
335+ the register file.
336+
337+</p>
338+<h2><code>put_by_id_replace</code></h2>
339+<p><b>Format: </b><code>
340+op_put_by_id_replace base(r) property(id) value(r) structure(sID) offset(n) nop(n) nop(n)
341+</code></p>
342+<p>
343+
344+ Cached property access: Attempts to set a pre-existing, cached
345+ property named by identifier property, belonging to register base,
346+ to register value. If the cache misses, op_put_by_id_replace
347+ reverts to op_put_by_id.
348+
349+ Unlike many opcodes, this one does not write any output to
350+ the register file.
351+
352+</p>
353+<h2><code>put_by_id_generic</code></h2>
354+<p><b>Format: </b><code>
355+op_put_by_id_generic base(r) property(id) value(r) nop(n) nop(n) nop(n) nop(n)
356+</code></p>
357+<p>
358+
359+ Generic property access: Sets the property named by identifier
360+ property, belonging to register base, to register value.
361
362 Unlike many opcodes, this one does not write any output to
363 the register file.
364@@ -588,6 +787,36 @@ jfalse cond(r) target(offset)
365 only if register cond converts to boolean as false.
366
367 </p>
368+<h2><code>jeq_null</code></h2>
369+<p><b>Format: </b><code>
370+jeq_null src(r) target(offset)
371+</code></p>
372+<p>
373+
374+ Jumps to offset target from the current instruction, if and
375+ only if register src is null.
376+
377+</p>
378+<h2><code>jneq_null</code></h2>
379+<p><b>Format: </b><code>
380+jneq_null src(r) target(offset)
381+</code></p>
382+<p>
383+
384+ Jumps to offset target from the current instruction, if and
385+ only if register src is not null.
386+
387+</p>
388+<h2><code>jneq_ptr</code></h2>
389+<p><b>Format: </b><code>
390+jneq_ptr src(r) ptr(jsCell) target(offset)
391+</code></p>
392+<p>
393+
394+ Jumps to offset target from the current instruction, if the value r is equal
395+ to ptr, using pointer equality.
396+
397+</p>
398 <h2><code>loop_if_less</code></h2>
399 <p><b>Format: </b><code>
400 loop_if_less src1(r) src2(r) target(offset)
401@@ -603,17 +832,20 @@ loop_if_less src1(r) src2(r) target(offs
402 the JS timeout is reached.
403
404 </p>
405-<h2><code>jless</code></h2>
406+<h2><code>loop_if_lesseq</code></h2>
407 <p><b>Format: </b><code>
408-jless src1(r) src2(r) target(offset)
409+loop_if_lesseq src1(r) src2(r) target(offset)
410 </code></p>
411 <p>
412
413- Checks whether register src1 is less than register src2, as
414- with the ECMAScript '<' operator, and then jumps to offset
415- target from the current instruction, if and only if the
416+ Checks whether register src1 is less than or equal to register
417+ src2, as with the ECMAScript '<=' operator, and then jumps to
418+ offset target from the current instruction, if and only if the
419 result of the comparison is true.
420
421+ Additionally this loop instruction may terminate JS execution is
422+ the JS timeout is reached.
423+
424 </p>
425 <h2><code>jnless</code></h2>
426 <p><b>Format: </b><code>
427@@ -627,6 +859,18 @@ jnless src1(r) src2(r) target(offset)
428 result of the comparison is false.
429
430 </p>
431+<h2><code>jnlesseq</code></h2>
432+<p><b>Format: </b><code>
433+jnlesseq src1(r) src2(r) target(offset)
434+</code></p>
435+<p>
436+
437+ Checks whether register src1 is less than or equal to
438+ register src2, as with the ECMAScript '<=' operator,
439+ and then jumps to offset target from the current instruction,
440+ if and only if theresult of the comparison is false.
441+
442+</p>
443 <h2><code>switch_imm</code></h2>
444 <p><b>Format: </b><code>
445 switch_imm tableIndex(n) defaultOffset(offset) scrutinee(r)
446@@ -692,7 +936,7 @@ new_func_exp dst(r) func(f)
447 </p>
448 <h2><code>call_eval</code></h2>
449 <p><b>Format: </b><code>
450-call_eval dst(r) func(r) thisVal(r) firstArg(r) argCount(n)
451+call_eval dst(r) func(r) argCount(n) registerOffset(n)
452 </code></p>
453 <p>
454
455@@ -707,42 +951,63 @@ call_eval dst(r) func(r) thisVal(r) firs
456 </p>
457 <h2><code>call</code></h2>
458 <p><b>Format: </b><code>
459-call dst(r) func(r) thisVal(r) firstArg(r) argCount(n)
460+call dst(r) func(r) argCount(n) registerOffset(n)
461 </code></p>
462 <p>
463
464- Perform a function call. Specifically, call register func
465- with a "this" value of register thisVal, and put the result
466- in register dst.
467+ Perform a function call.
468+
469+ registerOffset is the distance the callFrame pointer should move
470+ before the VM initializes the new call frame's header.
471+
472+ dst is where op_ret should store its result.
473
474- The arguments start at register firstArg and go up to
475- argCount, but the "this" value is considered an implicit
476- first argument, so the argCount should be one greater than
477- the number of explicit arguments passed, and the register
478- after firstArg should contain the actual first
479- argument. This opcode will copy from the thisVal register
480- to the firstArg register, unless the register index of
481- thisVal is the special missing this object marker, which is
482- 2^31-1; in that case, the global object will be used as the
483- "this" value.
484-
485- If func is a native code function, then this opcode calls
486- it and returns the value immediately.
487-
488- But if it is a JS function, then the current scope chain
489- and code block is set to the function's, and we slide the
490- register window so that the arguments would form the first
491- few local registers of the called function's register
492- window. In addition, a call frame header is written
493- immediately before the arguments; see the call frame
494- documentation for an explanation of how many registers a
495- call frame takes and what they contain. That many registers
496- before the firstArg register will be overwritten by the
497- call. In addition, any registers higher than firstArg +
498- argCount may be overwritten. Once this setup is complete,
499- execution continues from the called function's first
500- argument, and does not return until a "ret" opcode is
501- encountered.
502+</p>
503+<h2><code>call_varargs</code></h2>
504+<p><b>Format: </b><code>
505+call_varargs dst(r) func(r) argCountReg(r) baseRegisterOffset(n)
506+</code></p>
507+<p>
508+
509+ Perform a function call with a dynamic set of arguments.
510+
511+ registerOffset is the distance the callFrame pointer should move
512+ before the VM initializes the new call frame's header, excluding
513+ space for arguments.
514+
515+ dst is where op_ret should store its result.
516+
517+</p>
518+<h2><code>tear_off_activation</code></h2>
519+<p><b>Format: </b><code>
520+tear_off_activation activation(r)
521+</code></p>
522+<p>
523+
524+ Copy all locals and parameters to new memory allocated on
525+ the heap, and make the passed activation use this memory
526+ in the future when looking up entries in the symbol table.
527+ If there is an 'arguments' object, then it will also use
528+ this memory for storing the named parameters, but not any
529+ extra arguments.
530+
531+ This opcode should only be used immediately before op_ret.
532+
533+</p>
534+<h2><code>tear_off_arguments</code></h2>
535+<p><b>Format: </b><code>
536+tear_off_arguments
537+</code></p>
538+<p>
539+
540+ Copy all arguments to new memory allocated on the heap,
541+ and make the 'arguments' object use this memory in the
542+ future when looking up named parameters, but not any
543+ extra arguments. If an activation object exists for the
544+ current function context, then the tear_off_activation
545+ opcode should be used instead.
546+
547+ This opcode should only be used immediately before op_ret.
548
549 </p>
550 <h2><code>ret</code></h2>
551@@ -758,19 +1023,103 @@ ret result(r)
552 register base to those of the calling function.
553
554 </p>
555+<h2><code>enter</code></h2>
556+<p><b>Format: </b><code>
557+enter
558+</code></p>
559+<p>
560+
561+ Initializes local variables to undefined and fills constant
562+ registers with their values. If the code block requires an
563+ activation, enter_with_activation should be used instead.
564+
565+ This opcode should only be used at the beginning of a code
566+ block.
567+
568+</p>
569+<h2><code>enter_with_activation</code></h2>
570+<p><b>Format: </b><code>
571+enter_with_activation dst(r)
572+</code></p>
573+<p>
574+
575+ Initializes local variables to undefined, fills constant
576+ registers with their values, creates an activation object,
577+ and places the new activation both in dst and at the top
578+ of the scope chain. If the code block does not require an
579+ activation, enter should be used instead.
580+
581+ This opcode should only be used at the beginning of a code
582+ block.
583+
584+</p>
585+<h2><code>convert_this</code></h2>
586+<p><b>Format: </b><code>
587+convert_this this(r)
588+</code></p>
589+<p>
590+
591+ Takes the value in the 'this' register, converts it to a
592+ value that is suitable for use as the 'this' value, and
593+ stores it in the 'this' register. This opcode is emitted
594+ to avoid doing the conversion in the caller unnecessarily.
595+
596+ This opcode should only be used at the beginning of a code
597+ block.
598+
599+</p>
600+<h2><code>init_arguments</code></h2>
601+<p><b>Format: </b><code>
602+create_arguments
603+</code></p>
604+<p>
605+
606+ Initialises the arguments object reference to null to ensure
607+ we can correctly detect that we need to create it later (or
608+ avoid creating it altogether).
609+
610+ This opcode should only be used at the beginning of a code
611+ block.
612+
613+</p>
614+<h2><code>create_arguments</code></h2>
615+<p><b>Format: </b><code>
616+create_arguments
617+</code></p>
618+<p>
619+
620+ Creates the 'arguments' object and places it in both the
621+ 'arguments' call frame slot and the local 'arguments'
622+ register, if it has not already been initialised.
623+
624+</p>
625 <h2><code>construct</code></h2>
626 <p><b>Format: </b><code>
627-construct dst(r) constr(r) firstArg(r) argCount(n)
628+construct dst(r) func(r) argCount(n) registerOffset(n) proto(r) thisRegister(r)
629 </code></p>
630 <p>
631
632- Invoke register "constr" as a constructor. For JS
633+ Invoke register "func" as a constructor. For JS
634 functions, the calling convention is exactly as for the
635 "call" opcode, except that the "this" value is a newly
636- created Object. For native constructors, a null "this"
637- value is passed. In either case, the firstArg and argCount
638+ created Object. For native constructors, no "this"
639+ value is passed. In either case, the argCount and registerOffset
640 registers are interpreted as for the "call" opcode.
641
642+ Register proto must contain the prototype property of
643+ register func. This is to enable polymorphic inline
644+ caching of this lookup.
645+
646+</p>
647+<h2><code>construct_verify</code></h2>
648+<p><b>Format: </b><code>
649+construct_verify dst(r) override(r)
650+</code></p>
651+<p>
652+
653+ Verifies that register dst holds an object. If not, moves
654+ the object in register override to register dst.
655+
656 </p>
657 <h2><code>push_scope</code></h2>
658 <p><b>Format: </b><code>
659@@ -779,7 +1128,8 @@ push_scope scope(r)
660 <p>
661
662 Converts register scope to object, and pushes it onto the top
663- of the current scope chain.
664+ of the current scope chain. The contents of the register scope
665+ are replaced by the result of toObject conversion of the scope.
666
667 </p>
668 <h2><code>pop_scope</code></h2>
669@@ -827,13 +1177,24 @@ jmp_scopes count(n) target(offset)
670 target.
671
672 </p>
673+<h2><code>push_new_scope</code></h2>
674+<p><b>Format: </b><code>
675+new_scope dst(r) property(id) value(r)
676+</code></p>
677+<p>
678+
679+ Constructs a new StaticScopeObject with property set to value. That scope
680+ object is then pushed onto the ScopeChain. The scope object is then stored
681+ in dst for GC.
682+
683+</p>
684 <h2><code>catch</code></h2>
685 <p><b>Format: </b><code>
686 catch ex(r)
687 </code></p>
688 <p>
689
690- Retrieves the VMs current exception and puts it in register
691+ Retrieves the VM's current exception and puts it in register
692 ex. This is only valid after an exception has been raised,
693 and usually forms the beginning of an exception handler.
694
695@@ -935,3 +1296,23 @@ debug debugHookID(n) firstLine(n) lastLi
696 is only generated while the debugger is attached.
697
698 </p>
699+<h2><code>profile_will_call</code></h2>
700+<p><b>Format: </b><code>
701+op_profile_will_call function(r)
702+</code></p>
703+<p>
704+
705+ Notifies the profiler of the beginning of a function call. This opcode
706+ is only generated if developer tools are enabled.
707+
708+</p>
709+<h2><code>profile_did_call</code></h2>
710+<p><b>Format: </b><code>
711+op_profile_did_call function(r)
712+</code></p>
713+<p>
714+
715+ Notifies the profiler of the end of a function call. This opcode
716+ is only generated if developer tools are enabled.
717+
718+</p>