Thermal reads object members and folds Math, string building compiles, and methods, Array subclasses and globals behave as the standard says
Thermal, the optimizing compiler Floati writes for itself, now compiles three kinds of code it used to refuse a whole function for: Math.imul, floor, ceil, sqrt, abs, min and max, each folded into one instruction; number members of an object a function is given (p.x), checked against the layout the page has been using; and a step after the loop it cannot compile, such as turning a hash into text with toString(36), which it now hands to the interpreter instead of giving up on the loop. A murmur3 hash runs 12 times faster than in 0.1.358 and a CSS-in-JS class-name hash 11 times faster, with less memory. Functions that build strings from template literals or 'text' + value, and functions that use new, now compile too. Four differences from the standard are fixed: methods and getters can no longer be called with new, class X extends Array makes real arrays, a global created by a plain assignment is a property of window, and an object in a template literal converts the way the standard says. Real pages measure the same as before, and Floati can now write x86-64 code for Intel and Windows machines behind a switch while that code is made smaller.
Three things Thermal no longer refuses a function for
Thermal compiles a hot loop with its numbers kept in the processor's registers, but until now one operation it did not understand anywhere in a function meant the whole function stayed on Gust. Math methods are now folded: Math.imul becomes one 32-bit multiply and Math.min one instruction, behind a single check when the function starts that Math and its methods are still the built-ins, so a page that replaces Math.imul still gets its own function called. A member read like p.x of an object the function was given checks the object's layout against the one that site has seen, loads the value from its slot, and makes sure it is a number. And an operation after the loop that Thermal does not compile, the toString(36) that ends a CSS-in-JS hash for example, no longer refuses the function: the loop runs in registers, then the values are written into the frame the interpreter uses and the interpreter runs the last few steps. Every one of these leaves for the interpreter in the same way when its check fails, and every test map also runs with Thermal forced to leave at every third operation.
String building and new compile
A function with a template literal (`${a}-${b}`) or a concatenation that starts with text ('id-' + n) used to stay in the interpreter, because the compiled tiers had no operation for turning a value into text. They have one now, shared with the interpreter so both convert the same way, and a chain like base + '__' + mod + i that does not start with text is now built in one step once its first piece of text is reached, instead of making a new string at every plus. Functions that use new compile too: built-in constructors such as Date and Map now remember what kind of constructor they are instead of searching their own properties on every new, which made a loop creating dates and maps a fifth faster.
Closer to the standard
A method written as m() {} or a getter can no longer be called with new, and has no prototype, as the standard requires. class X extends Array now makes real arrays: new X(3) has length 3, Array.isArray says true, X.from and X.of make an X, and map, filter, slice and concat on an X give an X back. A variable created by assigning to an undeclared name in sloppy code is now a property of window, so 'x' in window, Object.keys(window), its property descriptor and delete window.x all see it. And `${obj}` now asks the object for a primitive the standard way: toString first, valueOf if toString is missing, and a TypeError for a Symbol wrapper. Fixing the third one also fixed how a global's value and window's copy of it stay in step when there is more than one script realm, such as frames.
What changed 7 changes
Try it in your browser
Each check runs live in the browser you are reading with. Nothing is sent anywhere.