1
0
Kaynağa Gözat

Use and: and or:.

They are now inlined,
no need for awkward ifTrue:ifFalse: uses.
Herby Vojčík 4 yıl önce
ebeveyn
işleme
34a2b94a89

+ 5 - 5
lang/src/Compiler-IR.js

@@ -77,11 +77,11 @@ selector: "aliasTemporally:",
 protocol: "visiting",
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["aCollection"],
-source: "aliasTemporally: aCollection\x0a\x09\x22https://lolg.it/amber/amber/issues/296\x0a\x09\x0a\x09If a node is aliased, all preceding ones are aliased as well.\x0a\x09The tree is iterated twice. First we get the aliasing dependency,\x0a\x09then the aliasing itself is done\x22\x0a\x0a\x09| threshold shouldAlias |\x0a\x09shouldAlias := false.\x0a\x09threshold := aCollection reversed\x0a\x09\x09detect: [ :each |\x0a\x09\x09\x09shouldAlias ifTrue: [ true ] ifFalse: [\x0a\x09\x09\x09\x09each shouldBeAliased ifTrue: [ true ] ifFalse: [\x0a\x09\x09\x09\x09\x09(each hasOpeningStatements ifTrue: [ true ] ifFalse: [ each subtreeNeedsAliasing ]) ifTrue: [ shouldAlias := true ].\x0a\x09\x09\x09\x09\x09false ] ] ]\x0a\x09\x09ifNone: [ nil ].\x0a\x09threshold ifNil: [ ^ self visitAll: aCollection ].\x0a\x0a\x09shouldAlias := true.\x0a\x09^ aCollection collect: [ :each |\x0a\x09\x09shouldAlias\x0a\x09\x09\x09ifTrue: [ each == threshold ifTrue: [ shouldAlias := false ]. self alias: each ]\x0a\x09\x09\x09ifFalse: [ self visit: each ] ]",
+source: "aliasTemporally: aCollection\x0a\x09\x22https://lolg.it/amber/amber/issues/296\x0a\x09\x0a\x09If a node is aliased, all preceding ones are aliased as well.\x0a\x09The tree is iterated twice. First we get the aliasing dependency,\x0a\x09then the aliasing itself is done\x22\x0a\x0a\x09| threshold shouldAlias |\x0a\x09shouldAlias := false.\x0a\x09threshold := aCollection reversed\x0a\x09\x09detect: [ :each |\x0a\x09\x09\x09shouldAlias or: [\x0a\x09\x09\x09\x09each shouldBeAliased or: [\x0a\x09\x09\x09\x09\x09(each hasOpeningStatements or: [ each subtreeNeedsAliasing ]) ifTrue: [ shouldAlias := true ].\x0a\x09\x09\x09\x09\x09false ] ] ]\x0a\x09\x09ifNone: [ nil ].\x0a\x09threshold ifNil: [ ^ self visitAll: aCollection ].\x0a\x0a\x09shouldAlias := true.\x0a\x09^ aCollection collect: [ :each |\x0a\x09\x09shouldAlias\x0a\x09\x09\x09ifTrue: [ each == threshold ifTrue: [ shouldAlias := false ]. self alias: each ]\x0a\x09\x09\x09ifFalse: [ self visit: each ] ]",
 referencedClasses: [],
 //>>excludeEnd("ide");
 pragmas: [],
-messageSends: ["detect:ifNone:", "reversed", "ifTrue:ifFalse:", "shouldBeAliased", "ifTrue:", "hasOpeningStatements", "subtreeNeedsAliasing", "ifNil:", "visitAll:", "collect:", "==", "alias:", "visit:"]
+messageSends: ["detect:ifNone:", "reversed", "or:", "shouldBeAliased", "ifTrue:", "hasOpeningStatements", "subtreeNeedsAliasing", "ifNil:", "visitAll:", "collect:", "ifTrue:ifFalse:", "==", "alias:", "visit:"]
 }, function ($methodClass){ return function (aCollection){
 var self=this,$self=this;
 var threshold,shouldAlias;
@@ -140,7 +140,7 @@ return $self._alias_(each);
 return $self._visit_(each);
 }
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,11)});
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,8)});
 //>>excludeEnd("ctx");
 }));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -6145,11 +6145,11 @@ selector: "subtreeNeedsAliasing",
 protocol: "*Compiler-IR",
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "subtreeNeedsAliasing\x0a\x09^ self dagChildren anySatisfy: [ :each |\x0a\x09\x09each shouldBeAliased ifTrue: [ true ] ifFalse: [\x0a\x09\x09\x09each hasOpeningStatements ifTrue: [ true ] ifFalse: [\x0a\x09\x09\x09\x09each subtreeNeedsAliasing ] ] ]",
+source: "subtreeNeedsAliasing\x0a\x09^ self dagChildren anySatisfy: [ :each |\x0a\x09\x09each shouldBeAliased or: [\x0a\x09\x09\x09each hasOpeningStatements or: [\x0a\x09\x09\x09\x09each subtreeNeedsAliasing ] ] ]",
 referencedClasses: [],
 //>>excludeEnd("ide");
 pragmas: [],
-messageSends: ["anySatisfy:", "dagChildren", "ifTrue:ifFalse:", "shouldBeAliased", "hasOpeningStatements", "subtreeNeedsAliasing"]
+messageSends: ["anySatisfy:", "dagChildren", "or:", "shouldBeAliased", "hasOpeningStatements", "subtreeNeedsAliasing"]
 }, function ($methodClass){ return function (){
 var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);

+ 5 - 5
lang/src/Compiler-IR.st

@@ -79,9 +79,9 @@ aliasTemporally: aCollection
 	shouldAlias := false.
 	threshold := aCollection reversed
 		detect: [ :each |
-			shouldAlias ifTrue: [ true ] ifFalse: [
-				each shouldBeAliased ifTrue: [ true ] ifFalse: [
-					(each hasOpeningStatements ifTrue: [ true ] ifFalse: [ each subtreeNeedsAliasing ]) ifTrue: [ shouldAlias := true ].
+			shouldAlias or: [
+				each shouldBeAliased or: [
+					(each hasOpeningStatements or: [ each subtreeNeedsAliasing ]) ifTrue: [ shouldAlias := true ].
 					false ] ] ]
 		ifNone: [ nil ].
 	threshold ifNil: [ ^ self visitAll: aCollection ].
@@ -1423,8 +1423,8 @@ hasOpeningStatements
 
 subtreeNeedsAliasing
 	^ self dagChildren anySatisfy: [ :each |
-		each shouldBeAliased ifTrue: [ true ] ifFalse: [
-			each hasOpeningStatements ifTrue: [ true ] ifFalse: [
+		each shouldBeAliased or: [
+			each hasOpeningStatements or: [
 				each subtreeNeedsAliasing ] ] ]
 ! !
 

+ 10 - 8
lang/src/Compiler-Inlining.js

@@ -2046,22 +2046,18 @@ selector: "shouldInline:",
 protocol: "accessing",
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["anIRSend"],
-source: "shouldInline: anIRSend\x0a\x09(self inlinedSelectors includes: anIRSend selector) ifFalse: [ ^ false ].\x0a\x09anIRSend receiver isSuper ifTrue: [ ^ false ].\x0a\x09^ anIRSend arguments allSatisfy: [ :each | each isClosure ]",
+source: "shouldInline: anIRSend\x0a\x09^ (self inlinedSelectors includes: anIRSend selector) and: [\x0a\x09\x09anIRSend receiver isSuper not and: [\x0a\x09\x09\x09anIRSend arguments allSatisfy: [ :each | each isClosure ] ] ]",
 referencedClasses: [],
 //>>excludeEnd("ide");
 pragmas: [],
-messageSends: ["ifFalse:", "includes:", "inlinedSelectors", "selector", "ifTrue:", "isSuper", "receiver", "allSatisfy:", "arguments", "isClosure"]
+messageSends: ["and:", "includes:", "inlinedSelectors", "selector", "not", "isSuper", "receiver", "allSatisfy:", "arguments", "isClosure"]
 }, function ($methodClass){ return function (anIRSend){
 var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-if(!$core.assert($recv($self._inlinedSelectors())._includes_($recv(anIRSend)._selector()))){
-return false;
-}
-if($core.assert($recv($recv(anIRSend)._receiver())._isSuper())){
-return false;
-}
+if($core.assert($recv($self._inlinedSelectors())._includes_($recv(anIRSend)._selector()))){
+if($core.assert($recv($recv($recv(anIRSend)._receiver())._isSuper())._not())){
 return $recv($recv(anIRSend)._arguments())._allSatisfy_((function(each){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
@@ -2071,6 +2067,12 @@ return $recv(each)._isClosure();
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)});
 //>>excludeEnd("ctx");
 }));
+} else {
+return false;
+}
+} else {
+return false;
+}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"shouldInline:",{anIRSend:anIRSend})});
 //>>excludeEnd("ctx");

+ 3 - 3
lang/src/Compiler-Inlining.st

@@ -530,9 +530,9 @@ inlinedSelectorsNeedingIdempotentReceiver
 !
 
 shouldInline: anIRSend
-	(self inlinedSelectors includes: anIRSend selector) ifFalse: [ ^ false ].
-	anIRSend receiver isSuper ifTrue: [ ^ false ].
-	^ anIRSend arguments allSatisfy: [ :each | each isClosure ]
+	^ (self inlinedSelectors includes: anIRSend selector) and: [
+		anIRSend receiver isSuper not and: [
+			anIRSend arguments allSatisfy: [ :each | each isClosure ] ] ]
 ! !
 
 IRSendInliner subclass: #IRAssignmentInliner

+ 4 - 3
lang/src/Compiler-Interpreter.js

@@ -2220,11 +2220,11 @@ selector: "atEnd",
 protocol: "testing",
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "atEnd\x0a\x09forceAtEnd ifTrue: [ ^ true ].\x0a\x09\x0a\x09^ self hasReturned or: [ self node isNil ]",
+source: "atEnd\x0a\x09^ forceAtEnd or: [ self hasReturned or: [ self node isNil ] ]",
 referencedClasses: [],
 //>>excludeEnd("ide");
 pragmas: [],
-messageSends: ["ifTrue:", "or:", "hasReturned", "isNil", "node"]
+messageSends: ["or:", "hasReturned", "isNil", "node"]
 }, function ($methodClass){ return function (){
 var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -2232,12 +2232,13 @@ return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 if($core.assert($self.forceAtEnd)){
 return true;
-}
+} else {
 if($core.assert($self._hasReturned())){
 return true;
 } else {
 return $recv($self._node())._isNil();
 }
+}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"atEnd",{})});
 //>>excludeEnd("ctx");

+ 1 - 3
lang/src/Compiler-Interpreter.st

@@ -801,9 +801,7 @@ push: anObject
 !ASTInterpreter methodsFor: 'testing'!
 
 atEnd
-	forceAtEnd ifTrue: [ ^ true ].
-	
-	^ self hasReturned or: [ self node isNil ]
+	^ forceAtEnd or: [ self hasReturned or: [ self node isNil ] ]
 !
 
 hasReturned

+ 27 - 29
lang/src/Kernel-Collections.js

@@ -1929,18 +1929,17 @@ selector: "=",
 protocol: "comparing",
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["anAssociativeCollection"],
-source: "= anAssociativeCollection\x0a\x09| comparisons |\x0a\x09self class = anAssociativeCollection class ifFalse: [ ^ false ].\x0a\x09self size = anAssociativeCollection size ifFalse: [ ^ false ].\x0a\x09comparisons := OrderedCollection new.\x0a\x09(self associations allSatisfy: [ :each |\x0a\x09\x09anAssociativeCollection at: each key\x0a\x09\x09\x09ifPresent: [ :otherValue | comparisons add: { each value. otherValue }. true ]\x0a\x09\x09\x09ifAbsent: [ false ] ]) ifFalse: [ ^ false ].\x0a\x09^ comparisons allSatisfy: [ :each | each first = each second ]",
+source: "= anAssociativeCollection\x0a\x09^ self class = anAssociativeCollection class and: [\x0a\x09\x09self size = anAssociativeCollection size and: [\x0a\x09\x09\x09| comparisons |\x0a\x09\x09\x09comparisons := OrderedCollection new.\x0a\x09\x09\x09(self associations allSatisfy: [ :each |\x0a\x09\x09\x09\x09anAssociativeCollection at: each key\x0a\x09\x09\x09\x09\x09ifPresent: [ :otherValue | comparisons add: { each value. otherValue }. true ]\x0a\x09\x09\x09\x09\x09ifAbsent: [ false ] ]) and: [\x0a\x09\x09\x09\x09\x09\x09comparisons allSatisfy: [ :each | each first = each second ] ] ] ]",
 referencedClasses: ["OrderedCollection"],
 //>>excludeEnd("ide");
 pragmas: [],
-messageSends: ["ifFalse:", "=", "class", "size", "new", "allSatisfy:", "associations", "at:ifPresent:ifAbsent:", "key", "add:", "value", "first", "second"]
+messageSends: ["and:", "=", "class", "size", "new", "allSatisfy:", "associations", "at:ifPresent:ifAbsent:", "key", "add:", "value", "first", "second"]
 }, function ($methodClass){ return function (anAssociativeCollection){
 var self=this,$self=this;
-var comparisons;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-if(!$core.assert([$recv([$self._class()
+if($core.assert([$recv([$self._class()
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 ,$ctx1.sendIdx["class"]=1
 //>>excludeEnd("ctx");
@@ -1949,9 +1948,7 @@ if(!$core.assert([$recv([$self._class()
 ,$ctx1.sendIdx["="]=1
 //>>excludeEnd("ctx");
 ][0])){
-return false;
-}
-if(!$core.assert([$recv([$self._size()
+if($core.assert([$recv([$self._size()
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 ,$ctx1.sendIdx["size"]=1
 //>>excludeEnd("ctx");
@@ -1960,10 +1957,9 @@ if(!$core.assert([$recv([$self._size()
 ,$ctx1.sendIdx["="]=2
 //>>excludeEnd("ctx");
 ][0])){
-return false;
-}
+var comparisons;
 comparisons=$recv($globals.OrderedCollection)._new();
-if(!$core.assert([$recv($self._associations())._allSatisfy_((function(each){
+if($core.assert([$recv($self._associations())._allSatisfy_((function(each){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
@@ -1988,8 +1984,6 @@ return false;
 ,$ctx1.sendIdx["allSatisfy:"]=1
 //>>excludeEnd("ctx");
 ][0])){
-return false;
-}
 return $recv(comparisons)._allSatisfy_((function(each){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
@@ -1999,8 +1993,17 @@ return $recv($recv(each)._first()).__eq($recv(each)._second());
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,7)});
 //>>excludeEnd("ctx");
 }));
+} else {
+return false;
+}
+} else {
+return false;
+}
+} else {
+return false;
+}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"=",{anAssociativeCollection:anAssociativeCollection,comparisons:comparisons})});
+}, function($ctx1) {$ctx1.fill(self,"=",{anAssociativeCollection:anAssociativeCollection})});
 //>>excludeEnd("ctx");
 }; }),
 $globals.AssociativeCollection);
@@ -7653,19 +7656,17 @@ selector: "=",
 protocol: "comparing",
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["aCollection"],
-source: "= aCollection\x0a\x09self class = aCollection class ifFalse: [ ^ false ].\x0a\x09self size = aCollection size ifFalse: [ ^ false ].\x0a\x09self do: [ :each | (aCollection includes: each) ifFalse: [ ^ false ] ].\x0a\x09^ true",
+source: "= aCollection\x0a\x09^ self class = aCollection class and: [\x0a\x09\x09self size = aCollection size and: [\x0a\x09\x09\x09self allSatisfy: [ :each | aCollection includes: each ] ] ]",
 referencedClasses: [],
 //>>excludeEnd("ide");
 pragmas: [],
-messageSends: ["ifFalse:", "=", "class", "size", "do:", "includes:"]
+messageSends: ["and:", "=", "class", "size", "allSatisfy:", "includes:"]
 }, function ($methodClass){ return function (aCollection){
 var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $early={};
-try {
-if(!$core.assert([$recv([$self._class()
+if($core.assert([$recv([$self._class()
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 ,$ctx1.sendIdx["class"]=1
 //>>excludeEnd("ctx");
@@ -7674,29 +7675,26 @@ if(!$core.assert([$recv([$self._class()
 ,$ctx1.sendIdx["="]=1
 //>>excludeEnd("ctx");
 ][0])){
-return false;
-}
-if(!$core.assert($recv([$self._size()
+if($core.assert($recv([$self._size()
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 ,$ctx1.sendIdx["size"]=1
 //>>excludeEnd("ctx");
 ][0]).__eq($recv(aCollection)._size()))){
-return false;
-}
-$self._do_((function(each){
+return $self._allSatisfy_((function(each){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-if(!$core.assert($recv(aCollection)._includes_(each))){
-throw $early=[false];
-}
+return $recv(aCollection)._includes_(each);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)});
 //>>excludeEnd("ctx");
 }));
-return true;
+} else {
+return false;
+}
+} else {
+return false;
 }
-catch(e) {if(e===$early)return e[0]; throw e}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"=",{aCollection:aCollection})});
 //>>excludeEnd("ctx");

+ 12 - 13
lang/src/Kernel-Collections.st

@@ -555,15 +555,15 @@ removeKey: aKey ifAbsent: aBlock
 !AssociativeCollection methodsFor: 'comparing'!
 
 = anAssociativeCollection
-	| comparisons |
-	self class = anAssociativeCollection class ifFalse: [ ^ false ].
-	self size = anAssociativeCollection size ifFalse: [ ^ false ].
-	comparisons := OrderedCollection new.
-	(self associations allSatisfy: [ :each |
-		anAssociativeCollection at: each key
-			ifPresent: [ :otherValue | comparisons add: { each value. otherValue }. true ]
-			ifAbsent: [ false ] ]) ifFalse: [ ^ false ].
-	^ comparisons allSatisfy: [ :each | each first = each second ]
+	^ self class = anAssociativeCollection class and: [
+		self size = anAssociativeCollection size and: [
+			| comparisons |
+			comparisons := OrderedCollection new.
+			(self associations allSatisfy: [ :each |
+				anAssociativeCollection at: each key
+					ifPresent: [ :otherValue | comparisons add: { each value. otherValue }. true ]
+					ifAbsent: [ false ] ]) and: [
+						comparisons allSatisfy: [ :each | each first = each second ] ] ] ]
 ! !
 
 !AssociativeCollection methodsFor: 'converting'!
@@ -1811,10 +1811,9 @@ removeAll
 !Set methodsFor: 'comparing'!
 
 = aCollection
-	self class = aCollection class ifFalse: [ ^ false ].
-	self size = aCollection size ifFalse: [ ^ false ].
-	self do: [ :each | (aCollection includes: each) ifFalse: [ ^ false ] ].
-	^ true
+	^ self class = aCollection class and: [
+		self size = aCollection size and: [
+			self allSatisfy: [ :each | aCollection includes: each ] ] ]
 ! !
 
 !Set methodsFor: 'enumerating'!

+ 5 - 4
lang/src/Kernel-Infrastructure.js

@@ -119,24 +119,25 @@ selector: "=",
 protocol: "comparing",
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["anObject"],
-source: "= anObject\x0a\x09anObject class == self class ifFalse: [ ^ false ].\x0a\x09^ JSObjectProxy compareJSObjectOfProxy: self withProxy: anObject",
+source: "= anObject\x0a\x09^ anObject class == self class and: [\x0a\x09\x09JSObjectProxy compareJSObjectOfProxy: self withProxy: anObject ]",
 referencedClasses: ["JSObjectProxy"],
 //>>excludeEnd("ide");
 pragmas: [],
-messageSends: ["ifFalse:", "==", "class", "compareJSObjectOfProxy:withProxy:"]
+messageSends: ["and:", "==", "class", "compareJSObjectOfProxy:withProxy:"]
 }, function ($methodClass){ return function (anObject){
 var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-if(!$core.assert($recv([$recv(anObject)._class()
+if($core.assert($recv([$recv(anObject)._class()
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 ,$ctx1.sendIdx["class"]=1
 //>>excludeEnd("ctx");
 ][0]).__eq_eq($self._class()))){
+return $recv($globals.JSObjectProxy)._compareJSObjectOfProxy_withProxy_(self,anObject);
+} else {
 return false;
 }
-return $recv($globals.JSObjectProxy)._compareJSObjectOfProxy_withProxy_(self,anObject);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"=",{anObject:anObject})});
 //>>excludeEnd("ctx");

+ 2 - 2
lang/src/Kernel-Infrastructure.st

@@ -103,8 +103,8 @@ removeKey: aString
 !JSObjectProxy methodsFor: 'comparing'!
 
 = anObject
-	anObject class == self class ifFalse: [ ^ false ].
-	^ JSObjectProxy compareJSObjectOfProxy: self withProxy: anObject
+	^ anObject class == self class and: [
+		JSObjectProxy compareJSObjectOfProxy: self withProxy: anObject ]
 ! !
 
 !JSObjectProxy methodsFor: 'converting'!

+ 2 - 2
lang/src/Kernel-Objects.js

@@ -385,11 +385,11 @@ selector: "isKindOf:",
 protocol: "testing",
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["aClass"],
-source: "isKindOf: aClass\x0a\x09^ (self isMemberOf: aClass)\x0a\x09\x09ifTrue: [ true ]\x0a\x09\x09ifFalse: [ self class inheritsFrom: aClass ]",
+source: "isKindOf: aClass\x0a\x09^ (self isMemberOf: aClass) or: [ self class inheritsFrom: aClass ]",
 referencedClasses: [],
 //>>excludeEnd("ide");
 pragmas: [],
-messageSends: ["ifTrue:ifFalse:", "isMemberOf:", "inheritsFrom:", "class"]
+messageSends: ["or:", "isMemberOf:", "inheritsFrom:", "class"]
 }, function ($methodClass){ return function (aClass){
 var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);

+ 1 - 3
lang/src/Kernel-Objects.st

@@ -136,9 +136,7 @@ ifNotNil: aBlock ifNil: anotherBlock
 !
 
 isKindOf: aClass
-	^ (self isMemberOf: aClass)
-		ifTrue: [ true ]
-		ifFalse: [ self class inheritsFrom: aClass ]
+	^ (self isMemberOf: aClass) or: [ self class inheritsFrom: aClass ]
 !
 
 isNil