Skip to content

Commit

Permalink
Never compile during activation
Browse files Browse the repository at this point in the history
  • Loading branch information
guillep committed Oct 19, 2023
1 parent c091c12 commit 1e786c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 28 deletions.
11 changes: 2 additions & 9 deletions smalltalksrc/VMMaker/CoInterpreter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -554,19 +554,12 @@ CoInterpreter >> activateNewFullClosure: blockClosure method: theMethod numArgs:
]

{ #category : #'message sending' }
CoInterpreter >> activateNewMethod: shouldCompileToMachineCode [
CoInterpreter >> activateNewMethod [

| methodHeader inInterpreter switched |

"Eagerly compile it if appropriate so that doits are fast."
methodHeader := self rawHeaderOf: newMethod.
(self isCogMethodReference: methodHeader) ifFalse: [
(shouldCompileToMachineCode and: [(self methodWithHeaderShouldBeCogged: methodHeader)])
ifTrue: [
cogit cog: newMethod selector: objectMemory nilObject.
methodHeader := self rawHeaderOf: newMethod ]
ifFalse: [ self maybeFlagMethodAsInterpreted: newMethod ] ].

inInterpreter := self isInstructionPointerInInterpreter:
instructionPointer.

Expand Down Expand Up @@ -3453,7 +3446,7 @@ CoInterpreter >> interpretMethodFromMachineCode [
self
executePrimitiveFromInterpreter: false
ifFail: [ "if not primitive, or primitive failed, activate the method and reenter the interpreter"
self activateNewMethod: false.
self activateNewMethod.
self siglong: reenterInterpreter jmp: ReturnToInterpreter.
"NOTREACHED"
^ nil ]
Expand Down
22 changes: 3 additions & 19 deletions smalltalksrc/VMMaker/StackInterpreter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -1880,14 +1880,6 @@ StackInterpreter >> activateNewFullClosure: blockClosure method: theMethod numAr
{ #category : #'message sending' }
StackInterpreter >> activateNewMethod [

<inline: #always>

self activateNewMethod: true
]

{ #category : #'message sending' }
StackInterpreter >> activateNewMethod: shouldCompileToMachineCode [

| methodHeader switched |
methodHeader := self justActivateNewMethod: false. "either interpreted or machine code"

Expand Down Expand Up @@ -4642,7 +4634,7 @@ StackInterpreter >> commonSendOrdinary [
self sendBreakpoint: messageSelector receiver: (self stackValue: argumentCount).
self doRecordSendTrace.
self findNewMethodOrdinary.
self executeNewMethod: false.
self executeNewMethod.
self fetchNextBytecode
]

Expand Down Expand Up @@ -5432,14 +5424,6 @@ StackInterpreter >> establishFrameForContextToReturnTo: contextToReturnTo [

{ #category : #'message sending' }
StackInterpreter >> executeNewMethod [

<inline: #always>

self executeNewMethod: false
]

{ #category : #'message sending' }
StackInterpreter >> executeNewMethod: shouldCompileToMachineCode [
"if not primitive, or primitive failed, activate the method"

| inInterpreter |
Expand All @@ -5448,7 +5432,7 @@ StackInterpreter >> executeNewMethod: shouldCompileToMachineCode [
self
executePrimitiveFromInterpreter: inInterpreter
ifFail: [ "if not primitive, or primitive failed, activate the method"
self activateNewMethod: shouldCompileToMachineCode ]
self activateNewMethod ]
]

{ #category : #'message sending' }
Expand Down Expand Up @@ -9400,7 +9384,7 @@ StackInterpreter >> mappedDirectCall [
argumentCount := self argumentCountOfMethodHeader: methodHeader.
"The primitive function pointer is not cached in the interpreter, but it's called quickly in the JIT"
primitiveFunctionPointer := self functionPointerFor: localPrimIndex inClass: objectMemory nilObject..
self activateNewMethod: false
self activateNewMethod
]

{ #category : #'sista bytecodes' }
Expand Down

0 comments on commit 1e786c0

Please sign in to comment.