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

Diff of /trunk/js/jsatom.cpp

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

revision 332 by siliconforks, Thu Oct 23 19:03:33 2008 UTC revision 399 by siliconforks, Tue Dec 9 03:37:47 2008 UTC
# Line 68  Line 68 
68  #undef JS_PROTO  #undef JS_PROTO
69    
70  /*  /*
71   * Names for common atoms defined in JSAtomState starting from   * String constants for common atoms defined in JSAtomState starting from
72   * JSAtomState.emptyAtom until JSAtomState.lazy.   * JSAtomState.emptyAtom until JSAtomState.lazy.
73   *   *
74   * The elements of the array after the first empty string define strings   * The elements of the array after the first empty string define strings
75   * corresponding to JSType enumerators from jspubtd.h and to two boolean   * corresponding to the two boolean literals, false and true, followed by the
76   * literals, false and true. The following assert insists that JSType defines   * JSType enumerators from jspubtd.h starting with "undefined" for JSTYPE_VOID
77   * exactly 8 types.   * (which is pseudo-boolean 2) and continuing as initialized below. The static
78     * asserts check these relations.
79   */   */
80  JS_STATIC_ASSERT(JSTYPE_LIMIT == 8);  JS_STATIC_ASSERT(JSTYPE_LIMIT == 8);
81    JS_STATIC_ASSERT(JSVAL_TO_BOOLEAN(JSVAL_VOID) == 2);
82    JS_STATIC_ASSERT(JSTYPE_VOID == 0);
83    
84  const char *const js_common_atom_names[] = {  const char *const js_common_atom_names[] = {
85      "",                         /* emptyAtom                    */      "",                         /* emptyAtom                    */
86        js_false_str,               /* booleanAtoms[0]              */
87        js_true_str,                /* booleanAtoms[1]              */
88      js_undefined_str,           /* typeAtoms[JSTYPE_VOID]       */      js_undefined_str,           /* typeAtoms[JSTYPE_VOID]       */
89      js_object_str,              /* typeAtoms[JSTYPE_OBJECT]     */      js_object_str,              /* typeAtoms[JSTYPE_OBJECT]     */
90      js_function_str,            /* typeAtoms[JSTYPE_FUNCTION]   */      js_function_str,            /* typeAtoms[JSTYPE_FUNCTION]   */
# Line 87  Line 93 
93      "boolean",                  /* typeAtoms[JSTYPE_BOOLEAN]    */      "boolean",                  /* typeAtoms[JSTYPE_BOOLEAN]    */
94      js_null_str,                /* typeAtoms[JSTYPE_NULL]       */      js_null_str,                /* typeAtoms[JSTYPE_NULL]       */
95      "xml",                      /* typeAtoms[JSTYPE_XML]        */      "xml",                      /* typeAtoms[JSTYPE_XML]        */
     js_false_str,               /* booleanAtoms[0]              */  
     js_true_str,                /* booleanAtoms[1]              */  
96      js_null_str,                /* nullAtom                     */      js_null_str,                /* nullAtom                     */
97    
98  #define JS_PROTO(name,code,init) js_##name##_str,  #define JS_PROTO(name,code,init) js_##name##_str,
# Line 96  Line 100 
100  #undef JS_PROTO  #undef JS_PROTO
101    
102      js_anonymous_str,           /* anonymousAtom                */      js_anonymous_str,           /* anonymousAtom                */
103        js_apply_str,               /* applyAtom                    */
104      js_arguments_str,           /* argumentsAtom                */      js_arguments_str,           /* argumentsAtom                */
105      js_arity_str,               /* arityAtom                    */      js_arity_str,               /* arityAtom                    */
106        js_call_str,                /* callAtom                     */
107      js_callee_str,              /* calleeAtom                   */      js_callee_str,              /* calleeAtom                   */
108      js_caller_str,              /* callerAtom                   */      js_caller_str,              /* callerAtom                   */
109      js_class_prototype_str,     /* classPrototypeAtom           */      js_class_prototype_str,     /* classPrototypeAtom           */
# Line 143  Line 149 
149  #endif  #endif
150    
151  #ifdef NARCISSUS  #ifdef NARCISSUS
152      js_call_str,                /* callAtom                     */      js___call___str,            /* __call__Atom                 */
153      js_construct_str,           /* constructAtom                */      js___construct___str,       /* __construct__Atom            */
154      js_hasInstance_str,         /* hasInstanceAtom              */      js___hasInstance___str,     /* __hasInstance__Atom          */
155      js_ExecutionContext_str,    /* ExecutionContextAtom         */      js_ExecutionContext_str,    /* ExecutionContextAtom         */
156      js_current_str,             /* currentAtom                  */      js_current_str,             /* currentAtom                  */
157  #endif  #endif
158  };  };
159    
160  JS_STATIC_ASSERT(JS_ARRAY_LENGTH(js_common_atom_names) * sizeof(JSAtom *) ==  JS_STATIC_ASSERT(JS_ARRAY_LENGTH(js_common_atom_names) * sizeof(JSAtom *) ==
161                   LAZY_ATOM_OFFSET_START - ATOM_OFFSET_START);                   LAZY_ATOM_OFFSET_START - ATOM_OFFSET_START);
162    
163    /*
164     * Interpreter macros called by the trace recorder assume common atom indexes
165     * fit in one byte of immediate operand.
166     */
167    JS_STATIC_ASSERT(JS_ARRAY_LENGTH(js_common_atom_names) < 256);
168    
169    const size_t js_common_atom_count = JS_ARRAY_LENGTH(js_common_atom_names);
170    
171  const char js_anonymous_str[]       = "anonymous";  const char js_anonymous_str[]       = "anonymous";
172    const char js_apply_str[]           = "apply";
173  const char js_arguments_str[]       = "arguments";  const char js_arguments_str[]       = "arguments";
174  const char js_arity_str[]           = "arity";  const char js_arity_str[]           = "arity";
175    const char js_call_str[]            = "call";
176  const char js_callee_str[]          = "callee";  const char js_callee_str[]          = "callee";
177  const char js_caller_str[]          = "caller";  const char js_caller_str[]          = "caller";
178  const char js_class_prototype_str[] = "prototype";  const char js_class_prototype_str[] = "prototype";
# Line 207  Line 224 
224  #endif  #endif
225    
226  #ifdef NARCISSUS  #ifdef NARCISSUS
227  const char js_call_str[]             = "__call__";  const char js___call___str[]         = "__call__";
228  const char js_construct_str[]        = "__construct__";  const char js___construct___str[]    = "__construct__";
229  const char js_hasInstance_str[]      = "__hasInstance__";  const char js___hasInstance___str[]  = "__hasInstance__";
230  const char js_ExecutionContext_str[] = "ExecutionContext";  const char js_ExecutionContext_str[] = "ExecutionContext";
231  const char js_current_str[]          = "current";  const char js_current_str[]          = "current";
232  #endif  #endif

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

  ViewVC Help
Powered by ViewVC 1.1.24