VMConstants.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Fri, 17 Nov 2017 13:44:50 -0300
changeset 47 58bc3165af87
parent 33 bec54ce61320
permissions -rw-r--r--
libudis86sx: Fixed build support files

"
    Copyright (c) 2016-now Jan Vrany <jan.vrany [at] fit . cvut . cz>

    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the 'Software'), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in all
    copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    SOFTWARE.
"
"{ Package: 'jv:dragonfly' }"

"{ NameSpace: Smalltalk }"

SharedPool subclass:#VMConstants
	instanceVariableNames:''
	classVariableNames:'__NARG_SHIFT __NVAR_SHIFT __NTMP_SHIFT __NARG_MASK __NVAR_MASK
		__NTMP_MASK __SPECIAL __ALLNONLAZY __LAZYMCON __LAZYBCON
		__LAZYJCON __MASK_LAZY __NONLIFO __COMPRESSED __C_NARG_SHIFT
		__C_NVAR_SHIFT __C_NTMP_SHIFT __C_NARG_MASK __C_NVAR_MASK
		__C_NTMP_MASK __REGSUSED __REGSUSED2 __REGSUSED3 __HANDLE_MARK
		__RAISE_MARK __METHOD_VALID __IRQ_ON_UNWIND __CANNOT_RETURN
		__UNWIND_MARK'
	poolDictionaries:''
	category:'System-Compiler-Interface'
!

!VMConstants class methodsFor:'documentation'!

copyright
"
    Copyright (c) 2016-now Jan Vrany <jan.vrany [at] fit . cvut . cz>

    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the 'Software'), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in all
    copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    SOFTWARE.

"
! !

!VMConstants class methodsFor:'initialization'!

initialize

    "Using inline C to make sure it matches definitions in stc.h"
%{
    @global(VMConstants:__NARG_SHIFT) = __MKSMALLINT(__NARG_SHIFT);    
    @global(VMConstants:__NVAR_SHIFT) = __MKSMALLINT(__NVAR_SHIFT);   
    @global(VMConstants:__NTMP_SHIFT) = __MKSMALLINT(__NTMP_SHIFT);   
    @global(VMConstants:__NARG_MASK) = __MKSMALLINT(__NARG_MASK);    
    @global(VMConstants:__NVAR_MASK) = __MKSMALLINT(__NVAR_MASK);    
    @global(VMConstants:__NTMP_MASK) = __MKSMALLINT(__NTMP_MASK);    
    @global(VMConstants:__SPECIAL) = __MKSMALLINT(__SPECIAL);            /* special handling at return required */
    @global(VMConstants:__ALLNONLAZY) = __MKSMALLINT(__ALLNONLAZY);      /* all contexts above are non-lazy */
    @global(VMConstants:__LAZYMCON) = __MKSMALLINT(__LAZYMCON);          /* method context is not valid (i.e. lazy) */
    @global(VMConstants:__LAZYBCON) = __MKSMALLINT(__LAZYBCON);          /* block context is not valid (i.e. lazy) */
    @global(VMConstants:__LAZYJCON) = __MKSMALLINT(__LAZYJCON);          /* java context is not valid (i.e. lazy) */
    @global(VMConstants:__MASK_LAZY) = __MKSMALLINT(__MASK_LAZY);    
    @global(VMConstants:__NONLIFO) = __MKSMALLINT(__NONLIFO);            /* context has reference taken */
    @global(VMConstants:__COMPRESSED) = __MKSMALLINT(__COMPRESSED);      /* flag bits are compressed */
    @global(VMConstants:__C_NARG_SHIFT) = __MKSMALLINT(__C_NARG_SHIFT);  
    @global(VMConstants:__C_NVAR_SHIFT) = __MKSMALLINT(__C_NVAR_SHIFT); 
    @global(VMConstants:__C_NTMP_SHIFT) = __MKSMALLINT(__C_NTMP_SHIFT); 
    @global(VMConstants:__C_NARG_MASK) = __MKSMALLINT(__C_NARG_MASK);  
    @global(VMConstants:__C_NVAR_MASK) = __MKSMALLINT(__C_NVAR_MASK);  
    @global(VMConstants:__C_NTMP_MASK) = __MKSMALLINT(__C_NTMP_MASK);  

    @global(VMConstants:__REGSUSED) = __MKSMALLINT(__REGSUSED);          /* used with sparc only - marks register usage (context-locals in registers) */
    @global(VMConstants:__REGSUSED2) = __MKSMALLINT(__REGSUSED2);    
    @global(VMConstants:__REGSUSED3) = __MKSMALLINT(__REGSUSED3);    

    @global(VMConstants:__HANDLE_MARK) = __MKSMALLINT(__HANDLE_MARK);    /* this is an exception-handle context */
    @global(VMConstants:__RAISE_MARK) = __MKSMALLINT(__RAISE_MARK);      /* this is an exception-raise context */
    @global(VMConstants:__METHOD_VALID) = __MKSMALLINT(__METHOD_VALID);  /* marks a valid value in the c_method slot (nil or a method ref) */

    @global(VMConstants:__IRQ_ON_UNWIND) = __MKSMALLINT(__IRQ_ON_UNWIND);/* interrupt on unwind */
    @global(VMConstants:__CANNOT_RETURN) = __MKSMALLINT(__CANNOT_RETURN);/* context did not safe machine state - no return/restart */
    @global(VMConstants:__UNWIND_MARK) = __MKSMALLINT(__UNWIND_MARK);    /* special action on unwind req'd */

%}.

! !


VMConstants initialize!