Browse Source

Comment for CompiledMethod

Laurent Laffont 12 years ago
parent
commit
e42125e5be
2 changed files with 27 additions and 8 deletions
  1. 4 3
      js/Kernel-Methods.js
  2. 23 5
      st/Kernel-Methods.st

+ 4 - 3
js/Kernel-Methods.js

@@ -1,5 +1,6 @@
 smalltalk.addPackage('Kernel-Methods', {});
 smalltalk.addPackage('Kernel-Methods', {});
 smalltalk.addClass('CompiledMethod', smalltalk.Object, [], 'Kernel-Methods');
 smalltalk.addClass('CompiledMethod', smalltalk.Object, [], 'Kernel-Methods');
+smalltalk.CompiledMethod.comment=unescape('CompiledMethod%20hold%20the%20source%20and%20compiled%20code%20of%20a%20class%20method.%0A%0AYou%20can%20get%20a%20CompiledMethod%20using%20%60Behavior%3E%3EmethodAt%3A%60%0A%0A%09String%20methodAt%3A%20%27lines%27%0A%0Aand%20read%20the%20source%20code%0A%0A%09%28String%20methodAt%3A%20%27lines%27%29%20source%0A%0ASee%20referenced%20classes%3A%0A%0A%09%28String%20methodAt%3A%20%27lines%27%29%20referencedClasses%0A%0Aor%20messages%20sent%20from%20this%20method%3A%0A%09%0A%09%28String%20methodAt%3A%20%27lines%27%29%20%20messageSends')
 smalltalk.addMethod(
 smalltalk.addMethod(
 unescape('_source'),
 unescape('_source'),
 smalltalk.method({
 smalltalk.method({
@@ -195,7 +196,7 @@ smalltalk.CompiledMethod);
 
 
 
 
 smalltalk.addClass('BlockClosure', smalltalk.Object, [], 'Kernel-Methods');
 smalltalk.addClass('BlockClosure', smalltalk.Object, [], 'Kernel-Methods');
-smalltalk.BlockClosure.comment=unescape('A%20BlockClosure%20is%20a%20lexical%20closure.%0AThe%20JavaScript%20representation%20is%20a%20function.%0A%0AA%20BlockClosure%20is%20evaluated%20with%20the%20%23value*%20methods%20in%20the%20%27evaluating%27%20protocol.')
+smalltalk.BlockClosure.comment=unescape('A%20BlockClosure%20is%20a%20lexical%20closure.%0AThe%20JavaScript%20representation%20is%20a%20function.%0A%0AA%20BlockClosure%20is%20evaluated%20with%20the%20%60%23value*%60%20methods%20in%20the%20%27evaluating%27%20protocol.')
 smalltalk.addMethod(
 smalltalk.addMethod(
 unescape('_compiledSource'),
 unescape('_compiledSource'),
 smalltalk.method({
 smalltalk.method({
@@ -537,7 +538,7 @@ smalltalk.BlockClosure);
 
 
 
 
 smalltalk.addClass('MethodContext', smalltalk.Object, [], 'Kernel-Methods');
 smalltalk.addClass('MethodContext', smalltalk.Object, [], 'Kernel-Methods');
-smalltalk.MethodContext.comment=unescape('MethodContext%20hold%20all%20the%20dynamic%20state%20associated%20with%20the%20execution%20of%20either%20a%20method%20activation%20resulting%20from%20a%20message%20send.%20That%20is%20used%20to%20build%20the%20call%20stack%20while%20debugging.%0A%20%20%0AMethodContext%20instances%20are%20JavaScript%20SmalltalkMethodContext%20objects%20defined%20in%20boot.js%20%0A%0ACurrent%20limitation%3A%20MethodContext%20instances%20are%20not%20created%20on%20Block%20evaluation.%20That%20means%20it%27s%20actually%20impossible%20to%20debug%20inside%20a%20Block.')
+smalltalk.MethodContext.comment=unescape('MethodContext%20holds%20all%20the%20dynamic%20state%20associated%20with%20the%20execution%20of%20either%20a%20method%20activation%20resulting%20from%20a%20message%20send.%20That%20is%20used%20to%20build%20the%20call%20stack%20while%20debugging.%0A%20%20%0AMethodContext%20instances%20are%20JavaScript%20%60SmalltalkMethodContext%60%20objects%20defined%20in%20boot.js%20%0A%0ACurrent%20limitation%3A%20MethodContext%20instances%20are%20not%20created%20on%20Block%20evaluation.%20That%20means%20it%27s%20actually%20impossible%20to%20debug%20inside%20a%20Block.')
 smalltalk.addMethod(
 smalltalk.addMethod(
 unescape('_receiver'),
 unescape('_receiver'),
 smalltalk.method({
 smalltalk.method({
@@ -637,7 +638,7 @@ smalltalk.MethodContext);
 
 
 
 
 smalltalk.addClass('Message', smalltalk.Object, ['selector', 'arguments'], 'Kernel-Methods');
 smalltalk.addClass('Message', smalltalk.Object, ['selector', 'arguments'], 'Kernel-Methods');
-smalltalk.Message.comment=unescape('Generally%2C%20the%20system%20does%20not%20use%20instances%20of%20Message%20for%20efficiency%20reasons.%0AHowever%2C%20when%20a%20message%20is%20not%20understood%20by%20its%20receiver%2C%20the%20interpreter%20will%20make%20up%20an%20instance%20of%20it%20in%20order%20to%20capture%20the%20information%20involved%20in%20an%20actual%20message%20transmission.%20%0AThis%20instance%20is%20sent%20it%20as%20an%20argument%20with%20the%20message%20doesNotUnderstand%3A%20to%20the%20receiver.%0A%0ASee%20boot.js%2C%20messageNotUnderstood%20%20and%20its%20counterpart%20Object%3E%3EdoesNotUnderstand%3A')
+smalltalk.Message.comment=unescape('Generally%2C%20the%20system%20does%20not%20use%20instances%20of%20Message%20for%20efficiency%20reasons.%0AHowever%2C%20when%20a%20message%20is%20not%20understood%20by%20its%20receiver%2C%20the%20interpreter%20will%20make%20up%20an%20instance%20of%20it%20in%20order%20to%20capture%20the%20information%20involved%20in%20an%20actual%20message%20transmission.%20%0AThis%20instance%20is%20sent%20it%20as%20an%20argument%20with%20the%20message%20%60doesNotUnderstand%3A%60%20to%20the%20receiver.%0A%0ASee%20boot.js%2C%20%60messageNotUnderstood%60%20%20and%20its%20counterpart%20%60Object%3E%3EdoesNotUnderstand%3A%60')
 smalltalk.addMethod(
 smalltalk.addMethod(
 unescape('_selector'),
 unescape('_selector'),
 smalltalk.method({
 smalltalk.method({

+ 23 - 5
st/Kernel-Methods.st

@@ -2,6 +2,24 @@ Smalltalk current createPackage: 'Kernel-Methods' properties: #{}!
 Object subclass: #CompiledMethod
 Object subclass: #CompiledMethod
 	instanceVariableNames: ''
 	instanceVariableNames: ''
 	category: 'Kernel-Methods'!
 	category: 'Kernel-Methods'!
+!CompiledMethod commentStamp!
+CompiledMethod hold the source and compiled code of a class method.
+
+You can get a CompiledMethod using `Behavior>>methodAt:`
+
+	String methodAt: 'lines'
+
+and read the source code
+
+	(String methodAt: 'lines') source
+
+See referenced classes:
+
+	(String methodAt: 'lines') referencedClasses
+
+or messages sent from this method:
+	
+	(String methodAt: 'lines')  messageSends!
 
 
 !CompiledMethod methodsFor: 'accessing'!
 !CompiledMethod methodsFor: 'accessing'!
 
 
@@ -60,7 +78,7 @@ Object subclass: #BlockClosure
 A BlockClosure is a lexical closure.
 A BlockClosure is a lexical closure.
 The JavaScript representation is a function.
 The JavaScript representation is a function.
 
 
-A BlockClosure is evaluated with the #value* methods in the 'evaluating' protocol.!
+A BlockClosure is evaluated with the `#value*` methods in the 'evaluating' protocol.!
 
 
 !BlockClosure methodsFor: 'accessing'!
 !BlockClosure methodsFor: 'accessing'!
 
 
@@ -187,9 +205,9 @@ Object subclass: #MethodContext
 	instanceVariableNames: ''
 	instanceVariableNames: ''
 	category: 'Kernel-Methods'!
 	category: 'Kernel-Methods'!
 !MethodContext commentStamp!
 !MethodContext commentStamp!
-MethodContext hold all the dynamic state associated with the execution of either a method activation resulting from a message send. That is used to build the call stack while debugging.
+MethodContext holds all the dynamic state associated with the execution of either a method activation resulting from a message send. That is used to build the call stack while debugging.
   
   
-MethodContext instances are JavaScript SmalltalkMethodContext objects defined in boot.js 
+MethodContext instances are JavaScript `SmalltalkMethodContext` objects defined in boot.js 
 
 
 Current limitation: MethodContext instances are not created on Block evaluation. That means it's actually impossible to debug inside a Block.!
 Current limitation: MethodContext instances are not created on Block evaluation. That means it's actually impossible to debug inside a Block.!
 
 
@@ -225,9 +243,9 @@ Object subclass: #Message
 !Message commentStamp!
 !Message commentStamp!
 Generally, the system does not use instances of Message for efficiency reasons.
 Generally, the system does not use instances of Message for efficiency reasons.
 However, when a message is not understood by its receiver, the interpreter will make up an instance of it in order to capture the information involved in an actual message transmission. 
 However, when a message is not understood by its receiver, the interpreter will make up an instance of it in order to capture the information involved in an actual message transmission. 
-This instance is sent it as an argument with the message doesNotUnderstand: to the receiver.
+This instance is sent it as an argument with the message `doesNotUnderstand:` to the receiver.
 
 
-See boot.js, messageNotUnderstood  and its counterpart Object>>doesNotUnderstand:!
+See boot.js, `messageNotUnderstood`  and its counterpart `Object>>doesNotUnderstand:`!
 
 
 !Message methodsFor: 'accessing'!
 !Message methodsFor: 'accessing'!