Skip to content

Commit 2ba4eea

Browse files
bnoordhuisjasnell
authored andcommitted
lib: remove simd support from util.format()
Upstream V8 is removing SIMD support. Be proactive and follow suit. Refs: https://bugs.chromium.org/p/v8/issues/detail?id=4124 PR-URL: #11346 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Ali Ijaz Sheikh <[email protected]> Reviewed-By: Сковорода Никита Андреевич <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent c5d1851 commit 2ba4eea

File tree

2 files changed

+0
-103
lines changed

2 files changed

+0
-103
lines changed

‎lib/util.js‎

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -18,41 +18,6 @@ const inspectDefaultOptions = Object.seal({
1818
});
1919

2020
varDebug;
21-
varsimdFormatters;
22-
23-
// SIMD is only available when --harmony_simd is specified on the command line
24-
// and the set of available types differs between v5 and v6, that's why we use
25-
// a map to look up and store the formatters. It also provides a modicum of
26-
// protection against users monkey-patching the SIMD object.
27-
if(typeofglobal.SIMD==='object'&&global.SIMD!==null){
28-
simdFormatters=newMap();
29-
30-
constmake=
31-
(extractLane,count)=>(ctx,value,recurseTimes,visibleKeys,keys)=>{
32-
constoutput=newArray(count);
33-
for(vari=0;i<count;i+=1)
34-
output[i]=formatPrimitive(ctx,extractLane(value,i));
35-
returnoutput;
36-
};
37-
38-
constcountPerType={
39-
Bool16x8: 8,
40-
Bool32x4: 4,
41-
Bool8x16: 16,
42-
Float32x4: 4,
43-
Int16x8: 8,
44-
Int32x4: 4,
45-
Int8x16: 16,
46-
Uint16x8: 8,
47-
Uint32x4: 4,
48-
Uint8x16: 16
49-
};
50-
51-
for(constkeyincountPerType){
52-
consttype=global.SIMD[key];
53-
simdFormatters.set(type,make(type.extractLane,countPerType[key]));
54-
}
55-
}
5621

5722
functiontryStringify(arg){
5823
try{
@@ -508,7 +473,6 @@ function formatValue(ctx, value, recurseTimes){
508473
braces=['{','}'];
509474
formatter=formatPromise;
510475
}else{
511-
letmaybeSimdFormatter;
512476
if(binding.isMapIterator(value)){
513477
constructor={name: 'MapIterator'};
514478
braces=['{','}'];
@@ -519,11 +483,6 @@ function formatValue(ctx, value, recurseTimes){
519483
braces=['{','}'];
520484
empty=false;
521485
formatter=formatCollectionIterator;
522-
}elseif(simdFormatters&&
523-
typeofconstructor==='function'&&
524-
(maybeSimdFormatter=simdFormatters.get(constructor))){
525-
braces=['[',']'];
526-
formatter=maybeSimdFormatter;
527486
}else{
528487
// Unset the constructor to prevent "Object{...}" for ordinary objects.
529488
if(constructor&&constructor.name==='Object')

‎test/parallel/test-util-inspect-simd.js‎

Lines changed: 0 additions & 62 deletions
This file was deleted.

0 commit comments

Comments
(0)