-----Original Message-----
From: András Páhi [mailto:pa...@info-m.hu]
Sent: Monday, October 02, 2006 9:42 PM
To: David Griswold
Subject: RE: Code ReviewHi David,No, you understand everything to get the sources to compile underVS6. Gilad Bracha pointed out, that it would be good to port the sourcesto more recent versions like VS7.1 or VS8.The changes you mentioned are only needed to compile under VS7.1.The VS7.1 C++ compiler does different scoping for the friend functionsthan the VS6 compiler did. So the change is effectively to move thosefunctions outside of the class declarations and thus removing theirinline properties.I have sent two files for the original Strongtalk group at groups.yahoo.com.The first one contained only the changes needed to compile under VS6and some minor changes to compile under VS7.1. (strongtalk-sources.zip)The other one strongtalk-source-1.0-vs71.zip which contains the entiresource, contains two important fixes, which are actually bugs in the originalcode. The first one is in the VirtualSpaces::remove function. Inside the forloop the condition is p->next = sp which is incorrect. p->next == sp is theright code.The second one is a calling convention mix-up. The primitives in vm/prims/double_prims_asm.asm and smi_prims_asm.asm contain routines whichuse the __stdcall calling convention. The corresponding .hpp files(double_prims.hpp and smi_prims.hpp) miss the PRIM_API callingconvention declaration in the external function declarations. So does theprim.cpp file in the prim_fntypeX declarations.I have included these modifications in the attached files. If you want to runthe code through VS6 no other modifications are necessary.I would like to stabilize first the VM code under some VisualStudio version,which you prefer. Just chose one of VS6 or VS7.1, which you like. I had ahard time to fire up the VM under VS8, but no results so far. The VM crashedin the Debug and Product versions also, so I gave up and concentrated toVS7.1 only. I did a quick trial to compile under a recent GCC version, butit requires *LOT OF WORK*, which I think is overkill in this time. I would liketo get the VM stable enough for one compiler on one platform.Regards,Andras Pahi-----Eredeti üzenet-----
Feladó: David Griswold [mailto:David.G...@acm.org]
Küldve: Monday, October 02, 2006 3:02 AM
Címzett: pa...@info-m.hu
Másolatot kap: strongtal...@googlegroups.com
Tárgy: Code ReviewHi Andras,
Sorry it's taken me so long to review the changes you submitted to get Strongtalk to build under VS6. Here are my comments:
I don't understand why you have changed the inline function declarations into non-inline definitions. We want those to be inline functions since they are performance critical, very small operations. The system seems to compile and run with only the following changes, as far as I can see:
- compiler\expr.hpp 36: need (?:) to return bool, rather than implicit conversion.
- runtime\debug.cpp 41: bug: MATERIALIZE_BOOLEAN_FLAG should be MATERIALIZE_INTEGER_FLAG. This is an error in the original code.
- topIncludes\types.hpp 36: change so that bool is not redefined for VC++.
- recompiler\recompiler.hpp 48: needRecompilerCounter must return bool; no return type declared; didn't match def. This is an error in the original code.
- code\inliningdb.cpp 739: file_out_all is declared to return a bool, which is wrong and doesn't match the decl of int. This is an error in the original code.
Is there something I am not understanding?Cheers,Dave
-----Original Message-----
From: András Páhi [mailto:pa...@info-m.hu]
Sent: Monday, October 02, 2006 9:42 PM
To: David Griswold
Subject: RE: Code Review
(...)
I did a quick trial to compile under a recent GCC version, butit requires *LOT OF WORK*, which I think is overkill in this time. I would liketo get the VM stable enough for one compiler on one platform.Regards,Andras Pahi
Ok, thanks for explain :)
Just out of curiosity, can anyone point out what exacly is the reason for using
those makedeps/generated includes? I mean, if my observation is correct,
makedeps creates the incls/* based on deps/includeDB, and this file is just an
specification of what sources include what. I'm not aware of scenarios where
such mechanism would help (instead of writing directly the dependencies in the
source files).
> As for the inline assembly; I don't believe there is any actual inline
> assembly in the C++.
I'm referring to this codes:
-prims/integerOps.cpp: lines 266, 287, 307, 330
-runtime/savedRegisters.cpp: line 65
-utilities/longInt.cpp:lines 43, 57, 71, 80
and so on...
> There *is* assembly code there, but it is written using
> pure C++ constructs to model an assembler. The C++ code then uses it to
> generate most of the interpreter when it starts up. When development stopped
> Robert Griesemer was in the process of converting all the external assembler
> into that format, in C++. Over time, we should complete that process, and
> then we won't need Turbo Assembler anymore.
> -Dave
Interesting.
I was wandering what faith those Tasm sources would have...
Thiago Silva
Thiago Silva wrote:
> > As for the inline assembly; I don't believe there is any actual inline
> > assembly in the C++.
>
> I'm referring to this codes:
>
> -prims/integerOps.cpp: lines 266, 287, 307, 330
> -runtime/savedRegisters.cpp: line 65
> -utilities/longInt.cpp:lines 43, 57, 71, 80
> and so on...
>
> > There *is* assembly code there, but it is written using
> > pure C++ constructs to model an assembler. The C++ code then uses it to
> > generate most of the interpreter when it starts up. When
> development stopped
> > Robert Griesemer was in the process of converting all the
> external assembler
> > into that format, in C++. Over time, we should complete that
> process, and
> > then we won't need Turbo Assembler anymore.
> > -Dave
It appears you are right, there is a little bit of inline assembler in a few
places. Hopefully very little of it.
-Dave
> I am trying to compile StrongTalk on MacOS X 10.4.8, also with g++ 3.4.
> I have two GNU makefiles.
I'm sorry I missed your previous email.
I didn't face the errors you did, so I'm not sure how to work around them...
> Can you send me a diff ?
I'm attaching the patch with modifications I've been done to compile
with MingW/MSYS (g++ 3.4.2) on MS Windows.
Some notes about the changes:
* I'm compiling with -DPRODUCT -DDELTA_COMPILER
* I didn't use -Dstd. Instead, I renamed "std" to Stdout and "err" to
Stderr (utilities/outputstream.?pp).
* Constructions like the following don't compile under g++:
char* name = f() ? "nmethod" : (isPIC() ? " PIC" : "count stub");
* There are lots of "for" loops declaring counters in it's own context
and then, using it latter, outside it's context (see
compiler/bitVector.cpp). I've been declaring such counters just before
the loop, so they are used in the entire method scope (there are
cleaner approaches for some cases, tough).
* "and", "or", "xor" identifiers are keywords. As for std, I've
renamed the identifiers with such names.
* I haven't tried using assembly Intel syntax. Maybe using it would be better...
* I didn't test too much some assembly blocks, even tough I pray for
it's rightness :)
> Also, which version of StrongTalk are you using ? Straight off SVN ?
Yep, SVN sources.
Thiago Silva