Skip to content

Instantly share code, notes, and snippets.

@Constellation
Constellation / ok.js
Created September 21, 2018 13:38
test.js
function test(string) { return string.length; }
noInline(test);
function check(value, expected) { if (value !== expected) throw new Error("out"); }
noInline(check);
for (var i = 0; i < 1e6; ++i)
check(test("Hello"), 5);
var obj = { length: 42 };
for (var i = 0; i < 1e6; ++i) {

Keybase proof

I hereby claim:

  • I am constellation on github.
  • I am yusukesuzuki (https://keybase.io/yusukesuzuki) on keybase.
  • I have a public key ASBcYw20GlKLnQHw-bS43i4O6dfEzA-HkMNxt3OYSlwSIAo

To claim this, I am signing this object:

[461/49/483] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/DerivedSources/JavaScriptCore/unified-sources/UnifiedSource59.cpp.o
In file included from DerivedSources/JavaScriptCore/unified-sources/UnifiedSource59.cpp:4:0:
../../../Source/JavaScriptCore/ftl/FTLCapabilities.cpp: In function ‘JSC::FTL::CapabilityLevel JSC::FTL::canCompile(JSC::DFG::Node*)’:
../../../Source/JavaScriptCore/ftl/FTLCapabilities.cpp:45:12: warning: enumeration value ‘IdentityWithProfile’ not handled in switch [-Wswitch]
switch (node->op()) {
^
../../../Source/JavaScriptCore/ftl/FTLCapabilities.cpp:45:12: warning: enumeration value ‘CreateThis’ not handled in switch [-Wswitch]
../../../Source/JavaScriptCore/ftl/FTLCapabilities.cpp:45:12: warning: enumeration value ‘CheckTierUpInLoop’ not handled in switch [-Wswitch]
../../../Source/JavaScriptCore/ftl/FTLCapabilities.cpp:45:12: warning: enumeration value ‘CheckTierUpAndOSREnter’ not handled in switch [-Wswitch]
../../../Source/JavaScriptCo
@Constellation
Constellation / after.log
Created September 24, 2017 00:16
after.log
DFG(Driver) compiling arrayPush1#ABG3Z8:[0x7f9bcca8c540->0x7f9bcca8c2f0->0x7f9bccaa8460, NoneFunctionCall, 38 (NeverInline)] with DFGMode, number of instructions = 38
DFG(Plan) compiling arrayPush1#ABG3Z8:[0x7f9bcca8c540->0x7f9bcca8c2f0->0x7f9bccaa8460, NoneFunctionCall, 38 (NeverInline)] with DFGMode, number of instructions = 38
Compiler must handle OSR entry from bc#0 with values: arg0:Object: 0x7f9bccae40a0 with butterfly 0x7f9bcc8e84a8 (0x7f9bccaaf280:[global, {parseInt:100, parseFloat:101, Object:102, Function:103, Array:104, RegExp:105, RangeError:106, TypeError:107, PrivateSymbol.Object:108, PrivateSymbol.Array:109, ArrayBuffer:110, SharedArrayBuffer:111, String:112, Symbol:113, Number:114, Error:115, Map:116, Set:117, Promise:118, eval:119, Intl:120, Reflect:121, WebAssembly:122, debug:123, describe:124, describeArray:125, print:126, printErr:127, quit:128, abort:129, gc:130, fullGC:131, edenGC:132, forceGCSlowPaths:133, gcHeapSize:134, addressOf:135, getGetterSetter:136, version:137, run:138, runStr
@Constellation
Constellation / before.log
Created September 24, 2017 00:16
before.log
DFG(Driver) compiling arrayPush1#ABG3Z8:[0x7f3e0af8c540->0x7f3e0af8c2f0->0x7f3e0afa8460, NoneFunctionCall, 38 (NeverInline)] with DFGMode, number of instructions = 38
DFG(Plan) compiling arrayPush1#ABG3Z8:[0x7f3e0af8c540->0x7f3e0af8c2f0->0x7f3e0afa8460, NoneFunctionCall, 38 (NeverInline)] with DFGMode, number of instructions = 38
Compiler must handle OSR entry from bc#0 with values: arg0:Object: 0x7f3e0afe40a0 with butterfly 0x7f3e0ade84a8 (0x7f3e0afaf280:[global, {parseInt:100, parseFloat:101, Object:102, Function:103, Array:104, RegExp:105, RangeError:106, TypeError:107, PrivateSymbol.Object:108, PrivateSymbol.Array:109, ArrayBuffer:110, SharedArrayBuffer:111, String:112, Symbol:113, Number:114, Error:115, Map:116, Set:117, Promise:118, eval:119, Intl:120, Reflect:121, WebAssembly:122, debug:123, describe:124, describeArray:125, print:126, printErr:127, quit:128, abort:129, gc:130, fullGC:131, edenGC:132, forceGCSlowPaths:133, gcHeapSize:134, addressOf:135, getGetterSetter:136, version:137, run:138, runStr

DFG worklist = 2

ARES-6:Time:Geometric: 26.1ms stdev=3.8%
      Air:Time:Geometric: 23.1ms stdev=9.4%
         averageWorstCase:Time: 30.2ms stdev=8.4%
         firstIteration:Time: 54ms stdev=19.0%
         steadyState:Time: 7.64ms stdev=2.6%
      Babylon:Time:Geometric: 15.2ms stdev=4.3%
             averageWorstCase:Time: 16.6ms stdev=4.1%
             firstIteration:Time: 31.3ms stdev=9.2%
Running... Air ( 1 to go)
firstIteration: 62.53 +- 19.75 ms
averageWorstCase: 27.10 +- 1.67 ms
steadyState: 7.64 +- 0.26 ms
summary: 26.82 +- 1.44 ms
Running... Basic ( 1 to go)
firstIteration: 27.28 +- 4.42 ms
averageWorstCase: 14.03 +- 1.17 ms
@Constellation
Constellation / log
Created July 12, 2017 06:00
bytecode
add#AebcRZ:[0x7fcce7c702e0->0x7fccf691ef80, NoneFunctionCall, 8258 (StrictMode)]: 8258 m_instructions; 66064 bytes; 3 parameter(s); 24 callee register(s); 10 variable(s); scope at loc3
[ 0] enter
[ 1] get_scope loc3
[ 3] mov loc4, loc3
[ 6] check_traps
[ 7] mov loc5, head3
[ 10] create_cloned_arguments loc6
[ 12] mov loc7, loc6
[ 15] mov loc8, String (atomic) (identifier): add, ID: 4(const0)
[ 18] resolve_scope loc14, loc3, test0(@id0), <ClosureVar>, 0, 0x7fccf72d0340
https://likr.github.io/matmul-bench/
crash log for WebKitWebProcess (pid 36485):
[New LWP 37614]
[New LWP 36552]
[New LWP 37417]
[New LWP 37273]
[New LWP 37558]
[New LWP 38335]
[New LWP 38325]
[New LWP 38329]