Created
December 5, 2011 19:09
-
-
Save seandenigris/1434823 to your computer and use it in GitHub Desktop.
Cog VM (Squeak/Pharo Smalltalk) Hack: Skip Message Send (Smalltalk part)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commonSend | |
"Send a message, starting lookup with the receiver's class." | |
"Assume: messageSelector and argumentCount have been set, and that | |
the receiver and arguments have been pushed onto the stack," | |
"Note: This method is inlined into the interpreter dispatch loop." | |
<sharedCodeNamed: 'commonSend' inCase: 131> | |
self sendBreak: messageSelector + BaseHeaderSize | |
point: (objectMemory lengthOf: messageSelector) | |
receiver: (self internalStackValue: argumentCount). | |
cogit recordSendTrace ifTrue: | |
[self recordTrace: lkupClass thing: messageSelector source: TraceIsFromInterpreter. | |
cogit printOnTrace ifTrue: | |
[self printActivationNameForSelector: messageSelector startClass: lkupClass; cr]]. | |
"This hook will not work until we tweak the C source code" | |
messageSelector = #skipMe: | |
ifTrue: [ "we will manually insert code here" ] | |
ifFalse: [ | |
self internalFindNewMethod. | |
self internalExecuteNewMethod ]. | |
self fetchNextBytecode. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment