Problems with latest VM

Lendvai Attila Attila.Lendvai at netvisor.hu
Sun Aug 8 11:50:15 PDT 2004


Hi!
 
I've played with VC++, too.
 
The problem is with a specific optimization, called "Global optimizations". This does three things as listed here:
http://www.google.com/url?sa=U&start=4&q=http://msdn.microsoft.com/library/en-us/vccore/html/_core_.2f.og.asp&e=912
 
Lee said, that this might be due to register allocation, and that we should try turning off Global optimizations for the function called "PSObjectHeap_pinCards". This can be done with a #pragma like this:
 
#pragma optimize("g", off)
 
void PSObjectHeap_pinCards() {}
 
#pragma optimize("g", on)
 
I will be able to test it in about 12 hours, but if you (or anyone) has a few minutes please take a look at it. (0.3 is imminent :)
 
bye,
 
- 101
 
 

	-----Eredeti üzenet----- 
	Feladó: slate-bounces at tunes.org meghatalmazó: Jaco van der Merwe 
	Küldve: V 2004. 08. 08. 14:39 
	Címzett: The Slate Environment Mailing List 
	Másolatot kap: 
	Tárgy: Problems with latest VM
	
	

	Hi all,
	
	I've just downloaded the latest VM and slate sources. I compiled the VM with
	Visual C++. I made both a debug and a release build. The debug build VM
	seems to work (at least it loads the image without problems). However, the
	release build fails fairly early while loading the image with an unhandled
	signal message, after which the VM exits.
	
	The fact that the debug and release builds behave differently still
	indicates to me that the VM code accesses memory somewhere that is
	uninitialised, or not intended to be accessed. Therefore, although the debug
	build seems to run, it may be hiding the problem or just postponing it to
	many instructions later. I'm not sure how to proceed with debugging the
	unhandled signal case mostly because I don't understand the underlying
	mechanisms used in the vm. I'll appreciate it if someone can explain it to
	me. Then, maybe I'll be able to debug this case.
	
	Also, when compiling the sources the compiler generates the following
	warning which seems suspicious to me:
	
	   vm.c(3021) : warning C4047: '=' : 'ObjectPointer *' differs in levels of
	indirection from 'ObjectPointer (*)[]'
	
	The offending line of code is as follows:
	
	   vars = &lexicalContext->variables;
	
	where vars and lexicalContext are defined as follows:
	
	   ObjectPointer * vars;
	   struct LexicalContext * lexicalContext;
	
	and LexicalContext is as follows:
	
	   struct LexicalContext {
	      struct ObjectHeader header;
	      struct Map * map;
	      ObjectPointer traits;
	      ObjectPointer unwindBlock;
	      ObjectPointer variables[0];
	   };
	
	This does not seem correct to me. Shouldn't the offending line of code read
	as follows?
	
	   vars = lexicalContext->variables;
	
	Also, the following suspicious warning still remains. This has previously
	been reported by me and other people.
	
	   file.c(136) : warning C4146: unary minus operator applied to unsigned
	type, result still unsigned
	
	The offending line of code is:
	
	   PSObjectHeap_adjustAllOopsBy_ (CurrentMemory, - (unsigned)
	CurrentMemory -> memory);
	
	where the function signature is:
	
	   unsigned long int PSObjectHeap_adjustAllOopsBy_(struct ObjectHeap * h,
	unsigned long int shiftAmountInBytes)
	
	Why give an explicit negative argument to a formal argument that is
	unsigned?
	
	Regards
	
	Jaco van der Merwe
	
	



More information about the Slate mailing list