[ENH] RE: Does #class deserve to be a very-special shortcut bytecode anymore?

Tim Rowledge tim at sumeru.stanford.edu
Sat Jan 5 19:22:37 UTC 2002


"Andreas Raab" <Andreas.Raab at gmx.de> is widely believed to have written:

> In certain places it is critical that the class of an object cannot be
> forged. Otherwise you would need to know beforehand which methods you can
> send to proxies and which ones you don't.
Good point. The nice thing about the curent special bytecode 199 is that
it is absolutely going to return the oop in the class field. The _bad_
thing about it is .... exactly the same!

I don't think we want to remove the bytecode right now (it would mean
recompiling everything and that is tedious) but we could change it to
be like most of the other bytecodePrim bytecodes and do the message
send. I guess adding #class/#basicClass split like #new/#basicNew should
be acceptable to most proxinators, but I expect there are some methods
out there that will need editing to work with this change.

I don't think I 've ever come across a proxying scheme that really
worked completely; there's always some awkard balancing act to try to
cope with basic messages either refering to the proxy or the proxant (my
new word for the thing the proxy is proxying for. A license to use this
word can be obtained from my business agents, 'Dewey, Cheatham and Howe')
and what do you do to get to the 'other side'... Somebody somewhere must
have really got it right but I've never had the priviledge of working
with it.

Small example changeset enclosed to illustrate the likely vm change.

tim
-- 
Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
Strange OpCodes: RP: Read Printer
-------------- next part --------------
'From Squeak3.1beta of 3 October 2001 [latest update: #4478] on 5 January 2002 at 11:21:57 am'!
"Change Set:		byteCodePrimClassFix
Date:			5 January 2002
Author:			tim at sumeru.stanford.edu

Snippet of VM code to change the bytecodePrimClass bytecode to send the special selector #23 (#class) instead of shortcircuiting it. This ought to be considered as a possible improvement in the life of proxy programmers."!


!Interpreter methodsFor: 'common selector sends' stamp: 'tpr 1/5/2002 11:19'!
bytecodePrimClass

	messageSelector _ self specialSelector: 23.
	argumentCount _ 1.
	self normalSend.
! !



More information about the Squeak-dev mailing list