[PATCH 1/2] kernel: Make >>#new/>>#new: go through >>#initialize

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

[PATCH 1/2] kernel: Make >>#new/>>#new: go through >>#initialize

Holger Freyther
In Pharo it is common that new/new: will already go through an
initialize call. When porting code from and to Pharo one needs
to make sure that initialize is called and only called once or
idempotent. Align the code with Pharo.
---
 kernel/Builtins.st           | 34 +++++++++++++++-------------------
 kernel/Metaclass.st          |  5 +++++
 packages/debug/debugtests.st |  2 +-
 3 files changed, 21 insertions(+), 20 deletions(-)

diff --git a/kernel/Builtins.st b/kernel/Builtins.st
index 666db54..eb5fa3b 100644
--- a/kernel/Builtins.st
+++ b/kernel/Builtins.st
@@ -43,6 +43,11 @@ Behavior extend [
 ]
 
 Object extend [
+    initialize [
+        "Subclasses should redefine this method to perform initializations on
+        instance creation"
+    ]
+
     class [
         "Answer the class to which the receiver belongs"
         <primitive: VMpr_Object_class>
@@ -53,15 +58,19 @@ Object extend [
         
 
 Behavior extend [
-    
+
     new [
         "Create a new instance of a class with no indexed instance variables"
-        <primitive: VMpr_Behavior_basicNew>
-        <category: 'builtin'>
-        self isFixed ifFalse: [ ^self new: 0 ].
-        ^self primitiveFailed
+        ^self basicNew initialize
     ]
-    
+
+    new: numInstanceVariables [
+        "Create a new instance of a class with indexed instance variables. The
+         instance has numInstanceVariables indexed instance variables."
+        ^(self basicNew: numInstanceVariables) initialize
+    ]
+
+
     basicNew [
         "Create a new instance of a class with no indexed instance variables;
          this method must not be overridden."
@@ -71,19 +80,6 @@ Behavior extend [
         ^self primitiveFailed
     ]
     
-    new: numInstanceVariables [
-        "Create a new instance of a class with indexed instance variables. The
-         instance has numInstanceVariables indexed instance variables."
-        <primitive: VMpr_Behavior_basicNewColon>
-        <category: 'builtin'>
-        self isFixed ifTrue: [
-     SystemExceptions.WrongMessageSent signalOn: #new: useInstead: #new
-        ].
-        numInstanceVariables isSmallInteger ifTrue: [ ^self primitiveFailed ].
-    
-        ^SystemExceptions.WrongClass signalOn: numInstanceVariables mustBe: SmallInteger
-    ]
-    
     basicNew: numInstanceVariables [
         "Create a new instance of a class with indexed instance variables. The
          instance has numInstanceVariables indexed instance variables;
diff --git a/kernel/Metaclass.st b/kernel/Metaclass.st
index 8b320cd..7fd8178 100644
--- a/kernel/Metaclass.st
+++ b/kernel/Metaclass.st
@@ -55,6 +55,11 @@ it should be...the Smalltalk metaclass system is strange and complex.'>
  ^newMeta
     ]
 
+    new [
+        "Do not call >>#initialize on the classes"
+        ^self basicNew
+    ]
+
     addClassVarName: aString [
  "Add a class variable with the given name to the class pool dictionary"
 
diff --git a/packages/debug/debugtests.st b/packages/debug/debugtests.st
index eaa62f0..16f4c5d 100644
--- a/packages/debug/debugtests.st
+++ b/packages/debug/debugtests.st
@@ -256,7 +256,7 @@ TestCase subclass: DebuggerTest [
 
  <category: 'test'>
  | debugger reached notReached |
- debugger := self debuggerOn: [reached := Object new].
+ debugger := self debuggerOn: [reached := Object basicNew].
  debugger step.
  self assert: reached notNil
     ]
--
2.0.1


_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

[PATCH 2/2] misc: Remove redundant >>#new implementations

Holger Freyther
Remove implementations that used to call super new/self basicNew
followed by a call to initialize. Remove empty >>#initialize selectors
---
 examples/PackageBuilder.st                         |   4 -
 kernel/CompildCode.st                              |   7 --
 kernel/PkgLoader.st                                |   5 -
 kernel/RecursionLock.st                            |   7 --
 kernel/Semaphore.st                                |   7 --
 kernel/URL.st                                      |   7 --
 packages/announcements/Announcements.st            |  10 --
 packages/announcements/AnnouncementsTests.st       |   5 -
 packages/blox/browser/PText.st                     |   5 -
 packages/blox/gtk/BloxText.st                      |   7 --
 packages/cairo/CairoPattern.st                     |   5 -
 packages/continuations/Amb.st                      |   5 -
 packages/digest/md5.st                             |   5 -
 packages/digest/sha1.st                            |   5 -
 packages/glorp/Glorp.st                            | 139 ---------------------
 packages/glorp/GlorpTest.st                        |  71 -----------
 packages/gnuplot/Base.st                           |   5 -
 packages/httpd/FileServer.st                       |   7 --
 packages/httpd/WebServer.st                        |   5 -
 packages/httpd/WikiServer.st                       |  20 ---
 packages/magritte/magritte-gst.st                  |   7 --
 packages/magritte/magritte-model.st                |  15 ---
 packages/net/Base.st                               |   5 -
 packages/net/IMAP.st                               |  10 --
 packages/net/MIME.st                               |  10 --
 packages/net/NetServer.st                          |   5 -
 packages/net/URIResolver.st                        |   5 -
 packages/sandstonedb/Core/SDAbstractStore.st       |   7 --
 packages/sandstonedb/Core/SDActiveRecord.st        |   5 -
 .../sandstonedb/Core/SDConcurrentDictionary.st     |   5 -
 packages/sandstonedb/Store/SDMemoryStore.st        |   5 -
 packages/sdl/libsdl/EventSource.st                 |   6 -
 packages/seaside/core/Seaside-Core.st              |  65 ----------
 packages/seaside/magritte/magritte-seaside.st      |   5 -
 packages/sockets/Tests.st                          |   1 -
 packages/stinst/parser/ParseTreeSearcher.st        |  17 ---
 packages/stinst/parser/RBParseNodes.st             |  10 --
 packages/sttools/Parser/SourceEval.st              |   4 -
 packages/sunit/SUnit.st                            |  10 --
 packages/swazoo-httpd/Core.st                      |   5 -
 packages/swazoo-httpd/HTTP.st                      |   5 -
 packages/visualgst/Tetris/TetrisField.st           |   6 -
 packages/xml/builder/NodeBuilder.st                |   5 -
 packages/xml/dom/DOM.st                            |  10 --
 packages/xml/expat/ExpatPullParser.st              |   5 -
 packages/xml/parser/XML.st                         |   5 -
 packages/xml/pullparser/XMLPullParser.st           |   5 -
 packages/xml/saxdriver/SAX.st                      |   5 -
 packages/xml/saxparser/Parser.st                   |   5 -
 packages/xml/xpath/XPath.st                        |  10 --
 packages/xml/xsl/XSL.st                            |   5 -
 scripts/Remote.st                                  |   7 --
 tests/intmath.st                                   |   3 -
 53 files changed, 609 deletions(-)

diff --git a/examples/PackageBuilder.st b/examples/PackageBuilder.st
index a926ad1..7dc1686 100644
--- a/examples/PackageBuilder.st
+++ b/examples/PackageBuilder.st
@@ -197,10 +197,6 @@ Object subclass: TestBuilder [
 Object subclass: PackageBuilder [
   |name url namespace prereqs provides testBuilder start fileins resources|
 
-  PackageBuilder class >> new [
-    ^ self basicNew initialize
-  ]
-
   initialize [
     prereqs := OrderedCollection new.
     provides := OrderedCollection new.
diff --git a/kernel/CompildCode.st b/kernel/CompildCode.st
index fd3f1b8..4882a3b 100644
--- a/kernel/CompildCode.st
+++ b/kernel/CompildCode.st
@@ -1053,13 +1053,6 @@ superclass for blocks and methods'>
  oldHeader isNil ifFalse: [Behavior flushCache]
     ]
 
-    initialize [
- "Do nothing"
-
- <category: 'private'>
-
-    ]
-
     getHeader [
  <category: 'private'>
  ^header
diff --git a/kernel/PkgLoader.st b/kernel/PkgLoader.st
index 53d9367..bd645e4 100644
--- a/kernel/PkgLoader.st
+++ b/kernel/PkgLoader.st
@@ -211,11 +211,6 @@ PackageGroup subclass: PackageDirectories [
 information on a Smalltalk package, and can output my description in
 XML.'>
 
-    PackageDirectories class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     postCopy [
  <category: 'copying'>
  dirs := dirs copy
diff --git a/kernel/RecursionLock.st b/kernel/RecursionLock.st
index f588c20..a7901e2 100644
--- a/kernel/RecursionLock.st
+++ b/kernel/RecursionLock.st
@@ -37,13 +37,6 @@ Object subclass: RecursionLock [
     <category: 'Language-Processes'>
     <comment: nil>
 
-    RecursionLock class >> new [
- "Answer a new semaphore"
-
- <category: 'instance creation'>
- ^self basicNew initialize
-    ]
-
     printOn: aStream [
  "Print a human-readable represention of the receiver on aStream."
 
diff --git a/kernel/Semaphore.st b/kernel/Semaphore.st
index cf8c6a7..5b2755c 100644
--- a/kernel/Semaphore.st
+++ b/kernel/Semaphore.st
@@ -40,13 +40,6 @@ LinkedList subclass: Semaphore [
 the semaphore''s availability, and methods for waiting for its availability.
 I also provide some methods for implementing critical sections.'>
 
-    Semaphore class >> new [
- "Answer a new semaphore"
-
- <category: 'instance creation'>
- ^self basicNew initialize
-    ]
-
     Semaphore class >> forMutualExclusion [
  "Answer a new semaphore with a signal on it. These semaphores are a useful
  shortcut when you use semaphores as critical sections."
diff --git a/kernel/URL.st b/kernel/URL.st
index 2ad93a1..6b8572b 100644
--- a/kernel/URL.st
+++ b/kernel/URL.st
@@ -144,13 +144,6 @@ Copyright (c) Kazuki Yasumatsu, 1995. All rights reserved.
  ^url
     ]
 
-    URL class >> new [
- "Answer a 'blank' URL."
-
- <category: 'instance creation'>
- ^self basicNew initialize
-    ]
-
     URL class >> scheme: schemeString username: userString password: passwordString host: hostString port: portNumber path: pathString [
  "Answer an URL object made from all the parts passed as arguments."
 
diff --git a/packages/announcements/Announcements.st b/packages/announcements/Announcements.st
index f5d25da..673321c 100644
--- a/packages/announcements/Announcements.st
+++ b/packages/announcements/Announcements.st
@@ -41,11 +41,6 @@ Object subclass: Announcer [
     <category: 'Announcements'>
     <comment: nil>
 
-    Announcer class >> new [
-        <category: 'instance creation'>
-        ^self basicNew initialize
-    ]
-
     announce: anObject [
  "Deliver anObject to the registered subscribers. anObject should respond to #asAnnouncement and return with an instance of announcementBaseClass. The return value is the announcement which can be modified by the subscribers."
 
@@ -500,11 +495,6 @@ Object subclass: SubscriptionRegistry [
     <category: 'Announcements'>
     <comment: nil>
 
-    SubscriptionRegistry class >> new [
-        <category: 'instance creation'>
-        ^self basicNew initialize
-    ]
-
     allSubscriptions [
  <category: 'accessing'>
  | result |
diff --git a/packages/announcements/AnnouncementsTests.st b/packages/announcements/AnnouncementsTests.st
index 806a022..3dc26ff 100644
--- a/packages/announcements/AnnouncementsTests.st
+++ b/packages/announcements/AnnouncementsTests.st
@@ -1501,11 +1501,6 @@ Object subclass: TestSubscriber [
     <category: 'Announcements-Tests'>
     <comment: nil>
 
-    TestSubscriber class >> new [
-        <category: 'instance creation'>
-        ^self basicNew initialize
-    ]
-
     announcements [
  <category: 'accessing'>
  ^announcements
diff --git a/packages/blox/browser/PText.st b/packages/blox/browser/PText.st
index cd1f8af..4b9c280 100644
--- a/packages/blox/browser/PText.st
+++ b/packages/blox/browser/PText.st
@@ -422,11 +422,6 @@ PText subclass: PWorksheetText [
     <comment: nil>
     <category: 'Graphics-Windows'>
 
-    PWorksheetText class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     initialize [
  "Use a lightweight class to evaluate the workspace expressions,
  so that variables are kept across evaluations."
diff --git a/packages/blox/gtk/BloxText.st b/packages/blox/gtk/BloxText.st
index 55875a3..7d1b060 100644
--- a/packages/blox/gtk/BloxText.st
+++ b/packages/blox/gtk/BloxText.st
@@ -1015,13 +1015,6 @@ text in a BText widget.  To use it, you simply have to add event handlers
 to it, and then create a BTextAttributes object that refers to it.'>
     <category: 'Graphics-Windows'>
 
-    BTextBindings class >> new [
- "Create a new instance of the receiver."
-
- <category: 'instance creation'>
- ^self basicNew initialize
-    ]
-
     defineTagFor: aBText [
  <category: 'private - BTextTags protocol'>
  list do: [:each | each sendTo: aBText]
diff --git a/packages/cairo/CairoPattern.st b/packages/cairo/CairoPattern.st
index aef2acb..73f1a82 100644
--- a/packages/cairo/CairoPattern.st
+++ b/packages/cairo/CairoPattern.st
@@ -297,11 +297,6 @@ CairoPattern subclass: SurfacePattern [
 CairoPattern subclass: GradientPattern [
     | colorStops |
 
-    GradientPattern class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     colorStops [
  <category: 'accessing'>
  ^colorStops
diff --git a/packages/continuations/Amb.st b/packages/continuations/Amb.st
index 08da20b..f83945e 100644
--- a/packages/continuations/Amb.st
+++ b/packages/continuations/Amb.st
@@ -36,11 +36,6 @@ Object subclass: Amb [
     <category: 'Seaside-Seaside-Continuations'>
     <comment: nil>
 
-    Amb class >> new [
- <category: 'new'>
- ^super new initialize
-    ]
-
     Amb class >> allValues: aBlock [
  <category: 'new'>
  | amb |
diff --git a/packages/digest/md5.st b/packages/digest/md5.st
index c7bf46f..de18a36 100644
--- a/packages/digest/md5.st
+++ b/packages/digest/md5.st
@@ -36,11 +36,6 @@ MessageDigest subclass: MD5 [
     <comment: nil>
     <category: 'Examples-Modules'>
 
-    MD5 class >> new [
- <category: 'C call-outs'>
- ^self basicNew initialize
-    ]
-
     newState [
  <category: 'C call-outs'>
  <cCall: 'MD5AllocOOP' returning: #smalltalk args: #()>
diff --git a/packages/digest/sha1.st b/packages/digest/sha1.st
index b992679..be49d82 100644
--- a/packages/digest/sha1.st
+++ b/packages/digest/sha1.st
@@ -36,11 +36,6 @@ MessageDigest subclass: SHA1 [
     <comment: nil>
     <category: 'Examples-Modules'>
 
-    SHA1 class >> new [
- <category: 'C call-outs'>
- ^self basicNew initialize
-    ]
-
     newState [
  <category: 'C call-outs'>
  <cCall: 'SHA1AllocOOP' returning: #smalltalk args: #()>
diff --git a/packages/glorp/Glorp.st b/packages/glorp/Glorp.st
index 3486537..3fd287c 100644
--- a/packages/glorp/Glorp.st
+++ b/packages/glorp/Glorp.st
@@ -132,11 +132,6 @@ This class is part of the GLORP system (see http://www.glorp.org), licensed unde
  ^Dialect isVisualWorks ifTrue: [WeakVWCachePolicy new] ifFalse: [self new]
     ]
 
-    CachePolicy class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     dictionaryClass [
  <category: 'accessing'>
  ^Dictionary
@@ -328,11 +323,6 @@ Object subclass: GlorpExpression [
 This class is part of the GLORP system (see http://www.glorp.org), licensed under the GNU Lesser General Public License, with clarifications with respect to Smalltalk library usage (LGPL(S)). This code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the package comment, or the COPYING.TXT file that should accompany this distribution, or the GNU Lesser General Public License.'
     ]
 
-    GlorpExpression class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     className [
  <category: 'printing'>
  ^self class name
@@ -983,11 +973,6 @@ Instance Variables:
 
 '>
 
-    ObjectTransaction class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     ObjectTransaction class >> LICENSE [
  <category: 'LICENSE'>
  ^'Copyright 2000-2003 Alan Knight.
@@ -1145,11 +1130,6 @@ Object subclass: Mapping [
     <category: 'Glorp-Mappings'>
     <comment: nil>
 
-    Mapping class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     Mapping class >> LICENSE [
  <category: 'LICENSE'>
  ^'Copyright 2000-2003 Alan Knight.
@@ -1497,11 +1477,6 @@ Object subclass: DatabaseConverter [
 This class is part of the GLORP system (see http://www.glorp.org), licensed under the GNU Lesser General Public License, with clarifications with respect to Smalltalk library usage (LGPL(S)). This code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the package comment, or the COPYING.TXT file that should accompany this distribution, or the GNU Lesser General Public License.'
     ]
 
-    DatabaseConverter class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     name [
  <category: 'accessing'>
  ^name
@@ -1546,11 +1521,6 @@ Object subclass: DatabaseTable [
  ^self new name: aString
     ]
 
-    DatabaseTable class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     DatabaseTable class >> LICENSE [
  <category: 'LICENSE'>
  ^'Copyright 2000-2003 Alan Knight.
@@ -2487,11 +2457,6 @@ This class is part of the GLORP system (see http://www.glorp.org), licensed unde
     query: aQuery
     ]
 
-    ElementBuilder class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     canCauseDuplicateRows [
  <category: 'accessing'>
  ^false
@@ -2657,11 +2622,6 @@ This class is part of the GLORP system (see http://www.glorp.org), licensed unde
  ^self new system: aSystem
     ]
 
-    GlorpSession class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     expiredInstanceOf: aClass key: key [
  <category: 'private'>
  ^cache expiredInstanceOf: aClass key: key
@@ -3156,11 +3116,6 @@ Object subclass: TableSorter [
  ^sorter
     ]
 
-    TableSorter class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     TableSorter class >> LICENSE [
  <category: 'LICENSE'>
  ^'Copyright 2000-2003 Alan Knight.
@@ -3287,11 +3242,6 @@ This class is part of the GLORP system (see http://www.glorp.org), licensed unde
  ^self new base: aQuery criteria ultimateBaseExpression
     ]
 
-    Tracing class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     addExpression: anExpression [
  <category: 'accessing'>
  self addExpression: anExpression andDo: [:ignore | ]
@@ -3410,11 +3360,6 @@ Object subclass: RowMap [
     <category: 'Glorp-UnitOfWork'>
     <comment: nil>
 
-    RowMap class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     RowMap class >> LICENSE [
  <category: 'LICENSE'>
  ^'Copyright 2000-2003 Alan Knight.
@@ -3630,11 +3575,6 @@ Object subclass: DatabaseType [
  ^super new
     ]
 
-    DatabaseType class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     DatabaseType class >> padToTwoDigits: anInteger [
  <category: 'printing'>
  | string |
@@ -3954,11 +3894,6 @@ Instance Variables:
 
     ]
 
-    DatabaseRow class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     DatabaseRow class >> newForTable: aTable [
  <category: 'instance creation'>
  ^self new table: aTable
@@ -4427,11 +4362,6 @@ Object subclass: Query [
 This class is part of the GLORP system (see http://www.glorp.org), licensed under the GNU Lesser General Public License, with clarifications with respect to Smalltalk library usage (LGPL(S)). This code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the package comment, or the COPYING.TXT file that should accompany this distribution, or the GNU Lesser General Public License.'
     ]
 
-    Query class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     Query class >> readManyOf: aClass [
  "readManyOf: and returningManyOf: are synonyms. This now seems more natural to me, to be consistent with session API"
 
@@ -4722,11 +4652,6 @@ Object subclass: Descriptor [
     <category: 'Glorp-Mappings'>
     <comment: nil>
 
-    Descriptor class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     Descriptor class >> LICENSE [
  <category: 'LICENSE'>
  ^'Copyright 2000-2003 Alan Knight.
@@ -5595,11 +5520,6 @@ This class is part of the GLORP system (see http://www.glorp.org), licensed unde
     addSource: from2Field target: to2Field
     ]
 
-    Join class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     additionalExpressions [
  <category: 'preparing'>
  ^#()
@@ -7007,13 +6927,6 @@ Object subclass: MultipleRowMapKey [
     <comment: '
 This is a special (and rarely needed) form of row map key that allows an arbitrary number of objects to participate in it.'>
 
-    MultipleRowMapKey class >> new [
- "Answer a newly created and initialized instance."
-
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     MultipleRowMapKey class >> with: key1 with: key2 with: key3 [
  <category: 'instance creation'>
  ^(self new)
@@ -8275,11 +8188,6 @@ Object subclass: DescriptorSystem [
     platform: dbPlatform
     ]
 
-    DescriptorSystem class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     DescriptorSystem class >> LICENSE [
  <category: 'LICENSE'>
  ^'Copyright 2000-2003 Alan Knight.
@@ -8740,11 +8648,6 @@ Object subclass: DatabaseAccessor [
  ^self classForThisPlatform new currentLogin: aLogin
     ]
 
-    DatabaseAccessor class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     DatabaseAccessor class >> loggingEnabled [
  <category: 'accessing'>
  LoggingEnabled isNil ifTrue: [LoggingEnabled := false].
@@ -10598,11 +10501,6 @@ Object subclass: FieldValueWrapper [
     <category: 'Glorp-UnitOfWork'>
     <comment: nil>
 
-    FieldValueWrapper class >> new [
- <category: 'public'>
- ^super new initialize
-    ]
-
     FieldValueWrapper class >> LICENSE [
  <category: 'LICENSE'>
  ^'Copyright 2000-2003 Alan Knight.
@@ -10942,11 +10840,6 @@ This class is part of the GLORP system (see http://www.glorp.org), licensed unde
  ^self new session: aSession
     ]
 
-    CacheManager class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     cacheForClass: aClass [
  <category: 'initialize/release'>
  ^subCaches at: aClass ifAbsentPut: [self makeCacheFor: aClass]
@@ -11275,11 +11168,6 @@ Instance Variables:
 
 '>
 
-    UnitOfWork class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     UnitOfWork class >> LICENSE [
  <category: 'LICENSE'>
  ^'Copyright 2000-2003 Alan Knight.
@@ -12120,11 +12008,6 @@ ProtoObject subclass: Proxy [
 This class is part of the GLORP system (see http://www.glorp.org), licensed under the GNU Lesser General Public License, with clarifications with respect to Smalltalk library usage (LGPL(S)). This code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the package comment, or the COPYING.TXT file that should accompany this distribution, or the GNU Lesser General Public License.'
     ]
 
-    Proxy class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     Proxy class >> returningManyOf: aClass where: aBlock [
  <category: 'instance creation'>
  ^self new query: (Query returningManyOf: aClass where: aBlock)
@@ -12782,11 +12665,6 @@ Object subclass: DatabaseCommand [
 This class is part of the GLORP system (see http://www.glorp.org), licensed under the GNU Lesser General Public License, with clarifications with respect to Smalltalk library usage (LGPL(S)). This code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the package comment, or the COPYING.TXT file that should accompany this distribution, or the GNU Lesser General Public License.'
     ]
 
-    DatabaseCommand class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     bindings [
  <category: 'accessing'>
  self subclassResponsibility
@@ -13163,11 +13041,6 @@ Object subclass: DatabaseSequence [
  ^self new name: aString
     ]
 
-    DatabaseSequence class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     DatabaseSequence class >> LICENSE [
  <category: 'LICENSE'>
  ^'Copyright 2000-2003 Alan Knight.
@@ -13441,11 +13314,6 @@ Instance Variables:
 This class is part of the GLORP system (see http://www.glorp.org), licensed under the GNU Lesser General Public License, with clarifications with respect to Smalltalk library usage (LGPL(S)). This code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the package comment, or the COPYING.TXT file that should accompany this distribution, or the GNU Lesser General Public License.'
     ]
 
-    Cache class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     Cache class >> newFor: aClass in: aCacheManager [
  <category: 'instance creation'>
  | newCache descriptor |
@@ -13658,13 +13526,6 @@ Object subclass: GlorpPreparedStatement [
 This class is part of the GLORP system (see http://www.glorp.org), licensed under the GNU Lesser General Public License, with clarifications with respect to Smalltalk library usage (LGPL(S)). This code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the package comment, or the COPYING.TXT file that should accompany this distribution, or the GNU Lesser General Public License.'
     ]
 
-    GlorpPreparedStatement class >> new [
- "Answer a newly created and initialized instance."
-
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     signature [
  <category: 'accessing'>
  ^signature
diff --git a/packages/glorp/GlorpTest.st b/packages/glorp/GlorpTest.st
index fa088aa..9f2e2d8 100644
--- a/packages/glorp/GlorpTest.st
+++ b/packages/glorp/GlorpTest.st
@@ -838,11 +838,6 @@ Object subclass: GlorpWorker [
     <category: 'Glorp-TestModels'>
     <comment: nil>
 
-    GlorpWorker class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     GlorpWorker class >> LICENSE [
  <category: 'LICENSE'>
  ^'Copyright 2000-2003 Alan Knight.
@@ -1401,11 +1396,6 @@ Object subclass: GlorpBankAccount [
     accountNumber: GlorpBankAccountNumber example12345
     ]
 
-    GlorpBankAccount class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     GlorpBankAccount class >> LICENSE [
  <category: 'LICENSE'>
  ^'Copyright 2000-2003 Alan Knight.
@@ -1485,11 +1475,6 @@ Object subclass: GlorpBankTransaction [
  ^self new
     ]
 
-    GlorpBankTransaction class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     GlorpBankTransaction class >> LICENSE [
  <category: 'LICENSE'>
  ^'Copyright 2000-2003 Alan Knight.
@@ -2666,13 +2651,6 @@ Object subclass: GlorpThingWithLotsOfDifferentCollections [
     <category: 'GlorpCollectionTypeModels'>
     <comment: nil>
 
-    GlorpThingWithLotsOfDifferentCollections class >> new [
- "Answer a newly created and initialized instance."
-
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     GlorpThingWithLotsOfDifferentCollections class >> example1 [
  <category: 'examples'>
  | example array |
@@ -2860,11 +2838,6 @@ Object subclass: GlorpEncyclopedia [
     <category: 'Glorp-TestModels'>
     <comment: nil>
 
-    GlorpEncyclopedia class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     GlorpEncyclopedia class >> example1 [
  <category: 'examples'>
  | result |
@@ -2995,11 +2968,6 @@ Object subclass: GlorpCustomer [
     addTransaction: GlorpBankTransaction example2
     ]
 
-    GlorpCustomer class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     GlorpCustomer class >> LICENSE [
  <category: 'LICENSE'>
  ^'Copyright 2000-2003 Alan Knight.
@@ -7733,11 +7701,6 @@ Object subclass: GlorpReservation [
     passenger: GlorpPassenger example2
     ]
 
-    GlorpReservation class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     GlorpReservation class >> LICENSE [
  <category: 'LICENSE'>
  ^'Copyright 2000-2003 Alan Knight.
@@ -8143,13 +8106,6 @@ GlorpDatabaseTypeIndividualDBTests subclass: GlorpInt4Test [
     <comment: nil>
     <category: 'Glorp-DBTests'>
 
-    GlorpInt4Test class >> new [
- "Answer a newly created and initialized instance."
-
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     GlorpInt4Test class >> LICENSE [
  <category: 'LICENSE'>
  ^'Copyright 2000-2003 Alan Knight.
@@ -9439,11 +9395,6 @@ GlorpExampleSystem subclass: GlorpBankExampleSystem [
     <category: 'Glorp-Tests'>
     <comment: nil>
 
-    GlorpBankExampleSystem class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     GlorpBankExampleSystem class >> LICENSE [
  <category: 'LICENSE'>
  ^'Copyright 2000-2003 Alan Knight.
@@ -10372,11 +10323,6 @@ Object subclass: GlorpServiceCharge [
     description: 'additional overcharge'
     ]
 
-    GlorpServiceCharge class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     GlorpServiceCharge class >> LICENSE [
  <category: 'LICENSE'>
  ^'Copyright 2000-2003 Alan Knight.
@@ -10573,13 +10519,6 @@ GlorpCacheTest subclass: GlorpWeakCacheTest [
 This class is part of the GLORP system (see http://www.glorp.org), licensed under the GNU Lesser General Public License, with clarifications with respect to Smalltalk library usage (LGPL(S)). This code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the package comment, or the COPYING.TXT file that should accompany this distribution, or the GNU Lesser General Public License.'
     ]
 
-    GlorpWeakCacheTest class >> new [
- "Answer a newly created and initialized instance."
-
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     checkCacheExhaustivelyFor: aBlock [
  "Check to make sure the cache satisfies the criteria. Since this relies on unpredictable finalization, do a full 10 garbage collect then wait iterations. Don't return early, because we're checking to see that finalization *doesn't* happen"
 
@@ -11484,11 +11423,6 @@ Instance Variables:
 
 '>
 
-    GlorpTransformedTime class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     GlorpTransformedTime class >> LICENSE [
  <category: 'LICENSE'>
  ^'Copyright 2000-2003 Alan Knight.
@@ -11865,11 +11799,6 @@ GlorpSession subclass: GlorpMockSession [
     <comment: nil>
     <category: 'Glorp-Tests'>
 
-    GlorpMockSession class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     GlorpMockSession class >> LICENSE [
  <category: 'LICENSE'>
  ^'Copyright 2000-2003 Alan Knight.
diff --git a/packages/gnuplot/Base.st b/packages/gnuplot/Base.st
index d6b4019..8712219 100644
--- a/packages/gnuplot/Base.st
+++ b/packages/gnuplot/Base.st
@@ -33,11 +33,6 @@ Object subclass: GPObject [
     <category: 'GNUPlot'>
     <comment: 'My instances are used to define aspects of a plot.'>
 
-    GPObject class >> new [
- <category: 'instance creation'>
-        ^super new initialize
-    ]
-
     asString [
  <category: 'printing'>
  ^self displayString
diff --git a/packages/httpd/FileServer.st b/packages/httpd/FileServer.st
index dcae7f8..640c20f 100644
--- a/packages/httpd/FileServer.st
+++ b/packages/httpd/FileServer.st
@@ -737,13 +737,6 @@ and DirectoryResponses.'>
     yourself
     ]
 
-    FileWebServer class >> new [
- <category: 'instance creation'>
- ^(super new)
-    initialize;
-    yourself
-    ]
-
     fileResponse: file request: aRequest [
  <category: 'interaction'>
  | range |
diff --git a/packages/httpd/WebServer.st b/packages/httpd/WebServer.st
index 76858e3..4659325 100644
--- a/packages/httpd/WebServer.st
+++ b/packages/httpd/WebServer.st
@@ -731,11 +731,6 @@ requests).'>
  ^self new initConnection: aClientConnection
     ]
 
-    WebRequest class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     action [
  <category: 'accessing'>
  ^action
diff --git a/packages/httpd/WikiServer.st b/packages/httpd/WikiServer.st
index c44c7b8..50b847e 100644
--- a/packages/httpd/WikiServer.st
+++ b/packages/httpd/WikiServer.st
@@ -44,11 +44,6 @@ Object subclass: WikiPage [
     yourself
     ]
 
-    WikiPage class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     allTitles [
  <category: 'accessing'>
  | oc |
@@ -424,11 +419,6 @@ Object subclass: WikiSettings [
  ^self new fromCookieString: aString
     ]
 
-    WikiSettings class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     loadFromFile: aFileStream [
  <category: 'flat file'>
  | line |
@@ -550,11 +540,6 @@ can have a custom contents or can be renamed.'>
  ^self new name: aString
     ]
 
-    Wiki class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     initialize [
  <category: 'initialize'>
  pages := Dictionary new.
@@ -977,11 +962,6 @@ such as when it is edited or renamed.
 All subclasses must implement sendBody.'>
     <category: 'Web-WikiRendering'>
 
-    WikiHTML class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     WikiHTML class >> respondTo: aRequest in: aWiki [
  <category: 'instance creation'>
  ^(self new)
diff --git a/packages/magritte/magritte-gst.st b/packages/magritte/magritte-gst.st
index 149c8cc..74d7223 100644
--- a/packages/magritte/magritte-gst.st
+++ b/packages/magritte/magritte-gst.st
@@ -367,13 +367,6 @@ Time extend [
 ]
 
 Object subclass: MAVisitor [
-    MAVisitor class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-    initialize [
- <category: 'initialization'>
-    ]
 ]
 
 
diff --git a/packages/magritte/magritte-model.st b/packages/magritte/magritte-model.st
index 0c93469..106a85c 100644
--- a/packages/magritte/magritte-model.st
+++ b/packages/magritte/magritte-model.st
@@ -426,11 +426,6 @@ Object subclass: MAAdaptiveModel [
     yourself
     ]
 
-    MAAdaptiveModel class >> new [
- <category: 'instance creation'>
- ^self basicNew initialize
-    ]
-
     defaultDescription [
  <category: 'accessing-configuration'>
  ^MAContainer new
@@ -516,11 +511,6 @@ Object subclass: MADescriptionBuilder [
  self default: MANamedBuilder new
     ]
 
-    MADescriptionBuilder class >> new [
- <category: 'instance creation'>
- ^self basicNew initialize
-    ]
-
     build: anObject [
  <category: 'private'>
  self subclassResponsibility
@@ -638,11 +628,6 @@ There are different file-models that you can use with Magritte. The idea is that
  ^MimeTypes
     ]
 
-    MAFileModel class >> new [
- <category: 'instance-creation'>
- ^self basicNew initialize
-    ]
-
     = anObject [
  <category: 'comparing'>
  ^self species = anObject species and:
diff --git a/packages/net/Base.st b/packages/net/Base.st
index fced264..a32f1aa 100644
--- a/packages/net/Base.st
+++ b/packages/net/Base.st
@@ -583,11 +583,6 @@ Object subclass: NetProtocolInterpreter [
  ^self new client: aNetClient
     ]
 
-    NetProtocolInterpreter class >> new [
- <category: 'instance creation'>
- ^self basicNew initialize
-    ]
-
     NetProtocolInterpreter class >> defaultResponseClass [
  <category: 'private-attributes'>
  ^NetResponse
diff --git a/packages/net/IMAP.st b/packages/net/IMAP.st
index 6a7cc91..b1a754c 100644
--- a/packages/net/IMAP.st
+++ b/packages/net/IMAP.st
@@ -102,11 +102,6 @@ Object subclass: IMAPCommand [
     arguments: (Array with: #string -> aNameString with: #string -> aPassString)
     ]
 
-    IMAPCommand class >> new [
- <category: 'instance creation'>
- ^self basicNew initialize
-    ]
-
     IMAPCommand class >> parse: scanner [
  "Read and parse next command from a stream. This is mainly useful for testing previously stored
  exchange logs"
@@ -952,11 +947,6 @@ Object subclass: IMAPCommandSequencer [
     <category: 'NetClients-IMAP'>
     <comment: nil>
 
-    IMAPCommandSequencer class >> new [
- <category: 'instance creation'>
- ^self basicNew initialize
-    ]
-
     IMAPCommandSequencer class >> newPrefix: prefix [
  <category: 'instance creation'>
  ^(self new)
diff --git a/packages/net/MIME.st b/packages/net/MIME.st
index a948293..9e2ba08 100644
--- a/packages/net/MIME.st
+++ b/packages/net/MIME.st
@@ -38,11 +38,6 @@ Object subclass: MessageElement [
     <category: 'NetClients-MIME'>
     <comment: nil>
 
-    MessageElement class >> new [
- <category: 'instance creation'>
- ^self basicNew initialize
-    ]
-
     MessageElement class >> fromLine: aString [
  "For compatibility with Swazoo"
 
@@ -263,11 +258,6 @@ Object subclass: SimpleScanner [
  CRLF := Array with: Character cr with: Character nl
     ]
 
-    SimpleScanner class >> new [
- <category: 'instance creation'>
- ^self basicNew initialize
-    ]
-
     SimpleScanner class >> on: stream [
  <category: 'instance creation'>
  ^self new on: stream
diff --git a/packages/net/NetServer.st b/packages/net/NetServer.st
index ea128ae..dfc1436 100644
--- a/packages/net/NetServer.st
+++ b/packages/net/NetServer.st
@@ -38,11 +38,6 @@ Object subclass: NetThread [
     <category: 'Sockets-Serving framework'>
     <comment: 'A NetThread runs a process attached to a specified socket.'>
 
-    NetThread class >> new [
- <category: 'instance creation'>
- ^self basicNew initialize
-    ]
-
     defaultPriority [
  <category: 'initialize-release'>
  ^Processor userSchedulingPriority
diff --git a/packages/net/URIResolver.st b/packages/net/URIResolver.st
index a98ad75..c09fdb5 100644
--- a/packages/net/URIResolver.st
+++ b/packages/net/URIResolver.st
@@ -1470,11 +1470,6 @@ Object subclass: UserProfileSettings [
  default := aSettingsObject
     ]
 
-    UserProfileSettings class >> new [
- <category: 'instance creation'>
- ^self basicNew initialize
-    ]
-
     UserProfileSettings class >> postLoad: aParcel [
  <category: 'parcel load/unload'>
  self initialize
diff --git a/packages/sandstonedb/Core/SDAbstractStore.st b/packages/sandstonedb/Core/SDAbstractStore.st
index 54a7b16..d0f2861 100644
--- a/packages/sandstonedb/Core/SDAbstractStore.st
+++ b/packages/sandstonedb/Core/SDAbstractStore.st
@@ -47,13 +47,6 @@ Object subclass: SDAbstractStore [
     loading, before returning the version from the store, it should resolve
     the references.'''>
 
-    SDAbstractStore class >> new [
- <category: 'initialize-release'>
- ^self basicNew initialize
-    ]
-
-    initialize []
-
     abortChanges: anObject [
  <category: 'actions'>
  self subclassResponsibility
diff --git a/packages/sandstonedb/Core/SDActiveRecord.st b/packages/sandstonedb/Core/SDActiveRecord.st
index bc03dba..b51538d 100644
--- a/packages/sandstonedb/Core/SDActiveRecord.st
+++ b/packages/sandstonedb/Core/SDActiveRecord.st
@@ -58,11 +58,6 @@ Object subclass: SDActiveRecord [
 
     Store := nil.
 
-    SDActiveRecord class >> new [
- <category: 'instance creation'>
- ^self basicNew initialize
-    ]
-
     SDActiveRecord class >> atId: anId [
  "hitting this in a tight loop for a class with subclasses can be very
  expensive because allCaches has to concatenate all the subclasses
diff --git a/packages/sandstonedb/Core/SDConcurrentDictionary.st b/packages/sandstonedb/Core/SDConcurrentDictionary.st
index 9c6ab0d..29da2f1 100644
--- a/packages/sandstonedb/Core/SDConcurrentDictionary.st
+++ b/packages/sandstonedb/Core/SDConcurrentDictionary.st
@@ -53,11 +53,6 @@ Object subclass: SDConcurrentDictionary [
     yourself
     ]
 
-   SDConcurrentDictionary class >> new [
- <category: 'instance creation'>
- ^self basicNew initialize
-   ]
-
     , aCollection [
  <category: 'copying'>
  ^lock critical: [self class on: dictionary , aCollection]
diff --git a/packages/sandstonedb/Store/SDMemoryStore.st b/packages/sandstonedb/Store/SDMemoryStore.st
index b086f77..5888c51 100644
--- a/packages/sandstonedb/Store/SDMemoryStore.st
+++ b/packages/sandstonedb/Store/SDMemoryStore.st
@@ -54,11 +54,6 @@ SDCachedStore subclass: SDMemoryStore [
  Cache := Dictionary new.
     ]
 
-     SDMemoryStore class >> new [
- <category: 'instance creation'>
- ^self basicNew initialize
-    ]
-
     abortChanges: anObject [
  <category: 'actions'>
  | diskVersion |
diff --git a/packages/sdl/libsdl/EventSource.st b/packages/sdl/libsdl/EventSource.st
index 76b1e59..b51e917 100644
--- a/packages/sdl/libsdl/EventSource.st
+++ b/packages/sdl/libsdl/EventSource.st
@@ -296,12 +296,6 @@ Object subclass: SdlEventSource [
 
     | handler pollDelay eventMask |
 
-    SdlEventSource class >> new [
- "Create a new event source.  This is private, because an event source
- is only created from an SdlDisplay."
- ^ super new initialize
-    ]
-
     handler [
  "Return the SdlEventHandler that will manage events for the display."
 
diff --git a/packages/seaside/core/Seaside-Core.st b/packages/seaside/core/Seaside-Core.st
index fa4095f..e663ede 100644
--- a/packages/seaside/core/Seaside-Core.st
+++ b/packages/seaside/core/Seaside-Core.st
@@ -431,11 +431,6 @@ Instance Variables
  parent: The parent brush I am used within.
  closed: Wether I have been closed/flushed yet.'>
 
-    WABrush class >> new [
- <category: 'instance-creation'>
- ^self basicNew initialize
-    ]
-
     close [
  "Close and flush the receiver onto the canvas and its associated document."
 
@@ -5319,11 +5314,6 @@ Subclasses must implement the following messages:
  localValueAt:ifAbsent:
  return the value of the attribute given as first argument'>
 
-    WAConfiguration class >> new [
- <category: 'instance creation'>
- ^self basicNew initialize
-    ]
-
     addAncestorsTo: tempCollection linearization: linearCollection [
  <category: 'ancestry'>
  (linearCollection includes: self)
@@ -6566,11 +6556,6 @@ rootBlock
  - a one argement block to customize the document root. The argument of the block is the root
 '>
 
-    WAHtmlBuilder class >> new [
- <category: 'instance creation'>
- ^self basicNew initialize
-    ]
-
     WAHtmlBuilder class >> on: aCanvasClass [
  <category: 'instance creation'>
  ^(self new)
@@ -6688,11 +6673,6 @@ Object subclass: WAHtmlDocument [
     <category: 'Seaside-Core-Document'>
     <comment: nil>
 
-    WAHtmlDocument class >> new [
- <category: 'instance-creation'>
- ^self basicNew initialize
-    ]
-
     closeTag: aString [
  <category: 'writing-xhtml'>
  self subclassResponsibility
@@ -7470,11 +7450,6 @@ WALRUCache is used to store the last n continutations of a session.
 
 '>
 
-    WALRUCache class >> new [
- <category: 'instance creation'>
- ^self basicNew initialize
-    ]
-
     WALRUCache class >> new: max [
  <category: 'instance creation'>
  ^self new capacity: max
@@ -9688,11 +9663,6 @@ Object subclass: WAPresenter [
     <category: 'Seaside-Core-Component'>
     <comment: nil>
 
-    WAPresenter class >> new [
- <category: 'instance creation'>
- ^self basicNew initialize
-    ]
-
     application [
  <category: 'convenience'>
  ^self session application
@@ -13472,11 +13442,6 @@ Instance Variables:
 
 '>
 
-    WAProcessMonitor class >> new [
- <category: 'instance creation'>
- ^self basicNew initialize
-    ]
-
     critical: aBlock ifError: anErrorBlock [
  "Evaluate aBlock as a mutual exclusive block within a new processes and wait for the process to finish. Evaluate anErrorBlock in case of a problem. Answer the result of evaluating the blocks. Note, that the semaphore needs to be an instance-variable, otherwise continuations might screw up the debugger."
 
@@ -13727,11 +13692,6 @@ Object subclass: WARenderingContext [
     <category: 'Seaside-Core-Callbacks'>
     <comment: nil>
 
-    WARenderingContext class >> new [
- <category: 'instance creation'>
- ^self basicNew initialize
-    ]
-
     absoluteUrlForResource: aString [
  <category: 'accessing'>
  | url |
@@ -13921,11 +13881,6 @@ Instance Variables:
 
 '>
 
-    WAReportColumn class >> new [
- <category: 'instance creation'>
- ^self basicNew initialize
-    ]
-
     WAReportColumn class >> renderBlock: aBlock title: aString [
  <category: 'instance creation'>
  ^(self new)
@@ -14309,11 +14264,6 @@ Instance Variables:
 
 '>
 
-    WARequestHandler class >> new [
- <category: 'instance-creation'>
- ^self basicNew initialize
-    ]
-
     description [
  "Answer a descriptive text of the receiver."
 
@@ -15837,11 +15787,6 @@ Object subclass: WAResponse [
  ^response
     ]
 
-    WAResponse class >> new [
- <category: 'instance creation'>
- ^self basicNew initialize
-    ]
-
     WAResponse class >> notFound: locationString [
  <category: 'instance creation'>
  | response content |
@@ -16166,11 +16111,6 @@ Object subclass: WARoot [
     <category: 'Seaside-Core-Document'>
     <comment: nil>
 
-    WARoot class >> new [
- <category: 'instance creation'>
- ^self basicNew initialize
-    ]
-
     close: aDocument [
  <category: 'writing'>
 
@@ -17006,11 +16946,6 @@ Instance Variables
  parameters: <Dictionary>
  fragment: <String> or nil'>
 
-    WAUrl class >> new [
- <category: 'instance creation'>
- ^self basicNew initialize
-    ]
-
     = anUrl [
  <category: 'comparing'>
  ^self class = anUrl class and: [self printString = anUrl printString]
diff --git a/packages/seaside/magritte/magritte-seaside.st b/packages/seaside/magritte/magritte-seaside.st
index d536fcb..318c28a 100644
--- a/packages/seaside/magritte/magritte-seaside.st
+++ b/packages/seaside/magritte/magritte-seaside.st
@@ -3677,11 +3677,6 @@ Object subclass: MAColumn [
     yourself
     ]
 
-    MAColumn class >> new [
- <category: 'instance creation'>
- ^self basicNew initialize
-    ]
-
     cascade [
  <category: 'accessing-settings'>
  ^self propertyAt: #cascade ifAbsent: [self defaultCascade]
diff --git a/packages/sockets/Tests.st b/packages/sockets/Tests.st
index 86450d9..1af4946 100644
--- a/packages/sockets/Tests.st
+++ b/packages/sockets/Tests.st
@@ -2,7 +2,6 @@ Stream subclass: DummyStream [
     <category: 'Sockets-Tests'>
 
     | n |
-    DummyStream class >> new [ ^super new initialize ]
     initialize [ n := 0 ]
     nextPut: anObject [ n := n + 1 ]
     next: anInteger putAll: aCollection startingAt: pos [ n := n + anInteger ]
diff --git a/packages/stinst/parser/ParseTreeSearcher.st b/packages/stinst/parser/ParseTreeSearcher.st
index 84395fa..d2e9ea9 100644
--- a/packages/stinst/parser/ParseTreeSearcher.st
+++ b/packages/stinst/parser/ParseTreeSearcher.st
@@ -21,11 +21,6 @@ Object subclass: RBReadBeforeWrittenTester [
     <category: 'Refactory-Parser'>
     <comment: nil>
 
-    RBReadBeforeWrittenTester class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     RBReadBeforeWrittenTester class >> isVariable: aString readBeforeWrittenIn: aBRProgramNode [
  <category: 'accessing'>
  ^(self isVariable: aString writtenBeforeReadIn: aBRProgramNode) not
@@ -235,13 +230,6 @@ Object subclass: RBParseTreeRule [
     yourself
     ]
 
-    RBParseTreeRule class >> new [
- <category: 'instance creation'>
- ^(super new)
-    initialize;
-    yourself
-    ]
-
     RBParseTreeRule class >> search: aString [
  <category: 'instance creation'>
  ^(self new)
@@ -249,11 +237,6 @@ Object subclass: RBParseTreeRule [
     yourself
     ]
 
-    initialize [
- <category: 'initialize-release'>
-
-    ]
-
     methodSearchString: aString [
  <category: 'initialize-release'>
  searchTree := RBParser parseRewriteMethod: aString
diff --git a/packages/stinst/parser/RBParseNodes.st b/packages/stinst/parser/RBParseNodes.st
index 2600497..adca894 100644
--- a/packages/stinst/parser/RBParseNodes.st
+++ b/packages/stinst/parser/RBParseNodes.st
@@ -22,16 +22,6 @@ Object subclass: RBProgramNodeVisitor [
 
 '>
 
-    RBProgramNodeVisitor class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
-    initialize [
- <category: 'initialize-release'>
-
-    ]
-
     visitArgument: each [
  "Here to allow subclasses to detect arguments or temporaries."
 
diff --git a/packages/sttools/Parser/SourceEval.st b/packages/sttools/Parser/SourceEval.st
index 2b9fd5c..d7ebf6f 100644
--- a/packages/sttools/Parser/SourceEval.st
+++ b/packages/sttools/Parser/SourceEval.st
@@ -37,10 +37,6 @@ SourceEntity subclass: SourceEval [
     <comment: 'This class is responsible for emitting a set of
     statements that should be inside an Eval declaration.'>
 
-    SourceEval class >> new [
-        ^super new initialize
-    ]
-
     initialize [
         statements := OrderedCollection new
     ]
diff --git a/packages/sunit/SUnit.st b/packages/sunit/SUnit.st
index 32fd3ac..ce56112 100644
--- a/packages/sunit/SUnit.st
+++ b/packages/sunit/SUnit.st
@@ -114,11 +114,6 @@ Object subclass: TestResource [
 
     ]
 
-    TestResource class >> new [
- <category: 'Creation'>
- ^super new initialize
-    ]
-
     TestResource class >> reset [
  <category: 'Creation'>
  current notNil ifTrue: [[current tearDown] ensure: [current := nil]]
@@ -273,11 +268,6 @@ This is a Collecting Parameter for the running of a bunch of tests. TestResult i
  self failure sunitSignalWith: aString
     ]
 
-    TestResult class >> new [
- <category: 'Init / Release'>
- ^super new initialize
-    ]
-
     correctCount [
  "depreciated - use #passedCount"
 
diff --git a/packages/swazoo-httpd/Core.st b/packages/swazoo-httpd/Core.st
index 4709b37..50eafaf 100644
--- a/packages/swazoo-httpd/Core.st
+++ b/packages/swazoo-httpd/Core.st
@@ -35,11 +35,6 @@ Object subclass: SwazooResource [
     <category: 'Swazoo-Core'>
     <comment: 'Resource is an abstract class for all so called web resources. Such resource has its url address and can serve with responding to web requests. Every resource need to #answerTo: aHTTPRequest with aHTTPResponse. Site is a subclass of a Resource. You can subclass it with your own implementation. There is also a CompositeResource, which can hold many subresources. Site is also aCopmpositeResource and therefore you can add your own resources to your site.'>
 
-    SwazooResource class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     SwazooResource class >> uriPattern: aString [
  <category: 'instance creation'>
  ^self new uriPattern: aString
diff --git a/packages/swazoo-httpd/HTTP.st b/packages/swazoo-httpd/HTTP.st
index 1fd04c2..bde22ec 100644
--- a/packages/swazoo-httpd/HTTP.st
+++ b/packages/swazoo-httpd/HTTP.st
@@ -266,11 +266,6 @@ Object subclass: AbstractHTTPServer [
  SpEnvironment addImageShutdownTask: [self shutDown] for: self
     ]
 
-    AbstractHTTPServer class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     AbstractHTTPServer class >> shutDown [
  "HTTPServer shutDown"
 
diff --git a/packages/visualgst/Tetris/TetrisField.st b/packages/visualgst/Tetris/TetrisField.st
index afd0465..a3f466a 100644
--- a/packages/visualgst/Tetris/TetrisField.st
+++ b/packages/visualgst/Tetris/TetrisField.st
@@ -34,12 +34,6 @@ Object subclass: TetrisField [
     <category: 'Graphics-Tetris'>
     <comment: nil>
 
-    TetrisField class >> new [
- <category: 'instance creation'>
-
- ^ self basicNew initialize
-    ]
-
     at: point [
  <category: 'accessing'>
 
diff --git a/packages/xml/builder/NodeBuilder.st b/packages/xml/builder/NodeBuilder.st
index 3080035..4e4b7da 100644
--- a/packages/xml/builder/NodeBuilder.st
+++ b/packages/xml/builder/NodeBuilder.st
@@ -51,11 +51,6 @@ Instance Variables:
      Stack showing the nesting of XML elements within the document at the current stage of parsing.
     tags <Dictionary> Currently not used. A map to make sure that within a document, tag identifiers are unique instances in order to save space.'>
 
-    XMLNodeBuilder class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     initialize [
  <category: 'initialize'>
  tagStack := OrderedCollection new.
diff --git a/packages/xml/dom/DOM.st b/packages/xml/dom/DOM.st
index bacf0d0..82ebe11 100644
--- a/packages/xml/dom/DOM.st
+++ b/packages/xml/dom/DOM.st
@@ -52,11 +52,6 @@ Instance Variables:
     parent <XML.Node | nil> All nodes except for Documents are contained by other nodes--this provides a pointer from the node to the node that contains it.
     flags <SmallInteger> Provides a compact representation for any boolean attributes that the node might have. Likely to be removed in the near future.'>
 
-    Node class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     initialize [
  <category: 'initialize'>
  flags := 0
@@ -1593,11 +1588,6 @@ Instance Variables:
     notations <Dictionary> Notations defined in the DTD.
     declaredRoot <XML.NodeTag> The NodeTag which the DTD declares will be the root element of the document--a document cannot be valid if this does not match the tag of the root element.'>
 
-    DocumentType class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     initialize [
  <category: 'initialize'>
  notations := Dictionary new.
diff --git a/packages/xml/expat/ExpatPullParser.st b/packages/xml/expat/ExpatPullParser.st
index 0bcebae..e9b4390 100644
--- a/packages/xml/expat/ExpatPullParser.st
+++ b/packages/xml/expat/ExpatPullParser.st
@@ -39,11 +39,6 @@ Object subclass: SAXEventSequence [
 communicates more than one event between its resumption and when it
 is stopped again.'>
 
-    SAXEventSequence class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     event [
  <category: 'accessing'>
  ^event
diff --git a/packages/xml/parser/XML.st b/packages/xml/parser/XML.st
index a9ebb7f..2ea7ecb 100644
--- a/packages/xml/parser/XML.st
+++ b/packages/xml/parser/XML.st
@@ -57,11 +57,6 @@ Subclasses must implement the following protocol:
 Instance Variables:
     followSet <OrderedCollection>  A list of the Patterns which may follow this one in an element''s content.'>
 
-    Pattern class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     followSet: aCollection [
  <category: 'initialize'>
  followSet := aCollection
diff --git a/packages/xml/pullparser/XMLPullParser.st b/packages/xml/pullparser/XMLPullParser.st
index 8b3a954..b26a4a1 100644
--- a/packages/xml/pullparser/XMLPullParser.st
+++ b/packages/xml/pullparser/XMLPullParser.st
@@ -89,11 +89,6 @@ Stream subclass: XMLPullParser [
 
     | needComments needPrefixMappingEvents needCdataDelimiters needDTDEvents |
 
-    XMLPullParser class >> new [
-        <category: 'instance creation'>
-        ^super new initialize
-    ]
-
     XMLPullParser class >> onFile: aFilename [
         <category: 'instance creation'>
         ^self on: (FileStream open: aFilename mode: FileStream read)
diff --git a/packages/xml/saxdriver/SAX.st b/packages/xml/saxdriver/SAX.st
index 0643d7d..485945b 100644
--- a/packages/xml/saxdriver/SAX.st
+++ b/packages/xml/saxdriver/SAX.st
@@ -358,11 +358,6 @@ Instance Variables:
     errorHandler <XML.SAXDriver> handles all errors
 '>
 
-    SAXDispatcher class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     contentHandler [
  <category: 'accessing'>
  ^contentHandler
diff --git a/packages/xml/saxparser/Parser.st b/packages/xml/saxparser/Parser.st
index 8eff44b..be89840 100644
--- a/packages/xml/saxparser/Parser.st
+++ b/packages/xml/saxparser/Parser.st
@@ -63,11 +63,6 @@ Instance Variables:
  DefaultParserClass := aClass.
     ]
 
-    SAXParser class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     SAXParser class >> on: aDataSource [
  "The dataSource may be a URI, a Filename (or a String
  which will be treated as a Filename), or an InputSource."
diff --git a/packages/xml/xpath/XPath.st b/packages/xml/xpath/XPath.st
index 50ac782..4ed3b31 100644
--- a/packages/xml/xpath/XPath.st
+++ b/packages/xml/xpath/XPath.st
@@ -37,11 +37,6 @@ Object subclass: XPathNodeContext [
     <category: 'XML-XPath'>
     <comment: nil>
 
-    XPathNodeContext class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     add: aNode [
  <category: 'adding'>
  nodes add: aNode
@@ -351,11 +346,6 @@ Object subclass: XPathExpression [
     <category: 'XML-XPath'>
     <comment: nil>
 
-    XPathExpression class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     XPathExpression class >> notANumber [
  <category: 'coercing'>
  ^FloatD nan
diff --git a/packages/xml/xsl/XSL.st b/packages/xml/xsl/XSL.st
index f54b9f7..8665814 100644
--- a/packages/xml/xsl/XSL.st
+++ b/packages/xml/xsl/XSL.st
@@ -752,11 +752,6 @@ E. Acknowledgements (Non-Normative)
  ^test process: doc
     ]
 
-    RuleDatabase class >> new [
- <category: 'instance creation'>
- ^super new initialize
-    ]
-
     importance [
  <category: 'importance'>
  ^currentImportance
diff --git a/scripts/Remote.st b/scripts/Remote.st
index 5ec457b..98525f0 100644
--- a/scripts/Remote.st
+++ b/scripts/Remote.st
@@ -41,13 +41,6 @@ DLD addLibrary: 'libc'.
 
 Object subclass: RemoteServer [
 
-    RemoteServer class >> new [
-
- ^ super new
- initialize;
- yourself
-    ]
-
     | remoteProcess queue |
 
     initialize [
diff --git a/tests/intmath.st b/tests/intmath.st
index 8b772ae..4ce5c30 100644
--- a/tests/intmath.st
+++ b/tests/intmath.st
@@ -188,9 +188,6 @@ Eval [
 "Another fraction torture test"
 Stream subclass: PiSeries [
     | i s tot |
-    PiSeries class >> new [
- ^super new initialize
-    ]
 
     initialize [
  i := 1.
--
2.0.1


_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 1/2] kernel: Make >>#new/>>#new: go through >>#initialize

Holger Freyther
In reply to this post by Holger Freyther
On Thu, Jul 24, 2014 at 08:16:49PM +0200, Holger Hans Peter Freyther wrote:

Dear Paolo,


> In Pharo it is common that new/new: will already go through an
> initialize call. When porting code from and to Pharo one needs
> to make sure that initialize is called and only called once or
> idempotent. Align the code with Pharo.


this is a common porting issue from GST to Pharo (initialize being
called twice) or Pharo to GST (initialize is never called). In my
opinion the amount of code tested/written for Pharo will increase
so we should make porting more easy. E.g. the "TimerScheduler" I
ported to Pharo ended up spawning the polling process twice due
>>#initialize being called twice.

On top of that we have a lot of code using the "self *new initialize"
pattern. The benchmark system is not set-up yet so I can't tell you
if there is a big change here (but we could always fix that by
calling basicNew).

What do you think? Is there anything missing besides the ChangeLog?

holger


_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 1/2] kernel: Make >>#new/>>#new: go through >>#initialize

Paolo Bonzini-2
In reply to this post by Holger Freyther
Il 24/07/2014 20:16, Holger Hans Peter Freyther ha scritto:
> In Pharo it is common that new/new: will already go through an
> initialize call. When porting code from and to Pharo one needs
> to make sure that initialize is called and only called once or
> idempotent. Align the code with Pharo.

I resisted doing this for several years, but I guess we should follow
Pharo's leadership now.

However, I think you should squash the two patches.

Thanks!

Paolo


> ---
>  kernel/Builtins.st           | 34 +++++++++++++++-------------------
>  kernel/Metaclass.st          |  5 +++++
>  packages/debug/debugtests.st |  2 +-
>  3 files changed, 21 insertions(+), 20 deletions(-)
>
> diff --git a/kernel/Builtins.st b/kernel/Builtins.st
> index 666db54..eb5fa3b 100644
> --- a/kernel/Builtins.st
> +++ b/kernel/Builtins.st
> @@ -43,6 +43,11 @@ Behavior extend [
>  ]
>  
>  Object extend [
> +    initialize [
> +        "Subclasses should redefine this method to perform initializations on
> +        instance creation"
> +    ]
> +
>      class [
>          "Answer the class to which the receiver belongs"
>          <primitive: VMpr_Object_class>
> @@ -53,15 +58,19 @@ Object extend [
>          
>  
>  Behavior extend [
> -    
> +
>      new [
>          "Create a new instance of a class with no indexed instance variables"
> -        <primitive: VMpr_Behavior_basicNew>
> -        <category: 'builtin'>
> -        self isFixed ifFalse: [ ^self new: 0 ].
> -        ^self primitiveFailed
> +        ^self basicNew initialize
>      ]
> -    
> +
> +    new: numInstanceVariables [
> +        "Create a new instance of a class with indexed instance variables. The
> +         instance has numInstanceVariables indexed instance variables."
> +        ^(self basicNew: numInstanceVariables) initialize
> +    ]
> +
> +
>      basicNew [
>          "Create a new instance of a class with no indexed instance variables;
>           this method must not be overridden."
> @@ -71,19 +80,6 @@ Behavior extend [
>          ^self primitiveFailed
>      ]
>      
> -    new: numInstanceVariables [
> -        "Create a new instance of a class with indexed instance variables. The
> -         instance has numInstanceVariables indexed instance variables."
> -        <primitive: VMpr_Behavior_basicNewColon>
> -        <category: 'builtin'>
> -        self isFixed ifTrue: [
> -     SystemExceptions.WrongMessageSent signalOn: #new: useInstead: #new
> -        ].
> -        numInstanceVariables isSmallInteger ifTrue: [ ^self primitiveFailed ].
> -    
> -        ^SystemExceptions.WrongClass signalOn: numInstanceVariables mustBe: SmallInteger
> -    ]
> -    
>      basicNew: numInstanceVariables [
>          "Create a new instance of a class with indexed instance variables. The
>           instance has numInstanceVariables indexed instance variables;
> diff --git a/kernel/Metaclass.st b/kernel/Metaclass.st
> index 8b320cd..7fd8178 100644
> --- a/kernel/Metaclass.st
> +++ b/kernel/Metaclass.st
> @@ -55,6 +55,11 @@ it should be...the Smalltalk metaclass system is strange and complex.'>
>   ^newMeta
>      ]
>  
> +    new [
> +        "Do not call >>#initialize on the classes"
> +        ^self basicNew
> +    ]
> +
>      addClassVarName: aString [
>   "Add a class variable with the given name to the class pool dictionary"
>  
> diff --git a/packages/debug/debugtests.st b/packages/debug/debugtests.st
> index eaa62f0..16f4c5d 100644
> --- a/packages/debug/debugtests.st
> +++ b/packages/debug/debugtests.st
> @@ -256,7 +256,7 @@ TestCase subclass: DebuggerTest [
>  
>   <category: 'test'>
>   | debugger reached notReached |
> - debugger := self debuggerOn: [reached := Object new].
> + debugger := self debuggerOn: [reached := Object basicNew].
>   debugger step.
>   self assert: reached notNil
>      ]
>


_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 1/2] kernel: Make >>#new/>>#new: go through >>#initialize

Holger Freyther
On Thu, Jul 24, 2014 at 08:26:29PM +0200, Paolo Bonzini wrote:

> Il 24/07/2014 20:16, Holger Hans Peter Freyther ha scritto:
> > In Pharo it is common that new/new: will already go through an
> > initialize call. When porting code from and to Pharo one needs
> > to make sure that initialize is called and only called once or
> > idempotent. Align the code with Pharo.
>
> I resisted doing this for several years, but I guess we should follow
> Pharo's leadership now.
>
> However, I think you should squash the two patches.

Okay, I had verified that all tests pass when only applying the kernel(
and debugger) patch.

Myclass class extend [
        new [
                ^super new initialize
        ]
]

Would now call initialize twice. I will squash the two patches and
write a "NEWS" items.

holger


_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 1/2] kernel: Make >>#new/>>#new: go through >>#initialize

Holger Freyther
On Sat, Jul 26, 2014 at 02:18:12PM +0200, Holger Hans Peter Freyther wrote:

> Would now call initialize twice. I will squash the two patches and
> write a "NEWS" items.

I have a macro-benchmark of [] vs. [Object new] vs. [Object basicNew]
and we pay a lot for the extra message send. This is besides the code
in _gst_send_message_internal already checking for the "self" routine.

I could cheat and add another "cache" for Behavior>>#new or make it
another kind of primitive?

Do you have an opinion/idea on that?


holger



_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 1/2] kernel: Make >>#new/>>#new: go through >>#initialize

Paolo Bonzini-2
Il 26/07/2014 18:20, Holger Hans Peter Freyther ha scritto:
> On Sat, Jul 26, 2014 at 02:18:12PM +0200, Holger Hans Peter Freyther wrote:
>
>> Would now call initialize twice. I will squash the two patches and
>> write a "NEWS" items.
>
> I have a macro-benchmark of [] vs. [Object new] vs. [Object basicNew]
> and we pay a lot for the extra message send. This is besides the code
> in _gst_send_message_internal already checking for the "self" routine.

Yes, this is why I was reluctant to do this.

> I could cheat and add another "cache" for Behavior>>#new or make it
> another kind of primitive?

Making it another primitive would lower that cost.  Sounds like a good idea.

Paolo

_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 1/2] kernel: Make >>#new/>>#new: go through >>#initialize

Holger Freyther
On Tue, Jul 29, 2014 at 06:48:20PM +0200, Paolo Bonzini wrote:

> Yes, this is why I was reluctant to do this.

I understand but I think portability is more important.


> > I could cheat and add another "cache" for Behavior>>#new or make it
> > another kind of primitive?
>
> Making it another primitive would lower that cost.  Sounds like a good idea.

Okay, I have one conceptual issue.

a.) VMpr_Behavior_basicNewInitialize will lookup_selector (cache) and
notice that Object>>#initialize is an empty method and we can skip the
call.

b.) >>#initialize is custom with real code but I calling
_gst_send_message_internal will not lead to the code being executed
but we already return from the primitive. What would be nice is to
have a PRIM_SEMI_SUCCEED and just call >>#initialize. This doesn't seem
to be possible right now.

what do you think?

        holger

_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 1/2] kernel: Make >>#new/>>#new: go through >>#initialize

Paolo Bonzini-2
Il 01/08/2014 21:04, Holger Hans Peter Freyther ha scritto:

>
> a.) VMpr_Behavior_basicNewInitialize will lookup_selector (cache) and
> notice that Object>>#initialize is an empty method and we can skip the
> call.
>
> b.) >>#initialize is custom with real code but I calling
> _gst_send_message_internal will not lead to the code being executed
> but we already return from the primitive. What would be nice is to
> have a PRIM_SEMI_SUCCEED and just call >>#initialize. This doesn't seem
> to be possible right now.

The primitive can send #initialize just like perform: does.  It does not
even need to check if it is empty, _gst_send_message_internal will do
that.  You save the creation of the MethodContext; the disadvantage is
that #new will not appear in the backtrace, and that the JIT will not be
able to use an inline cache.

Paolo

_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 1/2] kernel: Make >>#new/>>#new: go through >>#initialize

Holger Freyther
In reply to this post by Holger Freyther
On Fri, Aug 01, 2014 at 09:04:53PM +0200, Holger Hans Peter Freyther wrote:

Hi,



> a.) VMpr_Behavior_basicNewInitialize will lookup_selector (cache) and
> notice that Object>>#initialize is an empty method and we can skip the
> call.

no soemthing else is odd/wrong with the VM. I added an initializer for
_gst_initialize_symbol but the code that initializes the symbols doesn't
check if it is present or not. This is why

  _gst_send_message_internal(_gst_initialize_symbol, 0, result, OOP_CLASS(result));

failed as we had two symbols for 'initialize'. This is because initialize
will already occur inside the _gst_builtin_selector_names. :}


holger


_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 1/2] kernel: Make >>#new/>>#new: go through >>#initialize

Holger Freyther
In reply to this post by Paolo Bonzini-2
On Fri, Aug 01, 2014 at 09:21:36PM +0200, Paolo Bonzini wrote:

> The primitive can send #initialize just like perform: does.  It does not
> even need to check if it is empty, _gst_send_message_internal will do
> that.  You save the creation of the MethodContext; the disadvantage is
> that #new will not appear in the backtrace, and that the JIT will not be
> able to use an inline cache.

For the JIT case we could create an inline version that will emit a
inline cache. Given my jit issue we have some more work to do. I could
really use your help to understand why the JIT fails.

holger


_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk