Skip to content

Commit

Permalink
Merge pull request #631 from marceltaeumel/marceltaeumel/primitive-12…
Browse files Browse the repository at this point in the history
…6-fail

Enable graphics backends to let primitive 126 fail...
  • Loading branch information
marceltaeumel authored May 9, 2022
2 parents 2d7105d + 3a44010 commit 6ad01bc
Show file tree
Hide file tree
Showing 41 changed files with 370 additions and 130 deletions.
5 changes: 4 additions & 1 deletion platforms/iOS/vm/OSX/sqSqueakOSXCGView.m
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Some of this code was funded via a grant from the European Smalltalk User Group

extern SqueakOSXAppDelegate *gDelegateApp;
extern struct VirtualMachine* interpreterProxy;
extern sqInt cannotDeferDisplayUpdates;

static NSString *stringWithCharacter(unichar character) {
return [NSString stringWithCharacters: &character length: 1];
Expand All @@ -75,7 +76,9 @@ - (void)awakeFromNib {
- (void)initialize {

// NSLog(@"initialize %@", NSStringFromRect([self frame]));


cannotDeferDisplayUpdates = 1;

[self setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
[self setAutoresizesSubviews:YES];

Expand Down
2 changes: 2 additions & 0 deletions platforms/iOS/vm/OSX/sqSqueakOSXMetalView.m
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
extern struct VirtualMachine* interpreterProxy;

static sqSqueakOSXMetalView *mainMetalView;
extern sqInt cannotDeferDisplayUpdates;

#define STRINGIFY_SHADER(src) #src
static const char *squeakMainShadersSrc =
Expand Down Expand Up @@ -145,6 +146,7 @@ - (void)initialize {

self.paused = YES;
self.enableSetNeedsDisplay = YES;
cannotDeferDisplayUpdates = 1;

NSMutableArray *drawingLayers = [NSMutableArray arrayWithCapacity: MAX_NUMBER_OF_EXTRA_LAYERS];
for(int i = 0; i < MAX_NUMBER_OF_EXTRA_LAYERS; ++i) {
Expand Down
16 changes: 12 additions & 4 deletions src/spur32.cog.lowcode/cointerp.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3183 uuid: c5c103b4-2c5c-44e7-8e32-030e79600ca6
CCodeGeneratorGlobalStructure VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7
from
CoInterpreter VMMaker.oscog-eem.3183 uuid: c5c103b4-2c5c-44e7-8e32-030e79600ca6
CoInterpreter VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7
*/
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3183 uuid: c5c103b4-2c5c-44e7-8e32-030e79600ca6 " __DATE__ ;
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;


Expand Down Expand Up @@ -2669,8 +2669,9 @@ sqInt sendWheelEvents;
sqInt suppressHeartbeatFlag;
sqInt debugCallbackInvokes;
sqInt debugCallbackReturns;
sqInt cannotDeferDisplayUpdates;
sqInt checkedPluginName;
const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3183]";
const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-mt.3184]";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
char expensiveAsserts = 0;
int (*showSurfaceFn)(sqIntptr_t, int, int, int, int);
Expand Down Expand Up @@ -95544,6 +95545,13 @@ primitiveDeferDisplayUpdates(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt flag;

if (cannotDeferDisplayUpdates) {
/* begin primitiveFail */
if (!GIV(primFailCode)) {
GIV(primFailCode) = 1;
}
return;
}
/* begin stackTop */
flag = longAt(GIV(stackPointer));
if (flag == GIV(trueObj)) {
Expand Down
3 changes: 2 additions & 1 deletion src/spur32.cog.lowcode/cointerp.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3183 uuid: c5c103b4-2c5c-44e7-8e32-030e79600ca6
CCodeGeneratorGlobalStructure VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7
*/


Expand Down Expand Up @@ -336,6 +336,7 @@ extern sqInt ultimateLiteralOf(sqInt aMethodOop);
extern sqInt breakLookupClassTag;
extern char * breakSelector;
extern sqInt breakSelectorLength ;
extern sqInt cannotDeferDisplayUpdates;
extern sqInt checkedPluginName;
extern sqInt checkForLeaks;
extern sqInt debugCallbackInvokes;
Expand Down
16 changes: 12 additions & 4 deletions src/spur32.cog.lowcode/gcc3x-cointerp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@


/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3183 uuid: c5c103b4-2c5c-44e7-8e32-030e79600ca6
CCodeGeneratorGlobalStructure VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7
from
CoInterpreter VMMaker.oscog-eem.3183 uuid: c5c103b4-2c5c-44e7-8e32-030e79600ca6
CoInterpreter VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7
*/
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3183 uuid: c5c103b4-2c5c-44e7-8e32-030e79600ca6 " __DATE__ ;
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;


Expand Down Expand Up @@ -2672,8 +2672,9 @@ sqInt sendWheelEvents;
sqInt suppressHeartbeatFlag;
sqInt debugCallbackInvokes;
sqInt debugCallbackReturns;
sqInt cannotDeferDisplayUpdates;
sqInt checkedPluginName;
const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3183]";
const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-mt.3184]";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
char expensiveAsserts = 0;
int (*showSurfaceFn)(sqIntptr_t, int, int, int, int);
Expand Down Expand Up @@ -95553,6 +95554,13 @@ primitiveDeferDisplayUpdates(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt flag;

if (cannotDeferDisplayUpdates) {
/* begin primitiveFail */
if (!GIV(primFailCode)) {
GIV(primFailCode) = 1;
}
return;
}
/* begin stackTop */
flag = longAt(GIV(stackPointer));
if (flag == GIV(trueObj)) {
Expand Down
16 changes: 12 additions & 4 deletions src/spur32.cog/cointerp.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3183 uuid: c5c103b4-2c5c-44e7-8e32-030e79600ca6
CCodeGeneratorGlobalStructure VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7
from
CoInterpreter VMMaker.oscog-eem.3183 uuid: c5c103b4-2c5c-44e7-8e32-030e79600ca6
CoInterpreter VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7
*/
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3183 uuid: c5c103b4-2c5c-44e7-8e32-030e79600ca6 " __DATE__ ;
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;


Expand Down Expand Up @@ -2644,8 +2644,9 @@ sqInt sendWheelEvents;
sqInt suppressHeartbeatFlag;
sqInt debugCallbackInvokes;
sqInt debugCallbackReturns;
sqInt cannotDeferDisplayUpdates;
sqInt checkedPluginName;
const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3183]";
const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-mt.3184]";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
char expensiveAsserts = 0;
int (*showSurfaceFn)(sqIntptr_t, int, int, int, int);
Expand Down Expand Up @@ -75477,6 +75478,13 @@ primitiveDeferDisplayUpdates(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt flag;

if (cannotDeferDisplayUpdates) {
/* begin primitiveFail */
if (!GIV(primFailCode)) {
GIV(primFailCode) = 1;
}
return;
}
/* begin stackTop */
flag = longAt(GIV(stackPointer));
if (flag == GIV(trueObj)) {
Expand Down
3 changes: 2 additions & 1 deletion src/spur32.cog/cointerp.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3183 uuid: c5c103b4-2c5c-44e7-8e32-030e79600ca6
CCodeGeneratorGlobalStructure VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7
*/


Expand Down Expand Up @@ -331,6 +331,7 @@ extern sqInt ultimateLiteralOf(sqInt aMethodOop);
extern sqInt breakLookupClassTag;
extern char * breakSelector;
extern sqInt breakSelectorLength ;
extern sqInt cannotDeferDisplayUpdates;
extern sqInt checkedPluginName;
extern sqInt checkForLeaks;
extern sqInt debugCallbackInvokes;
Expand Down
16 changes: 12 additions & 4 deletions src/spur32.cog/cointerpmt.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3183 uuid: c5c103b4-2c5c-44e7-8e32-030e79600ca6
CCodeGeneratorGlobalStructure VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7
from
CoInterpreterMT VMMaker.oscog-eem.3183 uuid: c5c103b4-2c5c-44e7-8e32-030e79600ca6
CoInterpreterMT VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7
*/
static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.3183 uuid: c5c103b4-2c5c-44e7-8e32-030e79600ca6 " __DATE__ ;
static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;


Expand Down Expand Up @@ -2737,8 +2737,9 @@ sqInt suppressHeartbeatFlag;
sqInt willNotThreadWarnCount;
sqInt debugCallbackInvokes;
sqInt debugCallbackReturns;
sqInt cannotDeferDisplayUpdates;
sqInt checkedPluginName;
const char *interpreterVersion = "Open Smalltalk Cog MT VM [CoInterpreterMT VMMaker.oscog-eem.3183]";
const char *interpreterVersion = "Open Smalltalk Cog MT VM [CoInterpreterMT VMMaker.oscog-mt.3184]";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
char expensiveAsserts = 0;
int (*showSurfaceFn)(sqIntptr_t, int, int, int, int);
Expand Down Expand Up @@ -77612,6 +77613,13 @@ primitiveDeferDisplayUpdates(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt flag;

if (cannotDeferDisplayUpdates) {
/* begin primitiveFail */
if (!GIV(primFailCode)) {
GIV(primFailCode) = 1;
}
return;
}
/* begin stackTop */
flag = longAt(GIV(stackPointer));
if (flag == GIV(trueObj)) {
Expand Down
3 changes: 2 additions & 1 deletion src/spur32.cog/cointerpmt.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3183 uuid: c5c103b4-2c5c-44e7-8e32-030e79600ca6
CCodeGeneratorGlobalStructure VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7
*/


Expand Down Expand Up @@ -333,6 +333,7 @@ extern sqInt ultimateLiteralOf(sqInt aMethodOop);
extern sqInt breakLookupClassTag;
extern char * breakSelector;
extern sqInt breakSelectorLength ;
extern sqInt cannotDeferDisplayUpdates;
extern sqInt checkedPluginName;
extern sqInt checkForLeaks;
extern sqInt debugCallbackInvokes;
Expand Down
16 changes: 12 additions & 4 deletions src/spur32.cog/gcc3x-cointerp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@


/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3183 uuid: c5c103b4-2c5c-44e7-8e32-030e79600ca6
CCodeGeneratorGlobalStructure VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7
from
CoInterpreter VMMaker.oscog-eem.3183 uuid: c5c103b4-2c5c-44e7-8e32-030e79600ca6
CoInterpreter VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7
*/
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3183 uuid: c5c103b4-2c5c-44e7-8e32-030e79600ca6 " __DATE__ ;
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;


Expand Down Expand Up @@ -2647,8 +2647,9 @@ sqInt sendWheelEvents;
sqInt suppressHeartbeatFlag;
sqInt debugCallbackInvokes;
sqInt debugCallbackReturns;
sqInt cannotDeferDisplayUpdates;
sqInt checkedPluginName;
const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3183]";
const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-mt.3184]";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
char expensiveAsserts = 0;
int (*showSurfaceFn)(sqIntptr_t, int, int, int, int);
Expand Down Expand Up @@ -75486,6 +75487,13 @@ primitiveDeferDisplayUpdates(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt flag;

if (cannotDeferDisplayUpdates) {
/* begin primitiveFail */
if (!GIV(primFailCode)) {
GIV(primFailCode) = 1;
}
return;
}
/* begin stackTop */
flag = longAt(GIV(stackPointer));
if (flag == GIV(trueObj)) {
Expand Down
16 changes: 12 additions & 4 deletions src/spur32.cog/gcc3x-cointerpmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@


/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3183 uuid: c5c103b4-2c5c-44e7-8e32-030e79600ca6
CCodeGeneratorGlobalStructure VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7
from
CoInterpreterMT VMMaker.oscog-eem.3183 uuid: c5c103b4-2c5c-44e7-8e32-030e79600ca6
CoInterpreterMT VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7
*/
static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.3183 uuid: c5c103b4-2c5c-44e7-8e32-030e79600ca6 " __DATE__ ;
static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;


Expand Down Expand Up @@ -2740,8 +2740,9 @@ sqInt suppressHeartbeatFlag;
sqInt willNotThreadWarnCount;
sqInt debugCallbackInvokes;
sqInt debugCallbackReturns;
sqInt cannotDeferDisplayUpdates;
sqInt checkedPluginName;
const char *interpreterVersion = "Open Smalltalk Cog MT VM [CoInterpreterMT VMMaker.oscog-eem.3183]";
const char *interpreterVersion = "Open Smalltalk Cog MT VM [CoInterpreterMT VMMaker.oscog-mt.3184]";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
char expensiveAsserts = 0;
int (*showSurfaceFn)(sqIntptr_t, int, int, int, int);
Expand Down Expand Up @@ -77621,6 +77622,13 @@ primitiveDeferDisplayUpdates(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt flag;

if (cannotDeferDisplayUpdates) {
/* begin primitiveFail */
if (!GIV(primFailCode)) {
GIV(primFailCode) = 1;
}
return;
}
/* begin stackTop */
flag = longAt(GIV(stackPointer));
if (flag == GIV(trueObj)) {
Expand Down
16 changes: 12 additions & 4 deletions src/spur32.sista/cointerp.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3183 uuid: c5c103b4-2c5c-44e7-8e32-030e79600ca6
CCodeGeneratorGlobalStructure VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7
from
CoInterpreter VMMaker.oscog-eem.3183 uuid: c5c103b4-2c5c-44e7-8e32-030e79600ca6
CoInterpreter VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7
*/
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3183 uuid: c5c103b4-2c5c-44e7-8e32-030e79600ca6 " __DATE__ ;
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;


Expand Down Expand Up @@ -2659,8 +2659,9 @@ sqInt sendWheelEvents;
sqInt suppressHeartbeatFlag;
sqInt debugCallbackInvokes;
sqInt debugCallbackReturns;
sqInt cannotDeferDisplayUpdates;
sqInt checkedPluginName;
const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3183]";
const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-mt.3184]";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
char expensiveAsserts = 0;
int (*showSurfaceFn)(sqIntptr_t, int, int, int, int);
Expand Down Expand Up @@ -78550,6 +78551,13 @@ primitiveDeferDisplayUpdates(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt flag;

if (cannotDeferDisplayUpdates) {
/* begin primitiveFail */
if (!GIV(primFailCode)) {
GIV(primFailCode) = 1;
}
return;
}
/* begin stackTop */
flag = longAt(GIV(stackPointer));
if (flag == GIV(trueObj)) {
Expand Down
3 changes: 2 additions & 1 deletion src/spur32.sista/cointerp.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3183 uuid: c5c103b4-2c5c-44e7-8e32-030e79600ca6
CCodeGeneratorGlobalStructure VMMaker.oscog-mt.3184 uuid: 57b61827-3f1a-ab45-966e-7c5caaef28d7
*/


Expand Down Expand Up @@ -335,6 +335,7 @@ extern sqInt ultimateLiteralOf(sqInt aMethodOop);
extern sqInt breakLookupClassTag;
extern char * breakSelector;
extern sqInt breakSelectorLength ;
extern sqInt cannotDeferDisplayUpdates;
extern sqInt checkedPluginName;
extern sqInt checkForLeaks;
extern sqInt debugCallbackInvokes;
Expand Down
Loading

0 comments on commit 6ad01bc

Please sign in to comment.