The Trunk: Compiler-eem.445.mcz

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

The Trunk: Compiler-eem.445.mcz

commits-2
Eliot Miranda uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-eem.445.mcz

==================== Summary ====================

Name: Compiler-eem.445
Author: eem
Time: 9 October 2020, 11:49:44.532447 am
UUID: f890a5ec-6748-4c88-bbaa-fe311e572c51
Ancestors: Compiler-eem.444

Allow CompilationCue to carry encoderClass and methodTrailer to more fully control code generation.

=============== Diff against Compiler-eem.444 ===============

Item was changed:
  Object subclass: #CompilationCue
+ instanceVariableNames: 'source sourceStream context receiver class environment requestor encoderClass methodTrailer'
- instanceVariableNames: 'source sourceStream context receiver class environment requestor encoderClass'
  classVariableNames: ''
  poolDictionaries: ''
  category: 'Compiler-Kernel'!
 
  !CompilationCue commentStamp: 'eem 3/30/2017 17:32' prior: 0!
  A CompilationCue is a helper class holding enough context for evaluating/compiling Smalltalk code.
 
  That is mainly the source code, and the source code editor to interact with if the Compiler is used interactively.
  But that is also any additional information necessary to resolve variable names.
 
  When compiling a method, the Compiler typically need to know the target class in which to install the method.
 
  When evaluating an expression, the Compiler also needs a receiver (for accessing the value of its instance variables), its class (for resolving instance/class variable names), and optionnally a context of execution when debugging a method (for accessing values of temporaries and parameters).
 
  Instance Variables
  class: <Behavior>
  context: <Context | nil>
  environment: <Environment | nil>
  receiver: <Object>
  requestor: <TextEditor | nil>
  source: <Stream>
 
  class
  - the target class in which to install the compiled method;
   this enables to resolve the instance variable names, class variable names and shared pool variable names.
   When evaluating, this should be the receiver class
 
  context
  - the context introspected when evaluating the code: this is typically for accessing parameters and temporary variables when debugging
 
  environment
  - the environment in which to resolve global variable names
 
  receiver
  - the receiver into which to evaluate the code: this is typically for accessing instance variables in an inspector
 
  requestor
  - typically the text editor containing the source code being compiled/evaluated. This enables the Compiler to interact in case of syntax error.
 
  source
  - a ReadStream on the source code to be compiled
  !

Item was added:
+ ----- Method: CompilationCue>>encoderClass (in category 'accessing') -----
+ encoderClass
+ ^encoderClass!

Item was added:
+ ----- Method: CompilationCue>>encoderClass: (in category 'accessing') -----
+ encoderClass: aBytecodeEncoderClass
+ encoderClass := aBytecodeEncoderClass!

Item was changed:
  ----- Method: CompilationCue>>initializeWithSource:context:receiver:class:environment:requestor: (in category 'initialization') -----
  initializeWithSource: aTextOrString context: aContext receiver: recObject class: aClass environment: anEnvironment requestor: reqObject
  self initialize.
+ source := aTextOrString.
- source := aTextOrString isStream
- ifTrue: [aTextOrString]
- ifFalse: [ReadStream on: aTextOrString asString].
  sourceStream := aTextOrString isStream
  ifTrue: [aTextOrString]
  ifFalse: [ReadStream on: aTextOrString asString].
  context := aContext.
  receiver := recObject.
  class := aClass.
  environment := anEnvironment.
  requestor := reqObject!

Item was added:
+ ----- Method: CompilationCue>>methodTrailer (in category 'accessing') -----
+ methodTrailer
+ ^methodTrailer!

Item was added:
+ ----- Method: CompilationCue>>methodTrailer: (in category 'accessing') -----
+ methodTrailer: aCompiledMethodTrailer
+ methodTrailer := aCompiledMethodTrailer!

Item was added:
+ ----- Method: CompilationCue>>source (in category 'accessing') -----
+ source
+ ^source!

Item was changed:
  ----- Method: CompilationCue>>sourceStream (in category 'accessing') -----
  sourceStream
+ ^sourceStream!
- ^source!