Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Metaphysics: reifying runtimes to be able to work by Javier Pimás

40 views

Published on

In this work, we experiment with adapting live programming tools to make them safer for the development of Bee Smalltalk, they can work on systems which crashed or that are not fully working. We will show Metaphysics, a framework that combines mirrors and proxies to reify different message execution semantics, allowing execution of code by mixing behavior of a remote, possibly broken system with a local fully-working one. With Metaphysics we were able to create native code debugging and profiling tools.

Published in: Technology
  • Login to see the comments

  • Be the first to like this

Metaphysics: reifying runtimes to be able to work by Javier Pimás

  1. 1. debuggee “nil” → 0x4010F8 debugger IDE nil nil PE/ELF Header UndefinedObject handle Object Smalltalk globals Process SmalltalkSystem current process Obj mirror Cls mirror UndefObj stck mirror stack Only structural access How do we send messages? runtime bridge Cls mirror Dict mirror Smalltalk Object
  2. 2. debugger IDE – messaging proxy sum? runtime [1,2,3] handle debuggee [1,2,3] using which behavior? [1,2,3] execute remotely? simulate execution locally?
  3. 3. debugger IDE – messaging subjects subject sum? Trigger Mirage Direct dispatch:#sum [1,2,3] runtime [1,2,3] handle gate debuggee [1,2,3]
  4. 4. Trigger subject sum? dispatch:#sum [1,2,3] dispatch: aMessage | result | self saveContext; passArguments; pushReturnAddress; setIP. result := self run. self restoreContext. ^result [1,2,3] handle a Trigger
  5. 5. Mirage dispatch: aMessage from: parentInterpreter | method interpreter | method := class compiledMethodFor: aMessage selector. interpreter := SubjectInterpreter on: aMessage receiver with: aMessage arguments for: method. ^interpreter parent: parentInterpreter; evaluate: method parseTree [1,2,3] handle subject sum? dispatch:#sum [1,2,3] Array clas s a Mirage
  6. 6. Direct dispatch: aMessage from: parentInterpreter | receiver method interpreter | receiver := aMessage receiver. method := handle runtime lookup: aMessage selector on: receiver. interpreter := SubjectInterpreter on: receiver with: aMessage arguments for: method. ^interpreter parent: parentInterpreter; evaluate: method parseTree [1,2,3] subject sum? aDirectGate handle dispatch:#sum [1,2,3]

×