Skip to content

Instantly share code, notes, and snippets.

@abiduzz420
Last active September 10, 2019 17:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abiduzz420/fc6345bffe81f911f3c445d0848fe7f8 to your computer and use it in GitHub Desktop.
Save abiduzz420/fc6345bffe81f911f3c445d0848fe7f8 to your computer and use it in GitHub Desktop.
$ out/x64.debug/d8 --no-lazy-feedback-allocation --print-bytecode --allow-natives-syntax super-funny.js > super-funny-debug
[generated bytecode for function: ]
Parameter count 1
Register count 10
Frame size 80
0x5939701fae6 @ 0 : 12 00 LdaConstant [0]
0x5939701fae8 @ 2 : 26 f8 Star r3
0x5939701faea @ 4 : 61 34 01 f8 01 CallRuntime [NewScriptContext], r3-r3
0x5939701faef @ 9 : 16 f8 PushContext r3
0x5939701faf1 @ 11 : 0f LdaTheHole
0x5939701faf2 @ 12 : 1d 04 StaCurrentContextSlot [4]
0x5939701faf4 @ 14 : 0f LdaTheHole
0x5939701faf5 @ 15 : 1d 05 StaCurrentContextSlot [5]
0x5939701faf7 @ 17 : 0f LdaTheHole
0x5939701faf8 @ 18 : 1d 06 StaCurrentContextSlot [6]
0 E> 0x5939701fafa @ 20 : a5 StackCheck
0x5939701fafb @ 21 : 82 01 CreateBlockContext [1]
0x5939701fafd @ 23 : 16 f7 PushContext r4
0x5939701faff @ 25 : 0f LdaTheHole
0x5939701fb00 @ 26 : 26 f3 Star r8
0x5939701fb02 @ 28 : 81 03 00 00 CreateClosure [3], [0], #0
0x5939701fb06 @ 32 : 26 f6 Star r5
0x5939701fb08 @ 34 : 12 02 LdaConstant [2]
0x5939701fb0a @ 36 : 26 f5 Star r6
0x5939701fb0c @ 38 : 81 04 01 00 CreateClosure [4], [1], #0
0x5939701fb10 @ 42 : 26 f2 Star r9
0x5939701fb12 @ 44 : 27 f6 f4 Mov r5, r7
0x5939701fb15 @ 47 : 61 22 00 f5 04 CallRuntime [DefineClass], r6-r9
0x5939701fb1a @ 52 : 26 f5 Star r6
0x5939701fb1c @ 54 : 27 f4 f9 Mov r7, r2
0x5939701fb1f @ 57 : 17 f7 PopContext r4
0x5939701fb21 @ 59 : 25 f9 Ldar r2
0 E> 0x5939701fb23 @ 61 : 1d 04 StaCurrentContextSlot [4]
0x5939701fb25 @ 63 : 82 05 CreateBlockContext [5]
0x5939701fb27 @ 65 : 16 f7 PushContext r4
0x5939701fb29 @ 67 : 18 f7 04 00 LdaContextSlot r4, [4], [0]
0x5939701fb2d @ 71 : 26 f3 Star r8
166 E> 0x5939701fb2f @ 73 : 81 07 02 00 CreateClosure [7], [2], #0
0x5939701fb33 @ 77 : 26 f6 Star r5
0x5939701fb35 @ 79 : 12 06 LdaConstant [6]
0x5939701fb37 @ 81 : 26 f5 Star r6
0x5939701fb39 @ 83 : 81 08 03 00 CreateClosure [8], [3], #0
0x5939701fb3d @ 87 : 26 f2 Star r9
0x5939701fb3f @ 89 : 27 f6 f4 Mov r5, r7
0x5939701fb42 @ 92 : 61 22 00 f5 04 CallRuntime [DefineClass], r6-r9
0x5939701fb47 @ 97 : 26 f5 Star r6
0x5939701fb49 @ 99 : 27 f4 fa Mov r7, r1
0x5939701fb4c @ 102 : 17 f7 PopContext r4
0x5939701fb4e @ 104 : 25 fa Ldar r1
141 E> 0x5939701fb50 @ 106 : 1d 05 StaCurrentContextSlot [5]
310 S> 0x5939701fb52 @ 108 : 1a 05 LdaCurrentContextSlot [5]
0x5939701fb54 @ 110 : 26 f7 Star r4
0x5939701fb56 @ 112 : 0c 19 LdaSmi [25]
0x5939701fb58 @ 114 : 26 f6 Star r5
0x5939701fb5a @ 116 : 0c 08 LdaSmi [8]
0x5939701fb5c @ 118 : 26 f5 Star r6
0x5939701fb5e @ 120 : 12 09 LdaConstant [9]
0x5939701fb60 @ 122 : 26 f4 Star r7
0x5939701fb62 @ 124 : 25 f7 Ldar r4
310 E> 0x5939701fb64 @ 126 : 65 f7 f6 03 00 Construct r4, r5-r7, [0]
310 E> 0x5939701fb69 @ 131 : 1d 06 StaCurrentContextSlot [6]
362 S> 0x5939701fb6b @ 133 : 1a 06 LdaCurrentContextSlot [6]
0x5939701fb6d @ 135 : 26 f6 Star r5
365 E> 0x5939701fb6f @ 137 : 29 f6 0a LdaNamedPropertyNoFeedback r5, [10]
0x5939701fb72 @ 140 : 26 f7 Star r4
365 E> 0x5939701fb74 @ 142 : 5f f7 f6 01 CallNoFeedback r4, r5-r5
415 S> 0x5939701fb78 @ 146 : 1a 06 LdaCurrentContextSlot [6]
0x5939701fb7a @ 148 : 26 f7 Star r4
430 E> 0x5939701fb7c @ 150 : 29 f7 0a LdaNamedPropertyNoFeedback r4, [10]
0x5939701fb7f @ 153 : 26 f7 Star r4
0x5939701fb81 @ 155 : 61 65 01 f7 01 CallRuntime [DebugPrint], r4-r4
450 S> 0x5939701fb86 @ 160 : 1a 06 LdaCurrentContextSlot [6]
0x5939701fb88 @ 162 : 26 f6 Star r5
453 E> 0x5939701fb8a @ 164 : 29 f6 0a LdaNamedPropertyNoFeedback r5, [10]
0x5939701fb8d @ 167 : 26 f7 Star r4
453 E> 0x5939701fb8f @ 169 : 5f f7 f6 01 CallNoFeedback r4, r5-r5
0x5939701fb93 @ 173 : 26 fb Star r0
473 S> 0x5939701fb95 @ 175 : a9 Return
Constant pool (size = 11)
0x5939701fa49: [FixedArray] in OldSpace
- map: 0x325451200789 <Map>
- length: 11
0: 0x05939701f791 <ScopeInfo SCRIPT_SCOPE [13]>
1: 0x05939701f839 <ScopeInfo CLASS_SCOPE [4]>
2: 0x3645155cb549 <FixedArray[7]>
3: 0x05939701f8a9 <SharedFunctionInfo Point>
4: 0x05939701f901 <SharedFunctionInfo toString>
5: 0x05939701f809 <ScopeInfo CLASS_SCOPE [4]>
6: 0x3645155cb681 <FixedArray[7]>
7: 0x05939701f959 <SharedFunctionInfo ColorPoint>
8: 0x05939701f9b1 <SharedFunctionInfo superPropertyCall>
9: 0x05939701f759 <String[#5]: green>
10: 0x05939701f719 <String[#17]: superPropertyCall>
Handler Table (size = 0)
[generated bytecode for function: ColorPoint]
Parameter count 4
Register count 7
Frame size 56
0x5939701fde6 @ 0 : 27 fe fa Mov <closure>, r1
187 E> 0x5939701fde9 @ 3 : a5 StackCheck
207 S> 0x5939701fdea @ 4 : 25 fa Ldar r1
0x5939701fdec @ 6 : 55 f8 GetSuperConstructor r3
0x5939701fdee @ 8 : 25 fb Ldar r0
0x5939701fdf0 @ 10 : 27 04 f7 Mov a0, r4
0x5939701fdf3 @ 13 : 27 03 f6 Mov a1, r5
207 E> 0x5939701fdf6 @ 16 : 65 f8 f7 02 00 Construct r3, r4-r5, [0]
0x5939701fdfb @ 21 : 26 f5 Star r6
0x5939701fdfd @ 23 : 25 05 Ldar <this>
0x5939701fdff @ 25 : ac ThrowSuperAlreadyCalledIfNotHole
0x5939701fe00 @ 26 : 27 f5 05 Mov r6, <this>
224 S> 0x5939701fe03 @ 29 : 25 05 Ldar <this>
0x5939701fe05 @ 31 : ab ThrowSuperNotCalledIfHole
0x5939701fe06 @ 32 : 25 02 Ldar a2
235 E> 0x5939701fe08 @ 34 : 2d 05 00 02 StaNamedProperty <this>, [0], [2]
0x5939701fe0c @ 38 : 25 05 Ldar <this>
0x5939701fe0e @ 40 : ab ThrowSuperNotCalledIfHole
246 S> 0x5939701fe0f @ 41 : a9 Return
Constant pool (size = 1)
0x5939701fd99: [FixedArray] in OldSpace
- map: 0x325451200789 <Map>
- length: 1
0: 0x32545123b999 <String[#5]: color>
Handler Table (size = 0)
[generated bytecode for function: Point]
Parameter count 3
Register count 0
Frame size 0
27 E> 0x5939701ff5e @ 0 : a5 StackCheck
40 S> 0x5939701ff5f @ 1 : 25 03 Ldar a0
47 E> 0x5939701ff61 @ 3 : 2d 04 00 00 StaNamedProperty <this>, [0], [0]
56 S> 0x5939701ff65 @ 7 : 25 02 Ldar a1
63 E> 0x5939701ff67 @ 9 : 2d 04 01 02 StaNamedProperty <this>, [1], [2]
0x5939701ff6b @ 13 : 0d LdaUndefined
70 S> 0x5939701ff6c @ 14 : a9 Return
Constant pool (size = 2)
0x5939701ff09: [FixedArray] in OldSpace
- map: 0x325451200789 <Map>
- length: 2
0: 0x05939701f6c9 <String[#1]: x>
1: 0x05939701f6e1 <String[#1]: y>
Handler Table (size = 0)
[generated bytecode for function: superPropertyCall]
Parameter count 1
Register count 6
Frame size 48
0x5939702013e @ 0 : 27 fe fb Mov <closure>, r0
267 E> 0x59397020141 @ 3 : a5 StackCheck
276 S> 0x59397020142 @ 4 : 12 00 LdaConstant [0]
276 E> 0x59397020144 @ 6 : 2a fe 00 LdaKeyedProperty <closure>, [0]
0x59397020147 @ 9 : 26 f7 Star r4
0x59397020149 @ 11 : 12 01 LdaConstant [1]
0x5939702014b @ 13 : 26 f6 Star r5
0x5939702014d @ 15 : 27 02 f8 Mov <this>, r3
282 E> 0x59397020150 @ 18 : 61 24 00 f8 03 CallRuntime [LoadFromSuper], r3-r5
0x59397020155 @ 23 : 26 fa Star r1
282 E> 0x59397020157 @ 25 : 56 fa 02 01 02 CallAnyReceiver r1, <this>-<this>, [2]
0x5939702015c @ 30 : 0d LdaUndefined
296 S> 0x5939702015d @ 31 : a9 Return
Constant pool (size = 2)
0x593970200e9: [FixedArray] in OldSpace
- map: 0x325451200789 <Map>
- length: 2
0: 0x325451204991 <Symbol: (home_object_symbol)>
1: 0x325451204669 <String[#8]: toString>
Handler Table (size = 0)
[generated bytecode for function: toString]
Parameter count 1
Register count 1
Frame size 8
82 E> 0x5939702030e @ 0 : a5 StackCheck
91 S> 0x5939702030f @ 1 : 12 00 LdaConstant [0]
0x59397020311 @ 3 : 26 fb Star r0
109 E> 0x59397020313 @ 5 : 28 02 01 00 LdaNamedProperty <this>, [1], [0]
102 E> 0x59397020317 @ 9 : 34 fb 02 Add r0, [2]
0x5939702031a @ 12 : 26 fb Star r0
0x5939702031c @ 14 : 12 02 LdaConstant [2]
111 E> 0x5939702031e @ 16 : 34 fb 03 Add r0, [3]
0x59397020321 @ 19 : 26 fb Star r0
125 E> 0x59397020323 @ 21 : 28 02 03 04 LdaNamedProperty <this>, [3], [4]
118 E> 0x59397020327 @ 25 : 34 fb 06 Add r0, [6]
0x5939702032a @ 28 : 26 fb Star r0
0x5939702032c @ 30 : 12 04 LdaConstant [4]
127 E> 0x5939702032e @ 32 : 34 fb 07 Add r0, [7]
133 S> 0x59397020331 @ 35 : a9 Return
Constant pool (size = 5)
0x593970202a1: [FixedArray] in OldSpace
- map: 0x325451200789 <Map>
- length: 5
0: 0x0593970201e9 <String[#1]: (>
1: 0x05939701f6c9 <String[#1]: x>
2: 0x059397020201 <String[#2]: , >
3: 0x05939701f6e1 <String[#1]: y>
4: 0x059397020219 <String[#1]: )>
Handler Table (size = 0)
DebugPrint: 0x3645155cb981: [Function]
- map: 0x10f3656446c1 <Map(HOLEY_ELEMENTS)> [FastProperties]
- prototype: 0x059397002091 <JSFunction (sfi = 0x1d6e4e848081)>
- elements: 0x325451200bf9 <FixedArray[0]> [HOLEY_ELEMENTS]
- function prototype: <no-prototype-slot>
- shared_info: 0x05939701f9b1 <SharedFunctionInfo superPropertyCall>
- name: 0x05939701f719 <String[#17]: superPropertyCall>
- formal_parameter_count: 0
- safe_to_skip_arguments_adaptor
- kind: ConciseMethod
- context: 0x3645155cb911 <BlockContext[4]>
- code: 0x176ac10843a1 <Code BUILTIN InterpreterEntryTrampoline>
- interpreted
- bytecode: 0x059397020109 <BytecodeArray[32]>
- source code: () {
super.toString();
}
- properties: 0x325451200bf9 <FixedArray[0]> {
#length: 0x1d6e4e840491 <AccessorInfo> (const accessor descriptor)
#name: 0x1d6e4e840421 <AccessorInfo> (const accessor descriptor)
0x325451204991 <Symbol: (home_object_symbol)>: 0x3645155cb9c1 <ColorPoint map = 0x10f36564a7f1> (data field 0)
}
- feedback vector: 0x59397020199: [FeedbackVector] in OldSpace
- map: 0x325451200b99 <Map>
- length: 4
- shared function info: 0x05939701f9b1 <SharedFunctionInfo superPropertyCall>
- optimized code/marker: OptimizationMarker::kNone
- invocation count: 1
- profiler ticks: 0
- slot #0 LoadKeyed PREMONOMORPHIC {
[0]: 0x325451204a21 <Symbol: (premonomorphic_symbol)>
[1]: [weak] 0x10f3656446c1 <Map(HOLEY_ELEMENTS)>
}
- slot #2 Call MONOMORPHIC {
[2]: [weak] 0x3645155cb7c9 <JSFunction toString (sfi = 0x5939701f901)>
[3]: 2
}
0x10f3656446c1: [Map]
- type: JS_FUNCTION_TYPE
- instance size: 64
- inobject properties: 1
- elements kind: HOLEY_ELEMENTS
- unused property fields: 0
- enum length: invalid
- callable
- back pointer: 0x3254512004a9 <undefined>
- prototype_validity cell: 0x1d6e4e8405e1 <Cell value= 1>
- instance descriptors (own) #3: 0x05939701a6a1 <DescriptorArray[3]>
- layout descriptor: (nil)
- prototype: 0x059397002091 <JSFunction (sfi = 0x1d6e4e848081)>
- constructor: 0x3254512001b1 <null>
- dependent code: 0x325451200299 <Other heap object (WEAK_FIXED_ARRAY_TYPE)>
- construction counter: 0
class Point {
constructor(x, y) {
this.x = x;
this.y = y;
}
toString() {
return "(" + this.x + ", " + this.y + ")";
}
}
class ColorPoint extends Point {
constructor(x, y, color) {
super(x, y);
this.color = color;
}
superPropertyCall() {
super.toString();
}
}
let cp = new ColorPoint(25, 8, "green"); // (25, 8) in green
cp.superPropertyCall(); // Collecting the feedback ?
%DebugPrint(cp.superPropertyCall);
cp.superPropertyCall();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment