/[jscoverage]/trunk/js/jsatom.h
ViewVC logotype

Diff of /trunk/js/jsatom.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 398 by siliconforks, Thu Oct 23 19:03:33 2008 UTC revision 399 by siliconforks, Tue Dec 9 03:37:47 2008 UTC
# Line 162  Line 162 
162      /* The rt->emptyString atom, see jsstr.c's js_InitRuntimeStringState. */      /* The rt->emptyString atom, see jsstr.c's js_InitRuntimeStringState. */
163      JSAtom              *emptyAtom;      JSAtom              *emptyAtom;
164    
165      /* Type names and value literals. */      /*
166      JSAtom              *typeAtoms[JSTYPE_LIMIT];       * Literal value and type names.
167         * NB: booleanAtoms must come right before typeAtoms!
168         */
169      JSAtom              *booleanAtoms[2];      JSAtom              *booleanAtoms[2];
170        JSAtom              *typeAtoms[JSTYPE_LIMIT];
171      JSAtom              *nullAtom;      JSAtom              *nullAtom;
172    
173      /* Standard class constructor or prototype names. */      /* Standard class constructor or prototype names. */
# Line 172  Line 175 
175    
176      /* Various built-in or commonly-used atoms, pinned on first context. */      /* Various built-in or commonly-used atoms, pinned on first context. */
177      JSAtom              *anonymousAtom;      JSAtom              *anonymousAtom;
178        JSAtom              *applyAtom;
179      JSAtom              *argumentsAtom;      JSAtom              *argumentsAtom;
180      JSAtom              *arityAtom;      JSAtom              *arityAtom;
181        JSAtom              *callAtom;
182      JSAtom              *calleeAtom;      JSAtom              *calleeAtom;
183      JSAtom              *callerAtom;      JSAtom              *callerAtom;
184      JSAtom              *classPrototypeAtom;      JSAtom              *classPrototypeAtom;
# Line 219  Line 224 
224  #endif  #endif
225    
226  #ifdef NARCISSUS  #ifdef NARCISSUS
227      JSAtom              *callAtom;      JSAtom              *__call__Atom;
228      JSAtom              *constructAtom;      JSAtom              *__construct__Atom;
229      JSAtom              *hasInstanceAtom;      JSAtom              *__hasInstance__Atom;
230      JSAtom              *ExecutionContextAtom;      JSAtom              *ExecutionContextAtom;
231      JSAtom              *currentAtom;      JSAtom              *currentAtom;
232  #endif  #endif
# Line 261  Line 266 
266  #define ATOM_OFFSET_LIMIT       (sizeof(JSAtomState))  #define ATOM_OFFSET_LIMIT       (sizeof(JSAtomState))
267    
268  #define COMMON_ATOMS_START(state)                                             \  #define COMMON_ATOMS_START(state)                                             \
269      (JSAtom **)((uint8 *)(state) + ATOM_OFFSET_START)      ((JSAtom **)((uint8 *)(state) + ATOM_OFFSET_START))
270    #define COMMON_ATOM_INDEX(name)                                               \
271        ((offsetof(JSAtomState, name##Atom) - ATOM_OFFSET_START)                  \
272         / sizeof(JSAtom*))
273    #define COMMON_TYPE_ATOM_INDEX(type)                                          \
274        ((offsetof(JSAtomState, typeAtoms[type]) - ATOM_OFFSET_START)             \
275         / sizeof(JSAtom*))
276    
277  /* Start and limit offsets should correspond to atoms. */  /* Start and limit offsets should correspond to atoms. */
278  JS_STATIC_ASSERT(ATOM_OFFSET_START % sizeof(JSAtom *) == 0);  JS_STATIC_ASSERT(ATOM_OFFSET_START % sizeof(JSAtom *) == 0);
# Line 275  Line 286 
286      ((cx)->runtime->atomState.classAtoms[JSProto_##name])      ((cx)->runtime->atomState.classAtoms[JSProto_##name])
287    
288  extern const char *const js_common_atom_names[];  extern const char *const js_common_atom_names[];
289    extern const size_t      js_common_atom_count;
290    
291  /*  /*
292   * Macros to access C strings for JSType and boolean literals together with   * Macros to access C strings for JSType and boolean literals together with
293   * checks that type names and booleans starts from index 1 and 1+JSTYPE_LIMIT   * checks that boolean names start from index 1 and type names from 1+2.
  * correspondingly.  
294   */   */
295  #define JS_TYPE_STR(type)    (js_common_atom_names[1 + (type)])  #define JS_BOOLEAN_STR(type) (js_common_atom_names[1 + (type)])
296  #define JS_BOOLEAN_STR(type) (js_common_atom_names[1 + JSTYPE_LIMIT + (type)])  #define JS_TYPE_STR(type)    (js_common_atom_names[1 + 2 + (type)])
297    
298  JS_STATIC_ASSERT(1 * sizeof(JSAtom *) ==  JS_STATIC_ASSERT(1 * sizeof(JSAtom *) ==
                  offsetof(JSAtomState, typeAtoms) - ATOM_OFFSET_START);  
 JS_STATIC_ASSERT((1 + JSTYPE_LIMIT) * sizeof(JSAtom *) ==  
299                   offsetof(JSAtomState, booleanAtoms) - ATOM_OFFSET_START);                   offsetof(JSAtomState, booleanAtoms) - ATOM_OFFSET_START);
300    JS_STATIC_ASSERT((1 + 2) * sizeof(JSAtom *) ==
301                     offsetof(JSAtomState, typeAtoms) - ATOM_OFFSET_START);
302    
303  /* Well-known predefined C strings. */  /* Well-known predefined C strings. */
304  #define JS_PROTO(name,code,init) extern const char js_##name##_str[];  #define JS_PROTO(name,code,init) extern const char js_##name##_str[];
# Line 295  Line 306 
306  #undef JS_PROTO  #undef JS_PROTO
307    
308  extern const char   js_anonymous_str[];  extern const char   js_anonymous_str[];
309    extern const char   js_apply_str[];
310  extern const char   js_arguments_str[];  extern const char   js_arguments_str[];
311  extern const char   js_arity_str[];  extern const char   js_arity_str[];
312    extern const char   js_call_str[];
313  extern const char   js_callee_str[];  extern const char   js_callee_str[];
314  extern const char   js_caller_str[];  extern const char   js_caller_str[];
315  extern const char   js_class_prototype_str[];  extern const char   js_class_prototype_str[];
# Line 342  Line 355 
355  extern const char   js_xml_str[];  extern const char   js_xml_str[];
356    
357  #ifdef NARCISSUS  #ifdef NARCISSUS
358  extern const char   js_call_str[];  extern const char   js___call___str[];
359  extern const char   js_construct_str[];  extern const char   js___construct___str[];
360  extern const char   js_hasInstance_str[];  extern const char   js___hasInstance___str[];
361  extern const char   js_ExecutionContext_str[];  extern const char   js_ExecutionContext_str[];
362  extern const char   js_current_str[];  extern const char   js_current_str[];
363  #endif  #endif

Legend:
Removed from v.398  
changed lines
  Added in v.399

  ViewVC Help
Powered by ViewVC 1.1.24