Mix & match plugin and interpreter in Cog

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

Mix & match plugin and interpreter in Cog

Igor Stasenko
 
Hello,

in order to avoid overrides to CoInterpreter,
i created a subclass - NBCoInterpreter, where i put overridden methods.

Now how i could tell that CogNativeBoostPlugin is fine for including when
generating code using NBCoInterpreter, but not CoInterpreter,
so it won't be mistakenly included in standard Cog VM build?

--
Best regards,
Igor Stasenko AKA sig.
Reply | Threaded
Open this post in threaded view
|

Re: Mix & match plugin and interpreter in Cog

Eliot Miranda-2
 


On Tue, Oct 5, 2010 at 5:02 PM, Igor Stasenko <[hidden email]> wrote:

Hello,

in order to avoid overrides to CoInterpreter,
i created a subclass - NBCoInterpreter, where i put overridden methods.

Now how i could tell that CogNativeBoostPlugin is fine for including when
generating code using NBCoInterpreter, but not CoInterpreter,
so it won't be mistakenly included in standard Cog VM build?

You could bump  VM_PROXY_MINOR one higher and do that in the makefile/xcode project file etc, since in platforms/Cross/vm/sqVirtualMachine.h it says

#ifndef VM_PROXY_MINOR
/* Increment the following number if you add functions at the end */
# define VM_PROXY_MINOR 11  
#endif


--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

Re: Mix & match plugin and interpreter in Cog

Igor Stasenko

On 6 October 2010 03:09, Eliot Miranda <[hidden email]> wrote:

>
>
>
> On Tue, Oct 5, 2010 at 5:02 PM, Igor Stasenko <[hidden email]> wrote:
>>
>> Hello,
>>
>> in order to avoid overrides to CoInterpreter,
>> i created a subclass - NBCoInterpreter, where i put overridden methods.
>>
>> Now how i could tell that CogNativeBoostPlugin is fine for including when
>> generating code using NBCoInterpreter, but not CoInterpreter,
>> so it won't be mistakenly included in standard Cog VM build?
>
> You could bump  VM_PROXY_MINOR one higher and do that in the makefile/xcode project file etc, since in platforms/Cross/vm/sqVirtualMachine.h it says
> #ifndef VM_PROXY_MINOR
> /* Increment the following number if you add functions at the end */
> # define VM_PROXY_MINOR 11
> #endif

but i don't need to add something here, because there is nothing to change.

I just want to make sure that plugin is not included into build (disabled),
if you generating code using CoInterpreter, and included if using
NBCoInterpreter.

Btw, i found that examplePlugins.ext , generated by VMMaker is a bit odd
(i didn't touched anything related to generation of it):

# Automatically generated makefile include for external plugins
EXTERNAL_PLUGINS = \
ADPCMCodecPlugin \
AsynchFilePlugin \
B3DAcceleratorPlugin \
BMPReadWriterPlugin \
B2DPlugin \
BitBltPlugin \
BochsIA32Plugin \
NativeBoostPlugin \
CroquetPlugin \
DSAPrims \
ZipPlugin \
DropPlugin \
SqueakFFIPrims \
FFTPlugin \
FileCopyPlugin \
FilePlugin \
FloatArrayPlugin \
FloatMathPlugin \
GeniePlugin \
HostWindowPlugin \
IA32ABI \
InternetConfigPlugin \
JPEGReadWriter2Plugin \
JPEGReaderPlugin \
JoystickTabletPlugin \
Klatt \
LargeIntegers \
LocalePlugin \
MIDIPlugin \
MacMenubarPlugin \
Matrix2x3Plugin \
MiscPrimitivePlugin \
Mpeg3Plugin \
NativeBoostPlugin \
IA32ABI \
IA32ABI \
QVMProfileMacSupportPlugin \
QuicktimePlugin \
RePlugin \
SqueakFFIPrims \
SqueakFFIPrims \
SqueakFFIPrims \
SqueakFFIPrims \
SecurityPlugin \
SerialPlugin \
SocketPlugin \
SoundCodecPrims \
SoundGenerationPlugin \
SoundPlugin \
StarSqueakPlugin \
SurfacePlugin \
UUIDPlugin


>>
>> --
>> Best regards,
>> Igor Stasenko AKA sig.
>
>
>



--
Best regards,
Igor Stasenko AKA sig.
Reply | Threaded
Open this post in threaded view
|

Re: Mix & match plugin and interpreter in Cog

Eliot Miranda-2
 


On Tue, Oct 5, 2010 at 5:20 PM, Igor Stasenko <[hidden email]> wrote:

On 6 October 2010 03:09, Eliot Miranda <[hidden email]> wrote:
>
>
>
> On Tue, Oct 5, 2010 at 5:02 PM, Igor Stasenko <[hidden email]> wrote:
>>
>> Hello,
>>
>> in order to avoid overrides to CoInterpreter,
>> i created a subclass - NBCoInterpreter, where i put overridden methods.
>>
>> Now how i could tell that CogNativeBoostPlugin is fine for including when
>> generating code using NBCoInterpreter, but not CoInterpreter,
>> so it won't be mistakenly included in standard Cog VM build?
>
> You could bump  VM_PROXY_MINOR one higher and do that in the makefile/xcode project file etc, since in platforms/Cross/vm/sqVirtualMachine.h it says
> #ifndef VM_PROXY_MINOR
> /* Increment the following number if you add functions at the end */
> # define VM_PROXY_MINOR 11
> #endif

but i don't need to add something here, because there is nothing to change.

I just want to make sure that plugin is not included into build (disabled),
if you generating code using CoInterpreter, and included if using
NBCoInterpreter.

You could do it with the generation expression.  Either have two copies, one of which excludes it (e.g.)

VMMaker
generate: CoInterpreter
to: (FileDirectory default / '../src') fullName
platformDir: (FileDirectory default / '../platforms') fullName
excluding:#(BrokenPlugin SlangTestPlugin TestOSAPlugin
FFIPlugin ReentrantARMFFIPlugin ReentrantFFIPlugin ReentrantPPCBEFFIPlugin
NativeBoostPlugin NewsqueakIA32ABIPlugin NewsqueakIA32ABIPluginAttic)

or choose the interpreter via a menu and put some logic to test for it being NBCoInterpreter.


Btw, i found that examplePlugins.ext , generated by VMMaker is a bit odd
(i didn't touched anything related to generation of it):

# Automatically generated makefile include for external plugins
EXTERNAL_PLUGINS = \
ADPCMCodecPlugin \
AsynchFilePlugin \
B3DAcceleratorPlugin \
BMPReadWriterPlugin \
B2DPlugin \
BitBltPlugin \
BochsIA32Plugin \
NativeBoostPlugin \
CroquetPlugin \
DSAPrims \
ZipPlugin \
DropPlugin \
SqueakFFIPrims \
FFTPlugin \
FileCopyPlugin \
FilePlugin \
FloatArrayPlugin \
FloatMathPlugin \
GeniePlugin \
HostWindowPlugin \
IA32ABI \
InternetConfigPlugin \
JPEGReadWriter2Plugin \
JPEGReaderPlugin \
JoystickTabletPlugin \
Klatt \
LargeIntegers \
LocalePlugin \
MIDIPlugin \
MacMenubarPlugin \
Matrix2x3Plugin \
MiscPrimitivePlugin \
Mpeg3Plugin \
NativeBoostPlugin \
IA32ABI \
IA32ABI \
QVMProfileMacSupportPlugin \
QuicktimePlugin \
RePlugin \
SqueakFFIPrims \
SqueakFFIPrims \
SqueakFFIPrims \
SqueakFFIPrims \
SecurityPlugin \
SerialPlugin \
SocketPlugin \
SoundCodecPrims \
SoundGenerationPlugin \
SoundPlugin \
StarSqueakPlugin \
SurfacePlugin \
UUIDPlugin


>>
>> --
>> Best regards,
>> Igor Stasenko AKA sig.
>
>
>



--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

Re: Mix & match plugin and interpreter in Cog

Igor Stasenko

On 6 October 2010 04:25, Eliot Miranda <[hidden email]> wrote:

>
>
> You could do it with the generation expression.  Either have two copies, one of which excludes it (e.g.)
> VMMaker
> generate: CoInterpreter
> to: (FileDirectory default / '../src') fullName
> platformDir: (FileDirectory default / '../platforms') fullName
> excluding:#(BrokenPlugin SlangTestPlugin TestOSAPlugin
> FFIPlugin ReentrantARMFFIPlugin ReentrantFFIPlugin ReentrantPPCBEFFIPlugin
> NativeBoostPlugin NewsqueakIA32ABIPlugin NewsqueakIA32ABIPluginAttic)
> or choose the interpreter via a menu and put some logic to test for it being NBCoInterpreter.

Yes, i did exactly as you describing.
I just wondered if there are some way to automate that, like:

SomePlugin>>fitsForInterpreter: interpreterClass ...

And about generated .ext/.int example files, is it normal that some
plugins included multiple times:

>> SqueakFFIPrims \
>> SqueakFFIPrims \
>> SqueakFFIPrims \
>> SqueakFFIPrims \

?
As to me it looks like a bad example to follow :)

--
Best regards,
Igor Stasenko AKA sig.
Reply | Threaded
Open this post in threaded view
|

Re: Mix & match plugin and interpreter in Cog

Eliot Miranda-2
 


On Tue, Oct 5, 2010 at 6:44 PM, Igor Stasenko <[hidden email]> wrote:

On 6 October 2010 04:25, Eliot Miranda <[hidden email]> wrote:
>
>
> You could do it with the generation expression.  Either have two copies, one of which excludes it (e.g.)
> VMMaker
> generate: CoInterpreter
> to: (FileDirectory default / '../src') fullName
> platformDir: (FileDirectory default / '../platforms') fullName
> excluding:#(BrokenPlugin SlangTestPlugin TestOSAPlugin
> FFIPlugin ReentrantARMFFIPlugin ReentrantFFIPlugin ReentrantPPCBEFFIPlugin
> NativeBoostPlugin NewsqueakIA32ABIPlugin NewsqueakIA32ABIPluginAttic)
> or choose the interpreter via a menu and put some logic to test for it being NBCoInterpreter.

Yes, i did exactly as you describing.
I just wondered if there are some way to automate that, like:

SomePlugin>>fitsForInterpreter: interpreterClass ...

And about generated .ext/.int example files, is it normal that some
plugins included multiple times:

>> SqueakFFIPrims \
>> SqueakFFIPrims \
>> SqueakFFIPrims \
>> SqueakFFIPrims \

?
As to me it looks like a bad example to follow :)

That's simply the various forms of the FFI naming themselves the same thing.  These are 

ReentrantFFIPlugin (abstract)
ReentrantARMFFIPlugin
ReentrantIA32FFIPlugin
ReentrantPPCFFIPlugin

One's going to generate one of the concrete classes, and the above is an example file, so the above can be ignored.

--
Best regards,
Igor Stasenko AKA sig.