[Vm-dev] VM Maker: VMMaker.oscog-eem.122.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Sep 5 17:10:09 UTC 2011


Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.122.mcz

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

Name: VMMaker.oscog-eem.122
Author: eem
Time: 5 September 2011, 10:08:18.436 am
UUID: 3dcdc732-75f6-4bc4-934c-9d76770dfbb4
Ancestors: VMMaker.oscog-eem.121

Slang:
Fix bug in generaitng code for builtins, specifically integerObjectOf:.
In an interpreterProxy send, the receiver should be elided only for
the kernel builtins that do memory access, not for interpreterProxy's
protocol.  SO builtin: => kernel: & builtin:.

Refactor the sizeof: code so that e.g. self sizeof: aByteArray answers
the size of the byte array (i.e. alignedByteSizeForClient: => alignedByteSizeOf:forClient:).

Cog:
Move noInlineTemporary:in: from CoInterpreter to StackInterpreter

Remove the undef of halt following includes of sqAssert.h.
sqAssert.h should not implement halt.  This will temporarily break
builds until sqAssert.h is updated.

Make Cogit's halt: invoke warning, not error.

=============== Diff against VMMaker.oscog-eem.121 ===============

Item was changed:
  ----- Method: CCodeGenerator>>builtin: (in category 'utilities') -----
  builtin: sel
  	"Answer true if the given selector is one of the builtin selectors."
  
+ 	^(self kernel: sel) or: [translationDict includesKey: sel]!
- 	^(#(error:
- 		 byteAt: byteAt:put: byteAtPointer: byteAtPointer:put:
- 		 intAt: intAt:put: intAtPointer: intAtPointer:put:
- 		 longAt: longAt:put: longAtPointer: longAtPointer:put:
- 		 shortAt: shortAt:put: shortAtPointer: shortAtPointer:put:
- 		 fetchFloatAt:into: storeFloatAt:from:
- 				fetchFloatAtPointer:into: storeFloatAtPointer:from:
- 		 fetchSingleFloatAt:into: storeSingleFloatAt:from:
- 				fetchSingleFloatAtPointer:into: storeSingleFloatAtPointer:from:)
- 			includes: sel)
- 	  or: [translationDict includesKey: sel]!

Item was added:
+ ----- Method: CCodeGenerator>>kernel: (in category 'utilities') -----
+ kernel: sel
+ 	"Answer true if the given selector is one of the kernel selectors that are implemented as macros."
+ 
+ 	^(#(error:
+ 		 byteAt: byteAt:put: byteAtPointer: byteAtPointer:put:
+ 		 intAt: intAt:put: intAtPointer: intAtPointer:put:
+ 		 longAt: longAt:put: longAtPointer: longAtPointer:put:
+ 		 shortAt: shortAt:put: shortAtPointer: shortAtPointer:put:
+ 		 fetchFloatAt:into: storeFloatAt:from:
+ 				fetchFloatAtPointer:into: storeFloatAtPointer:from:
+ 		 fetchSingleFloatAt:into: storeSingleFloatAt:from:
+ 				fetchSingleFloatAtPointer:into: storeSingleFloatAtPointer:from:)
+ 			includes: sel)!

Item was changed:
  ----- Method: CCodeGenerator>>messageReceiverIsInterpreterProxy: (in category 'utilities') -----
  messageReceiverIsInterpreterProxy: sendNode
  	^self isGeneratingPluginCode
  	  and: [sendNode receiver isVariable
  	  and: ['interpreterProxy' = sendNode receiver name
+ 	  and: [(self kernel: sendNode selector) not]]]!
- 	  and: [(self builtin: sendNode selector) not]]]!

Item was added:
+ ----- Method: CObjectAccessor class>>alignedByteSizeOf:forClient: (in category 'accessing') -----
+ alignedByteSizeOf: aCObjectAccessor forClient: aVMClass
+ 	"Hack; this only works if the object is actually bytes."
+ 	^aCObjectAccessor object size!

Item was removed:
- ----- Method: CoInterpreter>>noInlineTemporary:in: (in category 'internal interpreter access') -----
- noInlineTemporary: offset in: theFP
- 	<var: #theFP type: #'char *'>
- 	<inline: false>
- 	^self temporary: offset in: theFP!

Item was removed:
- ----- Method: CogBlockMethod class>>alignedByteSizeForClient: (in category 'accessing') -----
- alignedByteSizeForClient: aVMClass
- 	^aVMClass cogit cogBlockMethodSurrogateClass alignedByteSize!

Item was added:
+ ----- Method: CogBlockMethod class>>alignedByteSizeOf:forClient: (in category 'accessing') -----
+ alignedByteSizeOf: anObject forClient: aVMClass
+ 	^aVMClass cogit cogBlockMethodSurrogateClass alignedByteSize!

Item was removed:
- ----- Method: CogMethod class>>alignedByteSizeForClient: (in category 'accessing') -----
- alignedByteSizeForClient: aVMClass
- 	^aVMClass cogit cogMethodSurrogateClass alignedByteSize!

Item was added:
+ ----- Method: CogMethod class>>alignedByteSizeOf:forClient: (in category 'accessing') -----
+ alignedByteSizeOf: anObject forClient: aVMClass
+ 	^aVMClass cogit cogMethodSurrogateClass alignedByteSize!

Item was removed:
- ----- Method: CogMethodSurrogate class>>alignedByteSizeForClient: (in category 'accessing') -----
- alignedByteSizeForClient: aVMClass
- 	^self alignedByteSize!

Item was added:
+ ----- Method: CogMethodSurrogate class>>alignedByteSizeOf:forClient: (in category 'accessing') -----
+ alignedByteSizeOf: anObject forClient: aVMClass
+ 	^self alignedByteSize!

Item was removed:
- ----- Method: CogStackPage class>>alignedByteSizeForClient: (in category 'translation') -----
- alignedByteSizeForClient: aVMClass
- 	^self surrogateClass alignedByteSize!

Item was added:
+ ----- Method: CogStackPage class>>alignedByteSizeOf:forClient: (in category 'translation') -----
+ alignedByteSizeOf: anObject forClient: aVMClass
+ 	^self surrogateClass alignedByteSize!

Item was changed:
  ----- Method: Cogit>>halt: (in category 'translation support') -----
  halt: aString
+ 	<cmacro: '(msg) warning("halt: " msg)'>
- 	<cmacro: '(msg) error("halt: " msg)'>
  	Halt new signal: aString!

Item was removed:
- ----- Method: InterpreterStackPage class>>alignedByteSizeForClient: (in category 'translation') -----
- alignedByteSizeForClient: aVMClass
- 	^self alignedByteSize!

Item was added:
+ ----- Method: InterpreterStackPage class>>alignedByteSizeOf:forClient: (in category 'translation') -----
+ alignedByteSizeOf: anObject forClient: aVMClass
+ 	^self alignedByteSize!

Item was added:
+ ----- Method: StackInterpreter>>noInlineTemporary:in: (in category 'internal interpreter access') -----
+ noInlineTemporary: offset in: theFP
+ 	<var: #theFP type: #'char *'>
+ 	<inline: false>
+ 	^self temporary: offset in: theFP!

Item was changed:
  ----- Method: ThreadedFFIPlugin class>>preambleCCode (in category 'translation') -----
  preambleCCode
  	"For a source of builtin defines grep for builtin_define in a gcc release config directory."
  	^'
  #include "sqAssert.h" /* for assert */
- #undef halt /* sqAssert.h provides a halt used in the interpreter */
  
  #ifdef _MSC_VER
  # define alloca _alloca
  #endif
  #if defined(__GNUC__) && (defined(_X86_) || defined(i386) || defined(__i386) || defined(__i386__))
  # define setsp(sp) asm volatile ("movl %0,%%esp" : : "m"(sp))
  # define getsp() ({ void *esp; asm volatile ("movl %%esp,%0" : "=r"(esp) : ); esp;})
  #endif
  #if !!defined(getsp)
  # define getsp() 0
  #endif 
  #if !!defined(setsp)
  # define setsp(ignored) 0
  #endif 
  
  #if !!defined(STACK_ALIGN_BYTES)
  # if __APPLE__ && __MACH__ && __i386__
  #  define STACK_ALIGN_BYTES 16
  # elif __linux__ && __i386__
  #  define STACK_ALIGN_BYTES 16
  # elif defined(__amd64__) || defined(__x86_64__) ||  defined(__amd64) || defined(__x86_64)
  #  define STACK_ALIGN_BYTES 16
  # elif defined(powerpc) || defined(__powerpc__) || defined(_POWER) || defined(__POWERPC__) || defined(__PPC__)
  #  define STACK_ALIGN_BYTES 16
  # elif defined(__sparc64__) || defined(__sparcv9__) || defined(__sparc_v9__) /* must preceed 32-bit sparc defs */
  #  define STACK_ALIGN_BYTES 16
  # elif defined(sparc) || defined(__sparc__) || defined(__sparclite__)
  #  define STACK_ALIGN_BYTES 8
  # else
  #  define STACK_ALIGN_BYTES 0
  # endif
  #endif /* !!defined(STACK_ALIGN_BYTES) */
  
  #if !!defined(STACK_OFFSET_BYTES)
  # define STACK_OFFSET_BYTES 0
  #endif
  
  #if defined(_X86_) || defined(i386) || defined(__i386) || defined(__i386__)
  /* Both Mac OS X x86 and Win32 x86 return structs of a power of two in size
   * less than or equal to eight bytes in length in registers. Linux never does so.
   */
  # if __linux__
  #	define WIN32_X86_STRUCT_RETURN 0
  # else
  #	define WIN32_X86_STRUCT_RETURN 1
  # endif
  # if WIN32
  #	define PLATFORM_API_USES_CALLEE_POPS_CONVENTION 1
  # else
  #	define PLATFORM_API_USES_CALLEE_POPS_CONVENTION 0
  # endif
  # if defined(__MINGW32__) && (__GNUC__ >= 3)
      /*
       * cygwin -mno-cygwin (MinGW) gcc 3.4.x''s alloca is a library routine that answers
       * %esp + 4, so the outgoing stack is offset by one word if uncorrected.
       * Grab the actual stack pointer to correct.
       */
  #	define ALLOCA_LIES_SO_USE_GETSP 1
  # endif
  #endif /* defined(_X86_) || defined(i386) || defined(__i386) || defined(__i386__) */
  
  #if !!defined(ALLOCA_LIES_SO_USE_GETSP)
  # define ALLOCA_LIES_SO_USE_GETSP 0
  #endif
  
  /* The dispatchOn:in:with:with: generates an unwanted call on error.  Just squash it. */
  #define error(foo) 0
  
  /* but print assert failures. */
  void
  warning(char *s) { /* Print an error message but don''t exit. */
  	printf("\n%s\n", s);
  }
  '!

Item was changed:
  ----- Method: VMClass>>sizeof: (in category 'translation support') -----
  sizeof: objectSymbolOrClass
  	<doNotGenerate>
  	| index |
  	objectSymbolOrClass isInteger ifTrue:
  		[self flag: #Dan.
  		 ^BytesPerWord].
  	objectSymbolOrClass isSymbol ifTrue:
  		[(objectSymbolOrClass last == $*
  		 or: [#long == objectSymbolOrClass
  		 or: [#'unsigned long' == objectSymbolOrClass]]) ifTrue:
  			[^BytesPerWord].
  		index := #(	#sqLong #usqLong #double
  					#int #'unsigned int' #float
  					#short #'unsigned short'
  					#char #'unsigned char' #'signed char')
  						indexOf: objectSymbolOrClass
  						ifAbsent: [self error: 'unrecognized C type name'].
  		^#(8 8 8
  			4 4 4
  			2 2
  			1 1 1) at: index].
  	^(objectSymbolOrClass isBehavior
  		ifTrue: [objectSymbolOrClass]
+ 		ifFalse: [objectSymbolOrClass class])
+ 			alignedByteSizeOf: objectSymbolOrClass
+ 			forClient: self!
- 		ifFalse: [objectSymbolOrClass class]) alignedByteSizeForClient: self!



More information about the Vm-dev mailing list