@@ -337,7 +337,6 @@ public abstract static class CallNode extends PythonVarargsBuiltinNode {
337
337
@ CompilationFinal private ConditionProfile hasNew = ConditionProfile .createBinaryProfile ();
338
338
@ CompilationFinal private ConditionProfile hasInit = ConditionProfile .createBinaryProfile ();
339
339
@ CompilationFinal private ConditionProfile gotInitResult = ConditionProfile .createBinaryProfile ();
340
- @ CompilationFinal private ConditionProfile needsInit = ConditionProfile .createBinaryProfile ();
341
340
342
341
@ CompilationFinal private boolean newWasDescriptor = false ;
343
342
@@ -487,7 +486,7 @@ private Object op(VirtualFrame frame, Object self, Object[] arguments, PKeyword[
487
486
// see typeobject.c#type_call()
488
487
// Ugly exception: when the call was type(something),
489
488
// don't call tp_init on the result.
490
- if (needsInit . profile (!( arguments . length == 2 && arguments [ 0 ] == PythonBuiltinClassType . PythonClass && keywords .length == 0 ) )) {
489
+ if (!( self == PythonBuiltinClassType . PythonClass && arguments . length == 2 && keywords .length == 0 )) {
491
490
callInit (lib , newInstance , self , frame , doCreateArgs , arguments , keywords );
492
491
}
493
492
return newInstance ;
@@ -496,7 +495,7 @@ private Object op(VirtualFrame frame, Object self, Object[] arguments, PKeyword[
496
495
}
497
496
}
498
497
499
- private void callInit (PythonObjectLibrary lib , Object newInstance , Object self , VirtualFrame frame , boolean doCreateArgs , Object [] arguments , PKeyword [] keywords ) throws PException {
498
+ private void callInit (PythonObjectLibrary lib , Object newInstance , Object self , VirtualFrame frame , boolean doCreateArgs , Object [] arguments , PKeyword [] keywords ) {
500
499
Object newInstanceKlass = lib .getLazyPythonClass (newInstance );
501
500
if (isSubType (newInstanceKlass , self )) {
502
501
Object initMethod = getInitNode ().execute (frame , newInstanceKlass , newInstance );
0 commit comments