Bug 327896: JS_STATIC_ASSERT is now used to assert constant conditions during compilation time instead of waiting for runtime to check for JS_ASSERT. r=brendan

This commit is contained in:
igor@mir2.org
2006-02-21 10:27:50 +00:00
parent a8039d051a
commit 661726edff
5 changed files with 29 additions and 12 deletions

View File

@@ -45,6 +45,8 @@
#include <stddef.h>
#include "jsprvtd.h"
#include "jspubtd.h"
#include "jsconfig.h"
#include "jsutil.h"
JS_BEGIN_EXTERN_C
@@ -180,6 +182,11 @@ typedef enum JSOp {
#define ATOM_INDEX_LIMIT_LOG2 23
#define ATOM_INDEX_LIMIT ((uint32)1 << ATOM_INDEX_LIMIT_LOG2)
#if JS_HAS_SHARP_VARS
JS_STATIC_ASSERT(sizeof(jsatomid) * JS_BITS_PER_BYTE >=
ATOM_INDEX_LIMIT_LOG2 + 1);
#endif
/* Actual argument count operand format helpers. */
#define ARGC_HI(argc) ((jsbytecode)((argc) >> 8))
#define ARGC_LO(argc) ((jsbytecode)(argc))