JavaNativeMethod.st
author cg
Sat, 25 Sep 1999 21:13:24 +0000
changeset 611 490fbaed2257
child 616 53bf2ec50346
permissions -rw-r--r--
faster nativeMethod invocation
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
611
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
     1
'From Smalltalk/X, Version:3.5.4 on 25-sep-1999 at 11:12:45 pm'                 !
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
     2
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
     3
JavaMethodWithHandler variableSubclass:#JavaNativeMethod
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
     4
	instanceVariableNames:'nativeImplementation'
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
     5
	classVariableNames:''
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
     6
	poolDictionaries:''
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
     7
	category:'Java-Classes'
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
     8
!
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
     9
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    10
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    11
!JavaNativeMethod methodsFor:'accessing'!
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    12
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    13
nativeImplementation
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    14
    "return the value of the instance variable 'nativeImplementation' (automatically generated)"
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    15
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    16
    ^ nativeImplementation
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    17
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    18
    "Created: / 25.9.1999 / 23:08:00 / cg"
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    19
!
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    20
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    21
nativeImplementation:something
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    22
    "set the value of the instance variable 'nativeImplementation' (automatically generated)"
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    23
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    24
    nativeImplementation := something.
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    25
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    26
    "Created: / 25.9.1999 / 23:08:00 / cg"
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    27
! !
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    28
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    29
!JavaNativeMethod methodsFor:'vm support'!
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    30
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    31
nativeMethodInvokation
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    32
    |nm sel|
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    33
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    34
    nativeImplementation isNil ifTrue:[
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    35
        nm := selector copyWithoutLast:signature size.
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    36
        sel := ('_' , javaClass lastName , '_' , nm , ':') asSymbol.
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    37
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    38
        nativeImplementation := (JavaVM class compiledMethodAt:sel).
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    39
        nativeImplementation isNil ifTrue:[
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    40
            ^ JavaVM 
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    41
                perform:sel
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    42
                with:thisContext sender.
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    43
        ].
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    44
    ].
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    45
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    46
    ^ nativeImplementation
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    47
        valueWithReceiver:JavaVM
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    48
        arguments:(Array with:thisContext sender)
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    49
        selector:selector
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    50
        search:JavaVM class
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    51
        sender:nil
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    52
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    53
    "Modified: / 25.9.1999 / 23:10:29 / cg"
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    54
! !
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    55
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    56
!JavaNativeMethod class methodsFor:'documentation'!
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    57
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    58
version
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    59
    ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaNativeMethod.st,v 1.1 1999/09/25 21:13:24 cg Exp $'
490fbaed2257 faster nativeMethod invocation
cg
parents:
diff changeset
    60
! !