1
1
/* Automatically generated by
2
- VMPluginCodeGenerator VMMaker.oscog-eem.3024 uuid: 417aa150-be4e-4631-b35b-948afa18e190
2
+ VMPluginCodeGenerator VMMaker.oscog-eem.3349 uuid: 09001547-129a-4b6b-9fed-ccdd6790c8f4
3
3
from
4
- SqueakSSLPlugin VMMaker.oscog-eem.3024 uuid: 417aa150-be4e-4631-b35b-948afa18e190
4
+ SqueakSSLPlugin VMMaker.oscog-eem.3349 uuid: 09001547-129a-4b6b-9fed-ccdd6790c8f4
5
5
*/
6
- static char __buildInfo [] = "SqueakSSLPlugin VMMaker.oscog-eem.3024 uuid: 417aa150-be4e-4631-b35b-948afa18e190 " __DATE__ ;
6
+ static char __buildInfo [] = "SqueakSSLPlugin VMMaker.oscog-eem.3349 uuid: 09001547-129a-4b6b-9fed-ccdd6790c8f4 " __DATE__ ;
7
7
8
8
9
9
#include "config.h"
@@ -34,6 +34,10 @@ static char __buildInfo[] = "SqueakSSLPlugin VMMaker.oscog-eem.3024 uuid: 417aa1
34
34
#endif
35
35
36
36
37
+ /*** Constants ***/
38
+ #define DisownVMForThreading 32
39
+
40
+
37
41
/*** Function Prototypes ***/
38
42
EXPORT (const char * ) getModuleName (void );
39
43
EXPORT (sqInt ) primitiveAccept (void );
@@ -54,12 +58,16 @@ EXPORT(sqInt) setInterpreter(struct VirtualMachine *anInterpreter);
54
58
#if !defined(SQUEAK_BUILTIN_PLUGIN )
55
59
static sqInt (* byteSizeOf )(sqInt oop );
56
60
static sqInt (* classString )(void );
61
+ static sqInt (* disownVM )(sqInt flags );
57
62
static sqInt (* failed )(void );
58
63
static void * (* firstIndexableField )(sqInt oop );
59
64
static sqInt (* instantiateClassindexableSize )(sqInt classPointer , sqInt size );
60
65
static sqInt (* isBytes )(sqInt oop );
66
+ static sqInt (* isPinned )(sqInt anObject );
61
67
static sqInt (* methodArgumentCount )(void );
62
68
static sqInt (* nilObject )(void );
69
+ static sqInt (* ownVM )(sqInt flags );
70
+ static sqInt (* pinObject )(sqInt anObject );
63
71
static sqInt (* pop )(sqInt nItems );
64
72
static sqInt (* popthenPush )(sqInt nItems , sqInt oop );
65
73
static sqInt (* primitiveFail )(void );
@@ -68,15 +76,28 @@ static sqInt (*signed32BitIntegerFor)(sqInt integerValue);
68
76
static int (* signed32BitValueOf )(sqInt oop );
69
77
static sqInt (* stackIntegerValue )(sqInt offset );
70
78
static sqInt (* stackValue )(sqInt offset );
79
+ static sqInt (* unpinObject )(sqInt anObject );
71
80
#else /* !defined(SQUEAK_BUILTIN_PLUGIN) */
72
81
extern sqInt byteSizeOf (sqInt oop );
73
82
extern sqInt classString (void );
83
+ extern sqInt disownVM (sqInt flags );
74
84
extern sqInt failed (void );
75
85
extern void * firstIndexableField (sqInt oop );
76
86
extern sqInt instantiateClassindexableSize (sqInt classPointer , sqInt size );
77
87
extern sqInt isBytes (sqInt oop );
88
+ #if VM_PROXY_MAJOR > 1 || (VM_PROXY_MAJOR == 1 && VM_PROXY_MINOR >= 13 )
89
+ extern sqInt isPinned (sqInt anObject );
90
+ #else
91
+ # define isPinned (anObject ) 0
92
+ #endif
78
93
extern sqInt methodArgumentCount (void );
79
94
extern sqInt nilObject (void );
95
+ extern sqInt ownVM (sqInt flags );
96
+ #if VM_PROXY_MAJOR > 1 || (VM_PROXY_MAJOR == 1 && VM_PROXY_MINOR >= 13 )
97
+ extern sqInt pinObject (sqInt anObject );
98
+ #else
99
+ # define pinObject (anObject ) 0
100
+ #endif
80
101
extern sqInt pop (sqInt nItems );
81
102
extern sqInt popthenPush (sqInt nItems , sqInt oop );
82
103
extern sqInt primitiveFail (void );
@@ -85,10 +106,15 @@ extern sqInt signed32BitIntegerFor(sqInt integerValue);
85
106
extern int signed32BitValueOf (sqInt oop );
86
107
extern sqInt stackIntegerValue (sqInt offset );
87
108
extern sqInt stackValue (sqInt offset );
109
+ #if VM_PROXY_MAJOR > 1 || (VM_PROXY_MAJOR == 1 && VM_PROXY_MINOR >= 13 )
110
+ extern sqInt unpinObject (sqInt anObject );
111
+ #else
112
+ # define unpinObject (anObject ) 0
113
+ #endif
88
114
extern
89
115
#endif
90
116
struct VirtualMachine * interpreterProxy ;
91
- static const char * moduleName = "SqueakSSL VMMaker.oscog-eem.3024 " INT_EXT ;
117
+ static const char * moduleName = "SqueakSSL VMMaker.oscog-eem.3349 " INT_EXT ;
92
118
93
119
94
120
@@ -185,6 +211,9 @@ primitiveConnect(void)
185
211
sqInt srcOop ;
186
212
char * srcPtr ;
187
213
sqInt start ;
214
+ sqInt vmHandle ;
215
+ sqInt wasDestPinned ;
216
+ sqInt wasSrcPinned ;
188
217
189
218
if (!((methodArgumentCount ()) == 5 )) {
190
219
return primitiveFail ();
@@ -204,11 +233,29 @@ primitiveConnect(void)
204
233
&& ((byteSizeOf (srcOop )) >= ((start + srcLen ) - 1 )))))) {
205
234
return primitiveFail ();
206
235
}
236
+ if (!((wasSrcPinned = isPinned (srcOop )))) {
237
+ srcOop = pinObject (srcOop );
238
+ }
239
+ if (!((wasDestPinned = isPinned (dstOop )))) {
240
+ dstOop = pinObject (dstOop );
241
+ }
242
+ if ((srcOop == null )
243
+ || (dstOop == null )) {
244
+ return primitiveFail ();
245
+ }
207
246
srcPtr = firstIndexableField (srcOop );
208
247
dstPtr = firstIndexableField (dstOop );
209
248
srcPtr = (srcPtr + start ) - 1 ;
210
249
dstLen = byteSizeOf (dstOop );
250
+ vmHandle = disownVM (DisownVMForThreading );
211
251
result = sqConnectSSL (handle , srcPtr , srcLen , dstPtr , dstLen );
252
+ ownVM (vmHandle );
253
+ if (!wasSrcPinned ) {
254
+ unpinObject (srcOop );
255
+ }
256
+ if (!wasDestPinned ) {
257
+ unpinObject (dstOop );
258
+ }
212
259
if (failed ()) {
213
260
return null ;
214
261
}
@@ -529,12 +576,28 @@ setInterpreter(struct VirtualMachine *anInterpreter)
529
576
#if !defined(SQUEAK_BUILTIN_PLUGIN )
530
577
byteSizeOf = interpreterProxy -> byteSizeOf ;
531
578
classString = interpreterProxy -> classString ;
579
+ disownVM = interpreterProxy -> disownVM ;
532
580
failed = interpreterProxy -> failed ;
533
581
firstIndexableField = interpreterProxy -> firstIndexableField ;
534
582
instantiateClassindexableSize = interpreterProxy -> instantiateClassindexableSize ;
535
583
isBytes = interpreterProxy -> isBytes ;
584
+ #if VM_PROXY_MAJOR > 1 || (VM_PROXY_MAJOR == 1 && VM_PROXY_MINOR >= 13 )
585
+ isPinned = interpreterProxy -> isPinned ;
586
+ #else
587
+ #if !defined(isPinned )
588
+ isPinned = 0 ;
589
+ #endif
590
+ #endif
536
591
methodArgumentCount = interpreterProxy -> methodArgumentCount ;
537
592
nilObject = interpreterProxy -> nilObject ;
593
+ ownVM = interpreterProxy -> ownVM ;
594
+ #if VM_PROXY_MAJOR > 1 || (VM_PROXY_MAJOR == 1 && VM_PROXY_MINOR >= 13 )
595
+ pinObject = interpreterProxy -> pinObject ;
596
+ #else
597
+ #if !defined(pinObject )
598
+ pinObject = 0 ;
599
+ #endif
600
+ #endif
538
601
pop = interpreterProxy -> pop ;
539
602
popthenPush = interpreterProxy -> popthenPush ;
540
603
primitiveFail = interpreterProxy -> primitiveFail ;
@@ -543,6 +606,13 @@ setInterpreter(struct VirtualMachine *anInterpreter)
543
606
signed32BitValueOf = interpreterProxy -> signed32BitValueOf ;
544
607
stackIntegerValue = interpreterProxy -> stackIntegerValue ;
545
608
stackValue = interpreterProxy -> stackValue ;
609
+ #if VM_PROXY_MAJOR > 1 || (VM_PROXY_MAJOR == 1 && VM_PROXY_MINOR >= 13 )
610
+ unpinObject = interpreterProxy -> unpinObject ;
611
+ #else
612
+ #if !defined(unpinObject )
613
+ unpinObject = 0 ;
614
+ #endif
615
+ #endif
546
616
#endif /* !defined(SQUEAK_BUILTIN_PLUGIN) */
547
617
}
548
618
return ok ;
0 commit comments