MCPcopy Create free account
hub / github.com/nodejs/node / to_fast

Function to_fast

deps/v8/test/mjsunit/optimized-map.js:448–465  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

446(function() {
447 var result = 0;
448 var to_fast = function() {
449 var callback = function(v,i,o) {
450 result += v;
451 if (i < 5) {
452 // First transition the output array to PACKED_DOUBLE_ELEMENTS.
453 return v + 0.5;
454 } else if (i < 10) {
455 // Then return smi values and make sure they can live in the double
456 // array.
457 return v;
458 } else {
459 // Later, to PACKED_ELEMENTS.
460 return v + 'hello';
461 }
462 };
463 %EnsureFeedbackVectorForFunction(callback);
464 return c.map(callback);
465 };
466 %PrepareFunctionForOptimization(to_fast);
467 to_fast();
468 to_fast();

Callers 1

optimized-map.jsFile · 0.70

Calls 1

mapMethod · 0.65

Tested by

no test coverage detected