# systemPrimitives

- primitiveCreateInvocationOf:named:isPrimaryInvocation:superclass:format:ifFail: ^<GlobalAssociation>

      'format: #Oops, #ExternalProxy #Process'
      '        #IndexedInstanceVariables #IndexedByteInstanceVariables'
      '        #IndexedDoubleByteInstanceVariables #IndexedNextOfKinInstanceVariables'

  Parameters:
  mixin <Mixin>
  name <Symbol>
  primary <Boolean>
  superclass <Behavior>
  format <Symbol>
  Errors: WrongFormat

- primitiveCreateInvocationOf:superclass:format:ifFail: ^<GlobalAssociation>

      'format: #Oops, #ExternalProxy #Process'
      '        #IndexedInstanceVariables #IndexedByteInstanceVariables'
      '        #IndexedDoubleByteInstanceVariables #IndexedNextOfKinInstanceVariables'

  Parameters:
  mixin <Mixin>
  superclass <Behavior>
  format <Symbol>
  Errors: WrongFormat

- primitiveApplyChange:ifFail: ^<Object>

      'Apply change to a mixin and their invocations.'
      'The change is a  with the following structure:'
      '  [1]     = new-mixin   '
      '  [2]     = old-mixin   '
      '  [3 - n] = invocations '
      'Where the format for the a incovation is:'
      '  [1]     = incovation  '
      '  [2]     = format      '
      '  [3]     = superClass  '
      '  [4 - m] = {subclass, format}*  , '
      'The list of classes are sub classes of the invocation (topological sorted).'

  Parameters:
  change <IndexedInstanceVariables>

- <Object> primitiveScavenge ^<Self>

- <Object> primitiveGarbageCollect ^<Self>

- primitiveBreakpoint ^<Object>

- primitiveHalt ^<Object>

- primitiveUserTime ^<Float>

- primitiveSystemTime ^<Float>

- primitiveElapsedTime ^<Float>

- primitiveWriteSnapshot: ^<Object>
  Parameters:
  fileName <String>

- primitiveQuit ^<BottomType>

- <GlobalAssociation> primitiveGlobalAssociationKey ^<Symbol>

- <GlobalAssociation> primitiveGlobalAssociationSetKey: ^<Object>
  Parameters:
  key <Symbol>

- <GlobalAssociation> primitiveGlobalAssociationValue ^<Object>

- <GlobalAssociation> primitiveGlobalAssociationSetValue: ^<Object>
  Parameters:
  value <Object>

- <GlobalAssociation> primitiveGlobalAssociationIsConstant ^<Boolean>

- <GlobalAssociation> primitiveGlobalAssociationSetConstant: ^<Boolean>
  Parameters:
  value <Boolean>

- primitiveSmalltalkAt:ifFail: ^<GlobalAssociation>

      'Returns the global association at index'

  Parameters:
  index <SmallInteger>
  Errors: OutOfBounds

- primitiveSmalltalkAt:Put:ifFail: ^<GlobalAssociation>

      'Add a new non-constant global association'

  Parameters:
  key <Symbol>
  value <Object>

- primitiveSmalltalkRemoveAt:ifFail: ^<GlobalAssociation>

      'Removes the association at index, and returns the removed element'

  Parameters:
  index <SmallInteger>

- primitiveSmalltalkSize ^<SmallInteger>

- primitiveSmalltalkArray ^<IndexedInstanceVariables>

- primitivePrintPrimitiveTable ^<Object>

- primitivePrintMemory ^<Object>

- primitivePrintZone ^<Object>

- primitiveDefWindowProc:ifFail: ^<Proxy>
  Parameters:
  resultProxy <Proxy>

- primitiveWindowsHInstance:ifFail: ^<Proxy>
  Parameters:
  resultProxy <Proxy>

- primitiveWindowsHPrevInstance:ifFail: ^<Proxy>
  Parameters:
  resultProxy <Proxy>

- primitiveWindowsNCmdShow ^<Object>

- primitiveCharacterFor:ifFail: ^<Proxy>
  Parameters:
  value <SmallInteger>
  Errors: OutOfBounds

- primitiveTraceStack ^<Object>

- primitiveFlatProfilerReset ^<Object>

      'Resets the flat profiler to initial state.'

- primitiveFlatProfilerProcess ^<Process|nil>

      'Returns the process beeing profiler, nil otherwise.'

- primitiveFlatProfilerEngage:ifFail: ^<Process>

      'Starts profiling process.'

  Parameters:
  process <Process>

- primitiveFlatProfilerDisengage ^<Process|nil>

      'Stops profiling.'

- primitiveFlatProfilerPrint ^<Object>

      'Prints the collected profile information.'

- primitiveNotificationQueueGetIfFail: ^<Object>

      'Returns the first element in the notification queue (FIFO).'

  Errors: EmptyQueue

- primitiveNotificationQueuePut: ^<Object>

      'Appends the argument to the notification queue (FIFO).'

  Parameters:
  value <Object>

- primitiveHadNearDeathExperience: ^<Boolean>

      'Tells whether the receiver had a near death experience.'

  Parameters:
  value <Object>

- primitiveDLLSetupLookup:selector:ifFail: ^<Object>

      'Setup call back for DLL lookup. Fails if selector does not have right number of arguments'

  Parameters:
  receiver <Object>
  selector <Symbol>

- primitiveDLLLookup:in:result:ifFail: ^<Proxy>

      'Lookup name in library'

  Parameters:
  name <Symbol>
  library <Proxy>
  entry <Proxy>

- primitiveDLLLoad:result:ifFail: ^<Proxy>

      'Load library'

  Parameters:
  name <Symbol>
  library <Proxy>

- primitiveDLLUnload:ifFail: ^<Object>

      'Unload the library'

  Parameters:
  library <Proxy>

- primitiveInliningDatabaseDirectory ^<Symbol>

      'Returns the directory for the external inlining database.'

- primitiveInliningDatabaseSetDirectory:ifFail: ^<Symbol>

      'Sets the directory for external inlining database.'
      'Returns the old directory.'

  Parameters:
  name <Symbol>

- primitiveInliningDatabaseFileOutClass:ifFail: ^<SmallInteger>

      'Adds inlining information to the external database for all compiled methods with the specific receiver class.'
      'Returns the number of filed out structures.'

  Parameters:
  receiverClass <Behavior>

- primitiveInliningDatabaseFileOutAllIfFail: ^<SmallInteger>

      'Adds inlining information to the external database for all compiled methods.'
      'Returns the number of filed out structures.'

- primitiveInliningDatabaseCompile:ifFail: ^<Object>

      'Compiles a method described in fileName.'

  Parameters:
  fileName <String>

- primitiveInliningDatabaseCompile ^<Boolean>

      'Compiles a method for the inlining database (for background compilation).'

- primitiveInliningDatabaseMangle:ifFail: ^<IndexedByteInstanceVariables>

      'Returns the mangled name'

  Parameters:
  name <String>

- primitiveInliningDatabaseCompileDemangled:ifFail: ^<IndexedByteInstanceVariables>

      'Returns the demangled name'

  Parameters:
  name <String>

- primitiveInliningDatabaseAddLookupEntryClass:selector:ifFail: ^<Boolean>
  Parameters:
  class <Behavior>
  selector <Symbol>

- primitiveSlidingSystemAverageIfFail: ^<IndexedInstanceVariables>

- primitiveInstancesOf:limit:ifFail: ^<IndexedInstanceVariables>

      'Returns an array with instances of class.'
      'limit specifies the maximum number of elements.'

  Parameters:
  class <Class>
  limit <SmallInteger>

- primitiveReferencesTo:limit:ifFail: ^<IndexedInstanceVariables>

      'Returns an array with all objects referring obj.'
      'limit specifies the maximum number of elements.'

  Parameters:
  obj <Object>
  limit <SmallInteger>

- primitiveReferencesToInstancesOf:limit:ifFail: ^<IndexedInstanceVariables>

      'Returns an array with all objects referring instances of class.'
      'limit specifies the maximum number of elements.'

  Parameters:
  class <Class>
  limit <SmallInteger>

- primitiveAllObjectsLimit:ifFail: ^<IndexedInstanceVariables>

      'Returns an array containing all objects.'
      'limit specifies the maximum number of elements.'

  Parameters:
  limit <SmallInteger>

- primitiveFlushCodeCache ^<Object>

      'Flushes all compiled code.'

- primitiveFlushDeadCode ^<Object>

      'Flushes all invalidate compiled code.'