Oolite
Loading...
Searching...
No Matches
OOJSEngineNativeWrappers.h File Reference
import "OOCocoa.h"
+ Include dependency graph for OOJSEngineNativeWrappers.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define OOJS_PROFILE   OOLITE_DEBUG
 
#define OOJS_PROFILE_ENTER   {
 
#define OOJS_PROFILE_EXIT_VAL(rval)   } OOJSUnreachable(__FUNCTION__, __FILE__, __LINE__); return (rval);
 
#define OOJS_PROFILE_EXIT_VOID   } return;
 
#define OOJS_PROFILE_ENTER_FOR_NATIVE   @try {
 
#define OOJS_NATIVE_ENTER(cx)
 
#define OOJS_NATIVE_EXIT
 
#define OOJS_PROFILE_EXIT   OOJS_PROFILE_EXIT_VAL(0)
 
#define OOJS_PROFILE_EXIT_JSVAL   OOJS_PROFILE_EXIT_VAL(JSVAL_VOID)
 
#define OOJS_BEGIN_FULL_NATIVE(context)
 
#define OOJS_END_FULL_NATIVE
 
#define OOJS_DECLARE_PROFILE_STACK_FRAME(name)
 
#define OOJSProfileEnter(frame, function)   do {} while (0)
 
#define OOJSProfileExit(frame)   do {} while (0)
 

Functions

void OOJSReportWrappedException (JSContext *context, id exception)
 
void OOJSUnreachable (const char *function, const char *file, unsigned line) NO_RETURN_FUNC
 

Macro Definition Documentation

◆ OOJS_BEGIN_FULL_NATIVE

#define OOJS_BEGIN_FULL_NATIVE (   context)
Value:
{ \
(void)(context); \
OOJSPauseTimeLimiter(); \
@try \
{

Definition at line 141 of file OOJSEngineNativeWrappers.h.

◆ OOJS_DECLARE_PROFILE_STACK_FRAME

#define OOJS_DECLARE_PROFILE_STACK_FRAME (   name)

Definition at line 189 of file OOJSEngineNativeWrappers.h.

◆ OOJS_END_FULL_NATIVE

#define OOJS_END_FULL_NATIVE
Value:
} \
@finally \
{ \
OOJSResumeTimeLimiter(); \
} \
}

Definition at line 148 of file OOJSEngineNativeWrappers.h.

◆ OOJS_NATIVE_ENTER

#define OOJS_NATIVE_ENTER (   cx)
Value:
{ \
JSContext *oojsNativeContext = (cx); \
#define OOJS_PROFILE_ENTER_FOR_NATIVE

Definition at line 84 of file OOJSEngineNativeWrappers.h.

85 { \
86 JSContext *oojsNativeContext = (cx); \

◆ OOJS_NATIVE_EXIT

#define OOJS_NATIVE_EXIT
Value:
} @catch(id exception) { \
OOJSReportWrappedException(oojsNativeContext, exception); \
return NO; \
OOJS_PROFILE_EXIT_VAL(NO) \
}

Definition at line 89 of file OOJSEngineNativeWrappers.h.

◆ OOJS_PROFILE

#define OOJS_PROFILE   OOLITE_DEBUG

Definition at line 50 of file OOJSEngineNativeWrappers.h.

◆ OOJS_PROFILE_ENTER

#define OOJS_PROFILE_ENTER   {

Definition at line 77 of file OOJSEngineNativeWrappers.h.

◆ OOJS_PROFILE_ENTER_FOR_NATIVE

#define OOJS_PROFILE_ENTER_FOR_NATIVE   @try {

Definition at line 80 of file OOJSEngineNativeWrappers.h.

◆ OOJS_PROFILE_EXIT

#define OOJS_PROFILE_EXIT   OOJS_PROFILE_EXIT_VAL(0)

Definition at line 107 of file OOJSEngineNativeWrappers.h.

◆ OOJS_PROFILE_EXIT_JSVAL

#define OOJS_PROFILE_EXIT_JSVAL   OOJS_PROFILE_EXIT_VAL(JSVAL_VOID)

Definition at line 108 of file OOJSEngineNativeWrappers.h.

◆ OOJS_PROFILE_EXIT_VAL

#define OOJS_PROFILE_EXIT_VAL (   rval)    } OOJSUnreachable(__FUNCTION__, __FILE__, __LINE__); return (rval);

Definition at line 78 of file OOJSEngineNativeWrappers.h.

◆ OOJS_PROFILE_EXIT_VOID

#define OOJS_PROFILE_EXIT_VOID   } return;

Definition at line 79 of file OOJSEngineNativeWrappers.h.

◆ OOJSProfileEnter

#define OOJSProfileEnter (   frame,
  function 
)    do {} while (0)

Definition at line 190 of file OOJSEngineNativeWrappers.h.

◆ OOJSProfileExit

#define OOJSProfileExit (   frame)    do {} while (0)

Definition at line 191 of file OOJSEngineNativeWrappers.h.

Function Documentation

◆ OOJSReportWrappedException()

void OOJSReportWrappedException ( JSContext *  context,
id  exception 
)

Definition at line 1050 of file OOJavaScriptEngine.m.

1051{
1052 if (!JS_IsExceptionPending(context))
1053 {
1054 if ([exception isKindOfClass:[NSException class]]) OOJSReportError(context, @"Native exception: %@", [exception reason]);
1055 else OOJSReportError(context, @"Unidentified native exception");
1056 }
1057 // Else, let the pending exception propagate.
1058}
void OOJSReportError(JSContext *context, NSString *format,...)

References OOJSReportError().

+ Here is the call graph for this function:

◆ OOJSUnreachable()

void OOJSUnreachable ( const char *  function,
const char *  file,
unsigned  line 
)

Definition at line 1063 of file OOJavaScriptEngine.m.

1064{
1065 OOLog(@"fatal.unreachable", @"Supposedly unreachable statement reached in %s (%@:%u) -- terminating.", function, OOLogAbbreviatedFileName(file), line);
1066 abort();
1067}
#define OOLog(class, format,...)
Definition OOLogging.h:88
NSString * OOLogAbbreviatedFileName(const char *inName)
Definition OOLogging.m:839

References OOLog, and OOLogAbbreviatedFileName().

+ Here is the call graph for this function: