VM Maker: VMMaker.oscog-nice.2580.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

VM Maker: VMMaker.oscog-nice.2580.mcz

commits-2
 
Nicolas Cellier uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-nice.2580.mcz

==================== Summary ====================

Name: VMMaker.oscog-nice.2580
Author: nice
Time: 9 November 2019, 10:24:35.162108 am
UUID: 80ed6059-062f-4907-843c-7ae7d21d86aa
Ancestors: VMMaker.oscog-nice.2578

NewspeakV4 is using this byte code:

        (2 239 239 genExtSendSuperBytecode isMapped)

But genExtSendSuperBytecode may result in genSendDirectedSuper:numArgs: send

Therefore, we should set BytecodeSetHasDirectedSuperSend to true, otherwise the generated code for genSendDirectedSuper:numArgs: is broken.

THIS IS A REPLACEMENT FOR VMMaker.oscog-nice.2579 WHICH SHOULD BE GARBAGE COLLECTED
I naively ignored the code duplications...

=============== Diff against VMMaker.oscog-nice.2578 ===============

Item was changed:
  ----- Method: SimpleStackBasedCogit class>>initializeBytecodeTableForNewspeakV4 (in category 'class initialization') -----
  initializeBytecodeTableForNewspeakV4
  "SimpleStackBasedCogit initializeBytecodeTableForNewspeakV4"
 
+ BytecodeSetHasDirectedSuperSend := true.
+ BytecodeSetHasExtensions := true.
  NSSendIsPCAnnotated := false. "IsNSSendCall used by SendAbsentImplicit"
  FirstSpecialSelector := 80.
  NumSpecialSelectors := 32.
  self flag:
  'Special selector send class must be inlined to agree with the interpreter, which
   inlines class.  If class is sent to e.g. a general instance of ProtoObject then unless
   class is inlined there will be an MNU.  It must be that the Cointerpreter and Cogit
   have identical semantics.  We get away with not hardwiring the other special
   selectors either because in the Cointerpreter they are not inlined or because they
   are inlined only to instances of classes for which there will always be a method.'.
  self generatorTableFrom: #(
  "1 byte bytecodes"
  (1    0   15 genPushReceiverVariableBytecode isInstVarRef)
  (1  16   31 genPushLiteralVariable16CasesBytecode needsFrameNever: 1)
  (1  32   63 genPushLiteralConstantBytecode needsFrameNever: 1)
  (1  64   75 genPushTemporaryVariableBytecode)
  (1  76   76 genPushReceiverBytecode)
  (1  77   77 genExtPushPseudoVariableOrOuterBytecode)
  (1  78   78 genPushConstantZeroBytecode)
  (1  79   79 genPushConstantOneBytecode)
 
  (1   80 101 genSpecialSelectorSend isMapped) "#+ #- #< #> #<= #>= #= #~= #* #/ #\\ #@ #bitShift: #// #bitAnd: #bitOr: #at: #at:put: #size #next #nextPut: #atEnd"
  (1 102 102 genSpecialSelectorEqualsEquals needsFrameNever: notMapped -1) "not mapped because it is directly inlined (for now)"
  (1 103 103 genSpecialSelectorClass needsFrameNever: notMapped 0) "not mapped because it is directly inlined (for now)"
  (1 104 104 genSpecialSelectorNotEqualsEquals needsFrameNever: notMapped -1) "not mapped because it is directly inlined (for now)"
  (1 105 111 genSpecialSelectorSend isMapped) "#value #value: #do: #new #new: #x #y"
 
  (1 112 127 genSendLiteralSelector0ArgsBytecode isMapped)
  (1 128 143 genSendLiteralSelector1ArgBytecode isMapped)
  (1 144 159 genSendLiteralSelector2ArgsBytecode isMapped)
  (1 160 175 genSendAbsentImplicit0ArgsBytecode isMapped hasIRC)
 
  (1 176 183 genStoreAndPopReceiverVariableBytecode isInstVarRef isMappedIfImmutability needsFrameIfImmutability: -1)
 
  (1 184 191 genStoreAndPopTemporaryVariableBytecode)
 
  (1 192 199 genShortUnconditionalJump branch v3:ShortForward:Branch:Distance:)
  (1 200 207 genShortJumpIfTrue branch isBranchTrue isMapped "because of mustBeBoolean"
  v3:ShortForward:Branch:Distance:)
  (1 208 215 genShortJumpIfFalse branch isBranchFalse isMapped "because of mustBeBoolean"
  v3:ShortForward:Branch:Distance:)
 
  (1 216 216 genReturnReceiver return needsFrameIfInBlock: isMappedInBlock 0)
  (1 217 217 genReturnTopFromMethod return needsFrameIfInBlock: isMappedInBlock -1)
  (1 218 218 genExtReturnTopFromBlock return needsFrameNever: -1)
 
  (1 219 219 duplicateTopBytecode needsFrameNever: 1)
  (1 220 220 genPopStackBytecode needsFrameNever: -1)
  (1 221 221 genExtNopBytecode needsFrameNever: 0)
  (1 222 223 unknownBytecode)
 
  "2 byte bytecodes"
  (2 224 224 extABytecode extension)
  (2 225 225 extBBytecode extension)
  (2 226 226 genExtPushReceiverVariableBytecode isInstVarRef)
  (2 227 227 genExtPushLiteralVariableBytecode needsFrameNever: 1)
  (2 228 228 genExtPushLiteralBytecode needsFrameNever: 1)
  (2 229 229 genExtPushIntegerBytecode needsFrameNever: 1)
  (2 230 230 genLongPushTemporaryVariableBytecode)
  (2 231 231 genPushNewArrayBytecode)
  (2 232 232 genExtStoreReceiverVariableBytecode isInstVarRef isMappedIfImmutability)
  (2 233 233 genExtStoreLiteralVariableBytecode isMappedIfImmutability)
  (2 234 234 genLongStoreTemporaryVariableBytecode)
  (2 235 235 genExtStoreAndPopReceiverVariableBytecode isInstVarRef isMappedIfImmutability)
  (2 236 236 genExtStoreAndPopLiteralVariableBytecode isMappedIfImmutability)
  (2 237 237 genLongStoreAndPopTemporaryVariableBytecode)
 
  (2 238 238 genExtSendBytecode isMapped)
  (2 239 239 genExtSendSuperBytecode isMapped)
  (2 240 240 genExtSendAbsentImplicitBytecode isMapped hasIRC)
  (2 241 241 genExtSendAbsentDynamicSuperBytecode isMapped hasIRC)
 
  (2 242 242 genExtUnconditionalJump branch isMapped "because of interrupt check" v4:Long:Branch:Distance:)
  (2 243 243 genExtJumpIfTrue branch isBranchTrue isMapped "because of mustBeBoolean" v4:Long:Branch:Distance:)
  (2 244 244 genExtJumpIfFalse branch isBranchFalse isMapped "because of mustBeBoolean" v4:Long:Branch:Distance:)
 
  (2 245 245 genExtSendAbsentSelfBytecode isMapped hasIRC)
 
  (2 246 248 unknownBytecode)
 
  "3 byte bytecodes"
  (3 249 249 genCallPrimitiveBytecode)
  (3 250 250 genPushRemoteTempLongBytecode)
  (3 251 251 genStoreRemoteTempLongBytecode)
  (3 252 252 genStoreAndPopRemoteTempLongBytecode)
  (3 253 253 genExtPushClosureBytecode block v4:Block:Code:Size:)
  (3 254 254 genExtSendAbsentOuterBytecode isMapped hasIRC)
 
  (3 255 255 unknownBytecode))!

Item was changed:
  ----- Method: StackInterpreter class>>initializeBytecodeTableForNewspeakV4 (in category 'initialization') -----
  initializeBytecodeTableForNewspeakV4
  "StackInterpreter initializeBytecodeTableForNewspeakV4"
  "Note: This table will be used to generate a C switch statement."
 
  InitializationOptions at: #NewsqueakV4BytecodeSet put: (NewsqueakV4BytecodeSet := true).
  BytecodeTable := Array new: 256.
  BytecodeEncoderClassName := #EncoderForNewsqueakV4.
+ BytecodeSetHasDirectedSuperSend := true.
  BytecodeSetHasExtensions := true.
  LongStoreBytecode := 234.
  self table: BytecodeTable from:
  #( "1 byte bytecodes"
  (   0  15 pushReceiverVariableBytecode)
  ( 16  31 pushLiteralVariable16CasesBytecode)
  ( 32  63 pushLiteralConstantBytecode)
  ( 64  75 pushTemporaryVariableBytecode)
  ( 76 pushReceiverBytecode)
  ( 77 extPushPseudoVariableOrOuterBytecode)
  ( 78 pushConstantZeroBytecode)
  ( 79 pushConstantOneBytecode)
 
  ( 80 bytecodePrimAdd)
  ( 81 bytecodePrimSubtract)
  ( 82 bytecodePrimLessThanV4) "for booleanCheatV4:"
  ( 83 bytecodePrimGreaterThanV4) "for booleanCheatV4:"
  ( 84 bytecodePrimLessOrEqualV4) "for booleanCheatV4:"
  ( 85 bytecodePrimGreaterOrEqualV4) "for booleanCheatV4:"
  ( 86 bytecodePrimEqualV4) "for booleanCheatV4:"
  ( 87 bytecodePrimNotEqualV4) "for booleanCheatV4:"
  ( 88 bytecodePrimMultiply)
  ( 89 bytecodePrimDivide)
  ( 90 bytecodePrimMod)
  ( 91 bytecodePrimMakePoint)
  ( 92 bytecodePrimBitShift)
  ( 93 bytecodePrimDiv)
  ( 94 bytecodePrimBitAnd)
  ( 95 bytecodePrimBitOr)
 
  ( 96 bytecodePrimAt)
  ( 97 bytecodePrimAtPut)
  ( 98 bytecodePrimSize)
  ( 99 bytecodePrimNext)
  (100 bytecodePrimNextPut)
  (101 bytecodePrimAtEnd)
  (102 bytecodePrimIdenticalV4) "for booleanCheatV4:"
  (103 bytecodePrimClass)
  (104 bytecodePrimNotIdenticalV4) "was blockCopy:"
  (105 bytecodePrimValue)
  (106 bytecodePrimValueWithArg)
  (107 bytecodePrimDo)
  (108 bytecodePrimNew)
  (109 bytecodePrimNewWithArg)
  (110 bytecodePrimPointX)
  (111 bytecodePrimPointY)
 
  (112 127 sendLiteralSelector0ArgsBytecode)
  (128 143 sendLiteralSelector1ArgBytecode)
  (144 159 sendLiteralSelector2ArgsBytecode)
  (160 175 sendAbsentImplicit0ArgsBytecode)
 
  (176 183 storeAndPopReceiverVariableBytecode)
  (184 191 storeAndPopTemporaryVariableBytecode)
 
  (192 199 shortUnconditionalJump)
  (200 207 shortConditionalJumpTrue)
  (208 215 shortConditionalJumpFalse)
 
  (216 returnReceiver)
  (217 returnTopFromMethod)
  (218 extReturnTopFromBlock)
 
  (219 duplicateTopBytecode)
  (220 popStackBytecode)
  (221 extNopBytecode)
  (222 223 unknownBytecode)
 
  "2 byte bytecodes"
  (224 extABytecode)
  (225 extBBytecode)
 
  (226 extPushReceiverVariableBytecode)
  (227 extPushLiteralVariableBytecode)
  (228 extPushLiteralBytecode)
  (229 extPushIntegerBytecode)
  (230 longPushTemporaryVariableBytecode)
  (231 pushNewArrayBytecode)
  (232 extStoreReceiverVariableBytecode)
  (233 extStoreLiteralVariableBytecode)
  (234 longStoreTemporaryVariableBytecode)
  (235 extStoreAndPopReceiverVariableBytecode)
  (236 extStoreAndPopLiteralVariableBytecode)
  (237 longStoreAndPopTemporaryVariableBytecode)
 
  (238 extSendBytecode)
  (239 extSendSuperBytecode)
  (240 extSendAbsentImplicitBytecode)
  (241 extSendAbsentDynamicSuperBytecode)
 
  (242 extUnconditionalJump)
  (243 extJumpIfTrue)
  (244 extJumpIfFalse)
 
  (245 extSendAbsentSelfBytecode)
 
  (246 248 unknownBytecode)
 
  "3 byte bytecodes"
  (249 callPrimitiveBytecode)
 
  (250 pushRemoteTempLongBytecode)
  (251 storeRemoteTempLongBytecode)
  (252 storeAndPopRemoteTempLongBytecode)
  (253 extPushClosureBytecode)
  (254 extSendAbsentOuterBytecode)
 
  (255 unknownBytecode)
  )!

Item was changed:
  ----- Method: StackToRegisterMappingCogit class>>initializeBytecodeTableForNewspeakV4 (in category 'class initialization') -----
  initializeBytecodeTableForNewspeakV4
  "StackToRegisterMappingCogit initializeBytecodeTableForNewspeakV4"
 
+ BytecodeSetHasDirectedSuperSend := true.
+ BytecodeSetHasExtensions := true.
  numPushNilsFunction := #v4:Num:Push:Nils:.
  pushNilSizeFunction := #v4PushNilSize:numInitialNils:.
  NSSendIsPCAnnotated := true. "IsNSSendCall used by SendAbsentImplicit"
  FirstSpecialSelector := 80.
  NumSpecialSelectors := 32.
  self flag:
  'Special selector send class must be inlined to agree with the interpreter, which
   inlines class.  If class is sent to e.g. a general instance of ProtoObject then unless
   class is inlined there will be an MNU.  It must be that the Cointerpreter and Cogit
   have identical semantics.  We get away with not hardwiring the other special
   selectors either because in the Cointerpreter they are not inlined or because they
   are inlined only to instances of classes for which there will always be a method.'.
  self generatorTableFrom: #(
  "1 byte bytecodes"
  (1    0   15 genPushReceiverVariableBytecode isInstVarRef needsFrameNever: 1)
  (1  16   31 genPushLiteralVariable16CasesBytecode needsFrameNever: 1)
  (1  32   63 genPushLiteralConstantBytecode needsFrameNever: 1)
  (1  64   75 genPushTemporaryVariableBytecode needsFrameIfMod16GENumArgs: 1)
  (1  76   76 genPushReceiverBytecode needsFrameNever: 1)
  (1  77   77 genExtPushPseudoVariableOrOuterBytecode needsFrameIfExtBGT2: 1)
  (1  78   78 genPushConstantZeroBytecode needsFrameNever: 1)
  (1  79   79 genPushConstantOneBytecode needsFrameNever: 1)
 
  (1   80   80 genSpecialSelectorArithmetic isMapped AddRR)
  (1   81   81 genSpecialSelectorArithmetic isMapped SubRR)
  (1   82   82 genSpecialSelectorComparison isMapped JumpLess)
  (1   83   83 genSpecialSelectorComparison isMapped JumpGreater)
  (1   84   84 genSpecialSelectorComparison isMapped JumpLessOrEqual)
  (1   85   85 genSpecialSelectorComparison isMapped JumpGreaterOrEqual)
  (1   86   86 genSpecialSelectorComparison isMapped JumpZero)
  (1   87   87 genSpecialSelectorComparison isMapped JumpNonZero)
  (1   88   93 genSpecialSelectorSend isMapped) " #* #/ #\\ #@ #bitShift: //"
  (1   94   94 genSpecialSelectorArithmetic isMapped AndRR)
  (1   95   95 genSpecialSelectorArithmetic isMapped OrRR)
  (1   96 101 genSpecialSelectorSend isMapped) "#at: #at:put: #size #next #nextPut: #atEnd"
  (1 102 102 genSpecialSelectorEqualsEquals needsFrameNever: notMapped -1) "not mapped because it is directly inlined (for now)"
  (1 103 103 genSpecialSelectorClass needsFrameIfStackGreaterThanOne: notMapped 0) "not mapped because it is directly inlined (for now)"
  (1 104 104 genSpecialSelectorNotEqualsEquals needsFrameNever: notMapped -1) "not mapped because it is directly inlined (for now)"
  (1 105 111 genSpecialSelectorSend isMapped) " #value #value: #do: #new #new: #x #y"
 
  (1 112 127 genSendLiteralSelector0ArgsBytecode isMapped)
  (1 128 143 genSendLiteralSelector1ArgBytecode isMapped)
  (1 144 159 genSendLiteralSelector2ArgsBytecode isMapped)
  (1 160 175 genSendAbsentImplicit0ArgsBytecode isMapped hasIRC)
 
  (1 176 183 genStoreAndPopReceiverVariableBytecode isInstVarRef is1ByteInstVarStore isMappedIfImmutability needsFrameIfImmutability: -1)
 
  (1 184 191 genStoreAndPopTemporaryVariableBytecode)
 
  (1 192 199 genShortUnconditionalJump branch v3:ShortForward:Branch:Distance:)
  (1 200 207 genShortJumpIfTrue branch isBranchTrue isMapped "because of mustBeBoolean"
  v3:ShortForward:Branch:Distance:)
  (1 208 215 genShortJumpIfFalse branch isBranchFalse isMapped "because of mustBeBoolean"
  v3:ShortForward:Branch:Distance:)
 
  (1 216 216 genReturnReceiver return needsFrameIfInBlock: isMappedInBlock 0)
  (1 217 217 genReturnTopFromMethod return needsFrameIfInBlock: isMappedInBlock -1)
  (1 218 218 genExtReturnTopFromBlock return needsFrameNever: -1)
 
  (1 219 219 duplicateTopBytecode needsFrameNever: 1)
  (1 220 220 genPopStackBytecode needsFrameNever: -1)
  (1 221 221 genExtNopBytecode needsFrameNever: 0)
  (1 222 223 unknownBytecode)
 
  "2 byte bytecodes"
  (2 224 224 extABytecode extension needsFrameNever: 0)
  (2 225 225 extBBytecode extension needsFrameNever: 0)
  (2 226 226 genExtPushReceiverVariableBytecode isInstVarRef)
  (2 227 227 genExtPushLiteralVariableBytecode needsFrameNever: 1)
  (2 228 228 genExtPushLiteralBytecode needsFrameNever: 1)
  (2 229 229 genExtPushIntegerBytecode needsFrameNever: 1)
  (2 230 230 genLongPushTemporaryVariableBytecode)
  (2 231 231 genPushNewArrayBytecode)
  (2 232 232 genExtStoreReceiverVariableBytecode isInstVarRef isMappedIfImmutability)
  (2 233 233 genExtStoreLiteralVariableBytecode isMappedIfImmutability)
  (2 234 234 genLongStoreTemporaryVariableBytecode)
  (2 235 235 genExtStoreAndPopReceiverVariableBytecode isInstVarRef isMappedIfImmutability)
  (2 236 236 genExtStoreAndPopLiteralVariableBytecode isMappedIfImmutability)
  (2 237 237 genLongStoreAndPopTemporaryVariableBytecode)
 
  (2 238 238 genExtSendBytecode isMapped)
  (2 239 239 genExtSendSuperBytecode isMapped)
  (2 240 240 genExtSendAbsentImplicitBytecode isMapped hasIRC)
  (2 241 241 genExtSendAbsentDynamicSuperBytecode isMapped hasIRC)
 
  (2 242 242 genExtUnconditionalJump branch isMapped "because of interrupt check" v4:Long:Branch:Distance:)
  (2 243 243 genExtJumpIfTrue branch isBranchTrue isMapped "because of mustBeBoolean" v4:Long:Branch:Distance:)
  (2 244 244 genExtJumpIfFalse branch isBranchFalse isMapped "because of mustBeBoolean" v4:Long:Branch:Distance:)
 
  (2 245 245 genExtSendAbsentSelfBytecode isMapped hasIRC)
 
  (2 246 248 unknownBytecode)
 
  "3 byte bytecodes"
  (3 249 249 genCallPrimitiveBytecode)
  (3 250 250 genPushRemoteTempLongBytecode)
  (3 251 251 genStoreRemoteTempLongBytecode)
  (3 252 252 genStoreAndPopRemoteTempLongBytecode)
  (3 253 253 genExtPushClosureBytecode block v4:Block:Code:Size:)
  (3 254 254 genExtSendAbsentOuterBytecode isMapped hasIRC)
 
  (3 255 255 unknownBytecode))!