]> git.wh0rd.org - ICEs.git/blob - 434452/ObjectImpl.ii
more
[ICEs.git] / 434452 / ObjectImpl.ii
1 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl.cpp"
2 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/obj-armv7l-unknown-linux-gnueabi/js/src//"
3 # 1 "<eingebaut>"
4 #define __STDC__ 1
5 #define __cplusplus 1
6 #define __STDC_HOSTED__ 1
7 #define __GNUC__ 4
8 #define __GNUC_MINOR__ 5
9 #define __GNUC_PATCHLEVEL__ 4
10 #define __GNUG__ 4
11 #define __SIZE_TYPE__ unsigned int
12 #define __PTRDIFF_TYPE__ int
13 #define __WCHAR_TYPE__ unsigned int
14 #define __WINT_TYPE__ unsigned int
15 #define __INTMAX_TYPE__ long long int
16 #define __UINTMAX_TYPE__ long long unsigned int
17 #define __CHAR16_TYPE__ short unsigned int
18 #define __CHAR32_TYPE__ unsigned int
19 #define __SIG_ATOMIC_TYPE__ int
20 #define __INT8_TYPE__ signed char
21 #define __INT16_TYPE__ short int
22 #define __INT32_TYPE__ int
23 #define __INT64_TYPE__ long long int
24 #define __UINT8_TYPE__ unsigned char
25 #define __UINT16_TYPE__ short unsigned int
26 #define __UINT32_TYPE__ unsigned int
27 #define __UINT64_TYPE__ long long unsigned int
28 #define __INT_LEAST8_TYPE__ signed char
29 #define __INT_LEAST16_TYPE__ short int
30 #define __INT_LEAST32_TYPE__ int
31 #define __INT_LEAST64_TYPE__ long long int
32 #define __UINT_LEAST8_TYPE__ unsigned char
33 #define __UINT_LEAST16_TYPE__ short unsigned int
34 #define __UINT_LEAST32_TYPE__ unsigned int
35 #define __UINT_LEAST64_TYPE__ long long unsigned int
36 #define __INT_FAST8_TYPE__ signed char
37 #define __INT_FAST16_TYPE__ int
38 #define __INT_FAST32_TYPE__ int
39 #define __INT_FAST64_TYPE__ long long int
40 #define __UINT_FAST8_TYPE__ unsigned char
41 #define __UINT_FAST16_TYPE__ unsigned int
42 #define __UINT_FAST32_TYPE__ unsigned int
43 #define __UINT_FAST64_TYPE__ long long unsigned int
44 #define __INTPTR_TYPE__ int
45 #define __UINTPTR_TYPE__ unsigned int
46 #define __GXX_WEAK__ 1
47 #define __DEPRECATED 1
48 #define __EXCEPTIONS 1
49 #define __GXX_ABI_VERSION 1002
50 #define __SCHAR_MAX__ 127
51 #define __SHRT_MAX__ 32767
52 #define __INT_MAX__ 2147483647
53 #define __LONG_MAX__ 2147483647L
54 #define __LONG_LONG_MAX__ 9223372036854775807LL
55 #define __WCHAR_MAX__ 4294967295U
56 #define __WCHAR_MIN__ 0U
57 #define __WINT_MAX__ 4294967295U
58 #define __WINT_MIN__ 0U
59 #define __PTRDIFF_MAX__ 2147483647
60 #define __SIZE_MAX__ 4294967295U
61 #define __CHAR_BIT__ 8
62 #define __INTMAX_MAX__ 9223372036854775807LL
63 #define __INTMAX_C(c) c ## LL
64 #define __UINTMAX_MAX__ 18446744073709551615ULL
65 #define __UINTMAX_C(c) c ## ULL
66 #define __SIG_ATOMIC_MAX__ 2147483647
67 #define __SIG_ATOMIC_MIN__ (-__SIG_ATOMIC_MAX__ - 1)
68 #define __INT8_MAX__ 127
69 #define __INT16_MAX__ 32767
70 #define __INT32_MAX__ 2147483647
71 #define __INT64_MAX__ 9223372036854775807LL
72 #define __UINT8_MAX__ 255
73 #define __UINT16_MAX__ 65535
74 #define __UINT32_MAX__ 4294967295U
75 #define __UINT64_MAX__ 18446744073709551615ULL
76 #define __INT_LEAST8_MAX__ 127
77 #define __INT8_C(c) c
78 #define __INT_LEAST16_MAX__ 32767
79 #define __INT16_C(c) c
80 #define __INT_LEAST32_MAX__ 2147483647
81 #define __INT32_C(c) c
82 #define __INT_LEAST64_MAX__ 9223372036854775807LL
83 #define __INT64_C(c) c ## LL
84 #define __UINT_LEAST8_MAX__ 255
85 #define __UINT8_C(c) c
86 #define __UINT_LEAST16_MAX__ 65535
87 #define __UINT16_C(c) c
88 #define __UINT_LEAST32_MAX__ 4294967295U
89 #define __UINT32_C(c) c ## U
90 #define __UINT_LEAST64_MAX__ 18446744073709551615ULL
91 #define __UINT64_C(c) c ## ULL
92 #define __INT_FAST8_MAX__ 127
93 #define __INT_FAST16_MAX__ 2147483647
94 #define __INT_FAST32_MAX__ 2147483647
95 #define __INT_FAST64_MAX__ 9223372036854775807LL
96 #define __UINT_FAST8_MAX__ 255
97 #define __UINT_FAST16_MAX__ 4294967295U
98 #define __UINT_FAST32_MAX__ 4294967295U
99 #define __UINT_FAST64_MAX__ 18446744073709551615ULL
100 #define __INTPTR_MAX__ 2147483647
101 #define __UINTPTR_MAX__ 4294967295U
102 #define __FLT_EVAL_METHOD__ 0
103 #define __DEC_EVAL_METHOD__ 2
104 #define __FLT_RADIX__ 2
105 #define __FLT_MANT_DIG__ 24
106 #define __FLT_DIG__ 6
107 #define __FLT_MIN_EXP__ (-125)
108 #define __FLT_MIN_10_EXP__ (-37)
109 #define __FLT_MAX_EXP__ 128
110 #define __FLT_MAX_10_EXP__ 38
111 #define __FLT_MAX__ 3.4028234663852886e+38F
112 #define __FLT_MIN__ 1.1754943508222875e-38F
113 #define __FLT_EPSILON__ 1.1920928955078125e-7F
114 #define __FLT_DENORM_MIN__ 1.4012984643248171e-45F
115 #define __FLT_HAS_DENORM__ 1
116 #define __FLT_HAS_INFINITY__ 1
117 #define __FLT_HAS_QUIET_NAN__ 1
118 #define __DBL_MANT_DIG__ 53
119 #define __DBL_DIG__ 15
120 #define __DBL_MIN_EXP__ (-1021)
121 #define __DBL_MIN_10_EXP__ (-307)
122 #define __DBL_MAX_EXP__ 1024
123 #define __DBL_MAX_10_EXP__ 308
124 #define __DBL_MAX__ ((double)1.7976931348623157e+308L)
125 #define __DBL_MIN__ ((double)2.2250738585072014e-308L)
126 #define __DBL_EPSILON__ ((double)2.2204460492503131e-16L)
127 #define __DBL_DENORM_MIN__ ((double)4.9406564584124654e-324L)
128 #define __DBL_HAS_DENORM__ 1
129 #define __DBL_HAS_INFINITY__ 1
130 #define __DBL_HAS_QUIET_NAN__ 1
131 #define __LDBL_MANT_DIG__ 53
132 #define __LDBL_DIG__ 15
133 #define __LDBL_MIN_EXP__ (-1021)
134 #define __LDBL_MIN_10_EXP__ (-307)
135 #define __LDBL_MAX_EXP__ 1024
136 #define __LDBL_MAX_10_EXP__ 308
137 #define __DECIMAL_DIG__ 17
138 #define __LDBL_MAX__ 1.7976931348623157e+308L
139 #define __LDBL_MIN__ 2.2250738585072014e-308L
140 #define __LDBL_EPSILON__ 2.2204460492503131e-16L
141 #define __LDBL_DENORM_MIN__ 4.9406564584124654e-324L
142 #define __LDBL_HAS_DENORM__ 1
143 #define __LDBL_HAS_INFINITY__ 1
144 #define __LDBL_HAS_QUIET_NAN__ 1
145 #define __DEC32_MANT_DIG__ 7
146 #define __DEC32_MIN_EXP__ (-94)
147 #define __DEC32_MAX_EXP__ 97
148 #define __DEC32_MIN__ 1E-95DF
149 #define __DEC32_MAX__ 9.999999E96DF
150 #define __DEC32_EPSILON__ 1E-6DF
151 #define __DEC32_SUBNORMAL_MIN__ 0.000001E-95DF
152 #define __DEC64_MANT_DIG__ 16
153 #define __DEC64_MIN_EXP__ (-382)
154 #define __DEC64_MAX_EXP__ 385
155 #define __DEC64_MIN__ 1E-383DD
156 #define __DEC64_MAX__ 9.999999999999999E384DD
157 #define __DEC64_EPSILON__ 1E-15DD
158 #define __DEC64_SUBNORMAL_MIN__ 0.000000000000001E-383DD
159 #define __DEC128_MANT_DIG__ 34
160 #define __DEC128_MIN_EXP__ (-6142)
161 #define __DEC128_MAX_EXP__ 6145
162 #define __DEC128_MIN__ 1E-6143DL
163 #define __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL
164 #define __DEC128_EPSILON__ 1E-33DL
165 #define __DEC128_SUBNORMAL_MIN__ 0.000000000000000000000000000000001E-6143DL
166 #define __REGISTER_PREFIX__
167 #define __USER_LABEL_PREFIX__
168 #define __VERSION__ "4.5.4"
169 #define __GNUC_GNU_INLINE__ 1
170 #define __OPTIMIZE__ 1
171 #define __FINITE_MATH_ONLY__ 0
172 #define __pic__ 2
173 #define __PIC__ 2
174 #define __CHAR_UNSIGNED__ 1
175 #define __WCHAR_UNSIGNED__ 1
176 #define __GCC_HAVE_DWARF2_CFI_ASM 1
177 #define __PRAGMA_REDEFINE_EXTNAME 1
178 #define __SIZEOF_INT__ 4
179 #define __SIZEOF_LONG__ 4
180 #define __SIZEOF_LONG_LONG__ 8
181 #define __SIZEOF_SHORT__ 2
182 #define __SIZEOF_FLOAT__ 4
183 #define __SIZEOF_DOUBLE__ 8
184 #define __SIZEOF_LONG_DOUBLE__ 8
185 #define __SIZEOF_SIZE_T__ 4
186 #define __SIZEOF_WCHAR_T__ 4
187 #define __SIZEOF_WINT_T__ 4
188 #define __SIZEOF_PTRDIFF_T__ 4
189 #define __SIZEOF_POINTER__ 4
190 #define __arm__ 1
191 #define __APCS_32__ 1
192 #define __ARMEL__ 1
193 #define __VFP_FP__ 1
194 #define __THUMB_INTERWORK__ 1
195 #define __ARM_ARCH_7A__ 1
196 #define __ARM_PCS_VFP 1
197 #define __ARM_EABI__ 1
198 #define __GXX_TYPEINFO_EQUALITY_INLINE 0
199 #define __gnu_linux__ 1
200 #define __linux 1
201 #define __linux__ 1
202 #define linux 1
203 #define __unix 1
204 #define __unix__ 1
205 #define unix 1
206 #define __ELF__ 1
207 #define __BIGGEST_ALIGNMENT__ 8
208 # 1 "<Kommandozeile>"
209 #define _GNU_SOURCE 1
210 #define _REENTRANT 1
211 #define MOZ_GLUE_IN_PROGRAM 1
212 #define EXPORT_JS_API 1
213 #define JS_HAS_CTYPES 1
214 #define DLL_PREFIX "lib"
215 #define DLL_SUFFIX ".so"
216 #define NO_NSPR_10_SUPPORT 1
217 #define NDEBUG 1
218 #define TRIMMED 1
219 #define USE_SYSTEM_MALLOC 1
220 #define ENABLE_ASSEMBLER 1
221 #define ENABLE_JIT 1
222 #define MOZILLA_CLIENT 1
223 #define _FORTIFY_SOURCE 2
224 # 1 "././js-confdefs.h" 1
225
226
227
228
229
230
231 #define _JS_CONFDEFS_H_
232
233 #define CPP_THROW_NEW throw()
234 #define CROSS_COMPILE 1
235 #define D_INO d_ino
236 #define EDITLINE 1
237 #define HAVE_ARM_NEON 1
238 #define HAVE_ARM_SIMD 1
239 #define HAVE_CPP_AMBIGUITY_RESOLVING_USING 1
240 #define HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR 1
241 #define HAVE_CPP_PARTIAL_SPECIALIZATION 1
242 #define HAVE_DIRENT_H 1
243 #define HAVE_DLADDR 1
244 #define HAVE_DLOPEN 1
245 #define HAVE_ENDIAN_H 1
246 #define HAVE_FCHMOD 1
247 #define HAVE_FLOCKFILE 1
248 #define HAVE_GETC_UNLOCKED 1
249 #define HAVE_GETOPT_H 1
250 #define HAVE_GETPAGESIZE 1
251 #define HAVE_GNU_GET_LIBC_VERSION 1
252 #define HAVE_GNU_LIBC_VERSION_H 1
253 #define HAVE_I18N_LC_MESSAGES 1
254 #define HAVE_ICONV 1
255 #define HAVE_LCHOWN 1
256 #define HAVE_LINUX_QUOTA_H 1
257 #define HAVE_LOCALECONV 1
258 #define HAVE_LOCALECONV 1
259 #define HAVE_LOCALTIME_R 1
260 #define HAVE_LSTAT64 1
261 #define HAVE_MALLOC_H 1
262 #define HAVE_MBRTOWC 1
263 #define HAVE_MEMALIGN 1
264 #define HAVE_MEMMOVE 1
265 #define HAVE_MEMORY_H 1
266 #define HAVE_MMINTRIN_H 1
267 #define HAVE_NL_TYPES_H 1
268 #define HAVE_POSIX_FALLOCATE 1
269 #define HAVE_POSIX_MEMALIGN 1
270 #define HAVE_RANDOM 1
271 #define HAVE_RES_NINIT 1
272 #define HAVE_SBRK 1
273 #define HAVE_SETLOCALE 1
274 #define HAVE_SIGINFO_T 1
275 #define HAVE_SNPRINTF 1
276 #define HAVE_SSIZE_T 1
277 #define HAVE_STAT64 1
278 #define HAVE_STATVFS 1
279 #define HAVE_STATVFS64 1
280 #define HAVE_STRERROR 1
281 #define HAVE_STRNDUP 1
282 #define HAVE_STRTOK_R 1
283 #define HAVE_ST_BLKSIZE 1
284 #define HAVE_SYS_BITYPES_H 1
285 #define HAVE_SYS_CDEFS_H 1
286 #define HAVE_SYS_MOUNT_H 1
287 #define HAVE_SYS_QUOTA_H 1
288 #define HAVE_SYS_STATFS_H 1
289 #define HAVE_SYS_STATVFS_H 1
290 #define HAVE_SYS_VFS_H 1
291 #define HAVE_THREAD_TLS_KEYWORD 1
292 #define HAVE_TM_ZONE_TM_GMTOFF 1
293 #define HAVE_TRUNCATE64 1
294 #define HAVE_UINT 1
295 #define HAVE_UNAME_DOMAINNAME_FIELD 1
296 #define HAVE_UNISTD_H 1
297 #define HAVE_VALLOC 1
298 #define HAVE_VA_COPY 1
299 #define HAVE_VISIBILITY_ATTRIBUTE 1
300 #define HAVE_VISIBILITY_HIDDEN_ATTRIBUTE 1
301 #define HAVE_WCRTOMB 1
302 #define HAVE_X11_XKBLIB_H 1
303 #define HAVE__UNWIND_BACKTRACE 1
304 #define HAVE___CXA_DEMANGLE 1
305 #define JSGC_INCREMENTAL 1
306 #define JS_ALIGN_OF_POINTER 4
307 #define JS_BITS_PER_WORD_LOG2 5
308 #define JS_BYTES_PER_DOUBLE 8
309 #define JS_BYTES_PER_WORD 4
310 #define JS_CPU_ARM 1
311 #define JS_DEFAULT_JITREPORT_GRANULARITY 3
312 #define JS_HAS_CTYPES 1
313 #define JS_HAS_XML_SUPPORT 1
314 #define JS_HAVE_ENDIAN_H 1
315 #define JS_METHODJIT 1
316 #define JS_MONOIC 1
317 #define JS_NUNBOX32 1
318 #define JS_POLYIC 1
319 #define JS_THREADSAFE 1
320 #define MALLOC_H <malloc.h>
321 #define MOZ_DEBUG_SYMBOLS 1
322 #define MOZ_DLL_SUFFIX ".so"
323 #define MOZ_MEMORY 1
324 #define MOZ_MEMORY_LINUX 1
325 #define MOZ_MEMORY_SIZEOF_PTR_2POW 2
326 #define NEED_CPP_UNUSED_IMPLEMENTATIONS 1
327 #define NEW_H <new>
328 #define NS_ALWAYS_INLINE __attribute__((always_inline))
329 #define NS_ATTR_MALLOC __attribute__((malloc))
330 #define NS_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
331 #define SIZEOF_INT_P 4
332 #define STATIC_EXPORTABLE_JS_API 1
333 #define STDC_HEADERS 1
334 #define UNIX_ASYNC_DNS 1
335 #define VA_COPY va_copy
336 #define XP_UNIX 1
337 #define _REENTRANT 1
338
339
340
341
342 #define __STDC_LIMIT_MACROS
343 # 1 "<Kommandozeile>" 2
344 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl.cpp"
345
346
347
348
349
350
351
352 # 1 "./../../dist/include/mozilla/Assertions.h" 1
353 # 11 "./../../dist/include/mozilla/Assertions.h"
354 #define mozilla_Assertions_h_
355
356 # 1 "./../../dist/include/mozilla/Attributes.h" 1
357 # 11 "./../../dist/include/mozilla/Attributes.h"
358 #define mozilla_Attributes_h_
359 # 25 "./../../dist/include/mozilla/Attributes.h"
360 #define MOZ_INLINE inline
361 # 46 "./../../dist/include/mozilla/Attributes.h"
362 #define MOZ_ALWAYS_INLINE __attribute__((always_inline)) MOZ_INLINE
363 # 106 "./../../dist/include/mozilla/Attributes.h"
364 #define MOZ_HAVE_NEVER_INLINE __attribute__((noinline))
365 #define MOZ_HAVE_NORETURN __attribute__((noreturn))
366 # 125 "./../../dist/include/mozilla/Attributes.h"
367 #define MOZ_NEVER_INLINE MOZ_HAVE_NEVER_INLINE
368 # 145 "./../../dist/include/mozilla/Attributes.h"
369 #define MOZ_NORETURN MOZ_HAVE_NORETURN
370 # 159 "./../../dist/include/mozilla/Attributes.h"
371 #define MOZ_ASAN_BLACKLIST
372 # 190 "./../../dist/include/mozilla/Attributes.h"
373 #define MOZ_DELETE
374 # 231 "./../../dist/include/mozilla/Attributes.h"
375 #define MOZ_OVERRIDE
376 # 300 "./../../dist/include/mozilla/Attributes.h"
377 #define MOZ_FINAL
378 # 317 "./../../dist/include/mozilla/Attributes.h"
379 #define MOZ_WARN_UNUSED_RESULT __attribute__ ((warn_unused_result))
380 # 14 "./../../dist/include/mozilla/Assertions.h" 2
381 # 1 "./../../dist/include/mozilla/Types.h" 1
382 # 11 "./../../dist/include/mozilla/Types.h"
383 #define mozilla_Types_h_
384 # 24 "./../../dist/include/mozilla/Types.h"
385 # 1 "./../../dist/include/mozilla/StandardInteger.h" 1
386 # 11 "./../../dist/include/mozilla/StandardInteger.h"
387 #define mozilla_StandardInteger_h_
388 # 42 "./../../dist/include/mozilla/StandardInteger.h"
389 # 1 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stdint.h" 1 3 4
390
391
392 # 1 "/usr/include/stdint.h" 1 3 4
393 # 24 "/usr/include/stdint.h" 3 4
394 #define _STDINT_H 1
395
396 # 1 "/usr/include/features.h" 1 3 4
397 # 21 "/usr/include/features.h" 3 4
398 #define _FEATURES_H 1
399 # 98 "/usr/include/features.h" 3 4
400 #undef __USE_ISOC99
401 #undef __USE_ISOC95
402 #undef __USE_POSIX
403 #undef __USE_POSIX2
404 #undef __USE_POSIX199309
405 #undef __USE_POSIX199506
406 #undef __USE_XOPEN
407 #undef __USE_XOPEN_EXTENDED
408 #undef __USE_UNIX98
409 #undef __USE_XOPEN2K
410 #undef __USE_XOPEN2KXSI
411 #undef __USE_XOPEN2K8
412 #undef __USE_XOPEN2K8XSI
413 #undef __USE_LARGEFILE
414 #undef __USE_LARGEFILE64
415 #undef __USE_FILE_OFFSET64
416 #undef __USE_BSD
417 #undef __USE_SVID
418 #undef __USE_MISC
419 #undef __USE_ATFILE
420 #undef __USE_GNU
421 #undef __USE_REENTRANT
422 #undef __USE_FORTIFY_LEVEL
423 #undef __FAVOR_BSD
424 #undef __KERNEL_STRICT_NAMES
425
426
427
428
429 #define __KERNEL_STRICT_NAMES
430
431
432
433 #define __USE_ANSI 1
434 # 141 "/usr/include/features.h" 3 4
435 #define __GNUC_PREREQ(maj,min) ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
436 # 157 "/usr/include/features.h" 3 4
437 #undef _ISOC95_SOURCE
438 #define _ISOC95_SOURCE 1
439 #undef _ISOC99_SOURCE
440 #define _ISOC99_SOURCE 1
441 #undef _POSIX_SOURCE
442 #define _POSIX_SOURCE 1
443 #undef _POSIX_C_SOURCE
444 #define _POSIX_C_SOURCE 200809L
445 #undef _XOPEN_SOURCE
446 #define _XOPEN_SOURCE 700
447 #undef _XOPEN_SOURCE_EXTENDED
448 #define _XOPEN_SOURCE_EXTENDED 1
449 #undef _LARGEFILE64_SOURCE
450 #define _LARGEFILE64_SOURCE 1
451 #undef _BSD_SOURCE
452 #define _BSD_SOURCE 1
453 #undef _SVID_SOURCE
454 #define _SVID_SOURCE 1
455 #undef _ATFILE_SOURCE
456 #define _ATFILE_SOURCE 1
457 # 194 "/usr/include/features.h" 3 4
458 #define __USE_ISOC99 1
459
460
461
462
463
464 #define __USE_ISOC95 1
465 # 221 "/usr/include/features.h" 3 4
466 #define __USE_POSIX 1
467
468
469
470 #define __USE_POSIX2 1
471
472
473
474 #define __USE_POSIX199309 1
475
476
477
478 #define __USE_POSIX199506 1
479
480
481
482 #define __USE_XOPEN2K 1
483 #undef __USE_ISOC95
484 #define __USE_ISOC95 1
485 #undef __USE_ISOC99
486 #define __USE_ISOC99 1
487
488
489
490 #define __USE_XOPEN2K8 1
491 #undef _ATFILE_SOURCE
492 #define _ATFILE_SOURCE 1
493
494
495
496 #define __USE_XOPEN 1
497
498 #define __USE_XOPEN_EXTENDED 1
499 #define __USE_UNIX98 1
500 #undef _LARGEFILE_SOURCE
501 #define _LARGEFILE_SOURCE 1
502
503
504 #define __USE_XOPEN2K8 1
505 #define __USE_XOPEN2K8XSI 1
506
507 #define __USE_XOPEN2K 1
508 #define __USE_XOPEN2KXSI 1
509 #undef __USE_ISOC95
510 #define __USE_ISOC95 1
511 #undef __USE_ISOC99
512 #define __USE_ISOC99 1
513 # 277 "/usr/include/features.h" 3 4
514 #define __USE_LARGEFILE 1
515
516
517
518 #define __USE_LARGEFILE64 1
519
520
521
522
523
524
525
526 #define __USE_MISC 1
527
528
529
530 #define __USE_BSD 1
531
532
533
534 #define __USE_SVID 1
535
536
537
538 #define __USE_ATFILE 1
539
540
541
542 #define __USE_GNU 1
543
544
545
546 #define __USE_REENTRANT 1
547
548
549
550
551
552 #define __USE_FORTIFY_LEVEL 2
553 # 324 "/usr/include/features.h" 3 4
554 #define __STDC_IEC_559__ 1
555 #define __STDC_IEC_559_COMPLEX__ 1
556
557
558 #define __STDC_ISO_10646__ 200009L
559
560
561
562
563
564
565
566 #undef __GNU_LIBRARY__
567 #define __GNU_LIBRARY__ 6
568
569
570
571 #define __GLIBC__ 2
572 #define __GLIBC_MINOR__ 15
573
574 #define __GLIBC_PREREQ(maj,min) ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min))
575
576
577
578
579
580
581
582 #define __GLIBC_HAVE_LONG_LONG 1
583
584
585
586
587
588 # 1 "/usr/include/sys/cdefs.h" 1 3 4
589 # 21 "/usr/include/sys/cdefs.h" 3 4
590 #define _SYS_CDEFS_H 1
591 # 36 "/usr/include/sys/cdefs.h" 3 4
592 #undef __P
593 #undef __PMT
594 # 47 "/usr/include/sys/cdefs.h" 3 4
595 #define __LEAF
596 #define __LEAF_ATTR
597 # 62 "/usr/include/sys/cdefs.h" 3 4
598 #define __THROW throw ()
599 #define __THROWNL throw ()
600 #define __NTH(fct) __LEAF_ATTR fct throw ()
601 # 88 "/usr/include/sys/cdefs.h" 3 4
602 #define __P(args) args
603 #define __PMT(args) args
604
605
606
607
608 #define __CONCAT(x,y) x ## y
609 #define __STRING(x) #x
610
611
612 #define __ptr_t void *
613 #define __long_double_t long double
614
615
616
617
618 #define __BEGIN_DECLS extern "C" {
619 #define __END_DECLS }
620 # 128 "/usr/include/sys/cdefs.h" 3 4
621 #define __BEGIN_NAMESPACE_STD
622 #define __END_NAMESPACE_STD
623 #define __USING_NAMESPACE_STD(name)
624 #define __BEGIN_NAMESPACE_C99
625 #define __END_NAMESPACE_C99
626 #define __USING_NAMESPACE_C99(name)
627
628
629
630
631
632 #define __bounded
633 #define __unbounded
634 #define __ptrvalue
635
636
637
638
639 #define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1)
640 #define __bos0(ptr) __builtin_object_size (ptr, 0)
641
642
643 #define __warndecl(name,msg) extern void name (void) __attribute__((__warning__ (msg)))
644
645 #define __warnattr(msg) __attribute__((__warning__ (msg)))
646 #define __errordecl(name,msg) extern void name (void) __attribute__((__error__ (msg)))
647 # 164 "/usr/include/sys/cdefs.h" 3 4
648 #define __flexarr []
649 # 191 "/usr/include/sys/cdefs.h" 3 4
650 #define __REDIRECT(name,proto,alias) name proto __asm__ (__ASMNAME (#alias))
651
652 #define __REDIRECT_NTH(name,proto,alias) name proto __THROW __asm__ (__ASMNAME (#alias))
653
654 #define __REDIRECT_NTHNL(name,proto,alias) name proto __THROWNL __asm__ (__ASMNAME (#alias))
655
656
657
658
659
660
661
662 #define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname)
663 #define __ASMNAME2(prefix,cname) __STRING (prefix) cname
664 # 225 "/usr/include/sys/cdefs.h" 3 4
665 #define __attribute_malloc__ __attribute__ ((__malloc__))
666 # 234 "/usr/include/sys/cdefs.h" 3 4
667 #define __attribute_pure__ __attribute__ ((__pure__))
668
669
670
671
672
673
674 #define __attribute_const__ __attribute__ ((__const__))
675 # 250 "/usr/include/sys/cdefs.h" 3 4
676 #define __attribute_used__ __attribute__ ((__used__))
677 #define __attribute_noinline__ __attribute__ ((__noinline__))
678
679
680
681
682
683
684
685 #define __attribute_deprecated__ __attribute__ ((__deprecated__))
686 # 271 "/usr/include/sys/cdefs.h" 3 4
687 #define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x)))
688 # 281 "/usr/include/sys/cdefs.h" 3 4
689 #define __attribute_format_strfmon__(a,b) __attribute__ ((__format__ (__strfmon__, a, b)))
690 # 290 "/usr/include/sys/cdefs.h" 3 4
691 #define __nonnull(params) __attribute__ ((__nonnull__ params))
692
693
694
695
696
697
698
699 #define __attribute_warn_unused_result__ __attribute__ ((__warn_unused_result__))
700
701
702 #define __wur __attribute_warn_unused_result__
703 # 312 "/usr/include/sys/cdefs.h" 3 4
704 #define __always_inline __inline __attribute__ ((__always_inline__))
705 # 321 "/usr/include/sys/cdefs.h" 3 4
706 #define __extern_inline extern __inline __attribute__ ((__gnu_inline__))
707
708 #define __extern_always_inline extern __always_inline __attribute__ ((__gnu_inline__, __artificial__))
709 # 343 "/usr/include/sys/cdefs.h" 3 4
710 #define __va_arg_pack() __builtin_va_arg_pack ()
711 #define __va_arg_pack_len() __builtin_va_arg_pack_len ()
712 # 367 "/usr/include/sys/cdefs.h" 3 4
713 #define __restrict_arr
714 # 378 "/usr/include/sys/cdefs.h" 3 4
715 # 1 "/usr/include/bits/wordsize.h" 1 3 4
716 # 19 "/usr/include/bits/wordsize.h" 3 4
717 #define __WORDSIZE 32
718 # 379 "/usr/include/sys/cdefs.h" 2 3 4
719 # 400 "/usr/include/sys/cdefs.h" 3 4
720 #define __LDBL_REDIR1(name,proto,alias) name proto
721 #define __LDBL_REDIR(name,proto) name proto
722 #define __LDBL_REDIR1_NTH(name,proto,alias) name proto __THROW
723 #define __LDBL_REDIR_NTH(name,proto) name proto __THROW
724 #define __LDBL_REDIR_DECL(name)
725
726 #define __REDIRECT_LDBL(name,proto,alias) __REDIRECT (name, proto, alias)
727 #define __REDIRECT_NTH_LDBL(name,proto,alias) __REDIRECT_NTH (name, proto, alias)
728 # 359 "/usr/include/features.h" 2 3 4
729 # 374 "/usr/include/features.h" 3 4
730 #define __USE_EXTERN_INLINES 1
731
732
733
734
735
736
737
738 # 1 "/usr/include/gnu/stubs.h" 1 3 4
739 # 10 "/usr/include/gnu/stubs.h" 3 4
740 #define __stub_chflags
741 #define __stub_create_module
742 #define __stub_fattach
743 #define __stub_fchflags
744 #define __stub_fdetach
745 #define __stub_get_kernel_syms
746 #define __stub_getcontext
747 #define __stub_getmsg
748 #define __stub_getpmsg
749 #define __stub_gtty
750 #define __stub_lchmod
751 #define __stub_makecontext
752 #define __stub_putmsg
753 #define __stub_putpmsg
754 #define __stub_query_module
755 #define __stub_revoke
756 #define __stub_setcontext
757 #define __stub_setlogin
758 #define __stub_sigreturn
759 #define __stub_sstk
760 #define __stub_stty
761 #define __stub_swapcontext
762 # 383 "/usr/include/features.h" 2 3 4
763 # 27 "/usr/include/stdint.h" 2 3 4
764 # 1 "/usr/include/bits/wchar.h" 1 3 4
765 # 21 "/usr/include/bits/wchar.h" 3 4
766 #define _BITS_WCHAR_H 1
767
768 #define __WCHAR_MIN (-2147483647 - 1)
769 #define __WCHAR_MAX (2147483647)
770 # 28 "/usr/include/stdint.h" 2 3 4
771 # 1 "/usr/include/bits/wordsize.h" 1 3 4
772 # 19 "/usr/include/bits/wordsize.h" 3 4
773 #define __WORDSIZE 32
774 # 29 "/usr/include/stdint.h" 2 3 4
775
776
777
778
779
780
781
782 #define __int8_t_defined
783 typedef signed char int8_t;
784 typedef short int int16_t;
785 typedef int int32_t;
786
787
788
789 __extension__
790 typedef long long int int64_t;
791
792
793
794
795 typedef unsigned char uint8_t;
796 typedef unsigned short int uint16_t;
797
798 typedef unsigned int uint32_t;
799 #define __uint32_t_defined
800
801
802
803
804 __extension__
805 typedef unsigned long long int uint64_t;
806
807
808
809
810
811
812 typedef signed char int_least8_t;
813 typedef short int int_least16_t;
814 typedef int int_least32_t;
815
816
817
818 __extension__
819 typedef long long int int_least64_t;
820
821
822
823 typedef unsigned char uint_least8_t;
824 typedef unsigned short int uint_least16_t;
825 typedef unsigned int uint_least32_t;
826
827
828
829 __extension__
830 typedef unsigned long long int uint_least64_t;
831
832
833
834
835
836
837 typedef signed char int_fast8_t;
838
839
840
841
842
843 typedef int int_fast16_t;
844 typedef int int_fast32_t;
845 __extension__
846 typedef long long int int_fast64_t;
847
848
849
850 typedef unsigned char uint_fast8_t;
851
852
853
854
855
856 typedef unsigned int uint_fast16_t;
857 typedef unsigned int uint_fast32_t;
858 __extension__
859 typedef unsigned long long int uint_fast64_t;
860 # 126 "/usr/include/stdint.h" 3 4
861 typedef int intptr_t;
862 #define __intptr_t_defined
863
864 typedef unsigned int uintptr_t;
865 # 138 "/usr/include/stdint.h" 3 4
866 __extension__
867 typedef long long int intmax_t;
868 __extension__
869 typedef unsigned long long int uintmax_t;
870 # 153 "/usr/include/stdint.h" 3 4
871 #define __INT64_C(c) c ## LL
872 #define __UINT64_C(c) c ## ULL
873
874
875
876
877
878 #define INT8_MIN (-128)
879 #define INT16_MIN (-32767-1)
880 #define INT32_MIN (-2147483647-1)
881 #define INT64_MIN (-__INT64_C(9223372036854775807)-1)
882
883 #define INT8_MAX (127)
884 #define INT16_MAX (32767)
885 #define INT32_MAX (2147483647)
886 #define INT64_MAX (__INT64_C(9223372036854775807))
887
888
889 #define UINT8_MAX (255)
890 #define UINT16_MAX (65535)
891 #define UINT32_MAX (4294967295U)
892 #define UINT64_MAX (__UINT64_C(18446744073709551615))
893
894
895
896 #define INT_LEAST8_MIN (-128)
897 #define INT_LEAST16_MIN (-32767-1)
898 #define INT_LEAST32_MIN (-2147483647-1)
899 #define INT_LEAST64_MIN (-__INT64_C(9223372036854775807)-1)
900
901 #define INT_LEAST8_MAX (127)
902 #define INT_LEAST16_MAX (32767)
903 #define INT_LEAST32_MAX (2147483647)
904 #define INT_LEAST64_MAX (__INT64_C(9223372036854775807))
905
906
907 #define UINT_LEAST8_MAX (255)
908 #define UINT_LEAST16_MAX (65535)
909 #define UINT_LEAST32_MAX (4294967295U)
910 #define UINT_LEAST64_MAX (__UINT64_C(18446744073709551615))
911
912
913
914 #define INT_FAST8_MIN (-128)
915
916
917
918
919 #define INT_FAST16_MIN (-2147483647-1)
920 #define INT_FAST32_MIN (-2147483647-1)
921
922 #define INT_FAST64_MIN (-__INT64_C(9223372036854775807)-1)
923
924 #define INT_FAST8_MAX (127)
925
926
927
928
929 #define INT_FAST16_MAX (2147483647)
930 #define INT_FAST32_MAX (2147483647)
931
932 #define INT_FAST64_MAX (__INT64_C(9223372036854775807))
933
934
935 #define UINT_FAST8_MAX (255)
936
937
938
939
940 #define UINT_FAST16_MAX (4294967295U)
941 #define UINT_FAST32_MAX (4294967295U)
942
943 #define UINT_FAST64_MAX (__UINT64_C(18446744073709551615))
944 # 234 "/usr/include/stdint.h" 3 4
945 #define INTPTR_MIN (-2147483647-1)
946 #define INTPTR_MAX (2147483647)
947 #define UINTPTR_MAX (4294967295U)
948
949
950
951
952 #define INTMAX_MIN (-__INT64_C(9223372036854775807)-1)
953
954 #define INTMAX_MAX (__INT64_C(9223372036854775807))
955
956
957 #define UINTMAX_MAX (__UINT64_C(18446744073709551615))
958 # 256 "/usr/include/stdint.h" 3 4
959 #define PTRDIFF_MIN (-2147483647-1)
960 #define PTRDIFF_MAX (2147483647)
961
962
963
964 #define SIG_ATOMIC_MIN (-2147483647-1)
965 #define SIG_ATOMIC_MAX (2147483647)
966
967
968
969
970
971 #define SIZE_MAX (4294967295U)
972
973
974
975
976
977 #define WCHAR_MIN __WCHAR_MIN
978 #define WCHAR_MAX __WCHAR_MAX
979
980
981
982 #define WINT_MIN (0u)
983 #define WINT_MAX (4294967295u)
984 # 4 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stdint.h" 2 3 4
985
986
987
988 #define _GCC_WRAP_STDINT_H
989 # 43 "./../../dist/include/mozilla/StandardInteger.h" 2
990 # 25 "./../../dist/include/mozilla/Types.h" 2
991
992
993 # 1 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 1 3 4
994 # 40 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
995 #define _STDDEF_H
996 #define _STDDEF_H_
997
998 #define _ANSI_STDDEF_H
999
1000 #define __STDDEF_H__
1001 # 138 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
1002 #define _PTRDIFF_T
1003 #define _T_PTRDIFF_
1004 #define _T_PTRDIFF
1005 #define __PTRDIFF_T
1006 #define _PTRDIFF_T_
1007 #define _BSD_PTRDIFF_T_
1008 #define ___int_ptrdiff_t_h
1009 #define _GCC_PTRDIFF_T
1010
1011
1012
1013 typedef int ptrdiff_t;
1014 # 160 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
1015 #undef __need_ptrdiff_t
1016 # 186 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
1017 #define __size_t__
1018 #define __SIZE_T__
1019 #define _SIZE_T
1020 #define _SYS_SIZE_T_H
1021 #define _T_SIZE_
1022 #define _T_SIZE
1023 #define __SIZE_T
1024 #define _SIZE_T_
1025 #define _BSD_SIZE_T_
1026 #define _SIZE_T_DEFINED_
1027 #define _SIZE_T_DEFINED
1028 #define _BSD_SIZE_T_DEFINED_
1029 #define _SIZE_T_DECLARED
1030 #define ___int_size_t_h
1031 #define _GCC_SIZE_T
1032 #define _SIZET_
1033
1034
1035
1036 #define __size_t
1037
1038
1039
1040
1041
1042 typedef unsigned int size_t;
1043 # 233 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
1044 #undef __need_size_t
1045 # 262 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
1046 #define __wchar_t__
1047 #define __WCHAR_T__
1048 #define _WCHAR_T
1049 #define _T_WCHAR_
1050 #define _T_WCHAR
1051 #define __WCHAR_T
1052 #define _WCHAR_T_
1053 #define _BSD_WCHAR_T_
1054 #define _WCHAR_T_DEFINED_
1055 #define _WCHAR_T_DEFINED
1056 #define _WCHAR_T_H
1057 #define ___int_wchar_t_h
1058 #define __INT_WCHAR_T_H
1059 #define _GCC_WCHAR_T
1060 #define _WCHAR_T_DECLARED
1061 # 289 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
1062 #undef _BSD_WCHAR_T_
1063 # 342 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
1064 #undef __need_wchar_t
1065 # 395 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
1066 #undef NULL
1067
1068 #define NULL __null
1069 # 406 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
1070 #undef __need_NULL
1071
1072
1073
1074
1075 #define offsetof(TYPE,MEMBER) __builtin_offsetof (TYPE, MEMBER)
1076 # 28 "./../../dist/include/mozilla/Types.h" 2
1077 # 54 "./../../dist/include/mozilla/Types.h"
1078 #define MOZ_EXTERNAL_VIS __attribute__((visibility("default")))
1079
1080
1081
1082
1083
1084 #define MOZ_EXPORT_API(type) MOZ_EXTERNAL_VIS type
1085 #define MOZ_EXPORT_DATA(type) MOZ_EXTERNAL_VIS type
1086 # 80 "./../../dist/include/mozilla/Types.h"
1087 #define MOZ_IMPORT_API(x) MOZ_EXPORT_API(x)
1088
1089
1090
1091
1092
1093
1094
1095 #define MOZ_IMPORT_DATA(x) MOZ_EXPORT_DATA(x)
1096 # 105 "./../../dist/include/mozilla/Types.h"
1097 #define MFBT_API(type) __attribute__((weak)) MOZ_IMPORT_API(type)
1098 #define MFBT_DATA(type) __attribute__((weak)) MOZ_IMPORT_DATA(type)
1099 # 131 "./../../dist/include/mozilla/Types.h"
1100 #define MOZ_BEGIN_EXTERN_C extern "C" {
1101 #define MOZ_END_EXTERN_C }
1102 # 15 "./../../dist/include/mozilla/Assertions.h" 2
1103
1104 # 1 "/usr/include/stdio.h" 1 3 4
1105 # 27 "/usr/include/stdio.h" 3 4
1106 #define _STDIO_H 1
1107
1108
1109 extern "C" {
1110
1111 #define __need_size_t
1112 #define __need_NULL
1113 # 1 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 1 3 4
1114 # 160 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
1115 #undef __need_ptrdiff_t
1116 # 233 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
1117 #undef __need_size_t
1118 # 342 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
1119 #undef __need_wchar_t
1120 # 395 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
1121 #undef NULL
1122
1123 #define NULL __null
1124 # 406 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
1125 #undef __need_NULL
1126
1127
1128
1129
1130 #define offsetof(TYPE,MEMBER) __builtin_offsetof (TYPE, MEMBER)
1131 # 35 "/usr/include/stdio.h" 2 3 4
1132
1133 # 1 "/usr/include/bits/types.h" 1 3 4
1134 # 25 "/usr/include/bits/types.h" 3 4
1135 #define _BITS_TYPES_H 1
1136
1137
1138 # 1 "/usr/include/bits/wordsize.h" 1 3 4
1139 # 19 "/usr/include/bits/wordsize.h" 3 4
1140 #define __WORDSIZE 32
1141 # 29 "/usr/include/bits/types.h" 2 3 4
1142
1143
1144 typedef unsigned char __u_char;
1145 typedef unsigned short int __u_short;
1146 typedef unsigned int __u_int;
1147 typedef unsigned long int __u_long;
1148
1149
1150 typedef signed char __int8_t;
1151 typedef unsigned char __uint8_t;
1152 typedef signed short int __int16_t;
1153 typedef unsigned short int __uint16_t;
1154 typedef signed int __int32_t;
1155 typedef unsigned int __uint32_t;
1156
1157
1158
1159
1160 __extension__ typedef signed long long int __int64_t;
1161 __extension__ typedef unsigned long long int __uint64_t;
1162
1163
1164
1165
1166
1167
1168
1169 __extension__ typedef long long int __quad_t;
1170 __extension__ typedef unsigned long long int __u_quad_t;
1171 # 99 "/usr/include/bits/types.h" 3 4
1172 #define __S16_TYPE short int
1173 #define __U16_TYPE unsigned short int
1174 #define __S32_TYPE int
1175 #define __U32_TYPE unsigned int
1176 #define __SLONGWORD_TYPE long int
1177 #define __ULONGWORD_TYPE unsigned long int
1178
1179 #define __SQUAD_TYPE __quad_t
1180 #define __UQUAD_TYPE __u_quad_t
1181 #define __SWORD_TYPE int
1182 #define __UWORD_TYPE unsigned int
1183 #define __SLONG32_TYPE long int
1184 #define __ULONG32_TYPE unsigned long int
1185 #define __S64_TYPE __quad_t
1186 #define __U64_TYPE __u_quad_t
1187
1188
1189 #define __STD_TYPE __extension__ typedef
1190 # 131 "/usr/include/bits/types.h" 3 4
1191 # 1 "/usr/include/bits/typesizes.h" 1 3 4
1192 # 25 "/usr/include/bits/typesizes.h" 3 4
1193 #define _BITS_TYPESIZES_H 1
1194
1195
1196
1197
1198 #define __DEV_T_TYPE __UQUAD_TYPE
1199 #define __UID_T_TYPE __U32_TYPE
1200 #define __GID_T_TYPE __U32_TYPE
1201 #define __INO_T_TYPE __ULONGWORD_TYPE
1202 #define __INO64_T_TYPE __UQUAD_TYPE
1203 #define __MODE_T_TYPE __U32_TYPE
1204 #define __NLINK_T_TYPE __UWORD_TYPE
1205 #define __OFF_T_TYPE __SLONGWORD_TYPE
1206 #define __OFF64_T_TYPE __SQUAD_TYPE
1207 #define __PID_T_TYPE __S32_TYPE
1208 #define __RLIM_T_TYPE __ULONGWORD_TYPE
1209 #define __RLIM64_T_TYPE __UQUAD_TYPE
1210 #define __BLKCNT_T_TYPE __SLONGWORD_TYPE
1211 #define __BLKCNT64_T_TYPE __SQUAD_TYPE
1212 #define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE
1213 #define __FSBLKCNT64_T_TYPE __UQUAD_TYPE
1214 #define __FSFILCNT_T_TYPE __ULONGWORD_TYPE
1215 #define __FSFILCNT64_T_TYPE __UQUAD_TYPE
1216 #define __ID_T_TYPE __U32_TYPE
1217 #define __CLOCK_T_TYPE __SLONGWORD_TYPE
1218 #define __TIME_T_TYPE __SLONGWORD_TYPE
1219 #define __USECONDS_T_TYPE __U32_TYPE
1220 #define __SUSECONDS_T_TYPE __SLONGWORD_TYPE
1221 #define __DADDR_T_TYPE __S32_TYPE
1222 #define __SWBLK_T_TYPE __SLONGWORD_TYPE
1223 #define __KEY_T_TYPE __S32_TYPE
1224 #define __CLOCKID_T_TYPE __S32_TYPE
1225 #define __TIMER_T_TYPE void *
1226 #define __BLKSIZE_T_TYPE __SLONGWORD_TYPE
1227 #define __FSID_T_TYPE struct { int __val[2]; }
1228 #define __SSIZE_T_TYPE __SWORD_TYPE
1229
1230
1231 #define __FD_SETSIZE 1024
1232 # 132 "/usr/include/bits/types.h" 2 3 4
1233
1234
1235 __extension__ typedef __u_quad_t __dev_t;
1236 __extension__ typedef unsigned int __uid_t;
1237 __extension__ typedef unsigned int __gid_t;
1238 __extension__ typedef unsigned long int __ino_t;
1239 __extension__ typedef __u_quad_t __ino64_t;
1240 __extension__ typedef unsigned int __mode_t;
1241 __extension__ typedef unsigned int __nlink_t;
1242 __extension__ typedef long int __off_t;
1243 __extension__ typedef __quad_t __off64_t;
1244 __extension__ typedef int __pid_t;
1245 __extension__ typedef struct { int __val[2]; } __fsid_t;
1246 __extension__ typedef long int __clock_t;
1247 __extension__ typedef unsigned long int __rlim_t;
1248 __extension__ typedef __u_quad_t __rlim64_t;
1249 __extension__ typedef unsigned int __id_t;
1250 __extension__ typedef long int __time_t;
1251 __extension__ typedef unsigned int __useconds_t;
1252 __extension__ typedef long int __suseconds_t;
1253
1254 __extension__ typedef int __daddr_t;
1255 __extension__ typedef long int __swblk_t;
1256 __extension__ typedef int __key_t;
1257
1258
1259 __extension__ typedef int __clockid_t;
1260
1261
1262 __extension__ typedef void * __timer_t;
1263
1264
1265 __extension__ typedef long int __blksize_t;
1266
1267
1268
1269
1270 __extension__ typedef long int __blkcnt_t;
1271 __extension__ typedef __quad_t __blkcnt64_t;
1272
1273
1274 __extension__ typedef unsigned long int __fsblkcnt_t;
1275 __extension__ typedef __u_quad_t __fsblkcnt64_t;
1276
1277
1278 __extension__ typedef unsigned long int __fsfilcnt_t;
1279 __extension__ typedef __u_quad_t __fsfilcnt64_t;
1280
1281 __extension__ typedef int __ssize_t;
1282
1283
1284
1285 typedef __off64_t __loff_t;
1286 typedef __quad_t *__qaddr_t;
1287 typedef char *__caddr_t;
1288
1289
1290 __extension__ typedef int __intptr_t;
1291
1292
1293 __extension__ typedef unsigned int __socklen_t;
1294
1295
1296 #undef __STD_TYPE
1297 # 37 "/usr/include/stdio.h" 2 3 4
1298 #define __need_FILE
1299 #define __need___FILE
1300
1301
1302
1303
1304
1305
1306 struct _IO_FILE;
1307
1308
1309
1310 typedef struct _IO_FILE FILE;
1311
1312
1313
1314
1315
1316
1317
1318 #define __FILE_defined 1
1319
1320 #undef __need_FILE
1321
1322
1323
1324
1325
1326 typedef struct _IO_FILE __FILE;
1327
1328 #define ____FILE_defined 1
1329
1330 #undef __need___FILE
1331
1332
1333
1334 #define _STDIO_USES_IOSTREAM
1335
1336 # 1 "/usr/include/libio.h" 1 3 4
1337 # 30 "/usr/include/libio.h" 3 4
1338 #define _IO_STDIO_H
1339
1340 # 1 "/usr/include/_G_config.h" 1 3 4
1341
1342
1343
1344
1345 #define _G_config_h 1
1346
1347
1348
1349
1350 #define __need_size_t
1351
1352
1353
1354 #define __need_NULL
1355 # 1 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 1 3 4
1356 # 160 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
1357 #undef __need_ptrdiff_t
1358 # 233 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
1359 #undef __need_size_t
1360 # 342 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
1361 #undef __need_wchar_t
1362 # 395 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
1363 #undef NULL
1364
1365 #define NULL __null
1366 # 406 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
1367 #undef __need_NULL
1368
1369
1370
1371
1372 #define offsetof(TYPE,MEMBER) __builtin_offsetof (TYPE, MEMBER)
1373 # 16 "/usr/include/_G_config.h" 2 3 4
1374 #define __need_mbstate_t
1375
1376
1377
1378 # 1 "/usr/include/wchar.h" 1 3 4
1379 # 81 "/usr/include/wchar.h" 3 4
1380 #define __mbstate_t_defined 1
1381
1382 typedef struct
1383 {
1384 int __count;
1385 union
1386 {
1387
1388 unsigned int __wch;
1389
1390
1391
1392 char __wchb[4];
1393 } __value;
1394 } __mbstate_t;
1395
1396 #undef __need_mbstate_t
1397 # 896 "/usr/include/wchar.h" 3 4
1398 #undef __need_mbstate_t
1399 #undef __need_wint_t
1400 # 21 "/usr/include/_G_config.h" 2 3 4
1401 #define _G_size_t size_t
1402 typedef struct
1403 {
1404 __off_t __pos;
1405 __mbstate_t __state;
1406 } _G_fpos_t;
1407 typedef struct
1408 {
1409 __off64_t __pos;
1410 __mbstate_t __state;
1411 } _G_fpos64_t;
1412 #define _G_ssize_t __ssize_t
1413 #define _G_off_t __off_t
1414 #define _G_off64_t __off64_t
1415 #define _G_pid_t __pid_t
1416 #define _G_uid_t __uid_t
1417 #define _G_wchar_t wchar_t
1418 #define _G_wint_t wint_t
1419 #define _G_stat64 stat64
1420 # 53 "/usr/include/_G_config.h" 3 4
1421 typedef int _G_int16_t __attribute__ ((__mode__ (__HI__)));
1422 typedef int _G_int32_t __attribute__ ((__mode__ (__SI__)));
1423 typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__)));
1424 typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));
1425
1426 #define _G_HAVE_BOOL 1
1427
1428
1429
1430 #define _G_HAVE_ATEXIT 1
1431 #define _G_HAVE_SYS_CDEFS 1
1432 #define _G_HAVE_SYS_WAIT 1
1433 #define _G_NEED_STDARG_H 1
1434 #define _G_va_list __gnuc_va_list
1435
1436 #define _G_HAVE_PRINTF_FP 1
1437 #define _G_HAVE_MMAP 1
1438 #define _G_HAVE_MREMAP 1
1439 #define _G_HAVE_LONG_DOUBLE_IO 1
1440 #define _G_HAVE_IO_FILE_OPEN 1
1441 #define _G_HAVE_IO_GETLINE_INFO 1
1442
1443 #define _G_IO_IO_FILE_VERSION 0x20001
1444
1445 #define _G_OPEN64 __open64
1446 #define _G_LSEEK64 __lseek64
1447 #define _G_MMAP64 __mmap64
1448 #define _G_FSTAT64(fd,buf) __fxstat64 (_STAT_VER, fd, buf)
1449
1450
1451 #define _G_HAVE_ST_BLKSIZE defined (_STATBUF_ST_BLKSIZE)
1452
1453 #define _G_BUFSIZ 8192
1454
1455
1456 #define _G_NAMES_HAVE_UNDERSCORE 0
1457 #define _G_VTABLE_LABEL_HAS_LENGTH 1
1458 #define _G_USING_THUNKS 1
1459 #define _G_VTABLE_LABEL_PREFIX "__vt_"
1460 #define _G_VTABLE_LABEL_PREFIX_ID __vt_
1461
1462
1463
1464 #define _G_ARGS(ARGLIST) ARGLIST
1465 # 33 "/usr/include/libio.h" 2 3 4
1466
1467 #define _IO_pos_t _G_fpos_t
1468 #define _IO_fpos_t _G_fpos_t
1469 #define _IO_fpos64_t _G_fpos64_t
1470 #define _IO_size_t _G_size_t
1471 #define _IO_ssize_t _G_ssize_t
1472 #define _IO_off_t _G_off_t
1473 #define _IO_off64_t _G_off64_t
1474 #define _IO_pid_t _G_pid_t
1475 #define _IO_uid_t _G_uid_t
1476 #define _IO_iconv_t _G_iconv_t
1477 #define _IO_HAVE_SYS_WAIT _G_HAVE_SYS_WAIT
1478 #define _IO_HAVE_ST_BLKSIZE _G_HAVE_ST_BLKSIZE
1479 #define _IO_BUFSIZ _G_BUFSIZ
1480 #define _IO_va_list _G_va_list
1481 #define _IO_wint_t _G_wint_t
1482
1483
1484
1485 #define __need___va_list
1486 # 1 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stdarg.h" 1 3 4
1487 # 34 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stdarg.h" 3 4
1488 #undef __need___va_list
1489
1490
1491
1492
1493 #define __GNUC_VA_LIST
1494 typedef __builtin_va_list __gnuc_va_list;
1495 # 54 "/usr/include/libio.h" 2 3 4
1496
1497 #undef _IO_va_list
1498 #define _IO_va_list __gnuc_va_list
1499 # 76 "/usr/include/libio.h" 3 4
1500 #define _PARAMS(protos) __P(protos)
1501
1502
1503
1504
1505
1506
1507
1508 #define _IO_UNIFIED_JUMPTABLES 1
1509
1510
1511
1512
1513
1514 #define EOF (-1)
1515 # 105 "/usr/include/libio.h" 3 4
1516 #define _IOS_INPUT 1
1517 #define _IOS_OUTPUT 2
1518 #define _IOS_ATEND 4
1519 #define _IOS_APPEND 8
1520 #define _IOS_TRUNC 16
1521 #define _IOS_NOCREATE 32
1522 #define _IOS_NOREPLACE 64
1523 #define _IOS_BIN 128
1524
1525
1526
1527
1528
1529
1530
1531 #define _IO_MAGIC 0xFBAD0000
1532 #define _OLD_STDIO_MAGIC 0xFABC0000
1533 #define _IO_MAGIC_MASK 0xFFFF0000
1534 #define _IO_USER_BUF 1
1535 #define _IO_UNBUFFERED 2
1536 #define _IO_NO_READS 4
1537 #define _IO_NO_WRITES 8
1538 #define _IO_EOF_SEEN 0x10
1539 #define _IO_ERR_SEEN 0x20
1540 #define _IO_DELETE_DONT_CLOSE 0x40
1541 #define _IO_LINKED 0x80
1542 #define _IO_IN_BACKUP 0x100
1543 #define _IO_LINE_BUF 0x200
1544 #define _IO_TIED_PUT_GET 0x400
1545 #define _IO_CURRENTLY_PUTTING 0x800
1546 #define _IO_IS_APPENDING 0x1000
1547 #define _IO_IS_FILEBUF 0x2000
1548 #define _IO_BAD_SEEN 0x4000
1549 #define _IO_USER_LOCK 0x8000
1550
1551 #define _IO_FLAGS2_MMAP 1
1552 #define _IO_FLAGS2_NOTCANCEL 2
1553
1554
1555
1556 #define _IO_FLAGS2_USER_WBUF 8
1557
1558
1559
1560
1561
1562
1563
1564 #define _IO_SKIPWS 01
1565 #define _IO_LEFT 02
1566 #define _IO_RIGHT 04
1567 #define _IO_INTERNAL 010
1568 #define _IO_DEC 020
1569 #define _IO_OCT 040
1570 #define _IO_HEX 0100
1571 #define _IO_SHOWBASE 0200
1572 #define _IO_SHOWPOINT 0400
1573 #define _IO_UPPERCASE 01000
1574 #define _IO_SHOWPOS 02000
1575 #define _IO_SCIENTIFIC 04000
1576 #define _IO_FIXED 010000
1577 #define _IO_UNITBUF 020000
1578 #define _IO_STDIO 040000
1579 #define _IO_DONT_CLOSE 0100000
1580 #define _IO_BOOLALPHA 0200000
1581
1582
1583 struct _IO_jump_t; struct _IO_FILE;
1584 # 182 "/usr/include/libio.h" 3 4
1585 typedef void _IO_lock_t;
1586
1587
1588
1589
1590
1591 struct _IO_marker {
1592 struct _IO_marker *_next;
1593 struct _IO_FILE *_sbuf;
1594
1595
1596
1597 int _pos;
1598 # 205 "/usr/include/libio.h" 3 4
1599 };
1600
1601
1602 enum __codecvt_result
1603 {
1604 __codecvt_ok,
1605 __codecvt_partial,
1606 __codecvt_error,
1607 __codecvt_noconv
1608 };
1609 # 273 "/usr/include/libio.h" 3 4
1610 struct _IO_FILE {
1611 int _flags;
1612 #define _IO_file_flags _flags
1613
1614
1615
1616 char* _IO_read_ptr;
1617 char* _IO_read_end;
1618 char* _IO_read_base;
1619 char* _IO_write_base;
1620 char* _IO_write_ptr;
1621 char* _IO_write_end;
1622 char* _IO_buf_base;
1623 char* _IO_buf_end;
1624
1625 char *_IO_save_base;
1626 char *_IO_backup_base;
1627 char *_IO_save_end;
1628
1629 struct _IO_marker *_markers;
1630
1631 struct _IO_FILE *_chain;
1632
1633 int _fileno;
1634
1635
1636
1637 int _flags2;
1638
1639 __off_t _old_offset;
1640
1641 #define __HAVE_COLUMN
1642
1643 unsigned short _cur_column;
1644 signed char _vtable_offset;
1645 char _shortbuf[1];
1646
1647
1648
1649 _IO_lock_t *_lock;
1650 # 321 "/usr/include/libio.h" 3 4
1651 __off64_t _offset;
1652 # 330 "/usr/include/libio.h" 3 4
1653 void *__pad1;
1654 void *__pad2;
1655 void *__pad3;
1656 void *__pad4;
1657 size_t __pad5;
1658
1659 int _mode;
1660
1661 char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
1662
1663 };
1664
1665
1666
1667
1668
1669 struct _IO_FILE_plus;
1670
1671 extern struct _IO_FILE_plus _IO_2_1_stdin_;
1672 extern struct _IO_FILE_plus _IO_2_1_stdout_;
1673 extern struct _IO_FILE_plus _IO_2_1_stderr_;
1674
1675 #define _IO_stdin ((_IO_FILE*)(&_IO_2_1_stdin_))
1676 #define _IO_stdout ((_IO_FILE*)(&_IO_2_1_stdout_))
1677 #define _IO_stderr ((_IO_FILE*)(&_IO_2_1_stderr_))
1678 # 366 "/usr/include/libio.h" 3 4
1679 typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes);
1680
1681
1682
1683
1684
1685
1686
1687 typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf,
1688 size_t __n);
1689
1690
1691
1692
1693
1694
1695
1696 typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w);
1697
1698
1699 typedef int __io_close_fn (void *__cookie);
1700
1701
1702
1703
1704 typedef __io_read_fn cookie_read_function_t;
1705 typedef __io_write_fn cookie_write_function_t;
1706 typedef __io_seek_fn cookie_seek_function_t;
1707 typedef __io_close_fn cookie_close_function_t;
1708
1709
1710 typedef struct
1711 {
1712 __io_read_fn *read;
1713 __io_write_fn *write;
1714 __io_seek_fn *seek;
1715 __io_close_fn *close;
1716 } _IO_cookie_io_functions_t;
1717 typedef _IO_cookie_io_functions_t cookie_io_functions_t;
1718
1719 struct _IO_cookie_file;
1720
1721
1722 extern void _IO_cookie_init (struct _IO_cookie_file *__cfile, int __read_write,
1723 void *__cookie, _IO_cookie_io_functions_t __fns);
1724
1725
1726
1727
1728 extern "C" {
1729
1730
1731 extern int __underflow (_IO_FILE *);
1732 extern int __uflow (_IO_FILE *);
1733 extern int __overflow (_IO_FILE *, int);
1734
1735
1736
1737
1738
1739
1740
1741 #define _IO_BE(expr,res) __builtin_expect ((expr), res)
1742
1743
1744
1745
1746 #define _IO_getc_unlocked(_fp) (_IO_BE ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end, 0) ? __uflow (_fp) : *(unsigned char *) (_fp)->_IO_read_ptr++)
1747
1748
1749 #define _IO_peekc_unlocked(_fp) (_IO_BE ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end, 0) && __underflow (_fp) == EOF ? EOF : *(unsigned char *) (_fp)->_IO_read_ptr)
1750
1751
1752
1753 #define _IO_putc_unlocked(_ch,_fp) (_IO_BE ((_fp)->_IO_write_ptr >= (_fp)->_IO_write_end, 0) ? __overflow (_fp, (unsigned char) (_ch)) : (unsigned char) (*(_fp)->_IO_write_ptr++ = (_ch)))
1754 # 459 "/usr/include/libio.h" 3 4
1755 #define _IO_feof_unlocked(__fp) (((__fp)->_flags & _IO_EOF_SEEN) != 0)
1756 #define _IO_ferror_unlocked(__fp) (((__fp)->_flags & _IO_ERR_SEEN) != 0)
1757
1758 extern int _IO_getc (_IO_FILE *__fp);
1759 extern int _IO_putc (int __c, _IO_FILE *__fp);
1760 extern int _IO_feof (_IO_FILE *__fp) throw ();
1761 extern int _IO_ferror (_IO_FILE *__fp) throw ();
1762
1763 extern int _IO_peekc_locked (_IO_FILE *__fp);
1764
1765
1766 #define _IO_PENDING_OUTPUT_COUNT(_fp) ((_fp)->_IO_write_ptr - (_fp)->_IO_write_base)
1767
1768
1769 extern void _IO_flockfile (_IO_FILE *) throw ();
1770 extern void _IO_funlockfile (_IO_FILE *) throw ();
1771 extern int _IO_ftrylockfile (_IO_FILE *) throw ();
1772 # 484 "/usr/include/libio.h" 3 4
1773 #define _IO_peekc(_fp) _IO_peekc_unlocked (_fp)
1774 #define _IO_flockfile(_fp)
1775 #define _IO_funlockfile(_fp)
1776 #define _IO_ftrylockfile(_fp)
1777 #define _IO_cleanup_region_start(_fct,_fp)
1778 #define _IO_cleanup_region_end(_Doit)
1779
1780
1781 extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict,
1782 __gnuc_va_list, int *__restrict);
1783 extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict,
1784 __gnuc_va_list);
1785 extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t);
1786 extern size_t _IO_sgetn (_IO_FILE *, void *, size_t);
1787
1788 extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int);
1789 extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int);
1790
1791 extern void _IO_free_backup_area (_IO_FILE *) throw ();
1792 # 554 "/usr/include/libio.h" 3 4
1793 }
1794 # 76 "/usr/include/stdio.h" 2 3 4
1795
1796
1797
1798
1799 typedef __gnuc_va_list va_list;
1800 #define _VA_LIST_DEFINED
1801 # 91 "/usr/include/stdio.h" 3 4
1802 typedef __off_t off_t;
1803
1804
1805
1806 #define __off_t_defined
1807
1808
1809 typedef __off64_t off64_t;
1810 #define __off64_t_defined
1811
1812
1813
1814 typedef __ssize_t ssize_t;
1815 #define __ssize_t_defined
1816
1817
1818
1819
1820
1821
1822 typedef _G_fpos_t fpos_t;
1823
1824
1825
1826
1827
1828 typedef _G_fpos64_t fpos64_t;
1829
1830
1831
1832 #define _IOFBF 0
1833 #define _IOLBF 1
1834 #define _IONBF 2
1835
1836
1837
1838
1839 #define BUFSIZ _IO_BUFSIZ
1840 # 141 "/usr/include/stdio.h" 3 4
1841 #define SEEK_SET 0
1842 #define SEEK_CUR 1
1843 #define SEEK_END 2
1844
1845 #define SEEK_DATA 3
1846 #define SEEK_HOLE 4
1847
1848
1849
1850
1851
1852 #define P_tmpdir "/tmp"
1853 # 165 "/usr/include/stdio.h" 3 4
1854 # 1 "/usr/include/bits/stdio_lim.h" 1 3 4
1855 # 24 "/usr/include/bits/stdio_lim.h" 3 4
1856 #define L_tmpnam 20
1857 #define TMP_MAX 238328
1858 #define FILENAME_MAX 4096
1859
1860
1861 #define L_ctermid 9
1862
1863 #define L_cuserid 9
1864
1865
1866
1867
1868
1869 #undef FOPEN_MAX
1870 #define FOPEN_MAX 16
1871 # 166 "/usr/include/stdio.h" 2 3 4
1872
1873
1874
1875 extern struct _IO_FILE *stdin;
1876 extern struct _IO_FILE *stdout;
1877 extern struct _IO_FILE *stderr;
1878
1879 #define stdin stdin
1880 #define stdout stdout
1881 #define stderr stderr
1882
1883
1884
1885 extern int remove (__const char *__filename) throw ();
1886
1887 extern int rename (__const char *__old, __const char *__new) throw ();
1888
1889
1890
1891
1892 extern int renameat (int __oldfd, __const char *__old, int __newfd,
1893 __const char *__new) throw ();
1894
1895
1896
1897
1898
1899
1900
1901
1902 extern FILE *tmpfile (void) __attribute__ ((__warn_unused_result__));
1903 # 206 "/usr/include/stdio.h" 3 4
1904 extern FILE *tmpfile64 (void) __attribute__ ((__warn_unused_result__));
1905
1906
1907
1908 extern char *tmpnam (char *__s) throw () __attribute__ ((__warn_unused_result__));
1909
1910
1911
1912
1913
1914 extern char *tmpnam_r (char *__s) throw () __attribute__ ((__warn_unused_result__));
1915 # 228 "/usr/include/stdio.h" 3 4
1916 extern char *tempnam (__const char *__dir, __const char *__pfx)
1917 throw () __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__));
1918
1919
1920
1921
1922
1923
1924
1925
1926 extern int fclose (FILE *__stream);
1927
1928
1929
1930
1931 extern int fflush (FILE *__stream);
1932
1933 # 253 "/usr/include/stdio.h" 3 4
1934 extern int fflush_unlocked (FILE *__stream);
1935 # 263 "/usr/include/stdio.h" 3 4
1936 extern int fcloseall (void);
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946 extern FILE *fopen (__const char *__restrict __filename,
1947 __const char *__restrict __modes) __attribute__ ((__warn_unused_result__));
1948
1949
1950
1951
1952 extern FILE *freopen (__const char *__restrict __filename,
1953 __const char *__restrict __modes,
1954 FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
1955 # 296 "/usr/include/stdio.h" 3 4
1956
1957
1958 extern FILE *fopen64 (__const char *__restrict __filename,
1959 __const char *__restrict __modes) __attribute__ ((__warn_unused_result__));
1960 extern FILE *freopen64 (__const char *__restrict __filename,
1961 __const char *__restrict __modes,
1962 FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
1963
1964
1965
1966
1967 extern FILE *fdopen (int __fd, __const char *__modes) throw () __attribute__ ((__warn_unused_result__));
1968
1969
1970
1971
1972
1973 extern FILE *fopencookie (void *__restrict __magic_cookie,
1974 __const char *__restrict __modes,
1975 _IO_cookie_io_functions_t __io_funcs) throw () __attribute__ ((__warn_unused_result__));
1976
1977
1978
1979
1980 extern FILE *fmemopen (void *__s, size_t __len, __const char *__modes)
1981 throw () __attribute__ ((__warn_unused_result__));
1982
1983
1984
1985
1986 extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) throw () __attribute__ ((__warn_unused_result__));
1987
1988
1989
1990
1991
1992
1993 extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) throw ();
1994
1995
1996
1997 extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
1998 int __modes, size_t __n) throw ();
1999
2000
2001
2002
2003
2004 extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
2005 size_t __size) throw ();
2006
2007
2008 extern void setlinebuf (FILE *__stream) throw ();
2009
2010
2011
2012
2013
2014
2015
2016
2017 extern int fprintf (FILE *__restrict __stream,
2018 __const char *__restrict __format, ...);
2019
2020
2021
2022
2023 extern int printf (__const char *__restrict __format, ...);
2024
2025 extern int sprintf (char *__restrict __s,
2026 __const char *__restrict __format, ...) throw ();
2027
2028
2029
2030
2031
2032 extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format,
2033 __gnuc_va_list __arg);
2034
2035
2036
2037
2038 extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg);
2039
2040 extern int vsprintf (char *__restrict __s, __const char *__restrict __format,
2041 __gnuc_va_list __arg) throw ();
2042
2043
2044
2045
2046
2047 extern int snprintf (char *__restrict __s, size_t __maxlen,
2048 __const char *__restrict __format, ...)
2049 throw () __attribute__ ((__format__ (__printf__, 3, 4)));
2050
2051 extern int vsnprintf (char *__restrict __s, size_t __maxlen,
2052 __const char *__restrict __format, __gnuc_va_list __arg)
2053 throw () __attribute__ ((__format__ (__printf__, 3, 0)));
2054
2055
2056
2057
2058
2059
2060 extern int vasprintf (char **__restrict __ptr, __const char *__restrict __f,
2061 __gnuc_va_list __arg)
2062 throw () __attribute__ ((__format__ (__printf__, 2, 0))) __attribute__ ((__warn_unused_result__));
2063 extern int __asprintf (char **__restrict __ptr,
2064 __const char *__restrict __fmt, ...)
2065 throw () __attribute__ ((__format__ (__printf__, 2, 3))) __attribute__ ((__warn_unused_result__));
2066 extern int asprintf (char **__restrict __ptr,
2067 __const char *__restrict __fmt, ...)
2068 throw () __attribute__ ((__format__ (__printf__, 2, 3))) __attribute__ ((__warn_unused_result__));
2069 # 418 "/usr/include/stdio.h" 3 4
2070 extern int vdprintf (int __fd, __const char *__restrict __fmt,
2071 __gnuc_va_list __arg)
2072 __attribute__ ((__format__ (__printf__, 2, 0)));
2073 extern int dprintf (int __fd, __const char *__restrict __fmt, ...)
2074 __attribute__ ((__format__ (__printf__, 2, 3)));
2075
2076
2077
2078
2079
2080
2081
2082
2083 extern int fscanf (FILE *__restrict __stream,
2084 __const char *__restrict __format, ...) __attribute__ ((__warn_unused_result__));
2085
2086
2087
2088
2089 extern int scanf (__const char *__restrict __format, ...) __attribute__ ((__warn_unused_result__));
2090
2091 extern int sscanf (__const char *__restrict __s,
2092 __const char *__restrict __format, ...) throw ();
2093 # 469 "/usr/include/stdio.h" 3 4
2094
2095
2096
2097
2098
2099
2100
2101
2102 extern int vfscanf (FILE *__restrict __s, __const char *__restrict __format,
2103 __gnuc_va_list __arg)
2104 __attribute__ ((__format__ (__scanf__, 2, 0))) __attribute__ ((__warn_unused_result__));
2105
2106
2107
2108
2109
2110 extern int vscanf (__const char *__restrict __format, __gnuc_va_list __arg)
2111 __attribute__ ((__format__ (__scanf__, 1, 0))) __attribute__ ((__warn_unused_result__));
2112
2113
2114 extern int vsscanf (__const char *__restrict __s,
2115 __const char *__restrict __format, __gnuc_va_list __arg)
2116 throw () __attribute__ ((__format__ (__scanf__, 2, 0)));
2117 # 528 "/usr/include/stdio.h" 3 4
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127 extern int fgetc (FILE *__stream);
2128 extern int getc (FILE *__stream);
2129
2130
2131
2132
2133
2134 extern int getchar (void);
2135
2136
2137
2138
2139 #define getc(_fp) _IO_getc (_fp)
2140
2141
2142
2143
2144
2145
2146 extern int getc_unlocked (FILE *__stream);
2147 extern int getchar_unlocked (void);
2148 # 567 "/usr/include/stdio.h" 3 4
2149 extern int fgetc_unlocked (FILE *__stream);
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161 extern int fputc (int __c, FILE *__stream);
2162 extern int putc (int __c, FILE *__stream);
2163
2164
2165
2166
2167
2168 extern int putchar (int __c);
2169
2170
2171
2172
2173 #define putc(_ch,_fp) _IO_putc (_ch, _fp)
2174 # 600 "/usr/include/stdio.h" 3 4
2175 extern int fputc_unlocked (int __c, FILE *__stream);
2176
2177
2178
2179
2180
2181
2182
2183 extern int putc_unlocked (int __c, FILE *__stream);
2184 extern int putchar_unlocked (int __c);
2185
2186
2187
2188
2189
2190
2191 extern int getw (FILE *__stream);
2192
2193
2194 extern int putw (int __w, FILE *__stream);
2195
2196
2197
2198
2199
2200
2201
2202
2203 extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
2204 __attribute__ ((__warn_unused_result__));
2205
2206
2207
2208
2209
2210
2211 extern char *gets (char *__s) __attribute__ ((__warn_unused_result__));
2212
2213 # 646 "/usr/include/stdio.h" 3 4
2214 extern char *fgets_unlocked (char *__restrict __s, int __n,
2215 FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
2216 # 662 "/usr/include/stdio.h" 3 4
2217 extern __ssize_t __getdelim (char **__restrict __lineptr,
2218 size_t *__restrict __n, int __delimiter,
2219 FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
2220 extern __ssize_t getdelim (char **__restrict __lineptr,
2221 size_t *__restrict __n, int __delimiter,
2222 FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
2223
2224
2225
2226
2227
2228
2229
2230 extern __ssize_t getline (char **__restrict __lineptr,
2231 size_t *__restrict __n,
2232 FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
2233
2234
2235
2236
2237
2238
2239
2240
2241 extern int fputs (__const char *__restrict __s, FILE *__restrict __stream);
2242
2243
2244
2245
2246
2247 extern int puts (__const char *__s);
2248
2249
2250
2251
2252
2253
2254 extern int ungetc (int __c, FILE *__stream);
2255
2256
2257
2258
2259
2260
2261 extern size_t fread (void *__restrict __ptr, size_t __size,
2262 size_t __n, FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
2263
2264
2265
2266
2267 extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
2268 size_t __n, FILE *__restrict __s) __attribute__ ((__warn_unused_result__));
2269
2270 # 723 "/usr/include/stdio.h" 3 4
2271 extern int fputs_unlocked (__const char *__restrict __s,
2272 FILE *__restrict __stream);
2273 # 734 "/usr/include/stdio.h" 3 4
2274 extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
2275 size_t __n, FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
2276 extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size,
2277 size_t __n, FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
2278
2279
2280
2281
2282
2283
2284
2285
2286 extern int fseek (FILE *__stream, long int __off, int __whence);
2287
2288
2289
2290
2291 extern long int ftell (FILE *__stream) __attribute__ ((__warn_unused_result__));
2292
2293
2294
2295
2296 extern void rewind (FILE *__stream);
2297
2298 # 770 "/usr/include/stdio.h" 3 4
2299 extern int fseeko (FILE *__stream, __off_t __off, int __whence);
2300
2301
2302
2303
2304 extern __off_t ftello (FILE *__stream) __attribute__ ((__warn_unused_result__));
2305 # 789 "/usr/include/stdio.h" 3 4
2306
2307
2308
2309
2310
2311
2312 extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos);
2313
2314
2315
2316
2317 extern int fsetpos (FILE *__stream, __const fpos_t *__pos);
2318 # 812 "/usr/include/stdio.h" 3 4
2319
2320
2321
2322 extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
2323 extern __off64_t ftello64 (FILE *__stream) __attribute__ ((__warn_unused_result__));
2324 extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
2325 extern int fsetpos64 (FILE *__stream, __const fpos64_t *__pos);
2326
2327
2328
2329
2330 extern void clearerr (FILE *__stream) throw ();
2331
2332 extern int feof (FILE *__stream) throw () __attribute__ ((__warn_unused_result__));
2333
2334 extern int ferror (FILE *__stream) throw () __attribute__ ((__warn_unused_result__));
2335
2336
2337
2338
2339 extern void clearerr_unlocked (FILE *__stream) throw ();
2340 extern int feof_unlocked (FILE *__stream) throw () __attribute__ ((__warn_unused_result__));
2341 extern int ferror_unlocked (FILE *__stream) throw () __attribute__ ((__warn_unused_result__));
2342
2343
2344
2345
2346
2347
2348
2349
2350 extern void perror (__const char *__s);
2351
2352
2353
2354
2355
2356
2357 # 1 "/usr/include/bits/sys_errlist.h" 1 3 4
2358 # 27 "/usr/include/bits/sys_errlist.h" 3 4
2359 extern int sys_nerr;
2360 extern __const char *__const sys_errlist[];
2361
2362
2363 extern int _sys_nerr;
2364 extern __const char *__const _sys_errlist[];
2365 # 851 "/usr/include/stdio.h" 2 3 4
2366
2367
2368
2369
2370 extern int fileno (FILE *__stream) throw () __attribute__ ((__warn_unused_result__));
2371
2372
2373
2374
2375 extern int fileno_unlocked (FILE *__stream) throw () __attribute__ ((__warn_unused_result__));
2376 # 870 "/usr/include/stdio.h" 3 4
2377 extern FILE *popen (__const char *__command, __const char *__modes) __attribute__ ((__warn_unused_result__));
2378
2379
2380
2381
2382
2383 extern int pclose (FILE *__stream);
2384
2385
2386
2387
2388
2389 extern char *ctermid (char *__s) throw ();
2390
2391
2392
2393
2394
2395 extern char *cuserid (char *__s);
2396
2397
2398
2399
2400 struct obstack;
2401
2402
2403 extern int obstack_printf (struct obstack *__restrict __obstack,
2404 __const char *__restrict __format, ...)
2405 throw () __attribute__ ((__format__ (__printf__, 2, 3)));
2406 extern int obstack_vprintf (struct obstack *__restrict __obstack,
2407 __const char *__restrict __format,
2408 __gnuc_va_list __args)
2409 throw () __attribute__ ((__format__ (__printf__, 2, 0)));
2410
2411
2412
2413
2414
2415
2416
2417 extern void flockfile (FILE *__stream) throw ();
2418
2419
2420
2421 extern int ftrylockfile (FILE *__stream) throw () __attribute__ ((__warn_unused_result__));
2422
2423
2424 extern void funlockfile (FILE *__stream) throw ();
2425 # 931 "/usr/include/stdio.h" 3 4
2426 # 1 "/usr/include/bits/stdio.h" 1 3 4
2427 # 27 "/usr/include/bits/stdio.h" 3 4
2428 #define __STDIO_INLINE __extern_inline
2429 # 44 "/usr/include/bits/stdio.h" 3 4
2430 extern __inline __attribute__ ((__gnu_inline__)) int
2431 getchar (void)
2432 {
2433 return _IO_getc (stdin);
2434 }
2435
2436
2437
2438
2439 extern __inline __attribute__ ((__gnu_inline__)) int
2440 fgetc_unlocked (FILE *__fp)
2441 {
2442 return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++);
2443 }
2444
2445
2446
2447
2448
2449 extern __inline __attribute__ ((__gnu_inline__)) int
2450 getc_unlocked (FILE *__fp)
2451 {
2452 return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++);
2453 }
2454
2455
2456 extern __inline __attribute__ ((__gnu_inline__)) int
2457 getchar_unlocked (void)
2458 {
2459 return (__builtin_expect (((stdin)->_IO_read_ptr >= (stdin)->_IO_read_end), 0) ? __uflow (stdin) : *(unsigned char *) (stdin)->_IO_read_ptr++);
2460 }
2461
2462
2463
2464
2465 extern __inline __attribute__ ((__gnu_inline__)) int
2466 putchar (int __c)
2467 {
2468 return _IO_putc (__c, stdout);
2469 }
2470
2471
2472
2473
2474 extern __inline __attribute__ ((__gnu_inline__)) int
2475 fputc_unlocked (int __c, FILE *__stream)
2476 {
2477 return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c)));
2478 }
2479
2480
2481
2482
2483
2484 extern __inline __attribute__ ((__gnu_inline__)) int
2485 putc_unlocked (int __c, FILE *__stream)
2486 {
2487 return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c)));
2488 }
2489
2490
2491 extern __inline __attribute__ ((__gnu_inline__)) int
2492 putchar_unlocked (int __c)
2493 {
2494 return (__builtin_expect (((stdout)->_IO_write_ptr >= (stdout)->_IO_write_end), 0) ? __overflow (stdout, (unsigned char) (__c)) : (unsigned char) (*(stdout)->_IO_write_ptr++ = (__c)));
2495 }
2496
2497
2498
2499
2500
2501 extern __inline __attribute__ ((__gnu_inline__)) __ssize_t
2502 getline (char **__lineptr, size_t *__n, FILE *__stream)
2503 {
2504 return __getdelim (__lineptr, __n, '\n', __stream);
2505 }
2506
2507
2508
2509
2510
2511 extern __inline __attribute__ ((__gnu_inline__)) int
2512 feof_unlocked (FILE *__stream) throw ()
2513 {
2514 return (((__stream)->_flags & 0x10) != 0);
2515 }
2516
2517
2518 extern __inline __attribute__ ((__gnu_inline__)) int
2519 ferror_unlocked (FILE *__stream) throw ()
2520 {
2521 return (((__stream)->_flags & 0x20) != 0);
2522 }
2523 # 191 "/usr/include/bits/stdio.h" 3 4
2524 #undef __STDIO_INLINE
2525 # 932 "/usr/include/stdio.h" 2 3 4
2526
2527
2528 # 1 "/usr/include/bits/stdio2.h" 1 3 4
2529 # 24 "/usr/include/bits/stdio2.h" 3 4
2530 extern int __sprintf_chk (char *__restrict __s, int __flag, size_t __slen,
2531 __const char *__restrict __format, ...) throw ();
2532 extern int __vsprintf_chk (char *__restrict __s, int __flag, size_t __slen,
2533 __const char *__restrict __format,
2534 __gnuc_va_list __ap) throw ();
2535
2536
2537 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
2538 sprintf (char *__restrict __s, __const char *__restrict __fmt, ...) throw ()
2539 {
2540 return __builtin___sprintf_chk (__s, 2 - 1,
2541 __builtin_object_size (__s, 2 > 1), __fmt, __builtin_va_arg_pack ());
2542 }
2543
2544
2545
2546
2547
2548
2549 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
2550 vsprintf (char *__restrict __s, __const char *__restrict __fmt, __gnuc_va_list __ap) throw ()
2551
2552 {
2553 return __builtin___vsprintf_chk (__s, 2 - 1,
2554 __builtin_object_size (__s, 2 > 1), __fmt, __ap);
2555 }
2556
2557
2558
2559 extern int __snprintf_chk (char *__restrict __s, size_t __n, int __flag,
2560 size_t __slen, __const char *__restrict __format,
2561 ...) throw ();
2562 extern int __vsnprintf_chk (char *__restrict __s, size_t __n, int __flag,
2563 size_t __slen, __const char *__restrict __format,
2564 __gnuc_va_list __ap) throw ();
2565
2566
2567 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
2568 snprintf (char *__restrict __s, size_t __n, __const char *__restrict __fmt, ...) throw ()
2569
2570 {
2571 return __builtin___snprintf_chk (__s, __n, 2 - 1,
2572 __builtin_object_size (__s, 2 > 1), __fmt, __builtin_va_arg_pack ());
2573 }
2574
2575
2576
2577
2578
2579
2580 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
2581 vsnprintf (char *__restrict __s, size_t __n, __const char *__restrict __fmt, __gnuc_va_list __ap) throw ()
2582
2583 {
2584 return __builtin___vsnprintf_chk (__s, __n, 2 - 1,
2585 __builtin_object_size (__s, 2 > 1), __fmt, __ap);
2586 }
2587
2588
2589
2590
2591
2592 extern int __fprintf_chk (FILE *__restrict __stream, int __flag,
2593 __const char *__restrict __format, ...);
2594 extern int __printf_chk (int __flag, __const char *__restrict __format, ...);
2595 extern int __vfprintf_chk (FILE *__restrict __stream, int __flag,
2596 __const char *__restrict __format, __gnuc_va_list __ap);
2597 extern int __vprintf_chk (int __flag, __const char *__restrict __format,
2598 __gnuc_va_list __ap);
2599
2600
2601 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
2602 fprintf (FILE *__restrict __stream, __const char *__restrict __fmt, ...)
2603 {
2604 return __fprintf_chk (__stream, 2 - 1, __fmt,
2605 __builtin_va_arg_pack ());
2606 }
2607
2608 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
2609 printf (__const char *__restrict __fmt, ...)
2610 {
2611 return __printf_chk (2 - 1, __fmt, __builtin_va_arg_pack ());
2612 }
2613
2614
2615
2616
2617
2618
2619
2620 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
2621 vprintf (__const char *__restrict __fmt, __gnuc_va_list __ap)
2622 {
2623
2624 return __vfprintf_chk (stdout, 2 - 1, __fmt, __ap);
2625
2626
2627
2628 }
2629
2630 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
2631 vfprintf (FILE *__restrict __stream,
2632 __const char *__restrict __fmt, __gnuc_va_list __ap)
2633 {
2634 return __vfprintf_chk (__stream, 2 - 1, __fmt, __ap);
2635 }
2636
2637
2638
2639 extern int __asprintf_chk (char **__restrict __ptr, int __flag,
2640 __const char *__restrict __fmt, ...)
2641 throw () __attribute__ ((__format__ (__printf__, 3, 4))) __attribute__ ((__warn_unused_result__));
2642 extern int __vasprintf_chk (char **__restrict __ptr, int __flag,
2643 __const char *__restrict __fmt, __gnuc_va_list __arg)
2644 throw () __attribute__ ((__format__ (__printf__, 3, 0))) __attribute__ ((__warn_unused_result__));
2645 extern int __dprintf_chk (int __fd, int __flag, __const char *__restrict __fmt,
2646 ...) __attribute__ ((__format__ (__printf__, 3, 4)));
2647 extern int __vdprintf_chk (int __fd, int __flag,
2648 __const char *__restrict __fmt, __gnuc_va_list __arg)
2649 __attribute__ ((__format__ (__printf__, 3, 0)));
2650 extern int __obstack_printf_chk (struct obstack *__restrict __obstack,
2651 int __flag, __const char *__restrict __format,
2652 ...)
2653 throw () __attribute__ ((__format__ (__printf__, 3, 4)));
2654 extern int __obstack_vprintf_chk (struct obstack *__restrict __obstack,
2655 int __flag,
2656 __const char *__restrict __format,
2657 __gnuc_va_list __args)
2658 throw () __attribute__ ((__format__ (__printf__, 3, 0)));
2659
2660
2661 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
2662 asprintf (char **__restrict __ptr, __const char *__restrict __fmt, ...) throw ()
2663 {
2664 return __asprintf_chk (__ptr, 2 - 1, __fmt,
2665 __builtin_va_arg_pack ());
2666 }
2667
2668 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
2669 __asprintf (char **__restrict __ptr, __const char *__restrict __fmt, ...) throw ()
2670
2671 {
2672 return __asprintf_chk (__ptr, 2 - 1, __fmt,
2673 __builtin_va_arg_pack ());
2674 }
2675
2676 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
2677 dprintf (int __fd, __const char *__restrict __fmt, ...)
2678 {
2679 return __dprintf_chk (__fd, 2 - 1, __fmt,
2680 __builtin_va_arg_pack ());
2681 }
2682
2683 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
2684 obstack_printf (struct obstack *__restrict __obstack, __const char *__restrict __fmt, ...) throw ()
2685
2686 {
2687 return __obstack_printf_chk (__obstack, 2 - 1, __fmt,
2688 __builtin_va_arg_pack ());
2689 }
2690 # 195 "/usr/include/bits/stdio2.h" 3 4
2691 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
2692 vasprintf (char **__restrict __ptr, __const char *__restrict __fmt, __gnuc_va_list __ap) throw ()
2693
2694 {
2695 return __vasprintf_chk (__ptr, 2 - 1, __fmt, __ap);
2696 }
2697
2698 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
2699 vdprintf (int __fd, __const char *__restrict __fmt, __gnuc_va_list __ap)
2700 {
2701 return __vdprintf_chk (__fd, 2 - 1, __fmt, __ap);
2702 }
2703
2704 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
2705 obstack_vprintf (struct obstack *__restrict __obstack, __const char *__restrict __fmt, __gnuc_va_list __ap) throw ()
2706
2707 {
2708 return __obstack_vprintf_chk (__obstack, 2 - 1, __fmt,
2709 __ap);
2710 }
2711
2712
2713
2714
2715
2716 extern char *__gets_chk (char *__str, size_t) __attribute__ ((__warn_unused_result__));
2717 extern char *__gets_warn (char *__str) __asm__ ("" "gets")
2718 __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("please use fgets or getline instead, gets can't " "specify buffer size")))
2719 ;
2720
2721 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__warn_unused_result__)) char *
2722 gets (char *__str)
2723 {
2724 if (__builtin_object_size (__str, 2 > 1) != (size_t) -1)
2725 return __gets_chk (__str, __builtin_object_size (__str, 2 > 1));
2726 return __gets_warn (__str);
2727 }
2728
2729 extern char *__fgets_chk (char *__restrict __s, size_t __size, int __n,
2730 FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
2731 extern char *__fgets_alias (char *__restrict __s, int __n, FILE *__restrict __stream) __asm__ ("" "fgets")
2732
2733 __attribute__ ((__warn_unused_result__));
2734 extern char *__fgets_chk_warn (char *__restrict __s, size_t __size, int __n, FILE *__restrict __stream) __asm__ ("" "__fgets_chk")
2735
2736
2737 __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("fgets called with bigger size than length " "of destination buffer")))
2738 ;
2739
2740 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__warn_unused_result__)) char *
2741 fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
2742 {
2743 if (__builtin_object_size (__s, 2 > 1) != (size_t) -1)
2744 {
2745 if (!__builtin_constant_p (__n) || __n <= 0)
2746 return __fgets_chk (__s, __builtin_object_size (__s, 2 > 1), __n, __stream);
2747
2748 if ((size_t) __n > __builtin_object_size (__s, 2 > 1))
2749 return __fgets_chk_warn (__s, __builtin_object_size (__s, 2 > 1), __n, __stream);
2750 }
2751 return __fgets_alias (__s, __n, __stream);
2752 }
2753
2754 extern size_t __fread_chk (void *__restrict __ptr, size_t __ptrlen,
2755 size_t __size, size_t __n,
2756 FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
2757 extern size_t __fread_alias (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("" "fread")
2758
2759
2760 __attribute__ ((__warn_unused_result__));
2761 extern size_t __fread_chk_warn (void *__restrict __ptr, size_t __ptrlen, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("" "__fread_chk")
2762
2763
2764
2765
2766 __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("fread called with bigger size * nmemb than length " "of destination buffer")))
2767 ;
2768
2769 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__warn_unused_result__)) size_t
2770 fread (void *__restrict __ptr, size_t __size, size_t __n,
2771 FILE *__restrict __stream)
2772 {
2773 if (__builtin_object_size (__ptr, 0) != (size_t) -1)
2774 {
2775 if (!__builtin_constant_p (__size)
2776 || !__builtin_constant_p (__n)
2777 || (__size | __n) >= (((size_t) 1) << (8 * sizeof (size_t) / 2)))
2778 return __fread_chk (__ptr, __builtin_object_size (__ptr, 0), __size, __n, __stream);
2779
2780 if (__size * __n > __builtin_object_size (__ptr, 0))
2781 return __fread_chk_warn (__ptr, __builtin_object_size (__ptr, 0), __size, __n, __stream);
2782 }
2783 return __fread_alias (__ptr, __size, __n, __stream);
2784 }
2785
2786
2787 extern char *__fgets_unlocked_chk (char *__restrict __s, size_t __size,
2788 int __n, FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
2789 extern char *__fgets_unlocked_alias (char *__restrict __s, int __n, FILE *__restrict __stream) __asm__ ("" "fgets_unlocked")
2790
2791 __attribute__ ((__warn_unused_result__));
2792 extern char *__fgets_unlocked_chk_warn (char *__restrict __s, size_t __size, int __n, FILE *__restrict __stream) __asm__ ("" "__fgets_unlocked_chk")
2793
2794
2795 __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("fgets_unlocked called with bigger size than length " "of destination buffer")))
2796 ;
2797
2798 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__warn_unused_result__)) char *
2799 fgets_unlocked (char *__restrict __s, int __n, FILE *__restrict __stream)
2800 {
2801 if (__builtin_object_size (__s, 2 > 1) != (size_t) -1)
2802 {
2803 if (!__builtin_constant_p (__n) || __n <= 0)
2804 return __fgets_unlocked_chk (__s, __builtin_object_size (__s, 2 > 1), __n, __stream);
2805
2806 if ((size_t) __n > __builtin_object_size (__s, 2 > 1))
2807 return __fgets_unlocked_chk_warn (__s, __builtin_object_size (__s, 2 > 1), __n, __stream);
2808 }
2809 return __fgets_unlocked_alias (__s, __n, __stream);
2810 }
2811
2812
2813
2814 #undef fread_unlocked
2815 extern size_t __fread_unlocked_chk (void *__restrict __ptr, size_t __ptrlen,
2816 size_t __size, size_t __n,
2817 FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
2818 extern size_t __fread_unlocked_alias (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("" "fread_unlocked")
2819
2820
2821 __attribute__ ((__warn_unused_result__));
2822 extern size_t __fread_unlocked_chk_warn (void *__restrict __ptr, size_t __ptrlen, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("" "__fread_unlocked_chk")
2823
2824
2825
2826
2827 __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("fread_unlocked called with bigger size * nmemb than " "length of destination buffer")))
2828 ;
2829
2830 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__warn_unused_result__)) size_t
2831 fread_unlocked (void *__restrict __ptr, size_t __size, size_t __n,
2832 FILE *__restrict __stream)
2833 {
2834 if (__builtin_object_size (__ptr, 0) != (size_t) -1)
2835 {
2836 if (!__builtin_constant_p (__size)
2837 || !__builtin_constant_p (__n)
2838 || (__size | __n) >= (((size_t) 1) << (8 * sizeof (size_t) / 2)))
2839 return __fread_unlocked_chk (__ptr, __builtin_object_size (__ptr, 0), __size, __n,
2840 __stream);
2841
2842 if (__size * __n > __builtin_object_size (__ptr, 0))
2843 return __fread_unlocked_chk_warn (__ptr, __builtin_object_size (__ptr, 0), __size, __n,
2844 __stream);
2845 }
2846
2847
2848 if (__builtin_constant_p (__size)
2849 && __builtin_constant_p (__n)
2850 && (__size | __n) < (((size_t) 1) << (8 * sizeof (size_t) / 2))
2851 && __size * __n <= 8)
2852 {
2853 size_t __cnt = __size * __n;
2854 char *__cptr = (char *) __ptr;
2855 if (__cnt == 0)
2856 return 0;
2857
2858 for (; __cnt > 0; --__cnt)
2859 {
2860 int __c = (__builtin_expect (((__stream)->_IO_read_ptr >= (__stream)->_IO_read_end), 0) ? __uflow (__stream) : *(unsigned char *) (__stream)->_IO_read_ptr++);
2861 if (__c == (-1))
2862 break;
2863 *__cptr++ = __c;
2864 }
2865 return (__cptr - (char *) __ptr) / __size;
2866 }
2867
2868 return __fread_unlocked_alias (__ptr, __size, __n, __stream);
2869 }
2870 # 935 "/usr/include/stdio.h" 2 3 4
2871
2872
2873
2874
2875
2876 }
2877 # 17 "./../../dist/include/mozilla/Assertions.h" 2
2878 # 1 "/usr/include/stdlib.h" 1 3 4
2879 # 28 "/usr/include/stdlib.h" 3 4
2880 #define __need_size_t
2881
2882 #define __need_wchar_t
2883 #define __need_NULL
2884
2885 # 1 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 1 3 4
2886 # 160 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
2887 #undef __need_ptrdiff_t
2888 # 233 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
2889 #undef __need_size_t
2890 # 342 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
2891 #undef __need_wchar_t
2892 # 395 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
2893 #undef NULL
2894
2895 #define NULL __null
2896 # 406 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
2897 #undef __need_NULL
2898
2899
2900
2901
2902 #define offsetof(TYPE,MEMBER) __builtin_offsetof (TYPE, MEMBER)
2903 # 34 "/usr/include/stdlib.h" 2 3 4
2904
2905 extern "C" {
2906
2907
2908 #define _STDLIB_H 1
2909
2910
2911
2912 # 1 "/usr/include/bits/waitflags.h" 1 3 4
2913 # 26 "/usr/include/bits/waitflags.h" 3 4
2914 #define WNOHANG 1
2915 #define WUNTRACED 2
2916
2917
2918 #define WSTOPPED 2
2919 #define WEXITED 4
2920 #define WCONTINUED 8
2921 #define WNOWAIT 0x01000000
2922
2923 #define __WNOTHREAD 0x20000000
2924
2925 #define __WALL 0x40000000
2926 #define __WCLONE 0x80000000
2927 # 43 "/usr/include/stdlib.h" 2 3 4
2928 # 1 "/usr/include/bits/waitstatus.h" 1 3 4
2929 # 29 "/usr/include/bits/waitstatus.h" 3 4
2930 #define __WEXITSTATUS(status) (((status) & 0xff00) >> 8)
2931
2932
2933 #define __WTERMSIG(status) ((status) & 0x7f)
2934
2935
2936 #define __WSTOPSIG(status) __WEXITSTATUS(status)
2937
2938
2939 #define __WIFEXITED(status) (__WTERMSIG(status) == 0)
2940
2941
2942 #define __WIFSIGNALED(status) (((signed char) (((status) & 0x7f) + 1) >> 1) > 0)
2943
2944
2945
2946 #define __WIFSTOPPED(status) (((status) & 0xff) == 0x7f)
2947
2948
2949
2950
2951 #define __WIFCONTINUED(status) ((status) == __W_CONTINUED)
2952
2953
2954
2955 #define __WCOREDUMP(status) ((status) & __WCOREFLAG)
2956
2957
2958 #define __W_EXITCODE(ret,sig) ((ret) << 8 | (sig))
2959 #define __W_STOPCODE(sig) ((sig) << 8 | 0x7f)
2960 #define __W_CONTINUED 0xffff
2961 #define __WCOREFLAG 0x80
2962
2963
2964
2965
2966 # 1 "/usr/include/endian.h" 1 3 4
2967 # 20 "/usr/include/endian.h" 3 4
2968 #define _ENDIAN_H 1
2969 # 32 "/usr/include/endian.h" 3 4
2970 #define __LITTLE_ENDIAN 1234
2971 #define __BIG_ENDIAN 4321
2972 #define __PDP_ENDIAN 3412
2973
2974
2975 # 1 "/usr/include/bits/endian.h" 1 3 4
2976 # 9 "/usr/include/bits/endian.h" 3 4
2977 #define __BYTE_ORDER __LITTLE_ENDIAN
2978
2979
2980
2981
2982
2983
2984 #define __FLOAT_WORD_ORDER __BYTE_ORDER
2985 # 38 "/usr/include/endian.h" 2 3 4
2986 # 46 "/usr/include/endian.h" 3 4
2987 #define LITTLE_ENDIAN __LITTLE_ENDIAN
2988 #define BIG_ENDIAN __BIG_ENDIAN
2989 #define PDP_ENDIAN __PDP_ENDIAN
2990 #define BYTE_ORDER __BYTE_ORDER
2991
2992
2993
2994 #define __LONG_LONG_PAIR(HI,LO) LO, HI
2995
2996
2997
2998
2999
3000
3001
3002 # 1 "/usr/include/bits/byteswap.h" 1 3 4
3003 # 26 "/usr/include/bits/byteswap.h" 3 4
3004 #define _BITS_BYTESWAP_H 1
3005
3006
3007 #define __bswap_constant_16(x) ((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8))
3008
3009
3010
3011 #define __bswap_16(x) (__extension__ ({ unsigned short int __bsx = (x); __bswap_constant_16 (__bsx); }))
3012 # 45 "/usr/include/bits/byteswap.h" 3 4
3013 #define __bswap_constant_32(x) ((((x) & 0xff000000u) >> 24) | (((x) & 0x00ff0000u) >> 8) | (((x) & 0x0000ff00u) << 8) | (((x) & 0x000000ffu) << 24))
3014
3015
3016
3017
3018 #define __bswap_32(x) (__extension__ ({ register unsigned int __bsx = (x); __bswap_constant_32 (__bsx); }))
3019 # 63 "/usr/include/bits/byteswap.h" 3 4
3020 #define __bswap_constant_64(x) (__extension__ ((((x) & 0xff00000000000000ull) >> 56) | (((x) & 0x00ff000000000000ull) >> 40) | (((x) & 0x0000ff0000000000ull) >> 24) | (((x) & 0x000000ff00000000ull) >> 8) | (((x) & 0x00000000ff000000ull) << 8) | (((x) & 0x0000000000ff0000ull) << 24) | (((x) & 0x000000000000ff00ull) << 40) | (((x) & 0x00000000000000ffull) << 56)))
3021 # 73 "/usr/include/bits/byteswap.h" 3 4
3022 #define __bswap_64(x) (__extension__ ({ union { __extension__ unsigned long long int __ll; unsigned int __l[2]; } __w, __r; if (__builtin_constant_p (x)) __r.__ll = __bswap_constant_64 (x); else { __w.__ll = (x); __r.__l[0] = __bswap_32 (__w.__l[1]); __r.__l[1] = __bswap_32 (__w.__l[0]); } __r.__ll; }))
3023 # 62 "/usr/include/endian.h" 2 3 4
3024
3025
3026 #define htobe16(x) __bswap_16 (x)
3027 #define htole16(x) (x)
3028 #define be16toh(x) __bswap_16 (x)
3029 #define le16toh(x) (x)
3030
3031 #define htobe32(x) __bswap_32 (x)
3032 #define htole32(x) (x)
3033 #define be32toh(x) __bswap_32 (x)
3034 #define le32toh(x) (x)
3035
3036 #define htobe64(x) __bswap_64 (x)
3037 #define htole64(x) (x)
3038 #define be64toh(x) __bswap_64 (x)
3039 #define le64toh(x) (x)
3040 # 66 "/usr/include/bits/waitstatus.h" 2 3 4
3041
3042 union wait
3043 {
3044 int w_status;
3045 struct
3046 {
3047
3048 unsigned int __w_termsig:7;
3049 unsigned int __w_coredump:1;
3050 unsigned int __w_retcode:8;
3051 unsigned int:16;
3052
3053
3054
3055
3056
3057
3058
3059 } __wait_terminated;
3060 struct
3061 {
3062
3063 unsigned int __w_stopval:8;
3064 unsigned int __w_stopsig:8;
3065 unsigned int:16;
3066
3067
3068
3069
3070
3071
3072 } __wait_stopped;
3073 };
3074
3075 #define w_termsig __wait_terminated.__w_termsig
3076 #define w_coredump __wait_terminated.__w_coredump
3077 #define w_retcode __wait_terminated.__w_retcode
3078 #define w_stopsig __wait_stopped.__w_stopsig
3079 #define w_stopval __wait_stopped.__w_stopval
3080 # 44 "/usr/include/stdlib.h" 2 3 4
3081 # 55 "/usr/include/stdlib.h" 3 4
3082 #define __WAIT_INT(status) (*(int *) &(status))
3083 # 64 "/usr/include/stdlib.h" 3 4
3084 #define __WAIT_STATUS void *
3085 #define __WAIT_STATUS_DEFN void *
3086 # 85 "/usr/include/stdlib.h" 3 4
3087 #define WEXITSTATUS(status) __WEXITSTATUS (__WAIT_INT (status))
3088 #define WTERMSIG(status) __WTERMSIG (__WAIT_INT (status))
3089 #define WSTOPSIG(status) __WSTOPSIG (__WAIT_INT (status))
3090 #define WIFEXITED(status) __WIFEXITED (__WAIT_INT (status))
3091 #define WIFSIGNALED(status) __WIFSIGNALED (__WAIT_INT (status))
3092 #define WIFSTOPPED(status) __WIFSTOPPED (__WAIT_INT (status))
3093
3094 #define WIFCONTINUED(status) __WIFCONTINUED (__WAIT_INT (status))
3095
3096
3097
3098
3099
3100 typedef struct
3101 {
3102 int quot;
3103 int rem;
3104 } div_t;
3105
3106
3107
3108 typedef struct
3109 {
3110 long int quot;
3111 long int rem;
3112 } ldiv_t;
3113 #define __ldiv_t_defined 1
3114
3115
3116
3117
3118
3119
3120 __extension__ typedef struct
3121 {
3122 long long int quot;
3123 long long int rem;
3124 } lldiv_t;
3125 #define __lldiv_t_defined 1
3126
3127
3128
3129
3130
3131 #define RAND_MAX 2147483647
3132
3133
3134
3135
3136 #define EXIT_FAILURE 1
3137 #define EXIT_SUCCESS 0
3138
3139
3140
3141 #define MB_CUR_MAX (__ctype_get_mb_cur_max ())
3142 extern size_t __ctype_get_mb_cur_max (void) throw () __attribute__ ((__warn_unused_result__));
3143
3144
3145
3146
3147 extern double atof (__const char *__nptr)
3148 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
3149
3150 extern int atoi (__const char *__nptr)
3151 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
3152
3153 extern long int atol (__const char *__nptr)
3154 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
3155
3156
3157
3158
3159
3160 __extension__ extern long long int atoll (__const char *__nptr)
3161 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
3162
3163
3164
3165
3166
3167 extern double strtod (__const char *__restrict __nptr,
3168 char **__restrict __endptr)
3169 throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
3170
3171
3172
3173
3174
3175 extern float strtof (__const char *__restrict __nptr,
3176 char **__restrict __endptr) throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
3177
3178 extern long double strtold (__const char *__restrict __nptr,
3179 char **__restrict __endptr)
3180 throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
3181
3182
3183
3184
3185
3186 extern long int strtol (__const char *__restrict __nptr,
3187 char **__restrict __endptr, int __base)
3188 throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
3189
3190 extern unsigned long int strtoul (__const char *__restrict __nptr,
3191 char **__restrict __endptr, int __base)
3192 throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
3193
3194
3195
3196
3197 __extension__
3198 extern long long int strtoq (__const char *__restrict __nptr,
3199 char **__restrict __endptr, int __base)
3200 throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
3201
3202 __extension__
3203 extern unsigned long long int strtouq (__const char *__restrict __nptr,
3204 char **__restrict __endptr, int __base)
3205 throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
3206
3207
3208
3209
3210
3211 __extension__
3212 extern long long int strtoll (__const char *__restrict __nptr,
3213 char **__restrict __endptr, int __base)
3214 throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
3215
3216 __extension__
3217 extern unsigned long long int strtoull (__const char *__restrict __nptr,
3218 char **__restrict __endptr, int __base)
3219 throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
3220
3221 # 236 "/usr/include/stdlib.h" 3 4
3222 # 1 "/usr/include/xlocale.h" 1 3 4
3223 # 22 "/usr/include/xlocale.h" 3 4
3224 #define _XLOCALE_H 1
3225
3226
3227
3228
3229
3230 typedef struct __locale_struct
3231 {
3232
3233 struct __locale_data *__locales[13];
3234
3235
3236 const unsigned short int *__ctype_b;
3237 const int *__ctype_tolower;
3238 const int *__ctype_toupper;
3239
3240
3241 const char *__names[13];
3242 } *__locale_t;
3243
3244
3245 typedef __locale_t locale_t;
3246 # 237 "/usr/include/stdlib.h" 2 3 4
3247
3248
3249
3250 extern long int strtol_l (__const char *__restrict __nptr,
3251 char **__restrict __endptr, int __base,
3252 __locale_t __loc) throw () __attribute__ ((__nonnull__ (1, 4))) __attribute__ ((__warn_unused_result__));
3253
3254 extern unsigned long int strtoul_l (__const char *__restrict __nptr,
3255 char **__restrict __endptr,
3256 int __base, __locale_t __loc)
3257 throw () __attribute__ ((__nonnull__ (1, 4))) __attribute__ ((__warn_unused_result__));
3258
3259 __extension__
3260 extern long long int strtoll_l (__const char *__restrict __nptr,
3261 char **__restrict __endptr, int __base,
3262 __locale_t __loc)
3263 throw () __attribute__ ((__nonnull__ (1, 4))) __attribute__ ((__warn_unused_result__));
3264
3265 __extension__
3266 extern unsigned long long int strtoull_l (__const char *__restrict __nptr,
3267 char **__restrict __endptr,
3268 int __base, __locale_t __loc)
3269 throw () __attribute__ ((__nonnull__ (1, 4))) __attribute__ ((__warn_unused_result__));
3270
3271 extern double strtod_l (__const char *__restrict __nptr,
3272 char **__restrict __endptr, __locale_t __loc)
3273 throw () __attribute__ ((__nonnull__ (1, 3))) __attribute__ ((__warn_unused_result__));
3274
3275 extern float strtof_l (__const char *__restrict __nptr,
3276 char **__restrict __endptr, __locale_t __loc)
3277 throw () __attribute__ ((__nonnull__ (1, 3))) __attribute__ ((__warn_unused_result__));
3278
3279 extern long double strtold_l (__const char *__restrict __nptr,
3280 char **__restrict __endptr,
3281 __locale_t __loc)
3282 throw () __attribute__ ((__nonnull__ (1, 3))) __attribute__ ((__warn_unused_result__));
3283
3284
3285
3286
3287
3288 extern __inline __attribute__ ((__gnu_inline__)) double
3289 atof (__const char *__nptr) throw ()
3290 {
3291 return strtod (__nptr, (char **) __null);
3292 }
3293 extern __inline __attribute__ ((__gnu_inline__)) int
3294 atoi (__const char *__nptr) throw ()
3295 {
3296 return (int) strtol (__nptr, (char **) __null, 10);
3297 }
3298 extern __inline __attribute__ ((__gnu_inline__)) long int
3299 atol (__const char *__nptr) throw ()
3300 {
3301 return strtol (__nptr, (char **) __null, 10);
3302 }
3303
3304
3305
3306
3307 __extension__ extern __inline __attribute__ ((__gnu_inline__)) long long int
3308 atoll (__const char *__nptr) throw ()
3309 {
3310 return strtoll (__nptr, (char **) __null, 10);
3311 }
3312
3313 # 311 "/usr/include/stdlib.h" 3 4
3314 extern char *l64a (long int __n) throw () __attribute__ ((__warn_unused_result__));
3315
3316
3317 extern long int a64l (__const char *__s)
3318 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
3319
3320
3321
3322
3323 # 1 "/usr/include/sys/types.h" 1 3 4
3324 # 24 "/usr/include/sys/types.h" 3 4
3325 #define _SYS_TYPES_H 1
3326
3327
3328
3329 extern "C" {
3330
3331
3332
3333
3334
3335 typedef __u_char u_char;
3336 typedef __u_short u_short;
3337 typedef __u_int u_int;
3338 typedef __u_long u_long;
3339 typedef __quad_t quad_t;
3340 typedef __u_quad_t u_quad_t;
3341 typedef __fsid_t fsid_t;
3342 #define __u_char_defined
3343
3344
3345
3346 typedef __loff_t loff_t;
3347
3348
3349
3350 typedef __ino_t ino_t;
3351
3352
3353
3354 #define __ino_t_defined
3355
3356
3357 typedef __ino64_t ino64_t;
3358 #define __ino64_t_defined
3359
3360
3361
3362 typedef __dev_t dev_t;
3363 #define __dev_t_defined
3364
3365
3366
3367 typedef __gid_t gid_t;
3368 #define __gid_t_defined
3369
3370
3371
3372 typedef __mode_t mode_t;
3373 #define __mode_t_defined
3374
3375
3376
3377 typedef __nlink_t nlink_t;
3378 #define __nlink_t_defined
3379
3380
3381
3382 typedef __uid_t uid_t;
3383 #define __uid_t_defined
3384 # 99 "/usr/include/sys/types.h" 3 4
3385 typedef __pid_t pid_t;
3386 #define __pid_t_defined
3387
3388
3389
3390
3391 typedef __id_t id_t;
3392 #define __id_t_defined
3393 # 116 "/usr/include/sys/types.h" 3 4
3394 typedef __daddr_t daddr_t;
3395 typedef __caddr_t caddr_t;
3396 #define __daddr_t_defined
3397
3398
3399
3400
3401 typedef __key_t key_t;
3402 #define __key_t_defined
3403
3404
3405
3406 #define __need_clock_t
3407
3408 #define __need_time_t
3409 #define __need_timer_t
3410 #define __need_clockid_t
3411 # 1 "/usr/include/time.h" 1 3 4
3412 # 54 "/usr/include/time.h" 3 4
3413 #define __clock_t_defined 1
3414
3415
3416
3417
3418
3419 typedef __clock_t clock_t;
3420
3421
3422
3423
3424
3425
3426 #undef __need_clock_t
3427
3428
3429 #define __time_t_defined 1
3430
3431
3432
3433
3434
3435 typedef __time_t time_t;
3436
3437
3438
3439
3440
3441
3442 #undef __need_time_t
3443
3444
3445
3446 #define __clockid_t_defined 1
3447
3448
3449
3450
3451 typedef __clockid_t clockid_t;
3452
3453
3454 #undef __clockid_time_t
3455
3456
3457
3458 #define __timer_t_defined 1
3459
3460
3461
3462
3463 typedef __timer_t timer_t;
3464
3465
3466 #undef __need_timer_t
3467 # 127 "/usr/include/time.h" 3 4
3468 #undef __need_timespec
3469 # 134 "/usr/include/sys/types.h" 2 3 4
3470
3471
3472
3473 typedef __useconds_t useconds_t;
3474 #define __useconds_t_defined
3475
3476
3477 typedef __suseconds_t suseconds_t;
3478 #define __suseconds_t_defined
3479
3480
3481
3482 #define __need_size_t
3483 # 1 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 1 3 4
3484 # 160 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
3485 #undef __need_ptrdiff_t
3486 # 233 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
3487 #undef __need_size_t
3488 # 342 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
3489 #undef __need_wchar_t
3490 # 395 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
3491 #undef NULL
3492
3493 #define NULL __null
3494 # 406 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
3495 #undef __need_NULL
3496
3497
3498
3499
3500 #define offsetof(TYPE,MEMBER) __builtin_offsetof (TYPE, MEMBER)
3501 # 148 "/usr/include/sys/types.h" 2 3 4
3502
3503
3504
3505 typedef unsigned long int ulong;
3506 typedef unsigned short int ushort;
3507 typedef unsigned int uint;
3508 # 188 "/usr/include/sys/types.h" 3 4
3509 #define __intN_t(N,MODE) typedef int int ##N ##_t __attribute__ ((__mode__ (MODE)))
3510
3511 #define __u_intN_t(N,MODE) typedef unsigned int u_int ##N ##_t __attribute__ ((__mode__ (MODE)))
3512 # 201 "/usr/include/sys/types.h" 3 4
3513 typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
3514 typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__)));
3515 typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
3516 typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__)));
3517
3518 typedef int register_t __attribute__ ((__mode__ (__word__)));
3519
3520
3521
3522
3523
3524 #define __BIT_TYPES_DEFINED__ 1
3525
3526
3527
3528
3529
3530
3531
3532 # 1 "/usr/include/sys/select.h" 1 3 4
3533 # 23 "/usr/include/sys/select.h" 3 4
3534 #define _SYS_SELECT_H 1
3535
3536
3537
3538
3539
3540
3541
3542 # 1 "/usr/include/bits/select.h" 1 3 4
3543 # 26 "/usr/include/bits/select.h" 3 4
3544 #define __FD_ZERO(s) do { unsigned int __i; fd_set *__arr = (s); for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) __FDS_BITS (__arr)[__i] = 0; } while (0)
3545
3546
3547
3548
3549
3550
3551 #define __FD_SET(d,s) ((void) (__FDS_BITS (s)[__FD_ELT(d)] |= __FD_MASK(d)))
3552
3553 #define __FD_CLR(d,s) ((void) (__FDS_BITS (s)[__FD_ELT(d)] &= ~__FD_MASK(d)))
3554
3555 #define __FD_ISSET(d,s) ((__FDS_BITS (s)[__FD_ELT (d)] & __FD_MASK (d)) != 0)
3556 # 32 "/usr/include/sys/select.h" 2 3 4
3557
3558
3559 # 1 "/usr/include/bits/sigset.h" 1 3 4
3560 # 22 "/usr/include/bits/sigset.h" 3 4
3561 #define _SIGSET_H_types 1
3562
3563 typedef int __sig_atomic_t;
3564
3565
3566
3567 #define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int)))
3568 typedef struct
3569 {
3570 unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
3571 } __sigset_t;
3572 # 35 "/usr/include/sys/select.h" 2 3 4
3573
3574
3575 #define __sigset_t_defined
3576 typedef __sigset_t sigset_t;
3577
3578
3579
3580 #define __need_time_t
3581 #define __need_timespec
3582 # 1 "/usr/include/time.h" 1 3 4
3583 # 67 "/usr/include/time.h" 3 4
3584 #undef __need_clock_t
3585 # 83 "/usr/include/time.h" 3 4
3586 #undef __need_time_t
3587 # 95 "/usr/include/time.h" 3 4
3588 #undef __clockid_time_t
3589 # 107 "/usr/include/time.h" 3 4
3590 #undef __need_timer_t
3591
3592
3593
3594
3595
3596
3597 #define __timespec_defined 1
3598
3599
3600
3601
3602
3603 struct timespec
3604 {
3605 __time_t tv_sec;
3606 long int tv_nsec;
3607 };
3608
3609
3610 #undef __need_timespec
3611 # 45 "/usr/include/sys/select.h" 2 3 4
3612 #define __need_timeval
3613 # 1 "/usr/include/bits/time.h" 1 3 4
3614 # 26 "/usr/include/bits/time.h" 3 4
3615 #define _STRUCT_TIMEVAL 1
3616
3617
3618
3619
3620 struct timeval
3621 {
3622 __time_t tv_sec;
3623 __suseconds_t tv_usec;
3624 };
3625 # 99 "/usr/include/bits/time.h" 3 4
3626 #undef __need_timeval
3627 # 47 "/usr/include/sys/select.h" 2 3 4
3628 # 55 "/usr/include/sys/select.h" 3 4
3629 typedef long int __fd_mask;
3630
3631
3632 #undef __NFDBITS
3633
3634 #define __NFDBITS (8 * (int) sizeof (__fd_mask))
3635 #define __FD_ELT(d) ((d) / __NFDBITS)
3636 #define __FD_MASK(d) ((__fd_mask) 1 << ((d) % __NFDBITS))
3637
3638
3639 typedef struct
3640 {
3641
3642
3643
3644 __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];
3645 #define __FDS_BITS(set) ((set)->fds_bits)
3646
3647
3648
3649
3650 } fd_set;
3651
3652
3653 #define FD_SETSIZE __FD_SETSIZE
3654
3655
3656
3657 typedef __fd_mask fd_mask;
3658
3659
3660 #define NFDBITS __NFDBITS
3661
3662
3663
3664
3665 #define FD_SET(fd,fdsetp) __FD_SET (fd, fdsetp)
3666 #define FD_CLR(fd,fdsetp) __FD_CLR (fd, fdsetp)
3667 #define FD_ISSET(fd,fdsetp) __FD_ISSET (fd, fdsetp)
3668 #define FD_ZERO(fdsetp) __FD_ZERO (fdsetp)
3669
3670
3671 extern "C" {
3672 # 107 "/usr/include/sys/select.h" 3 4
3673 extern int select (int __nfds, fd_set *__restrict __readfds,
3674 fd_set *__restrict __writefds,
3675 fd_set *__restrict __exceptfds,
3676 struct timeval *__restrict __timeout);
3677 # 119 "/usr/include/sys/select.h" 3 4
3678 extern int pselect (int __nfds, fd_set *__restrict __readfds,
3679 fd_set *__restrict __writefds,
3680 fd_set *__restrict __exceptfds,
3681 const struct timespec *__restrict __timeout,
3682 const __sigset_t *__restrict __sigmask);
3683
3684
3685
3686
3687
3688 # 1 "/usr/include/bits/select2.h" 1 3 4
3689 # 25 "/usr/include/bits/select2.h" 3 4
3690 extern long int __fdelt_chk (long int __d);
3691 extern long int __fdelt_warn (long int __d)
3692 __attribute__((__warning__ ("bit outside of fd_set selected")));
3693 #undef __FD_ELT
3694 #define __FD_ELT(d) __extension__ ({ long int __d = (d); (__builtin_constant_p (__d) ? (0 <= __d && __d < __FD_SETSIZE ? (__d / __NFDBITS) : __fdelt_warn (__d)) : __fdelt_chk (__d)); })
3695 # 130 "/usr/include/sys/select.h" 2 3 4
3696
3697
3698 }
3699 # 221 "/usr/include/sys/types.h" 2 3 4
3700
3701
3702 # 1 "/usr/include/sys/sysmacros.h" 1 3 4
3703 # 22 "/usr/include/sys/sysmacros.h" 3 4
3704 #define _SYS_SYSMACROS_H 1
3705
3706
3707
3708
3709
3710
3711
3712 extern "C" {
3713
3714 __extension__
3715 extern unsigned int gnu_dev_major (unsigned long long int __dev)
3716 throw () __attribute__ ((__const__));
3717 __extension__
3718 extern unsigned int gnu_dev_minor (unsigned long long int __dev)
3719 throw () __attribute__ ((__const__));
3720 __extension__
3721 extern unsigned long long int gnu_dev_makedev (unsigned int __major,
3722 unsigned int __minor)
3723 throw () __attribute__ ((__const__));
3724
3725
3726 __extension__ extern __inline __attribute__ ((__gnu_inline__)) __attribute__ ((__const__)) unsigned int
3727 gnu_dev_major (unsigned long long int __dev) throw ()
3728 {
3729 return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff);
3730 }
3731
3732 __extension__ extern __inline __attribute__ ((__gnu_inline__)) __attribute__ ((__const__)) unsigned int
3733 gnu_dev_minor (unsigned long long int __dev) throw ()
3734 {
3735 return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff);
3736 }
3737
3738 __extension__ extern __inline __attribute__ ((__gnu_inline__)) __attribute__ ((__const__)) unsigned long long int
3739 gnu_dev_makedev (unsigned int __major, unsigned int __minor) throw ()
3740 {
3741 return ((__minor & 0xff) | ((__major & 0xfff) << 8)
3742 | (((unsigned long long int) (__minor & ~0xff)) << 12)
3743 | (((unsigned long long int) (__major & ~0xfff)) << 32));
3744 }
3745
3746 }
3747
3748
3749 #define major(dev) gnu_dev_major (dev)
3750 #define minor(dev) gnu_dev_minor (dev)
3751 #define makedev(maj,min) gnu_dev_makedev (maj, min)
3752 # 224 "/usr/include/sys/types.h" 2 3 4
3753
3754
3755
3756
3757
3758 typedef __blksize_t blksize_t;
3759 #define __blksize_t_defined
3760
3761
3762
3763
3764
3765 typedef __blkcnt_t blkcnt_t;
3766 #define __blkcnt_t_defined
3767
3768
3769 typedef __fsblkcnt_t fsblkcnt_t;
3770 #define __fsblkcnt_t_defined
3771
3772
3773 typedef __fsfilcnt_t fsfilcnt_t;
3774 #define __fsfilcnt_t_defined
3775 # 263 "/usr/include/sys/types.h" 3 4
3776 typedef __blkcnt64_t blkcnt64_t;
3777 typedef __fsblkcnt64_t fsblkcnt64_t;
3778 typedef __fsfilcnt64_t fsfilcnt64_t;
3779
3780
3781
3782
3783
3784 # 1 "/usr/include/bits/pthreadtypes.h" 1 3 4
3785 # 20 "/usr/include/bits/pthreadtypes.h" 3 4
3786 #define _BITS_PTHREADTYPES_H 1
3787
3788
3789
3790 #define __SIZEOF_PTHREAD_ATTR_T 36
3791 #define __SIZEOF_PTHREAD_MUTEX_T 24
3792 #define __SIZEOF_PTHREAD_MUTEXATTR_T 4
3793 #define __SIZEOF_PTHREAD_COND_T 48
3794 #define __SIZEOF_PTHREAD_COND_COMPAT_T 12
3795 #define __SIZEOF_PTHREAD_CONDATTR_T 4
3796 #define __SIZEOF_PTHREAD_RWLOCK_T 32
3797 #define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
3798 #define __SIZEOF_PTHREAD_BARRIER_T 20
3799 #define __SIZEOF_PTHREAD_BARRIERATTR_T 4
3800
3801
3802
3803
3804 typedef unsigned long int pthread_t;
3805
3806
3807 typedef union
3808 {
3809 char __size[36];
3810 long int __align;
3811 } pthread_attr_t;
3812
3813
3814 typedef struct __pthread_internal_slist
3815 {
3816 struct __pthread_internal_slist *__next;
3817 } __pthread_slist_t;
3818
3819
3820
3821
3822 typedef union
3823 {
3824 struct __pthread_mutex_s
3825 {
3826 int __lock;
3827 unsigned int __count;
3828 int __owner;
3829
3830
3831 int __kind;
3832 unsigned int __nusers;
3833 __extension__ union
3834 {
3835 int __spins;
3836 __pthread_slist_t __list;
3837 };
3838 } __data;
3839 char __size[24];
3840 long int __align;
3841 } pthread_mutex_t;
3842
3843 typedef union
3844 {
3845 char __size[4];
3846 long int __align;
3847 } pthread_mutexattr_t;
3848
3849
3850
3851
3852 typedef union
3853 {
3854 struct
3855 {
3856 int __lock;
3857 unsigned int __futex;
3858 __extension__ unsigned long long int __total_seq;
3859 __extension__ unsigned long long int __wakeup_seq;
3860 __extension__ unsigned long long int __woken_seq;
3861 void *__mutex;
3862 unsigned int __nwaiters;
3863 unsigned int __broadcast_seq;
3864 } __data;
3865 char __size[48];
3866 __extension__ long long int __align;
3867 } pthread_cond_t;
3868
3869 typedef union
3870 {
3871 char __size[4];
3872 long int __align;
3873 } pthread_condattr_t;
3874
3875
3876
3877 typedef unsigned int pthread_key_t;
3878
3879
3880
3881 typedef int pthread_once_t;
3882
3883
3884
3885
3886
3887 typedef union
3888 {
3889 struct
3890 {
3891 int __lock;
3892 unsigned int __nr_readers;
3893 unsigned int __readers_wakeup;
3894 unsigned int __writer_wakeup;
3895 unsigned int __nr_readers_queued;
3896 unsigned int __nr_writers_queued;
3897 # 141 "/usr/include/bits/pthreadtypes.h" 3 4
3898 unsigned char __flags;
3899 unsigned char __shared;
3900 unsigned char __pad1;
3901 unsigned char __pad2;
3902
3903 int __writer;
3904 } __data;
3905 char __size[32];
3906 long int __align;
3907 } pthread_rwlock_t;
3908
3909 typedef union
3910 {
3911 char __size[8];
3912 long int __align;
3913 } pthread_rwlockattr_t;
3914
3915
3916
3917
3918
3919 typedef volatile int pthread_spinlock_t;
3920
3921
3922
3923
3924 typedef union
3925 {
3926 char __size[20];
3927 long int __align;
3928 } pthread_barrier_t;
3929
3930 typedef union
3931 {
3932 char __size[4];
3933 int __align;
3934 } pthread_barrierattr_t;
3935 # 272 "/usr/include/sys/types.h" 2 3 4
3936
3937
3938 }
3939 # 321 "/usr/include/stdlib.h" 2 3 4
3940
3941
3942
3943
3944
3945
3946 extern long int random (void) throw ();
3947
3948
3949 extern void srandom (unsigned int __seed) throw ();
3950
3951
3952
3953
3954
3955 extern char *initstate (unsigned int __seed, char *__statebuf,
3956 size_t __statelen) throw () __attribute__ ((__nonnull__ (2)));
3957
3958
3959
3960 extern char *setstate (char *__statebuf) throw () __attribute__ ((__nonnull__ (1)));
3961
3962
3963
3964
3965
3966
3967
3968 struct random_data
3969 {
3970 int32_t *fptr;
3971 int32_t *rptr;
3972 int32_t *state;
3973 int rand_type;
3974 int rand_deg;
3975 int rand_sep;
3976 int32_t *end_ptr;
3977 };
3978
3979 extern int random_r (struct random_data *__restrict __buf,
3980 int32_t *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2)));
3981
3982 extern int srandom_r (unsigned int __seed, struct random_data *__buf)
3983 throw () __attribute__ ((__nonnull__ (2)));
3984
3985 extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
3986 size_t __statelen,
3987 struct random_data *__restrict __buf)
3988 throw () __attribute__ ((__nonnull__ (2, 4)));
3989
3990 extern int setstate_r (char *__restrict __statebuf,
3991 struct random_data *__restrict __buf)
3992 throw () __attribute__ ((__nonnull__ (1, 2)));
3993
3994
3995
3996
3997
3998
3999 extern int rand (void) throw ();
4000
4001 extern void srand (unsigned int __seed) throw ();
4002
4003
4004
4005
4006 extern int rand_r (unsigned int *__seed) throw ();
4007
4008
4009
4010
4011
4012
4013
4014 extern double drand48 (void) throw ();
4015 extern double erand48 (unsigned short int __xsubi[3]) throw () __attribute__ ((__nonnull__ (1)));
4016
4017
4018 extern long int lrand48 (void) throw ();
4019 extern long int nrand48 (unsigned short int __xsubi[3])
4020 throw () __attribute__ ((__nonnull__ (1)));
4021
4022
4023 extern long int mrand48 (void) throw ();
4024 extern long int jrand48 (unsigned short int __xsubi[3])
4025 throw () __attribute__ ((__nonnull__ (1)));
4026
4027
4028 extern void srand48 (long int __seedval) throw ();
4029 extern unsigned short int *seed48 (unsigned short int __seed16v[3])
4030 throw () __attribute__ ((__nonnull__ (1)));
4031 extern void lcong48 (unsigned short int __param[7]) throw () __attribute__ ((__nonnull__ (1)));
4032
4033
4034
4035
4036
4037 struct drand48_data
4038 {
4039 unsigned short int __x[3];
4040 unsigned short int __old_x[3];
4041 unsigned short int __c;
4042 unsigned short int __init;
4043 unsigned long long int __a;
4044 };
4045
4046
4047 extern int drand48_r (struct drand48_data *__restrict __buffer,
4048 double *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2)));
4049 extern int erand48_r (unsigned short int __xsubi[3],
4050 struct drand48_data *__restrict __buffer,
4051 double *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2)));
4052
4053
4054 extern int lrand48_r (struct drand48_data *__restrict __buffer,
4055 long int *__restrict __result)
4056 throw () __attribute__ ((__nonnull__ (1, 2)));
4057 extern int nrand48_r (unsigned short int __xsubi[3],
4058 struct drand48_data *__restrict __buffer,
4059 long int *__restrict __result)
4060 throw () __attribute__ ((__nonnull__ (1, 2)));
4061
4062
4063 extern int mrand48_r (struct drand48_data *__restrict __buffer,
4064 long int *__restrict __result)
4065 throw () __attribute__ ((__nonnull__ (1, 2)));
4066 extern int jrand48_r (unsigned short int __xsubi[3],
4067 struct drand48_data *__restrict __buffer,
4068 long int *__restrict __result)
4069 throw () __attribute__ ((__nonnull__ (1, 2)));
4070
4071
4072 extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
4073 throw () __attribute__ ((__nonnull__ (2)));
4074
4075 extern int seed48_r (unsigned short int __seed16v[3],
4076 struct drand48_data *__buffer) throw () __attribute__ ((__nonnull__ (1, 2)));
4077
4078 extern int lcong48_r (unsigned short int __param[7],
4079 struct drand48_data *__buffer)
4080 throw () __attribute__ ((__nonnull__ (1, 2)));
4081
4082
4083
4084
4085
4086
4087 #define __malloc_and_calloc_defined
4088
4089
4090 extern void *malloc (size_t __size) throw () __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__));
4091
4092 extern void *calloc (size_t __nmemb, size_t __size)
4093 throw () __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__));
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104 extern void *realloc (void *__ptr, size_t __size)
4105 throw () __attribute__ ((__warn_unused_result__));
4106
4107 extern void free (void *__ptr) throw ();
4108
4109
4110
4111
4112 extern void cfree (void *__ptr) throw ();
4113
4114
4115
4116 # 1 "/usr/include/alloca.h" 1 3 4
4117 # 20 "/usr/include/alloca.h" 3 4
4118 #define _ALLOCA_H 1
4119
4120
4121
4122 #define __need_size_t
4123 # 1 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 1 3 4
4124 # 160 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
4125 #undef __need_ptrdiff_t
4126 # 233 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
4127 #undef __need_size_t
4128 # 342 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
4129 #undef __need_wchar_t
4130 # 395 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
4131 #undef NULL
4132
4133 #define NULL __null
4134 # 406 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
4135 #undef __need_NULL
4136
4137
4138
4139
4140 #define offsetof(TYPE,MEMBER) __builtin_offsetof (TYPE, MEMBER)
4141 # 26 "/usr/include/alloca.h" 2 3 4
4142
4143 extern "C" {
4144
4145
4146 #undef alloca
4147
4148
4149 extern void *alloca (size_t __size) throw ();
4150
4151
4152 #define alloca(size) __builtin_alloca (size)
4153
4154
4155 }
4156 # 498 "/usr/include/stdlib.h" 2 3 4
4157
4158
4159
4160
4161
4162 extern void *valloc (size_t __size) throw () __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__));
4163
4164
4165
4166
4167 extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
4168 throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
4169
4170
4171
4172
4173 extern void abort (void) throw () __attribute__ ((__noreturn__));
4174
4175
4176
4177 extern int atexit (void (*__func) (void)) throw () __attribute__ ((__nonnull__ (1)));
4178
4179
4180
4181
4182
4183
4184 extern "C++" int at_quick_exit (void (*__func) (void))
4185 throw () __asm ("at_quick_exit") __attribute__ ((__nonnull__ (1)));
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195 extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
4196 throw () __attribute__ ((__nonnull__ (1)));
4197
4198
4199
4200
4201
4202
4203 extern void exit (int __status) throw () __attribute__ ((__noreturn__));
4204
4205
4206
4207
4208
4209
4210
4211 extern void quick_exit (int __status) throw () __attribute__ ((__noreturn__));
4212
4213
4214
4215
4216
4217
4218
4219 extern void _Exit (int __status) throw () __attribute__ ((__noreturn__));
4220
4221
4222
4223
4224
4225
4226 extern char *getenv (__const char *__name) throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
4227
4228
4229
4230
4231 extern char *__secure_getenv (__const char *__name)
4232 throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
4233
4234
4235
4236
4237
4238 extern int putenv (char *__string) throw () __attribute__ ((__nonnull__ (1)));
4239
4240
4241
4242
4243
4244 extern int setenv (__const char *__name, __const char *__value, int __replace)
4245 throw () __attribute__ ((__nonnull__ (2)));
4246
4247
4248 extern int unsetenv (__const char *__name) throw () __attribute__ ((__nonnull__ (1)));
4249
4250
4251
4252
4253
4254
4255 extern int clearenv (void) throw ();
4256 # 606 "/usr/include/stdlib.h" 3 4
4257 extern char *mktemp (char *__template) throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
4258 # 620 "/usr/include/stdlib.h" 3 4
4259 extern int mkstemp (char *__template) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
4260 # 630 "/usr/include/stdlib.h" 3 4
4261 extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
4262 # 642 "/usr/include/stdlib.h" 3 4
4263 extern int mkstemps (char *__template, int __suffixlen) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
4264 # 652 "/usr/include/stdlib.h" 3 4
4265 extern int mkstemps64 (char *__template, int __suffixlen)
4266 __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
4267 # 663 "/usr/include/stdlib.h" 3 4
4268 extern char *mkdtemp (char *__template) throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
4269 # 674 "/usr/include/stdlib.h" 3 4
4270 extern int mkostemp (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
4271 # 684 "/usr/include/stdlib.h" 3 4
4272 extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
4273 # 694 "/usr/include/stdlib.h" 3 4
4274 extern int mkostemps (char *__template, int __suffixlen, int __flags)
4275 __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
4276 # 706 "/usr/include/stdlib.h" 3 4
4277 extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
4278 __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288 extern int system (__const char *__command) __attribute__ ((__warn_unused_result__));
4289
4290
4291
4292
4293
4294
4295 extern char *canonicalize_file_name (__const char *__name)
4296 throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
4297 # 734 "/usr/include/stdlib.h" 3 4
4298 extern char *realpath (__const char *__restrict __name,
4299 char *__restrict __resolved) throw () __attribute__ ((__warn_unused_result__));
4300
4301
4302
4303
4304
4305 #define __COMPAR_FN_T
4306 typedef int (*__compar_fn_t) (__const void *, __const void *);
4307
4308
4309 typedef __compar_fn_t comparison_fn_t;
4310
4311
4312
4313 typedef int (*__compar_d_fn_t) (__const void *, __const void *, void *);
4314
4315
4316
4317
4318
4319 extern void *bsearch (__const void *__key, __const void *__base,
4320 size_t __nmemb, size_t __size, __compar_fn_t __compar)
4321 __attribute__ ((__nonnull__ (1, 2, 5))) __attribute__ ((__warn_unused_result__));
4322
4323
4324
4325 extern void qsort (void *__base, size_t __nmemb, size_t __size,
4326 __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));
4327
4328 extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
4329 __compar_d_fn_t __compar, void *__arg)
4330 __attribute__ ((__nonnull__ (1, 4)));
4331
4332
4333
4334
4335 extern int abs (int __x) throw () __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__));
4336 extern long int labs (long int __x) throw () __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__));
4337
4338
4339
4340 __extension__ extern long long int llabs (long long int __x)
4341 throw () __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__));
4342
4343
4344
4345
4346
4347
4348
4349 extern div_t div (int __numer, int __denom)
4350 throw () __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__));
4351 extern ldiv_t ldiv (long int __numer, long int __denom)
4352 throw () __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__));
4353
4354
4355
4356
4357 __extension__ extern lldiv_t lldiv (long long int __numer,
4358 long long int __denom)
4359 throw () __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__));
4360
4361 # 808 "/usr/include/stdlib.h" 3 4
4362 extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
4363 int *__restrict __sign) throw () __attribute__ ((__nonnull__ (3, 4))) __attribute__ ((__warn_unused_result__));
4364
4365
4366
4367
4368 extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
4369 int *__restrict __sign) throw () __attribute__ ((__nonnull__ (3, 4))) __attribute__ ((__warn_unused_result__));
4370
4371
4372
4373
4374 extern char *gcvt (double __value, int __ndigit, char *__buf)
4375 throw () __attribute__ ((__nonnull__ (3))) __attribute__ ((__warn_unused_result__));
4376
4377
4378
4379
4380 extern char *qecvt (long double __value, int __ndigit,
4381 int *__restrict __decpt, int *__restrict __sign)
4382 throw () __attribute__ ((__nonnull__ (3, 4))) __attribute__ ((__warn_unused_result__));
4383 extern char *qfcvt (long double __value, int __ndigit,
4384 int *__restrict __decpt, int *__restrict __sign)
4385 throw () __attribute__ ((__nonnull__ (3, 4))) __attribute__ ((__warn_unused_result__));
4386 extern char *qgcvt (long double __value, int __ndigit, char *__buf)
4387 throw () __attribute__ ((__nonnull__ (3))) __attribute__ ((__warn_unused_result__));
4388
4389
4390
4391
4392 extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
4393 int *__restrict __sign, char *__restrict __buf,
4394 size_t __len) throw () __attribute__ ((__nonnull__ (3, 4, 5)));
4395 extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
4396 int *__restrict __sign, char *__restrict __buf,
4397 size_t __len) throw () __attribute__ ((__nonnull__ (3, 4, 5)));
4398
4399 extern int qecvt_r (long double __value, int __ndigit,
4400 int *__restrict __decpt, int *__restrict __sign,
4401 char *__restrict __buf, size_t __len)
4402 throw () __attribute__ ((__nonnull__ (3, 4, 5)));
4403 extern int qfcvt_r (long double __value, int __ndigit,
4404 int *__restrict __decpt, int *__restrict __sign,
4405 char *__restrict __buf, size_t __len)
4406 throw () __attribute__ ((__nonnull__ (3, 4, 5)));
4407
4408
4409
4410
4411
4412
4413
4414 extern int mblen (__const char *__s, size_t __n) throw () __attribute__ ((__warn_unused_result__));
4415
4416
4417 extern int mbtowc (wchar_t *__restrict __pwc,
4418 __const char *__restrict __s, size_t __n) throw () __attribute__ ((__warn_unused_result__));
4419
4420
4421 extern int wctomb (char *__s, wchar_t __wchar) throw () __attribute__ ((__warn_unused_result__));
4422
4423
4424
4425 extern size_t mbstowcs (wchar_t *__restrict __pwcs,
4426 __const char *__restrict __s, size_t __n) throw ();
4427
4428 extern size_t wcstombs (char *__restrict __s,
4429 __const wchar_t *__restrict __pwcs, size_t __n)
4430 throw ();
4431
4432
4433
4434
4435
4436
4437
4438
4439 extern int rpmatch (__const char *__response) throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
4440 # 896 "/usr/include/stdlib.h" 3 4
4441 extern int getsubopt (char **__restrict __optionp,
4442 char *__const *__restrict __tokens,
4443 char **__restrict __valuep)
4444 throw () __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__warn_unused_result__));
4445
4446
4447
4448
4449
4450 extern void setkey (__const char *__key) throw () __attribute__ ((__nonnull__ (1)));
4451
4452
4453
4454
4455
4456
4457
4458 extern int posix_openpt (int __oflag) __attribute__ ((__warn_unused_result__));
4459
4460
4461
4462
4463
4464
4465
4466 extern int grantpt (int __fd) throw ();
4467
4468
4469
4470 extern int unlockpt (int __fd) throw ();
4471
4472
4473
4474
4475 extern char *ptsname (int __fd) throw () __attribute__ ((__warn_unused_result__));
4476
4477
4478
4479
4480
4481
4482 extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
4483 throw () __attribute__ ((__nonnull__ (2)));
4484
4485
4486 extern int getpt (void);
4487
4488
4489
4490
4491
4492
4493 extern int getloadavg (double __loadavg[], int __nelem)
4494 throw () __attribute__ ((__nonnull__ (1)));
4495
4496
4497
4498
4499
4500 # 1 "/usr/include/bits/stdlib.h" 1 3 4
4501 # 24 "/usr/include/bits/stdlib.h" 3 4
4502 extern char *__realpath_chk (__const char *__restrict __name,
4503 char *__restrict __resolved,
4504 size_t __resolvedlen) throw () __attribute__ ((__warn_unused_result__));
4505 extern char *__realpath_alias (__const char *__restrict __name, char *__restrict __resolved) throw () __asm__ ("" "realpath")
4506
4507 __attribute__ ((__warn_unused_result__));
4508 extern char *__realpath_chk_warn (__const char *__restrict __name, char *__restrict __resolved, size_t __resolvedlen) throw () __asm__ ("" "__realpath_chk")
4509
4510
4511 __attribute__ ((__warn_unused_result__))
4512 __attribute__((__warning__ ("second argument of realpath must be either NULL or at " "least PATH_MAX bytes long buffer")))
4513 ;
4514
4515 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__warn_unused_result__)) char *
4516 realpath (__const char *__restrict __name, char *__restrict __resolved) throw ()
4517 {
4518 if (__builtin_object_size (__resolved, 2 > 1) != (size_t) -1)
4519 {
4520
4521
4522
4523
4524 return __realpath_chk (__name, __resolved, __builtin_object_size (__resolved, 2 > 1));
4525 }
4526
4527 return __realpath_alias (__name, __resolved);
4528 }
4529
4530
4531 extern int __ptsname_r_chk (int __fd, char *__buf, size_t __buflen,
4532 size_t __nreal) throw () __attribute__ ((__nonnull__ (2)));
4533 extern int __ptsname_r_alias (int __fd, char *__buf, size_t __buflen) throw () __asm__ ("" "ptsname_r")
4534
4535 __attribute__ ((__nonnull__ (2)));
4536 extern int __ptsname_r_chk_warn (int __fd, char *__buf, size_t __buflen, size_t __nreal) throw () __asm__ ("" "__ptsname_r_chk")
4537
4538
4539 __attribute__ ((__nonnull__ (2))) __attribute__((__warning__ ("ptsname_r called with buflen bigger than " "size of buf")))
4540 ;
4541
4542 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) int
4543 ptsname_r (int __fd, char *__buf, size_t __buflen) throw ()
4544 {
4545 if (__builtin_object_size (__buf, 2 > 1) != (size_t) -1)
4546 {
4547 if (!__builtin_constant_p (__buflen))
4548 return __ptsname_r_chk (__fd, __buf, __buflen, __builtin_object_size (__buf, 2 > 1));
4549 if (__buflen > __builtin_object_size (__buf, 2 > 1))
4550 return __ptsname_r_chk_warn (__fd, __buf, __buflen, __builtin_object_size (__buf, 2 > 1));
4551 }
4552 return __ptsname_r_alias (__fd, __buf, __buflen);
4553 }
4554
4555
4556 extern int __wctomb_chk (char *__s, wchar_t __wchar, size_t __buflen)
4557 throw () __attribute__ ((__warn_unused_result__));
4558 extern int __wctomb_alias (char *__s, wchar_t __wchar) throw () __asm__ ("" "wctomb")
4559 __attribute__ ((__warn_unused_result__));
4560
4561 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __attribute__ ((__warn_unused_result__)) int
4562 wctomb (char *__s, wchar_t __wchar) throw ()
4563 {
4564
4565
4566
4567 #define __STDLIB_MB_LEN_MAX 16
4568
4569
4570
4571 if (__builtin_object_size (__s, 2 > 1) != (size_t) -1 && 16 > __builtin_object_size (__s, 2 > 1))
4572 return __wctomb_chk (__s, __wchar, __builtin_object_size (__s, 2 > 1));
4573 return __wctomb_alias (__s, __wchar);
4574 }
4575
4576
4577 extern size_t __mbstowcs_chk (wchar_t *__restrict __dst,
4578 __const char *__restrict __src,
4579 size_t __len, size_t __dstlen) throw ();
4580 extern size_t __mbstowcs_alias (wchar_t *__restrict __dst, __const char *__restrict __src, size_t __len) throw () __asm__ ("" "mbstowcs")
4581
4582
4583 ;
4584 extern size_t __mbstowcs_chk_warn (wchar_t *__restrict __dst, __const char *__restrict __src, size_t __len, size_t __dstlen) throw () __asm__ ("" "__mbstowcs_chk")
4585
4586
4587
4588 __attribute__((__warning__ ("mbstowcs called with dst buffer smaller than len " "* sizeof (wchar_t)")))
4589 ;
4590
4591 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) size_t
4592 mbstowcs (wchar_t *__restrict __dst, __const char *__restrict __src, size_t __len) throw ()
4593
4594 {
4595 if (__builtin_object_size (__dst, 2 > 1) != (size_t) -1)
4596 {
4597 if (!__builtin_constant_p (__len))
4598 return __mbstowcs_chk (__dst, __src, __len,
4599 __builtin_object_size (__dst, 2 > 1) / sizeof (wchar_t));
4600
4601 if (__len > __builtin_object_size (__dst, 2 > 1) / sizeof (wchar_t))
4602 return __mbstowcs_chk_warn (__dst, __src, __len,
4603 __builtin_object_size (__dst, 2 > 1) / sizeof (wchar_t));
4604 }
4605 return __mbstowcs_alias (__dst, __src, __len);
4606 }
4607
4608
4609 extern size_t __wcstombs_chk (char *__restrict __dst,
4610 __const wchar_t *__restrict __src,
4611 size_t __len, size_t __dstlen) throw ();
4612 extern size_t __wcstombs_alias (char *__restrict __dst, __const wchar_t *__restrict __src, size_t __len) throw () __asm__ ("" "wcstombs")
4613
4614
4615 ;
4616 extern size_t __wcstombs_chk_warn (char *__restrict __dst, __const wchar_t *__restrict __src, size_t __len, size_t __dstlen) throw () __asm__ ("" "__wcstombs_chk")
4617
4618
4619
4620 __attribute__((__warning__ ("wcstombs called with dst buffer smaller than len")));
4621
4622 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) size_t
4623 wcstombs (char *__restrict __dst, __const wchar_t *__restrict __src, size_t __len) throw ()
4624
4625 {
4626 if (__builtin_object_size (__dst, 2 > 1) != (size_t) -1)
4627 {
4628 if (!__builtin_constant_p (__len))
4629 return __wcstombs_chk (__dst, __src, __len, __builtin_object_size (__dst, 2 > 1));
4630 if (__len > __builtin_object_size (__dst, 2 > 1))
4631 return __wcstombs_chk_warn (__dst, __src, __len, __builtin_object_size (__dst, 2 > 1));
4632 }
4633 return __wcstombs_alias (__dst, __src, __len);
4634 }
4635 # 956 "/usr/include/stdlib.h" 2 3 4
4636
4637
4638
4639
4640
4641
4642 #undef __need_malloc_and_calloc
4643
4644 }
4645 # 18 "./../../dist/include/mozilla/Assertions.h" 2
4646
4647 # 1 "/usr/include/signal.h" 1 3 4
4648 # 26 "/usr/include/signal.h" 3 4
4649 #define _SIGNAL_H
4650
4651
4652
4653
4654 extern "C" {
4655
4656 # 1 "/usr/include/bits/sigset.h" 1 3 4
4657 # 44 "/usr/include/bits/sigset.h" 3 4
4658 #define _SIGSET_H_fns 1
4659
4660
4661 #define _EXTERN_INLINE __extern_inline
4662
4663
4664
4665 #define __sigmask(sig) (((unsigned long int) 1) << (((sig) - 1) % (8 * sizeof (unsigned long int))))
4666
4667
4668
4669 #define __sigword(sig) (((sig) - 1) / (8 * sizeof (unsigned long int)))
4670
4671
4672 #define __sigemptyset(set) (__extension__ ({ int __cnt = _SIGSET_NWORDS; sigset_t *__set = (set); while (--__cnt >= 0) __set->__val[__cnt] = 0; 0; }))
4673
4674
4675
4676
4677 #define __sigfillset(set) (__extension__ ({ int __cnt = _SIGSET_NWORDS; sigset_t *__set = (set); while (--__cnt >= 0) __set->__val[__cnt] = ~0UL; 0; }))
4678 # 73 "/usr/include/bits/sigset.h" 3 4
4679 #define __sigisemptyset(set) (__extension__ ({ int __cnt = _SIGSET_NWORDS; const sigset_t *__set = (set); int __ret = __set->__val[--__cnt]; while (!__ret && --__cnt >= 0) __ret = __set->__val[__cnt]; __ret == 0; }))
4680
4681
4682
4683
4684
4685
4686 #define __sigandset(dest,left,right) (__extension__ ({ int __cnt = _SIGSET_NWORDS; sigset_t *__dest = (dest); const sigset_t *__left = (left); const sigset_t *__right = (right); while (--__cnt >= 0) __dest->__val[__cnt] = (__left->__val[__cnt] & __right->__val[__cnt]); 0; }))
4687 # 89 "/usr/include/bits/sigset.h" 3 4
4688 #define __sigorset(dest,left,right) (__extension__ ({ int __cnt = _SIGSET_NWORDS; sigset_t *__dest = (dest); const sigset_t *__left = (left); const sigset_t *__right = (right); while (--__cnt >= 0) __dest->__val[__cnt] = (__left->__val[__cnt] | __right->__val[__cnt]); 0; }))
4689 # 104 "/usr/include/bits/sigset.h" 3 4
4690 extern int __sigismember (__const __sigset_t *, int);
4691 extern int __sigaddset (__sigset_t *, int);
4692 extern int __sigdelset (__sigset_t *, int);
4693
4694
4695 #define __SIGSETFN(NAME,BODY,CONST) _EXTERN_INLINE int NAME (CONST __sigset_t *__set, int __sig) { unsigned long int __mask = __sigmask (__sig); unsigned long int __word = __sigword (__sig); return BODY; }
4696 # 118 "/usr/include/bits/sigset.h" 3 4
4697 extern __inline __attribute__ ((__gnu_inline__)) int __sigismember (__const __sigset_t *__set, int __sig) { unsigned long int __mask = (((unsigned long int) 1) << (((__sig) - 1) % (8 * sizeof (unsigned long int)))); unsigned long int __word = (((__sig) - 1) / (8 * sizeof (unsigned long int))); return (__set->__val[__word] & __mask) ? 1 : 0; }
4698 extern __inline __attribute__ ((__gnu_inline__)) int __sigaddset ( __sigset_t *__set, int __sig) { unsigned long int __mask = (((unsigned long int) 1) << (((__sig) - 1) % (8 * sizeof (unsigned long int)))); unsigned long int __word = (((__sig) - 1) / (8 * sizeof (unsigned long int))); return ((__set->__val[__word] |= __mask), 0); }
4699 extern __inline __attribute__ ((__gnu_inline__)) int __sigdelset ( __sigset_t *__set, int __sig) { unsigned long int __mask = (((unsigned long int) 1) << (((__sig) - 1) % (8 * sizeof (unsigned long int)))); unsigned long int __word = (((__sig) - 1) / (8 * sizeof (unsigned long int))); return ((__set->__val[__word] &= ~__mask), 0); }
4700
4701 #undef __SIGSETFN
4702 # 34 "/usr/include/signal.h" 2 3 4
4703
4704
4705
4706
4707
4708 #define __sig_atomic_t_defined
4709
4710 typedef __sig_atomic_t sig_atomic_t;
4711
4712
4713 #undef __need_sig_atomic_t
4714
4715
4716
4717
4718
4719
4720
4721 #undef __need_sigset_t
4722
4723
4724
4725
4726
4727 # 1 "/usr/include/bits/signum.h" 1 3 4
4728 # 23 "/usr/include/bits/signum.h" 3 4
4729 #define SIG_ERR ((__sighandler_t) -1)
4730 #define SIG_DFL ((__sighandler_t) 0)
4731 #define SIG_IGN ((__sighandler_t) 1)
4732
4733
4734 #define SIG_HOLD ((__sighandler_t) 2)
4735
4736
4737
4738
4739 #define SIGHUP 1
4740 #define SIGINT 2
4741 #define SIGQUIT 3
4742 #define SIGILL 4
4743 #define SIGTRAP 5
4744 #define SIGABRT 6
4745 #define SIGIOT 6
4746 #define SIGBUS 7
4747 #define SIGFPE 8
4748 #define SIGKILL 9
4749 #define SIGUSR1 10
4750 #define SIGSEGV 11
4751 #define SIGUSR2 12
4752 #define SIGPIPE 13
4753 #define SIGALRM 14
4754 #define SIGTERM 15
4755 #define SIGSTKFLT 16
4756 #define SIGCLD SIGCHLD
4757 #define SIGCHLD 17
4758 #define SIGCONT 18
4759 #define SIGSTOP 19
4760 #define SIGTSTP 20
4761 #define SIGTTIN 21
4762 #define SIGTTOU 22
4763 #define SIGURG 23
4764 #define SIGXCPU 24
4765 #define SIGXFSZ 25
4766 #define SIGVTALRM 26
4767 #define SIGPROF 27
4768 #define SIGWINCH 28
4769 #define SIGPOLL SIGIO
4770 #define SIGIO 29
4771 #define SIGPWR 30
4772 #define SIGSYS 31
4773 #define SIGUNUSED 31
4774
4775 #define _NSIG 65
4776
4777
4778 #define SIGRTMIN (__libc_current_sigrtmin ())
4779 #define SIGRTMAX (__libc_current_sigrtmax ())
4780
4781
4782
4783 #define __SIGRTMIN 32
4784 #define __SIGRTMAX (_NSIG - 1)
4785 # 59 "/usr/include/signal.h" 2 3 4
4786 # 75 "/usr/include/signal.h" 3 4
4787 #define __need_timespec
4788 # 1 "/usr/include/time.h" 1 3 4
4789 # 67 "/usr/include/time.h" 3 4
4790 #undef __need_clock_t
4791 # 83 "/usr/include/time.h" 3 4
4792 #undef __need_time_t
4793 # 95 "/usr/include/time.h" 3 4
4794 #undef __clockid_time_t
4795 # 107 "/usr/include/time.h" 3 4
4796 #undef __need_timer_t
4797 # 127 "/usr/include/time.h" 3 4
4798 #undef __need_timespec
4799 # 77 "/usr/include/signal.h" 2 3 4
4800
4801
4802 # 1 "/usr/include/bits/siginfo.h" 1 3 4
4803 # 25 "/usr/include/bits/siginfo.h" 3 4
4804 # 1 "/usr/include/bits/wordsize.h" 1 3 4
4805 # 19 "/usr/include/bits/wordsize.h" 3 4
4806 #define __WORDSIZE 32
4807 # 26 "/usr/include/bits/siginfo.h" 2 3 4
4808
4809
4810
4811
4812 #define __have_sigval_t 1
4813
4814
4815 typedef union sigval
4816 {
4817 int sival_int;
4818 void *sival_ptr;
4819 } sigval_t;
4820
4821
4822
4823
4824 #define __have_siginfo_t 1
4825
4826 #define __SI_MAX_SIZE 128
4827
4828
4829
4830 #define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 3)
4831
4832
4833 typedef struct siginfo
4834 {
4835 int si_signo;
4836 int si_errno;
4837
4838 int si_code;
4839
4840 union
4841 {
4842 int _pad[((128 / sizeof (int)) - 3)];
4843
4844
4845 struct
4846 {
4847 __pid_t si_pid;
4848 __uid_t si_uid;
4849 } _kill;
4850
4851
4852 struct
4853 {
4854 int si_tid;
4855 int si_overrun;
4856 sigval_t si_sigval;
4857 } _timer;
4858
4859
4860 struct
4861 {
4862 __pid_t si_pid;
4863 __uid_t si_uid;
4864 sigval_t si_sigval;
4865 } _rt;
4866
4867
4868 struct
4869 {
4870 __pid_t si_pid;
4871 __uid_t si_uid;
4872 int si_status;
4873 __clock_t si_utime;
4874 __clock_t si_stime;
4875 } _sigchld;
4876
4877
4878 struct
4879 {
4880 void *si_addr;
4881 } _sigfault;
4882
4883
4884 struct
4885 {
4886 long int si_band;
4887 int si_fd;
4888 } _sigpoll;
4889 } _sifields;
4890 } siginfo_t;
4891
4892
4893
4894 #define si_pid _sifields._kill.si_pid
4895 #define si_uid _sifields._kill.si_uid
4896 #define si_timerid _sifields._timer.si_tid
4897 #define si_overrun _sifields._timer.si_overrun
4898 #define si_status _sifields._sigchld.si_status
4899 #define si_utime _sifields._sigchld.si_utime
4900 #define si_stime _sifields._sigchld.si_stime
4901 #define si_value _sifields._rt.si_sigval
4902 #define si_int _sifields._rt.si_sigval.sival_int
4903 #define si_ptr _sifields._rt.si_sigval.sival_ptr
4904 #define si_addr _sifields._sigfault.si_addr
4905 #define si_band _sifields._sigpoll.si_band
4906 #define si_fd _sifields._sigpoll.si_fd
4907
4908
4909
4910
4911 enum
4912 {
4913 SI_ASYNCNL = -60,
4914 #define SI_ASYNCNL SI_ASYNCNL
4915 SI_TKILL = -6,
4916 #define SI_TKILL SI_TKILL
4917 SI_SIGIO,
4918 #define SI_SIGIO SI_SIGIO
4919 SI_ASYNCIO,
4920 #define SI_ASYNCIO SI_ASYNCIO
4921 SI_MESGQ,
4922 #define SI_MESGQ SI_MESGQ
4923 SI_TIMER,
4924 #define SI_TIMER SI_TIMER
4925 SI_QUEUE,
4926 #define SI_QUEUE SI_QUEUE
4927 SI_USER,
4928 #define SI_USER SI_USER
4929 SI_KERNEL = 0x80
4930 #define SI_KERNEL SI_KERNEL
4931 };
4932
4933
4934
4935 enum
4936 {
4937 ILL_ILLOPC = 1,
4938 #define ILL_ILLOPC ILL_ILLOPC
4939 ILL_ILLOPN,
4940 #define ILL_ILLOPN ILL_ILLOPN
4941 ILL_ILLADR,
4942 #define ILL_ILLADR ILL_ILLADR
4943 ILL_ILLTRP,
4944 #define ILL_ILLTRP ILL_ILLTRP
4945 ILL_PRVOPC,
4946 #define ILL_PRVOPC ILL_PRVOPC
4947 ILL_PRVREG,
4948 #define ILL_PRVREG ILL_PRVREG
4949 ILL_COPROC,
4950 #define ILL_COPROC ILL_COPROC
4951 ILL_BADSTK
4952 #define ILL_BADSTK ILL_BADSTK
4953 };
4954
4955
4956 enum
4957 {
4958 FPE_INTDIV = 1,
4959 #define FPE_INTDIV FPE_INTDIV
4960 FPE_INTOVF,
4961 #define FPE_INTOVF FPE_INTOVF
4962 FPE_FLTDIV,
4963 #define FPE_FLTDIV FPE_FLTDIV
4964 FPE_FLTOVF,
4965 #define FPE_FLTOVF FPE_FLTOVF
4966 FPE_FLTUND,
4967 #define FPE_FLTUND FPE_FLTUND
4968 FPE_FLTRES,
4969 #define FPE_FLTRES FPE_FLTRES
4970 FPE_FLTINV,
4971 #define FPE_FLTINV FPE_FLTINV
4972 FPE_FLTSUB
4973 #define FPE_FLTSUB FPE_FLTSUB
4974 };
4975
4976
4977 enum
4978 {
4979 SEGV_MAPERR = 1,
4980 #define SEGV_MAPERR SEGV_MAPERR
4981 SEGV_ACCERR
4982 #define SEGV_ACCERR SEGV_ACCERR
4983 };
4984
4985
4986 enum
4987 {
4988 BUS_ADRALN = 1,
4989 #define BUS_ADRALN BUS_ADRALN
4990 BUS_ADRERR,
4991 #define BUS_ADRERR BUS_ADRERR
4992 BUS_OBJERR
4993 #define BUS_OBJERR BUS_OBJERR
4994 };
4995
4996
4997 enum
4998 {
4999 TRAP_BRKPT = 1,
5000 #define TRAP_BRKPT TRAP_BRKPT
5001 TRAP_TRACE
5002 #define TRAP_TRACE TRAP_TRACE
5003 };
5004
5005
5006 enum
5007 {
5008 CLD_EXITED = 1,
5009 #define CLD_EXITED CLD_EXITED
5010 CLD_KILLED,
5011 #define CLD_KILLED CLD_KILLED
5012 CLD_DUMPED,
5013 #define CLD_DUMPED CLD_DUMPED
5014 CLD_TRAPPED,
5015 #define CLD_TRAPPED CLD_TRAPPED
5016 CLD_STOPPED,
5017 #define CLD_STOPPED CLD_STOPPED
5018 CLD_CONTINUED
5019 #define CLD_CONTINUED CLD_CONTINUED
5020 };
5021
5022
5023 enum
5024 {
5025 POLL_IN = 1,
5026 #define POLL_IN POLL_IN
5027 POLL_OUT,
5028 #define POLL_OUT POLL_OUT
5029 POLL_MSG,
5030 #define POLL_MSG POLL_MSG
5031 POLL_ERR,
5032 #define POLL_ERR POLL_ERR
5033 POLL_PRI,
5034 #define POLL_PRI POLL_PRI
5035 POLL_HUP
5036 #define POLL_HUP POLL_HUP
5037 };
5038
5039 #undef __need_siginfo_t
5040
5041
5042
5043
5044
5045 #define __have_sigevent_t 1
5046
5047
5048 #define __SIGEV_MAX_SIZE 64
5049
5050
5051
5052 #define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 3)
5053
5054
5055 typedef struct sigevent
5056 {
5057 sigval_t sigev_value;
5058 int sigev_signo;
5059 int sigev_notify;
5060
5061 union
5062 {
5063 int _pad[((64 / sizeof (int)) - 3)];
5064
5065
5066
5067 __pid_t _tid;
5068
5069 struct
5070 {
5071 void (*_function) (sigval_t);
5072 void *_attribute;
5073 } _sigev_thread;
5074 } _sigev_un;
5075 } sigevent_t;
5076
5077
5078 #define sigev_notify_function _sigev_un._sigev_thread._function
5079 #define sigev_notify_attributes _sigev_un._sigev_thread._attribute
5080
5081
5082 enum
5083 {
5084 SIGEV_SIGNAL = 0,
5085 #define SIGEV_SIGNAL SIGEV_SIGNAL
5086 SIGEV_NONE,
5087 #define SIGEV_NONE SIGEV_NONE
5088 SIGEV_THREAD,
5089 #define SIGEV_THREAD SIGEV_THREAD
5090
5091 SIGEV_THREAD_ID = 4
5092 #define SIGEV_THREAD_ID SIGEV_THREAD_ID
5093 };
5094 # 80 "/usr/include/signal.h" 2 3 4
5095
5096
5097
5098
5099 typedef void (*__sighandler_t) (int);
5100
5101
5102
5103
5104 extern __sighandler_t __sysv_signal (int __sig, __sighandler_t __handler)
5105 throw ();
5106
5107 extern __sighandler_t sysv_signal (int __sig, __sighandler_t __handler)
5108 throw ();
5109
5110
5111
5112
5113
5114
5115
5116 extern __sighandler_t signal (int __sig, __sighandler_t __handler)
5117 throw ();
5118 # 113 "/usr/include/signal.h" 3 4
5119
5120
5121
5122
5123
5124 extern __sighandler_t bsd_signal (int __sig, __sighandler_t __handler)
5125 throw ();
5126
5127
5128
5129
5130
5131
5132 extern int kill (__pid_t __pid, int __sig) throw ();
5133
5134
5135
5136
5137
5138
5139 extern int killpg (__pid_t __pgrp, int __sig) throw ();
5140
5141
5142
5143
5144 extern int raise (int __sig) throw ();
5145
5146
5147
5148
5149 extern __sighandler_t ssignal (int __sig, __sighandler_t __handler)
5150 throw ();
5151 extern int gsignal (int __sig) throw ();
5152
5153
5154
5155
5156 extern void psignal (int __sig, __const char *__s);
5157
5158
5159
5160
5161 extern void psiginfo (__const siginfo_t *__pinfo, __const char *__s);
5162 # 168 "/usr/include/signal.h" 3 4
5163 extern int __sigpause (int __sig_or_mask, int __is_sig);
5164 # 177 "/usr/include/signal.h" 3 4
5165 extern int sigpause (int __sig) __asm__ ("__xpg_sigpause");
5166 # 193 "/usr/include/signal.h" 3 4
5167 #define sigmask(sig) __sigmask(sig)
5168
5169
5170 extern int sigblock (int __mask) throw () __attribute__ ((__deprecated__));
5171
5172
5173 extern int sigsetmask (int __mask) throw () __attribute__ ((__deprecated__));
5174
5175
5176 extern int siggetmask (void) throw () __attribute__ ((__deprecated__));
5177
5178
5179
5180
5181 #define NSIG _NSIG
5182
5183
5184
5185 typedef __sighandler_t sighandler_t;
5186
5187
5188
5189
5190 typedef __sighandler_t sig_t;
5191
5192
5193
5194
5195
5196 extern int sigemptyset (sigset_t *__set) throw () __attribute__ ((__nonnull__ (1)));
5197
5198
5199 extern int sigfillset (sigset_t *__set) throw () __attribute__ ((__nonnull__ (1)));
5200
5201
5202 extern int sigaddset (sigset_t *__set, int __signo) throw () __attribute__ ((__nonnull__ (1)));
5203
5204
5205 extern int sigdelset (sigset_t *__set, int __signo) throw () __attribute__ ((__nonnull__ (1)));
5206
5207
5208 extern int sigismember (__const sigset_t *__set, int __signo)
5209 throw () __attribute__ ((__nonnull__ (1)));
5210
5211
5212
5213 extern int sigisemptyset (__const sigset_t *__set) throw () __attribute__ ((__nonnull__ (1)));
5214
5215
5216 extern int sigandset (sigset_t *__set, __const sigset_t *__left,
5217 __const sigset_t *__right) throw () __attribute__ ((__nonnull__ (1, 2, 3)));
5218
5219
5220 extern int sigorset (sigset_t *__set, __const sigset_t *__left,
5221 __const sigset_t *__right) throw () __attribute__ ((__nonnull__ (1, 2, 3)));
5222
5223
5224
5225
5226 # 1 "/usr/include/bits/sigaction.h" 1 3 4
5227 # 25 "/usr/include/bits/sigaction.h" 3 4
5228 struct sigaction
5229 {
5230
5231
5232 union
5233 {
5234
5235 __sighandler_t sa_handler;
5236
5237 void (*sa_sigaction) (int, siginfo_t *, void *);
5238 }
5239 __sigaction_handler;
5240 #define sa_handler __sigaction_handler.sa_handler
5241 #define sa_sigaction __sigaction_handler.sa_sigaction
5242
5243
5244
5245
5246
5247 __sigset_t sa_mask;
5248
5249
5250 int sa_flags;
5251
5252
5253 void (*sa_restorer) (void);
5254 };
5255
5256
5257 #define SA_NOCLDSTOP 1
5258 #define SA_NOCLDWAIT 2
5259 #define SA_SIGINFO 4
5260
5261
5262 #define SA_ONSTACK 0x08000000
5263
5264
5265 #define SA_RESTART 0x10000000
5266 #define SA_NODEFER 0x40000000
5267
5268 #define SA_RESETHAND 0x80000000
5269
5270
5271 #define SA_INTERRUPT 0x20000000
5272
5273
5274 #define SA_NOMASK SA_NODEFER
5275 #define SA_ONESHOT SA_RESETHAND
5276 #define SA_STACK SA_ONSTACK
5277
5278
5279
5280 #define SIG_BLOCK 0
5281 #define SIG_UNBLOCK 1
5282 #define SIG_SETMASK 2
5283 # 253 "/usr/include/signal.h" 2 3 4
5284
5285
5286 extern int sigprocmask (int __how, __const sigset_t *__restrict __set,
5287 sigset_t *__restrict __oset) throw ();
5288
5289
5290
5291
5292
5293
5294 extern int sigsuspend (__const sigset_t *__set) __attribute__ ((__nonnull__ (1)));
5295
5296
5297 extern int sigaction (int __sig, __const struct sigaction *__restrict __act,
5298 struct sigaction *__restrict __oact) throw ();
5299
5300
5301 extern int sigpending (sigset_t *__set) throw () __attribute__ ((__nonnull__ (1)));
5302
5303
5304
5305
5306
5307
5308 extern int sigwait (__const sigset_t *__restrict __set, int *__restrict __sig)
5309 __attribute__ ((__nonnull__ (1, 2)));
5310
5311
5312
5313
5314
5315
5316 extern int sigwaitinfo (__const sigset_t *__restrict __set,
5317 siginfo_t *__restrict __info) __attribute__ ((__nonnull__ (1)));
5318
5319
5320
5321
5322
5323
5324 extern int sigtimedwait (__const sigset_t *__restrict __set,
5325 siginfo_t *__restrict __info,
5326 __const struct timespec *__restrict __timeout)
5327 __attribute__ ((__nonnull__ (1)));
5328
5329
5330
5331 extern int sigqueue (__pid_t __pid, int __sig, __const union sigval __val)
5332 throw ();
5333 # 310 "/usr/include/signal.h" 3 4
5334 extern __const char *__const _sys_siglist[65];
5335 extern __const char *__const sys_siglist[65];
5336
5337
5338 struct sigvec
5339 {
5340 __sighandler_t sv_handler;
5341 int sv_mask;
5342
5343 int sv_flags;
5344 #define sv_onstack sv_flags
5345 };
5346
5347
5348 #define SV_ONSTACK (1 << 0)
5349 #define SV_INTERRUPT (1 << 1)
5350 #define SV_RESETHAND (1 << 2)
5351
5352
5353
5354
5355
5356
5357
5358 extern int sigvec (int __sig, __const struct sigvec *__vec,
5359 struct sigvec *__ovec) throw ();
5360
5361
5362
5363 # 1 "/usr/include/bits/sigcontext.h" 1 3 4
5364 # 26 "/usr/include/bits/sigcontext.h" 3 4
5365 #define sigcontext_struct sigcontext
5366
5367 # 1 "/usr/include/asm/sigcontext.h" 1 3 4
5368
5369 #define _ASMARM_SIGCONTEXT_H
5370
5371
5372
5373
5374
5375
5376 struct sigcontext {
5377 unsigned long trap_no;
5378 unsigned long error_code;
5379 unsigned long oldmask;
5380 unsigned long arm_r0;
5381 unsigned long arm_r1;
5382 unsigned long arm_r2;
5383 unsigned long arm_r3;
5384 unsigned long arm_r4;
5385 unsigned long arm_r5;
5386 unsigned long arm_r6;
5387 unsigned long arm_r7;
5388 unsigned long arm_r8;
5389 unsigned long arm_r9;
5390 unsigned long arm_r10;
5391 unsigned long arm_fp;
5392 unsigned long arm_ip;
5393 unsigned long arm_sp;
5394 unsigned long arm_lr;
5395 unsigned long arm_pc;
5396 unsigned long arm_cpsr;
5397 unsigned long fault_address;
5398 };
5399 # 29 "/usr/include/bits/sigcontext.h" 2 3 4
5400
5401
5402 #define __need_NULL
5403 # 1 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 1 3 4
5404 # 160 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
5405 #undef __need_ptrdiff_t
5406 # 233 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
5407 #undef __need_size_t
5408 # 342 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
5409 #undef __need_wchar_t
5410 # 395 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
5411 #undef NULL
5412
5413 #define NULL __null
5414 # 406 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
5415 #undef __need_NULL
5416
5417
5418
5419
5420 #define offsetof(TYPE,MEMBER) __builtin_offsetof (TYPE, MEMBER)
5421 # 33 "/usr/include/bits/sigcontext.h" 2 3 4
5422 # 340 "/usr/include/signal.h" 2 3 4
5423
5424
5425 extern int sigreturn (struct sigcontext *__scp) throw ();
5426
5427
5428
5429
5430
5431 #define __need_size_t
5432 # 1 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 1 3 4
5433 # 160 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
5434 #undef __need_ptrdiff_t
5435 # 233 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
5436 #undef __need_size_t
5437 # 342 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
5438 #undef __need_wchar_t
5439 # 395 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
5440 #undef NULL
5441
5442 #define NULL __null
5443 # 406 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
5444 #undef __need_NULL
5445
5446
5447
5448
5449 #define offsetof(TYPE,MEMBER) __builtin_offsetof (TYPE, MEMBER)
5450 # 350 "/usr/include/signal.h" 2 3 4
5451
5452
5453
5454
5455 extern int siginterrupt (int __sig, int __interrupt) throw ();
5456
5457 # 1 "/usr/include/bits/sigstack.h" 1 3 4
5458 # 26 "/usr/include/bits/sigstack.h" 3 4
5459 struct sigstack
5460 {
5461 void *ss_sp;
5462 int ss_onstack;
5463 };
5464
5465
5466
5467 enum
5468 {
5469 SS_ONSTACK = 1,
5470 #define SS_ONSTACK SS_ONSTACK
5471 SS_DISABLE
5472 #define SS_DISABLE SS_DISABLE
5473 };
5474
5475
5476 #define MINSIGSTKSZ 2048
5477
5478
5479 #define SIGSTKSZ 8192
5480
5481
5482
5483 typedef struct sigaltstack
5484 {
5485 void *ss_sp;
5486 int ss_flags;
5487 size_t ss_size;
5488 } stack_t;
5489 # 357 "/usr/include/signal.h" 2 3 4
5490
5491
5492 # 1 "/usr/include/sys/ucontext.h" 1 3 4
5493 # 22 "/usr/include/sys/ucontext.h" 3 4
5494 #define _SYS_UCONTEXT_H 1
5495
5496
5497 # 1 "/usr/include/signal.h" 1 3 4
5498 # 26 "/usr/include/sys/ucontext.h" 2 3 4
5499
5500
5501
5502 # 1 "/usr/include/bits/sigcontext.h" 1 3 4
5503 # 30 "/usr/include/sys/ucontext.h" 2 3 4
5504
5505 typedef int greg_t;
5506
5507
5508 #define NGREG 18
5509
5510
5511 typedef greg_t gregset_t[18];
5512
5513
5514 enum
5515 {
5516 REG_R0 = 0,
5517 #define REG_R0 REG_R0
5518 REG_R1 = 1,
5519 #define REG_R1 REG_R1
5520 REG_R2 = 2,
5521 #define REG_R2 REG_R2
5522 REG_R3 = 3,
5523 #define REG_R3 REG_R3
5524 REG_R4 = 4,
5525 #define REG_R4 REG_R4
5526 REG_R5 = 5,
5527 #define REG_R5 REG_R5
5528 REG_R6 = 6,
5529 #define REG_R6 REG_R6
5530 REG_R7 = 7,
5531 #define REG_R7 REG_R7
5532 REG_R8 = 8,
5533 #define REG_R8 REG_R8
5534 REG_R9 = 9,
5535 #define REG_R9 REG_R9
5536 REG_R10 = 10,
5537 #define REG_R10 REG_R10
5538 REG_R11 = 11,
5539 #define REG_R11 REG_R11
5540 REG_R12 = 12,
5541 #define REG_R12 REG_R12
5542 REG_R13 = 13,
5543 #define REG_R13 REG_R13
5544 REG_R14 = 14,
5545 #define REG_R14 REG_R14
5546 REG_R15 = 15
5547 #define REG_R15 REG_R15
5548 };
5549
5550 struct _libc_fpstate
5551 {
5552 struct
5553 {
5554 unsigned int sign1:1;
5555 unsigned int unused:15;
5556 unsigned int sign2:1;
5557 unsigned int exponent:14;
5558 unsigned int j:1;
5559 unsigned int mantissa1:31;
5560 unsigned int mantissa0:32;
5561 } fpregs[8];
5562 unsigned int fpsr:32;
5563 unsigned int fpcr:32;
5564 unsigned char ftype[8];
5565 unsigned int init_flag;
5566 };
5567
5568 typedef struct _libc_fpstate fpregset_t;
5569
5570
5571
5572
5573
5574 typedef struct sigcontext mcontext_t;
5575
5576
5577 typedef struct ucontext
5578 {
5579 unsigned long uc_flags;
5580 struct ucontext *uc_link;
5581 stack_t uc_stack;
5582 mcontext_t uc_mcontext;
5583 __sigset_t uc_sigmask;
5584 unsigned long uc_regspace[128] __attribute__((__aligned__(8)));
5585 } ucontext_t;
5586 # 360 "/usr/include/signal.h" 2 3 4
5587
5588
5589
5590
5591
5592 extern int sigstack (struct sigstack *__ss, struct sigstack *__oss)
5593 throw () __attribute__ ((__deprecated__));
5594
5595
5596
5597 extern int sigaltstack (__const struct sigaltstack *__restrict __ss,
5598 struct sigaltstack *__restrict __oss) throw ();
5599
5600
5601
5602
5603
5604
5605
5606 extern int sighold (int __sig) throw ();
5607
5608
5609 extern int sigrelse (int __sig) throw ();
5610
5611
5612 extern int sigignore (int __sig) throw ();
5613
5614
5615 extern __sighandler_t sigset (int __sig, __sighandler_t __disp) throw ();
5616
5617
5618
5619
5620
5621
5622 # 1 "/usr/include/bits/sigthread.h" 1 3 4
5623 # 21 "/usr/include/bits/sigthread.h" 3 4
5624 #define _BITS_SIGTHREAD_H 1
5625 # 31 "/usr/include/bits/sigthread.h" 3 4
5626 extern int pthread_sigmask (int __how,
5627 __const __sigset_t *__restrict __newmask,
5628 __sigset_t *__restrict __oldmask)throw ();
5629
5630
5631 extern int pthread_kill (pthread_t __threadid, int __signo) throw ();
5632
5633
5634
5635 extern int pthread_sigqueue (pthread_t __threadid, int __signo,
5636 const union sigval __value) throw ();
5637 # 396 "/usr/include/signal.h" 2 3 4
5638
5639
5640
5641
5642
5643
5644 extern int __libc_current_sigrtmin (void) throw ();
5645
5646 extern int __libc_current_sigrtmax (void) throw ();
5647
5648
5649
5650 }
5651 # 20 "./../../dist/include/mozilla/Assertions.h" 2
5652 # 65 "./../../dist/include/mozilla/Assertions.h"
5653 #define MOZ_STATIC_ASSERT_GLUE1(x,y) x ##y
5654 #define MOZ_STATIC_ASSERT_GLUE(x,y) MOZ_STATIC_ASSERT_GLUE1(x, y)
5655 # 96 "./../../dist/include/mozilla/Assertions.h"
5656 #define MOZ_STATIC_ASSERT(cond,reason) typedef int MOZ_STATIC_ASSERT_GLUE(moz_static_assert, __COUNTER__)[(cond) ? 1 : -1]
5657
5658
5659
5660
5661
5662
5663
5664 #define MOZ_STATIC_ASSERT_IF(cond,expr,reason) MOZ_STATIC_ASSERT(!(cond) || (expr), reason)
5665
5666
5667 extern "C" {
5668 # 150 "./../../dist/include/mozilla/Assertions.h"
5669 #define MOZ_CRASH() do { raise(SIGABRT); } while (0)
5670
5671
5672
5673
5674
5675
5676 extern __attribute__((weak)) __attribute__((visibility("default"))) void
5677 MOZ_Assert(const char* s, const char* file, int ln);
5678
5679 static __attribute__((always_inline)) inline void
5680 MOZ_OutputAssertMessage(const char* s, const char *file, int ln)
5681 {
5682
5683
5684
5685
5686 fprintf(stderr, "Assertion failure: %s, at %s:%d\n", s, file, ln);
5687 fflush(stderr);
5688
5689 }
5690
5691
5692 }
5693 # 250 "./../../dist/include/mozilla/Assertions.h"
5694 #define MOZ_ASSERT(...) do { } while(0)
5695 # 269 "./../../dist/include/mozilla/Assertions.h"
5696 #define MOZ_ASSERT_IF(cond,expr) do { } while (0)
5697 # 281 "./../../dist/include/mozilla/Assertions.h"
5698 #define MOZ_NOT_REACHED_MARKER() __builtin_unreachable()
5699 # 311 "./../../dist/include/mozilla/Assertions.h"
5700 #define MOZ_NOT_REACHED(reason) MOZ_NOT_REACHED_MARKER()
5701 # 349 "./../../dist/include/mozilla/Assertions.h"
5702 #define MOZ_ALWAYS_TRUE(expr) ((void)(expr))
5703 #define MOZ_ALWAYS_FALSE(expr) ((void)(expr))
5704 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl.cpp" 2
5705
5706
5707 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscope.h" 1
5708 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscope.h"
5709 #define jsscope_h___
5710
5711
5712
5713 # 1 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/new" 1 3
5714 # 37 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/new" 3
5715 #define _NEW
5716
5717
5718 # 40 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/new" 3
5719
5720 # 1 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/cstddef" 1 3
5721 # 41 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/cstddef" 3
5722
5723 # 42 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/cstddef" 3
5724
5725 # 1 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/armv7a-hardfloat-linux-gnueabi/bits/c++config.h" 1 3
5726 # 32 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/armv7a-hardfloat-linux-gnueabi/bits/c++config.h" 3
5727 #define _GLIBCXX_CXX_CONFIG_H 1
5728
5729
5730 #define __GLIBCXX__ 20120702
5731
5732
5733
5734
5735 #define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY 1
5736
5737
5738 #define _GLIBCXX_VISIBILITY_ATTR(V) __attribute__ ((__visibility__ (#V)))
5739 # 54 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/armv7a-hardfloat-linux-gnueabi/bits/c++config.h" 3
5740 #define _GLIBCXX_DEPRECATED 1
5741
5742
5743
5744
5745
5746 #define _GLIBCXX_DEPRECATED_ATTR
5747 # 95 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/armv7a-hardfloat-linux-gnueabi/bits/c++config.h" 3
5748 #define _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION 0
5749 # 117 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/armv7a-hardfloat-linux-gnueabi/bits/c++config.h" 3
5750 #define _GLIBCXX_STD_D _GLIBCXX_STD
5751 #define _GLIBCXX_STD_P _GLIBCXX_STD
5752 #define _GLIBCXX_STD_PR _GLIBCXX_STD
5753 #define _GLIBCXX_STD std
5754 #define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X,Y) _GLIBCXX_BEGIN_NAMESPACE(X)
5755 #define _GLIBCXX_END_NESTED_NAMESPACE _GLIBCXX_END_NAMESPACE
5756 #define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) {
5757 #define _GLIBCXX_END_NAMESPACE }
5758 # 240 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/armv7a-hardfloat-linux-gnueabi/bits/c++config.h" 3
5759 #undef _GLIBCXX_LONG_DOUBLE_COMPAT
5760 # 252 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/armv7a-hardfloat-linux-gnueabi/bits/c++config.h" 3
5761 #define _GLIBCXX_LDBL_NAMESPACE
5762 #define _GLIBCXX_BEGIN_LDBL_NAMESPACE
5763 #define _GLIBCXX_END_LDBL_NAMESPACE
5764
5765
5766
5767
5768
5769 #define _GLIBCXX_BEGIN_EXTERN_C extern "C" {
5770 #define _GLIBCXX_END_EXTERN_C }
5771 # 275 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/armv7a-hardfloat-linux-gnueabi/bits/c++config.h" 3
5772 # 1 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/armv7a-hardfloat-linux-gnueabi/bits/os_defines.h" 1 3
5773 # 31 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/armv7a-hardfloat-linux-gnueabi/bits/os_defines.h" 3
5774 #define _GLIBCXX_OS_DEFINES 1
5775
5776
5777
5778
5779
5780 #define __NO_CTYPE 1
5781 # 276 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/armv7a-hardfloat-linux-gnueabi/bits/c++config.h" 2 3
5782
5783
5784 # 1 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/armv7a-hardfloat-linux-gnueabi/bits/cpu_defines.h" 1 3
5785 # 31 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/armv7a-hardfloat-linux-gnueabi/bits/cpu_defines.h" 3
5786 #define _GLIBCXX_CPU_DEFINES 1
5787 # 279 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/armv7a-hardfloat-linux-gnueabi/bits/c++config.h" 2 3
5788
5789
5790
5791
5792 #define _GLIBCXX_PSEUDO_VISIBILITY(V)
5793 # 301 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/armv7a-hardfloat-linux-gnueabi/bits/c++config.h" 3
5794 #define _GLIBCXX_EXTERN_TEMPLATE 1
5795
5796
5797
5798
5799
5800
5801 #define _GLIBCXX_WEAK_DEFINITION
5802
5803
5804
5805
5806
5807
5808 #define __glibcxx_assert(_Condition)
5809 # 346 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/armv7a-hardfloat-linux-gnueabi/bits/c++config.h" 3
5810 #define _GLIBCXX_FAST_MATH 0
5811
5812
5813
5814
5815
5816
5817 #define __N(msgid) (msgid)
5818
5819
5820 #undef min
5821 #undef max
5822
5823
5824 #define _GLIBCXX_PURE __attribute__ ((__pure__))
5825
5826
5827
5828 #define _GLIBCXX_CONST __attribute__ ((__const__))
5829
5830
5831
5832 #define _GLIBCXX_NORETURN __attribute__ ((__noreturn__))
5833
5834
5835
5836
5837 #define _GLIBCXX_NOTHROW throw()
5838 # 384 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/armv7a-hardfloat-linux-gnueabi/bits/c++config.h" 3
5839 #define _GLIBCXX_HAVE_ACOSF 1
5840
5841
5842 #define _GLIBCXX_HAVE_ACOSL 1
5843
5844
5845 #define _GLIBCXX_HAVE_ASINF 1
5846
5847
5848 #define _GLIBCXX_HAVE_ASINL 1
5849
5850
5851 #define _GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE 1
5852
5853
5854 #define _GLIBCXX_HAVE_ATAN2F 1
5855
5856
5857 #define _GLIBCXX_HAVE_ATAN2L 1
5858
5859
5860 #define _GLIBCXX_HAVE_ATANF 1
5861
5862
5863 #define _GLIBCXX_HAVE_ATANL 1
5864
5865
5866
5867
5868
5869 #define _GLIBCXX_HAVE_CEILF 1
5870
5871
5872 #define _GLIBCXX_HAVE_CEILL 1
5873
5874
5875 #define _GLIBCXX_HAVE_COMPLEX_H 1
5876
5877
5878 #define _GLIBCXX_HAVE_COSF 1
5879
5880
5881 #define _GLIBCXX_HAVE_COSHF 1
5882
5883
5884 #define _GLIBCXX_HAVE_COSHL 1
5885
5886
5887 #define _GLIBCXX_HAVE_COSL 1
5888
5889
5890 #define _GLIBCXX_HAVE_DLFCN_H 1
5891
5892
5893 #define _GLIBCXX_HAVE_EBADMSG 1
5894
5895
5896 #define _GLIBCXX_HAVE_ECANCELED 1
5897
5898
5899 #define _GLIBCXX_HAVE_EIDRM 1
5900
5901
5902 #define _GLIBCXX_HAVE_ENDIAN_H 1
5903
5904
5905 #define _GLIBCXX_HAVE_ENODATA 1
5906
5907
5908 #define _GLIBCXX_HAVE_ENOLINK 1
5909
5910
5911 #define _GLIBCXX_HAVE_ENOSR 1
5912
5913
5914 #define _GLIBCXX_HAVE_ENOSTR 1
5915
5916
5917 #define _GLIBCXX_HAVE_ENOTRECOVERABLE 1
5918
5919
5920 #define _GLIBCXX_HAVE_ENOTSUP 1
5921
5922
5923 #define _GLIBCXX_HAVE_EOVERFLOW 1
5924
5925
5926 #define _GLIBCXX_HAVE_EOWNERDEAD 1
5927
5928
5929 #define _GLIBCXX_HAVE_EPROTO 1
5930
5931
5932 #define _GLIBCXX_HAVE_ETIME 1
5933
5934
5935 #define _GLIBCXX_HAVE_ETXTBSY 1
5936
5937
5938 #define _GLIBCXX_HAVE_EXECINFO_H 1
5939
5940
5941 #define _GLIBCXX_HAVE_EXPF 1
5942
5943
5944 #define _GLIBCXX_HAVE_EXPL 1
5945
5946
5947 #define _GLIBCXX_HAVE_FABSF 1
5948
5949
5950 #define _GLIBCXX_HAVE_FABSL 1
5951
5952
5953 #define _GLIBCXX_HAVE_FENV_H 1
5954
5955
5956 #define _GLIBCXX_HAVE_FINITE 1
5957
5958
5959 #define _GLIBCXX_HAVE_FINITEF 1
5960
5961
5962 #define _GLIBCXX_HAVE_FINITEL 1
5963
5964
5965 #define _GLIBCXX_HAVE_FLOAT_H 1
5966
5967
5968 #define _GLIBCXX_HAVE_FLOORF 1
5969
5970
5971 #define _GLIBCXX_HAVE_FLOORL 1
5972
5973
5974 #define _GLIBCXX_HAVE_FMODF 1
5975
5976
5977 #define _GLIBCXX_HAVE_FMODL 1
5978 # 531 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/armv7a-hardfloat-linux-gnueabi/bits/c++config.h" 3
5979 #define _GLIBCXX_HAVE_FREXPF 1
5980
5981
5982 #define _GLIBCXX_HAVE_FREXPL 1
5983
5984
5985 #define _GLIBCXX_HAVE_GETIPINFO 1
5986
5987
5988
5989 #define _GLIBCXX_HAVE_GTHR_DEFAULT 1
5990
5991
5992 #define _GLIBCXX_HAVE_HYPOT 1
5993
5994
5995 #define _GLIBCXX_HAVE_HYPOTF 1
5996
5997
5998 #define _GLIBCXX_HAVE_HYPOTL 1
5999
6000
6001 #define _GLIBCXX_HAVE_ICONV 1
6002
6003
6004
6005
6006
6007 #define _GLIBCXX_HAVE_INT64_T 1
6008
6009
6010
6011
6012
6013 #define _GLIBCXX_HAVE_INT64_T_LONG_LONG 1
6014
6015
6016 #define _GLIBCXX_HAVE_INTTYPES_H 1
6017
6018
6019 #define _GLIBCXX_HAVE_ISINF 1
6020
6021
6022 #define _GLIBCXX_HAVE_ISINFF 1
6023
6024
6025 #define _GLIBCXX_HAVE_ISINFL 1
6026
6027
6028 #define _GLIBCXX_HAVE_ISNAN 1
6029
6030
6031 #define _GLIBCXX_HAVE_ISNANF 1
6032
6033
6034 #define _GLIBCXX_HAVE_ISNANL 1
6035
6036
6037 #define _GLIBCXX_HAVE_ISWBLANK 1
6038
6039
6040 #define _GLIBCXX_HAVE_LC_MESSAGES 1
6041
6042
6043 #define _GLIBCXX_HAVE_LDEXPF 1
6044
6045
6046 #define _GLIBCXX_HAVE_LDEXPL 1
6047
6048
6049 #define _GLIBCXX_HAVE_LIBINTL_H 1
6050
6051
6052 #define _GLIBCXX_HAVE_LIMIT_AS 1
6053
6054
6055 #define _GLIBCXX_HAVE_LIMIT_DATA 1
6056
6057
6058 #define _GLIBCXX_HAVE_LIMIT_FSIZE 1
6059
6060
6061 #define _GLIBCXX_HAVE_LIMIT_RSS 1
6062
6063
6064 #define _GLIBCXX_HAVE_LIMIT_VMEM 0
6065
6066
6067 #define _GLIBCXX_HAVE_LINUX_FUTEX 1
6068
6069
6070 #define _GLIBCXX_HAVE_LOCALE_H 1
6071
6072
6073 #define _GLIBCXX_HAVE_LOG10F 1
6074
6075
6076 #define _GLIBCXX_HAVE_LOG10L 1
6077
6078
6079 #define _GLIBCXX_HAVE_LOGF 1
6080
6081
6082 #define _GLIBCXX_HAVE_LOGL 1
6083 # 643 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/armv7a-hardfloat-linux-gnueabi/bits/c++config.h" 3
6084 #define _GLIBCXX_HAVE_MBSTATE_T 1
6085
6086
6087 #define _GLIBCXX_HAVE_MEMORY_H 1
6088
6089
6090 #define _GLIBCXX_HAVE_MODF 1
6091
6092
6093 #define _GLIBCXX_HAVE_MODFF 1
6094
6095
6096 #define _GLIBCXX_HAVE_MODFL 1
6097
6098
6099
6100
6101
6102 #define _GLIBCXX_HAVE_POLL 1
6103
6104
6105 #define _GLIBCXX_HAVE_POWF 1
6106
6107
6108 #define _GLIBCXX_HAVE_POWL 1
6109
6110
6111
6112
6113
6114 #define _GLIBCXX_HAVE_SETENV 1
6115
6116
6117 #define _GLIBCXX_HAVE_SINCOS 1
6118
6119
6120 #define _GLIBCXX_HAVE_SINCOSF 1
6121
6122
6123 #define _GLIBCXX_HAVE_SINCOSL 1
6124
6125
6126 #define _GLIBCXX_HAVE_SINF 1
6127
6128
6129 #define _GLIBCXX_HAVE_SINHF 1
6130
6131
6132 #define _GLIBCXX_HAVE_SINHL 1
6133
6134
6135 #define _GLIBCXX_HAVE_SINL 1
6136
6137
6138 #define _GLIBCXX_HAVE_SQRTF 1
6139
6140
6141 #define _GLIBCXX_HAVE_SQRTL 1
6142
6143
6144 #define _GLIBCXX_HAVE_STDBOOL_H 1
6145
6146
6147 #define _GLIBCXX_HAVE_STDINT_H 1
6148
6149
6150 #define _GLIBCXX_HAVE_STDLIB_H 1
6151
6152
6153 #define _GLIBCXX_HAVE_STRERROR_L 1
6154
6155
6156 #define _GLIBCXX_HAVE_STRERROR_R 1
6157
6158
6159 #define _GLIBCXX_HAVE_STRINGS_H 1
6160
6161
6162 #define _GLIBCXX_HAVE_STRING_H 1
6163
6164
6165 #define _GLIBCXX_HAVE_STRTOF 1
6166
6167
6168 #define _GLIBCXX_HAVE_STRTOLD 1
6169
6170
6171 #define _GLIBCXX_HAVE_STRXFRM_L 1
6172
6173
6174
6175
6176
6177 #define _GLIBCXX_HAVE_SYS_IOCTL_H 1
6178
6179
6180 #define _GLIBCXX_HAVE_SYS_IPC_H 1
6181 # 748 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/armv7a-hardfloat-linux-gnueabi/bits/c++config.h" 3
6182 #define _GLIBCXX_HAVE_SYS_PARAM_H 1
6183
6184
6185 #define _GLIBCXX_HAVE_SYS_RESOURCE_H 1
6186
6187
6188 #define _GLIBCXX_HAVE_SYS_SEM_H 1
6189
6190
6191 #define _GLIBCXX_HAVE_SYS_STAT_H 1
6192
6193
6194 #define _GLIBCXX_HAVE_SYS_TIME_H 1
6195
6196
6197 #define _GLIBCXX_HAVE_SYS_TYPES_H 1
6198
6199
6200 #define _GLIBCXX_HAVE_SYS_UIO_H 1
6201
6202
6203
6204
6205
6206 #define _GLIBCXX_HAVE_S_ISREG 1
6207
6208
6209 #define _GLIBCXX_HAVE_TANF 1
6210
6211
6212 #define _GLIBCXX_HAVE_TANHF 1
6213
6214
6215 #define _GLIBCXX_HAVE_TANHL 1
6216
6217
6218 #define _GLIBCXX_HAVE_TANL 1
6219
6220
6221 #define _GLIBCXX_HAVE_TGMATH_H 1
6222
6223
6224 #define _GLIBCXX_HAVE_TLS 1
6225
6226
6227 #define _GLIBCXX_HAVE_UNISTD_H 1
6228
6229
6230 #define _GLIBCXX_HAVE_VFWSCANF 1
6231
6232
6233 #define _GLIBCXX_HAVE_VSWSCANF 1
6234
6235
6236 #define _GLIBCXX_HAVE_VWSCANF 1
6237
6238
6239 #define _GLIBCXX_HAVE_WCHAR_H 1
6240
6241
6242 #define _GLIBCXX_HAVE_WCSTOF 1
6243
6244
6245 #define _GLIBCXX_HAVE_WCTYPE_H 1
6246
6247
6248 #define _GLIBCXX_HAVE_WRITEV 1
6249 # 1003 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/armv7a-hardfloat-linux-gnueabi/bits/c++config.h" 3
6250 #define _GLIBCXX_ICONV_CONST
6251
6252
6253
6254 #define LT_OBJDIR ".libs/"
6255
6256
6257
6258
6259
6260 #define _GLIBCXX_PACKAGE_BUGREPORT ""
6261
6262
6263 #define _GLIBCXX_PACKAGE_NAME "package-unused"
6264
6265
6266 #define _GLIBCXX_PACKAGE_STRING "package-unused version-unused"
6267
6268
6269 #define _GLIBCXX_PACKAGE_TARNAME "libstdc++"
6270
6271
6272 #define _GLIBCXX_PACKAGE_URL ""
6273
6274
6275 #define _GLIBCXX_PACKAGE__GLIBCXX_VERSION "version-unused"
6276 # 1046 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/armv7a-hardfloat-linux-gnueabi/bits/c++config.h" 3
6277 #define STDC_HEADERS 1
6278
6279
6280
6281
6282
6283 #define _GLIBCXX_ATOMIC_BUILTINS_1 1
6284
6285
6286
6287 #define _GLIBCXX_ATOMIC_BUILTINS_2 1
6288
6289
6290 #define _GLIBCXX_ATOMIC_BUILTINS_4 1
6291 # 1072 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/armv7a-hardfloat-linux-gnueabi/bits/c++config.h" 3
6292 #define _GLIBCXX_HAS_GTHREADS 1
6293
6294
6295 #define _GLIBCXX_HOSTED 1
6296
6297
6298
6299
6300 #define _GLIBCXX_PTRDIFF_T_IS_INT 1
6301
6302
6303 #define _GLIBCXX_RES_LIMITS 1
6304
6305
6306 #define _GLIBCXX_SIZE_T_IS_UINT 1
6307
6308
6309
6310
6311
6312 #define _GLIBCXX_STDIO_MACROS 1
6313
6314
6315 #define _GLIBCXX_SYMVER 1
6316
6317
6318
6319
6320
6321 #define _GLIBCXX_SYMVER_GNU 1
6322
6323
6324
6325
6326
6327
6328 #define _GLIBCXX_USE_C99 1
6329
6330
6331
6332
6333 #define _GLIBCXX_USE_C99_COMPLEX 1
6334
6335
6336
6337
6338 #define _GLIBCXX_USE_C99_COMPLEX_TR1 1
6339
6340
6341
6342 #define _GLIBCXX_USE_C99_CTYPE_TR1 1
6343
6344
6345
6346 #define _GLIBCXX_USE_C99_FENV_TR1 1
6347
6348
6349
6350 #define _GLIBCXX_USE_C99_INTTYPES_TR1 1
6351
6352
6353
6354 #define _GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1 1
6355
6356
6357
6358 #define _GLIBCXX_USE_C99_MATH 1
6359
6360
6361
6362 #define _GLIBCXX_USE_C99_MATH_TR1 1
6363
6364
6365
6366 #define _GLIBCXX_USE_C99_STDINT_TR1 1
6367 # 1159 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/armv7a-hardfloat-linux-gnueabi/bits/c++config.h" 3
6368 #define _GLIBCXX_USE_GETTIMEOFDAY 1
6369
6370
6371 #define _GLIBCXX_USE_LFS 1
6372
6373
6374 #define _GLIBCXX_USE_LONG_LONG 1
6375
6376
6377
6378
6379
6380 #define _GLIBCXX_USE_NLS 1
6381
6382
6383
6384 #define _GLIBCXX_USE_RANDOM_TR1 1
6385
6386
6387
6388
6389
6390 #define _GLIBCXX_USE_WCHAR_T 1
6391 # 44 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/cstddef" 2 3
6392 # 1 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 1 3 4
6393 # 45 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/cstddef" 2 3
6394
6395
6396 #define _GLIBCXX_CSTDDEF 1
6397
6398 namespace std __attribute__ ((__visibility__ ("default"))) {
6399
6400 using ::ptrdiff_t;
6401 using ::size_t;
6402
6403 }
6404 # 42 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/new" 2 3
6405 # 1 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/exception" 1 3
6406 # 33 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/exception" 3
6407 #define __EXCEPTION__
6408
6409
6410 # 36 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/exception" 3
6411
6412 #pragma GCC visibility push(default)
6413
6414
6415
6416 extern "C++" {
6417
6418 namespace std
6419 {
6420 # 61 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/exception" 3
6421 class exception
6422 {
6423 public:
6424 exception() throw() { }
6425 virtual ~exception() throw();
6426
6427
6428
6429 virtual const char* what() const throw();
6430 };
6431
6432
6433
6434 class bad_exception : public exception
6435 {
6436 public:
6437 bad_exception() throw() { }
6438
6439
6440
6441 virtual ~bad_exception() throw();
6442
6443
6444 virtual const char* what() const throw();
6445 };
6446
6447
6448 typedef void (*terminate_handler) ();
6449
6450
6451 typedef void (*unexpected_handler) ();
6452
6453
6454 terminate_handler set_terminate(terminate_handler) throw();
6455
6456
6457
6458 void terminate() throw() __attribute__ ((__noreturn__));
6459
6460
6461 unexpected_handler set_unexpected(unexpected_handler) throw();
6462
6463
6464
6465 void unexpected() __attribute__ ((__noreturn__));
6466 # 118 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/exception" 3
6467 bool uncaught_exception() throw() __attribute__ ((__pure__));
6468
6469
6470 }
6471
6472 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
6473 # 141 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/exception" 3
6474 void __verbose_terminate_handler();
6475
6476 }
6477
6478 }
6479
6480 #pragma GCC visibility pop
6481 # 43 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/new" 2 3
6482
6483 #pragma GCC visibility push(default)
6484
6485 extern "C++" {
6486
6487 namespace std
6488 {
6489
6490
6491
6492
6493
6494
6495 class bad_alloc : public exception
6496 {
6497 public:
6498 bad_alloc() throw() { }
6499
6500
6501
6502 virtual ~bad_alloc() throw();
6503
6504
6505 virtual const char* what() const throw();
6506 };
6507
6508 struct nothrow_t { };
6509
6510 extern const nothrow_t nothrow;
6511
6512
6513
6514 typedef void (*new_handler)();
6515
6516
6517
6518 new_handler set_new_handler(new_handler) throw();
6519 }
6520 # 93 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/new" 3
6521 void* operator new(std::size_t) throw (std::bad_alloc);
6522 void* operator new[](std::size_t) throw (std::bad_alloc);
6523 void operator delete(void*) throw();
6524 void operator delete[](void*) throw();
6525 void* operator new(std::size_t, const std::nothrow_t&) throw();
6526 void* operator new[](std::size_t, const std::nothrow_t&) throw();
6527 void operator delete(void*, const std::nothrow_t&) throw();
6528 void operator delete[](void*, const std::nothrow_t&) throw();
6529
6530
6531 inline void* operator new(std::size_t, void* __p) throw() { return __p; }
6532 inline void* operator new[](std::size_t, void* __p) throw() { return __p; }
6533
6534
6535 inline void operator delete (void*, void*) throw() { }
6536 inline void operator delete[](void*, void*) throw() { }
6537
6538 }
6539
6540 #pragma GCC visibility pop
6541 # 14 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscope.h" 2
6542
6543
6544
6545
6546 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobj.h" 1
6547 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobj.h"
6548 #define jsobj_h___
6549 # 19 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobj.h"
6550 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h" 1
6551 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
6552 #define jsapi_h___
6553
6554
6555
6556
6557
6558 # 1 "./../../dist/include/mozilla/FloatingPoint.h" 1
6559 # 9 "./../../dist/include/mozilla/FloatingPoint.h"
6560 #define mozilla_FloatingPoint_h_
6561 # 40 "./../../dist/include/mozilla/FloatingPoint.h"
6562 typedef int moz_static_assert0[(sizeof(double) == sizeof(uint64_t)) ? 1 : -1];
6563
6564
6565
6566
6567
6568 #define MOZ_DOUBLE_SIGN_BIT 0x8000000000000000ULL
6569 #define MOZ_DOUBLE_EXPONENT_BITS 0x7ff0000000000000ULL
6570 #define MOZ_DOUBLE_SIGNIFICAND_BITS 0x000fffffffffffffULL
6571
6572 #define MOZ_DOUBLE_EXPONENT_BIAS 1023
6573 #define MOZ_DOUBLE_EXPONENT_SHIFT 52
6574
6575 typedef int
6576 moz_static_assert1
6577 # 53 "./../../dist/include/mozilla/FloatingPoint.h"
6578 [((0x8000000000000000ULL & 0x7ff0000000000000ULL) == 0) ? 1 : -1]
6579 ;
6580 typedef int
6581 moz_static_assert2
6582 # 55 "./../../dist/include/mozilla/FloatingPoint.h"
6583 [((0x8000000000000000ULL & 0x000fffffffffffffULL) == 0) ? 1 : -1]
6584 ;
6585 typedef int
6586 moz_static_assert3
6587 # 57 "./../../dist/include/mozilla/FloatingPoint.h"
6588 [((0x7ff0000000000000ULL & 0x000fffffffffffffULL) == 0) ? 1 : -1]
6589 ;
6590
6591 typedef int
6592
6593 moz_static_assert4
6594 # 60 "./../../dist/include/mozilla/FloatingPoint.h"
6595 [((0x8000000000000000ULL | 0x7ff0000000000000ULL | 0x000fffffffffffffULL) == ~(uint64_t)0) ? 1 : -1]
6596
6597 ;
6598
6599
6600 extern "C" {
6601
6602
6603
6604
6605
6606
6607 union MozDoublePun {
6608
6609
6610
6611
6612
6613
6614 uint64_t u;
6615 double d;
6616 };
6617
6618
6619 static __attribute__((always_inline)) inline int
6620 MOZ_DOUBLE_IS_NaN(double d)
6621 {
6622 union MozDoublePun pun;
6623 pun.d = d;
6624
6625
6626
6627
6628
6629 return (pun.u & 0x7ff0000000000000ULL) == 0x7ff0000000000000ULL &&
6630 (pun.u & 0x000fffffffffffffULL) != 0;
6631 }
6632
6633
6634 static __attribute__((always_inline)) inline int
6635 MOZ_DOUBLE_IS_INFINITE(double d)
6636 {
6637 union MozDoublePun pun;
6638 pun.d = d;
6639
6640
6641 return (pun.u & ~0x8000000000000000ULL) == 0x7ff0000000000000ULL;
6642 }
6643
6644
6645 static __attribute__((always_inline)) inline int
6646 MOZ_DOUBLE_IS_FINITE(double d)
6647 {
6648 union MozDoublePun pun;
6649 pun.d = d;
6650
6651
6652
6653
6654
6655 return (pun.u & 0x7ff0000000000000ULL) != 0x7ff0000000000000ULL;
6656 }
6657
6658
6659
6660
6661
6662 static __attribute__((always_inline)) inline int
6663 MOZ_DOUBLE_IS_NEGATIVE(double d)
6664 {
6665 union MozDoublePun pun;
6666 pun.d = d;
6667
6668 do { } while(0);
6669
6670
6671 return (pun.u & 0x8000000000000000ULL) != 0;
6672 }
6673
6674
6675 static __attribute__((always_inline)) inline int
6676 MOZ_DOUBLE_IS_NEGATIVE_ZERO(double d)
6677 {
6678 union MozDoublePun pun;
6679 pun.d = d;
6680
6681
6682 return pun.u == 0x8000000000000000ULL;
6683 }
6684
6685
6686 static __attribute__((always_inline)) inline int_fast16_t
6687 MOZ_DOUBLE_EXPONENT(double d)
6688 {
6689 union MozDoublePun pun;
6690 pun.d = d;
6691
6692
6693
6694
6695
6696 return (int_fast16_t)((pun.u & 0x7ff0000000000000ULL) >> 52) -
6697 1023;
6698 }
6699
6700
6701 static __attribute__((always_inline)) inline double
6702 MOZ_DOUBLE_POSITIVE_INFINITY()
6703 {
6704 union MozDoublePun pun;
6705
6706
6707
6708
6709
6710 pun.u = 0x7ff0000000000000ULL;
6711 return pun.d;
6712 }
6713
6714
6715 static __attribute__((always_inline)) inline double
6716 MOZ_DOUBLE_NEGATIVE_INFINITY()
6717 {
6718 union MozDoublePun pun;
6719
6720
6721
6722
6723
6724 pun.u = 0x8000000000000000ULL | 0x7ff0000000000000ULL;
6725 return pun.d;
6726 }
6727
6728
6729 static __attribute__((always_inline)) inline double
6730 MOZ_DOUBLE_SPECIFIC_NaN(int signbit, uint64_t significand)
6731 {
6732 union MozDoublePun pun;
6733
6734 do { } while(0);
6735 do { } while(0);
6736 do { } while(0);
6737
6738 pun.u = (signbit ? 0x8000000000000000ULL : 0) |
6739 0x7ff0000000000000ULL |
6740 significand;
6741 do { } while(0);
6742 return pun.d;
6743 }
6744
6745
6746
6747
6748
6749 static __attribute__((always_inline)) inline double
6750 MOZ_DOUBLE_NaN()
6751 {
6752 return MOZ_DOUBLE_SPECIFIC_NaN(0, 0xfffffffffffffULL);
6753 }
6754
6755
6756 static __attribute__((always_inline)) inline double
6757 MOZ_DOUBLE_MIN_VALUE()
6758 {
6759 union MozDoublePun pun;
6760 pun.u = 1;
6761 return pun.d;
6762 }
6763
6764
6765 static __attribute__((always_inline)) inline uint32_t
6766 MOZ_HASH_DOUBLE(double d)
6767 {
6768 union MozDoublePun pun;
6769 pun.d = d;
6770
6771 return ((uint32_t)(pun.u >> 32)) ^ ((uint32_t)(pun.u));
6772 }
6773
6774 static __attribute__((always_inline)) inline int
6775 MOZ_DOUBLE_IS_INT32(double d, int32_t* i)
6776 {
6777
6778
6779
6780
6781
6782 return !MOZ_DOUBLE_IS_NEGATIVE_ZERO(d) && d == (*i = (int32_t)d);
6783 }
6784
6785
6786 }
6787 # 16 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h" 2
6788
6789
6790 # 1 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 1 3 4
6791 # 19 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h" 2
6792
6793 # 1 "./js-config.h" 1
6794 # 10 "./js-config.h"
6795 #define js_config_h___
6796
6797
6798
6799
6800
6801
6802 #define JS_THREADSAFE 1
6803
6804
6805 #define JS_HAS_CTYPES 1
6806
6807
6808
6809
6810
6811
6812
6813 #define JS_HAVE_ENDIAN_H 1
6814 # 60 "./js-config.h"
6815 #define JS_BYTES_PER_WORD 4
6816
6817
6818
6819 #define JS_METHODJIT 1
6820
6821
6822 #define JS_HAS_XML_SUPPORT 1
6823 # 21 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h" 2
6824 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jspubtd.h" 1
6825
6826
6827
6828
6829
6830
6831
6832 #define jspubtd_h___
6833
6834
6835
6836
6837 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jstypes.h" 1
6838 # 21 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jstypes.h"
6839 #define jstypes_h___
6840
6841
6842 # 1 "./../../dist/include/mozilla/Util.h" 1
6843 # 14 "./../../dist/include/mozilla/Util.h"
6844 #define mozilla_Util_h_
6845
6846
6847
6848
6849
6850
6851
6852 namespace mozilla {
6853 # 41 "./../../dist/include/mozilla/Util.h"
6854 template <typename T>
6855 struct DebugOnly
6856 {
6857 # 69 "./../../dist/include/mozilla/Util.h"
6858 DebugOnly() {}
6859 DebugOnly(const T&) {}
6860 DebugOnly(const DebugOnly&) {}
6861 DebugOnly& operator=(const T&) { return *this; }
6862 void operator++(int) {}
6863 void operator--(int) {}
6864
6865
6866
6867
6868
6869
6870
6871 ~DebugOnly() {}
6872 };
6873
6874
6875
6876
6877
6878 template<class T>
6879 struct AlignmentFinder
6880 {
6881 private:
6882 struct Aligner
6883 {
6884 char c;
6885 T t;
6886 };
6887
6888 public:
6889 static const int alignment = sizeof(Aligner) - sizeof(T);
6890 };
6891
6892 #define MOZ_ALIGNOF(T) mozilla::AlignmentFinder<T>::alignment
6893 # 116 "./../../dist/include/mozilla/Util.h"
6894 #define MOZ_ALIGNED_DECL(_type,_align) _type __attribute__((aligned(_align)))
6895 # 131 "./../../dist/include/mozilla/Util.h"
6896 template<size_t align>
6897 struct AlignedElem;
6898
6899
6900
6901
6902
6903
6904 template<>
6905 struct AlignedElem<1>
6906 {
6907 uint8_t elem __attribute__((aligned(1)));
6908 };
6909
6910 template<>
6911 struct AlignedElem<2>
6912 {
6913 uint8_t elem __attribute__((aligned(2)));
6914 };
6915
6916 template<>
6917 struct AlignedElem<4>
6918 {
6919 uint8_t elem __attribute__((aligned(4)));
6920 };
6921
6922 template<>
6923 struct AlignedElem<8>
6924 {
6925 uint8_t elem __attribute__((aligned(8)));
6926 };
6927
6928 template<>
6929 struct AlignedElem<16>
6930 {
6931 uint8_t elem __attribute__((aligned(16)));
6932 };
6933 # 179 "./../../dist/include/mozilla/Util.h"
6934 template <size_t nbytes>
6935 struct AlignedStorage
6936 {
6937 union U {
6938 char bytes[nbytes];
6939 uint64_t _;
6940 } u;
6941
6942 const void *addr() const { return u.bytes; }
6943 void *addr() { return u.bytes; }
6944 };
6945
6946 template <class T>
6947 struct AlignedStorage2
6948 {
6949 union U {
6950 char bytes[sizeof(T)];
6951 uint64_t _;
6952 } u;
6953
6954 const T *addr() const { return (const T *)u.bytes; }
6955 T *addr() { return (T *)(void *)u.bytes; }
6956 };
6957 # 214 "./../../dist/include/mozilla/Util.h"
6958 template <class T>
6959 class Maybe
6960 {
6961 AlignedStorage2<T> storage;
6962 bool constructed;
6963
6964 T &asT() { return *storage.addr(); }
6965
6966 explicit Maybe(const Maybe &other);
6967 const Maybe &operator=(const Maybe &other);
6968
6969 public:
6970 Maybe() { constructed = false; }
6971 ~Maybe() { if (constructed) asT().~T(); }
6972
6973 bool empty() const { return !constructed; }
6974
6975 void construct() {
6976 do { } while(0);
6977 new(storage.addr()) T();
6978 constructed = true;
6979 }
6980
6981 template <class T1>
6982 void construct(const T1 &t1) {
6983 do { } while(0);
6984 new(storage.addr()) T(t1);
6985 constructed = true;
6986 }
6987
6988 template <class T1, class T2>
6989 void construct(const T1 &t1, const T2 &t2) {
6990 do { } while(0);
6991 new(storage.addr()) T(t1, t2);
6992 constructed = true;
6993 }
6994
6995 template <class T1, class T2, class T3>
6996 void construct(const T1 &t1, const T2 &t2, const T3 &t3) {
6997 do { } while(0);
6998 new(storage.addr()) T(t1, t2, t3);
6999 constructed = true;
7000 }
7001
7002 template <class T1, class T2, class T3, class T4>
7003 void construct(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4) {
7004 do { } while(0);
7005 new(storage.addr()) T(t1, t2, t3, t4);
7006 constructed = true;
7007 }
7008
7009 T *addr() {
7010 do { } while(0);
7011 return &asT();
7012 }
7013
7014 T &ref() {
7015 do { } while(0);
7016 return asT();
7017 }
7018
7019 const T &ref() const {
7020 do { } while(0);
7021 return const_cast<Maybe *>(this)->asT();
7022 }
7023
7024 void destroy() {
7025 ref().~T();
7026 constructed = false;
7027 }
7028
7029 void destroyIfConstructed() {
7030 if (!empty())
7031 destroy();
7032 }
7033 };
7034
7035
7036
7037
7038
7039
7040
7041 template <class T>
7042 __attribute__((always_inline)) inline size_t
7043 PointerRangeSize(T* begin, T* end)
7044 {
7045 do { } while(0);
7046 return (size_t(end) - size_t(begin)) / sizeof(T);
7047 }
7048
7049
7050
7051
7052
7053
7054
7055 template<typename T, size_t N>
7056 size_t
7057 ArrayLength(T (&arr)[N])
7058 {
7059 return N;
7060 }
7061
7062
7063
7064
7065
7066
7067 template<typename T, size_t N>
7068 T*
7069 ArrayEnd(T (&arr)[N])
7070 {
7071 return arr + ArrayLength(arr);
7072 }
7073
7074 }
7075 # 25 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jstypes.h" 2
7076 # 49 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jstypes.h"
7077 #define JS_EXTERN_API(type) extern MOZ_EXPORT_API(type)
7078 #define JS_EXPORT_API(type) MOZ_EXPORT_API(type)
7079 #define JS_EXPORT_DATA(type) MOZ_EXPORT_DATA(type)
7080 #define JS_IMPORT_API(type) MOZ_IMPORT_API(type)
7081 #define JS_IMPORT_DATA(type) MOZ_IMPORT_DATA(type)
7082 # 65 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jstypes.h"
7083 #define JS_PUBLIC_API(t) MOZ_EXPORT_API(t)
7084 #define JS_PUBLIC_DATA(t) MOZ_EXPORT_DATA(t)
7085
7086
7087
7088
7089
7090 #define JS_FRIEND_API(t) JS_PUBLIC_API(t)
7091 #define JS_FRIEND_DATA(t) JS_PUBLIC_DATA(t)
7092
7093
7094
7095
7096
7097
7098
7099 #define JS_FASTCALL
7100 #define JS_NO_FASTCALL
7101
7102
7103
7104 #define JS_INLINE MOZ_INLINE
7105
7106
7107
7108 #define JS_ALWAYS_INLINE MOZ_ALWAYS_INLINE
7109
7110
7111
7112 #define JS_NEVER_INLINE MOZ_NEVER_INLINE
7113
7114
7115
7116
7117 #define JS_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
7118 # 112 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jstypes.h"
7119 #define JS_BEGIN_MACRO do {
7120
7121
7122
7123
7124
7125
7126 #define JS_END_MACRO } while (0)
7127 # 128 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jstypes.h"
7128 #define JS_BEGIN_EXTERN_C MOZ_BEGIN_EXTERN_C
7129 #define JS_END_EXTERN_C MOZ_END_EXTERN_C
7130
7131
7132
7133
7134
7135
7136
7137 #define JS_BIT(n) ((uint32_t)1 << (n))
7138 #define JS_BITMASK(n) (JS_BIT(n) - 1)
7139 # 148 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jstypes.h"
7140 #define JS_HOWMANY(x,y) (((x)+(y)-1)/(y))
7141 #define JS_ROUNDUP(x,y) (JS_HOWMANY(x,y)*(y))
7142 #define JS_MIN(x,y) ((x)<(y)?(x):(y))
7143 #define JS_MAX(x,y) ((x)>(y)?(x):(y))
7144
7145 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscpucfg.h" 1
7146
7147
7148
7149
7150
7151
7152
7153 #define js_cpucfg___
7154
7155 #define JS_HAVE_LONG_LONG
7156 # 65 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscpucfg.h"
7157 #define IS_LITTLE_ENDIAN 1
7158 #undef IS_BIG_ENDIAN
7159 # 130 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscpucfg.h"
7160 #define JS_STACK_GROWTH_DIRECTION (-1)
7161 # 154 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jstypes.h" 2
7162 # 186 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jstypes.h"
7163 extern "C" {
7164 # 196 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jstypes.h"
7165 typedef int JSBool;
7166 #define JS_TRUE (int)1
7167 #define JS_FALSE (int)0
7168 # 218 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jstypes.h"
7169 #define JS_LIKELY(x) (__builtin_expect((x), 1))
7170 #define JS_UNLIKELY(x) (__builtin_expect((x), 0))
7171 # 245 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jstypes.h"
7172 #define JS_ARRAY_LENGTH(array) (sizeof (array) / sizeof (array)[0])
7173 #define JS_ARRAY_END(array) ((array) + JS_ARRAY_LENGTH(array))
7174
7175 #define JS_BITS_PER_BYTE 8
7176 #define JS_BITS_PER_BYTE_LOG2 3
7177
7178 #define JS_BITS_PER_WORD (JS_BITS_PER_BYTE * JS_BYTES_PER_WORD)
7179 #define JS_BITS_PER_DOUBLE (JS_BITS_PER_BYTE * JS_BYTES_PER_DOUBLE)
7180 # 271 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jstypes.h"
7181 #define JS_FUNC_TO_DATA_PTR(type,fun) (__extension__ (type) (size_t) (fun))
7182 #define JS_DATA_TO_FUNC_PTR(type,ptr) (__extension__ (type) (size_t) (ptr))
7183
7184
7185
7186
7187
7188
7189
7190 #define JS_EXTENSION __extension__
7191 #define JS_EXTENSION_(s) __extension__ ({ s; })
7192
7193
7194
7195
7196
7197 }
7198 # 14 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jspubtd.h" 2
7199
7200
7201
7202
7203
7204
7205 namespace JS { class Value; }
7206 # 53 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jspubtd.h"
7207 typedef ptrdiff_t jsid;
7208 #define JSID_BITS(id) (id)
7209
7210
7211
7212
7213
7214
7215 extern "C" {
7216
7217
7218
7219
7220 typedef uint16_t jschar;
7221
7222
7223
7224
7225
7226
7227
7228 typedef enum JSVersion {
7229 JSVERSION_1_0 = 100,
7230 JSVERSION_1_1 = 110,
7231 JSVERSION_1_2 = 120,
7232 JSVERSION_1_3 = 130,
7233 JSVERSION_1_4 = 140,
7234 JSVERSION_ECMA_3 = 148,
7235 JSVERSION_1_5 = 150,
7236 JSVERSION_1_6 = 160,
7237 JSVERSION_1_7 = 170,
7238 JSVERSION_1_8 = 180,
7239 JSVERSION_ECMA_5 = 185,
7240 JSVERSION_DEFAULT = 0,
7241 JSVERSION_UNKNOWN = -1,
7242 JSVERSION_LATEST = JSVERSION_ECMA_5
7243 } JSVersion;
7244
7245 #define JSVERSION_IS_ECMA(version) ((version) == JSVERSION_DEFAULT || (version) >= JSVERSION_1_3)
7246
7247
7248
7249 typedef enum JSType {
7250 JSTYPE_VOID,
7251 JSTYPE_OBJECT,
7252 JSTYPE_FUNCTION,
7253 JSTYPE_STRING,
7254 JSTYPE_NUMBER,
7255 JSTYPE_BOOLEAN,
7256 JSTYPE_NULL,
7257 JSTYPE_XML,
7258 JSTYPE_LIMIT
7259 } JSType;
7260
7261
7262 typedef enum JSProtoKey {
7263 #define JS_PROTO(name,code,init) JSProto_ ##name = code,
7264 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsproto.tbl" 1
7265
7266
7267
7268
7269
7270
7271
7272 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsversion.h" 1
7273 # 11 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsversion.h"
7274 #define JS_VERSION 185
7275 # 42 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsversion.h"
7276 #define JS_VERSION_ECMA_3 148
7277 #define JS_VERSION_ECMA_3_TEST 149
7278 # 124 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsversion.h"
7279 #define JS_HAS_STR_HTML_HELPERS 1
7280 #define JS_HAS_OBJ_PROTO_PROP 1
7281 #define JS_HAS_OBJ_WATCHPOINT 1
7282 #define JS_HAS_TOSOURCE 1
7283 #define JS_HAS_CATCH_GUARD 1
7284 #define JS_HAS_UNEVAL 1
7285 #define JS_HAS_CONST 1
7286 #define JS_HAS_FUN_EXPR_STMT 1
7287 #define JS_HAS_NO_SUCH_METHOD 1
7288 #define JS_HAS_GENERATORS 1
7289 #define JS_HAS_BLOCK_SCOPE 1
7290 #define JS_HAS_DESTRUCTURING 2
7291 #define JS_HAS_GENERATOR_EXPRS 1
7292 #define JS_HAS_EXPR_CLOSURES 1
7293 # 146 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsversion.h"
7294 #define JS_HAS_NEW_GLOBAL_OBJECT 1
7295
7296
7297 #define JS_HAS_MAKE_SYSTEM_OBJECT 1
7298
7299
7300 #define JS_HAS_DESTRUCTURING_SHORTHAND (JS_HAS_DESTRUCTURING == 2)
7301
7302
7303
7304
7305
7306 #define OLD_GETTER_SETTER_METHODS 1
7307
7308
7309 #define USE_NEW_OBJECT_REPRESENTATION 0
7310
7311
7312
7313
7314 #define NEW_OBJECT_REPRESENTATION_ONLY() MOZ_NOT_REACHED("don't call this! to be used in the new object representation")
7315 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsproto.tbl" 2
7316
7317
7318 #define XML_INIT js_InitXMLClass
7319 #define NAMESPACE_INIT js_InitNamespaceClass
7320 #define QNAME_INIT js_InitQNameClass
7321 #define XMLFILTER_INIT js_InitXMLFilterClass
7322 # 27 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsproto.tbl"
7323 JSProto_Null = 0,
7324 JSProto_Object = 1,
7325 JSProto_Function = 2,
7326 JSProto_Array = 3,
7327 JSProto_Boolean = 4,
7328 JSProto_JSON = 5,
7329 JSProto_Date = 6,
7330 JSProto_Math = 7,
7331 JSProto_Number = 8,
7332 JSProto_String = 9,
7333 JSProto_RegExp = 10,
7334 JSProto_XML = 11,
7335 JSProto_Namespace = 12,
7336 JSProto_QName = 13,
7337 JSProto_Error = 14,
7338 JSProto_InternalError = 15,
7339 JSProto_EvalError = 16,
7340 JSProto_RangeError = 17,
7341 JSProto_ReferenceError = 18,
7342 JSProto_SyntaxError = 19,
7343 JSProto_TypeError = 20,
7344 JSProto_URIError = 21,
7345 JSProto_Iterator = 22,
7346 JSProto_StopIteration = 23,
7347 JSProto_ArrayBuffer = 24,
7348 JSProto_Int8Array = 25,
7349 JSProto_Uint8Array = 26,
7350 JSProto_Int16Array = 27,
7351 JSProto_Uint16Array = 28,
7352 JSProto_Int32Array = 29,
7353 JSProto_Uint32Array = 30,
7354 JSProto_Float32Array = 31,
7355 JSProto_Float64Array = 32,
7356 JSProto_Uint8ClampedArray = 33,
7357 JSProto_Proxy = 34,
7358 JSProto_AnyName = 35,
7359 JSProto_WeakMap = 36,
7360 JSProto_Map = 37,
7361 JSProto_Set = 38,
7362 JSProto_DataView = 39,
7363
7364 #undef XML_INIT
7365 #undef NAMESPACE_INIT
7366 #undef QNAME_INIT
7367 # 111 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jspubtd.h" 2
7368 #undef JS_PROTO
7369 JSProto_LIMIT
7370 } JSProtoKey;
7371
7372
7373 typedef enum JSAccessMode {
7374 JSACC_PROTO = 0,
7375 JSACC_PARENT = 1,
7376
7377
7378
7379
7380
7381
7382 JSACC_WATCH = 3,
7383 JSACC_READ = 4,
7384 JSACC_WRITE = 8,
7385 JSACC_LIMIT
7386 } JSAccessMode;
7387
7388 #define JSACC_TYPEMASK (JSACC_WRITE - 1)
7389
7390
7391
7392
7393
7394 typedef enum JSIterateOp {
7395
7396 JSENUMERATE_INIT,
7397
7398
7399 JSENUMERATE_INIT_ALL,
7400
7401
7402 JSENUMERATE_NEXT,
7403
7404
7405 JSENUMERATE_DESTROY
7406 } JSIterateOp;
7407
7408
7409 typedef enum {
7410 JSTRACE_OBJECT,
7411 JSTRACE_STRING,
7412 JSTRACE_SCRIPT,
7413
7414
7415
7416
7417
7418
7419 JSTRACE_XML,
7420
7421 JSTRACE_SHAPE,
7422 JSTRACE_BASE_SHAPE,
7423 JSTRACE_TYPE_OBJECT,
7424 JSTRACE_LAST = JSTRACE_TYPE_OBJECT
7425 } JSGCTraceKind;
7426
7427
7428 typedef struct JSClass JSClass;
7429 typedef struct JSCompartment JSCompartment;
7430 typedef struct JSConstDoubleSpec JSConstDoubleSpec;
7431 typedef struct JSContext JSContext;
7432 typedef struct JSCrossCompartmentCall JSCrossCompartmentCall;
7433 typedef struct JSErrorReport JSErrorReport;
7434 typedef struct JSExceptionState JSExceptionState;
7435 typedef struct JSFunction JSFunction;
7436 typedef struct JSFunctionSpec JSFunctionSpec;
7437 typedef struct JSIdArray JSIdArray;
7438 typedef struct JSLocaleCallbacks JSLocaleCallbacks;
7439 typedef struct JSObject JSObject;
7440 typedef struct JSObjectMap JSObjectMap;
7441 typedef struct JSPrincipals JSPrincipals;
7442 typedef struct JSPropertyDescriptor JSPropertyDescriptor;
7443 typedef struct JSPropertyName JSPropertyName;
7444 typedef struct JSPropertySpec JSPropertySpec;
7445 typedef struct JSRuntime JSRuntime;
7446 typedef struct JSSecurityCallbacks JSSecurityCallbacks;
7447 typedef struct JSStackFrame JSStackFrame;
7448 typedef struct JSScript JSScript;
7449 typedef struct JSStructuredCloneCallbacks JSStructuredCloneCallbacks;
7450 typedef struct JSStructuredCloneReader JSStructuredCloneReader;
7451 typedef struct JSStructuredCloneWriter JSStructuredCloneWriter;
7452 typedef struct JSTracer JSTracer;
7453
7454
7455 class JSFlatString;
7456 class JSString;
7457
7458
7459
7460
7461
7462
7463 typedef struct PRCallOnceType JSCallOnceType;
7464
7465
7466
7467 typedef JSBool (*JSInitCallback)(void);
7468
7469 }
7470
7471
7472
7473 namespace JS {
7474
7475 template <typename T>
7476 class Rooted;
7477
7478 class SkipRoot;
7479
7480 enum ThingRootKind
7481 {
7482 THING_ROOT_OBJECT,
7483 THING_ROOT_SHAPE,
7484 THING_ROOT_BASE_SHAPE,
7485 THING_ROOT_TYPE_OBJECT,
7486 THING_ROOT_STRING,
7487 THING_ROOT_SCRIPT,
7488 THING_ROOT_XML,
7489 THING_ROOT_ID,
7490 THING_ROOT_VALUE,
7491 THING_ROOT_LIMIT
7492 };
7493
7494 struct ContextFriendFields {
7495 JSRuntime *const runtime;
7496
7497 ContextFriendFields(JSRuntime *rt)
7498 : runtime(rt) { }
7499
7500 static const ContextFriendFields *get(const JSContext *cx) {
7501 return reinterpret_cast<const ContextFriendFields *>(cx);
7502 }
7503
7504 static ContextFriendFields *get(JSContext *cx) {
7505 return reinterpret_cast<ContextFriendFields *>(cx);
7506 }
7507 # 272 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jspubtd.h"
7508 };
7509
7510 }
7511 # 22 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h" 2
7512 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsutil.h" 1
7513 # 12 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsutil.h"
7514 #define jsutil_h___
7515
7516
7517
7518 # 1 "./../../dist/include/js/Utility.h" 1
7519 # 9 "./../../dist/include/js/Utility.h"
7520 #define js_utility_h__
7521
7522
7523
7524
7525 # 1 "/usr/include/string.h" 1 3 4
7526 # 25 "/usr/include/string.h" 3 4
7527 #define _STRING_H 1
7528
7529
7530
7531 extern "C" {
7532
7533
7534 #define __need_size_t
7535 #define __need_NULL
7536 # 1 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 1 3 4
7537 # 160 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
7538 #undef __need_ptrdiff_t
7539 # 233 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
7540 #undef __need_size_t
7541 # 342 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
7542 #undef __need_wchar_t
7543 # 395 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
7544 #undef NULL
7545
7546 #define NULL __null
7547 # 406 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
7548 #undef __need_NULL
7549
7550
7551
7552
7553 #define offsetof(TYPE,MEMBER) __builtin_offsetof (TYPE, MEMBER)
7554 # 35 "/usr/include/string.h" 2 3 4
7555
7556
7557
7558 #define __CORRECT_ISO_CPP_STRING_H_PROTO
7559
7560
7561
7562
7563
7564 extern void *memcpy (void *__restrict __dest,
7565 __const void *__restrict __src, size_t __n)
7566 throw () __attribute__ ((__nonnull__ (1, 2)));
7567
7568
7569 extern void *memmove (void *__dest, __const void *__src, size_t __n)
7570 throw () __attribute__ ((__nonnull__ (1, 2)));
7571
7572
7573
7574
7575
7576
7577 extern void *memccpy (void *__restrict __dest, __const void *__restrict __src,
7578 int __c, size_t __n)
7579 throw () __attribute__ ((__nonnull__ (1, 2)));
7580
7581
7582
7583
7584
7585 extern void *memset (void *__s, int __c, size_t __n) throw () __attribute__ ((__nonnull__ (1)));
7586
7587
7588 extern int memcmp (__const void *__s1, __const void *__s2, size_t __n)
7589 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
7590
7591
7592
7593 extern "C++"
7594 {
7595 extern void *memchr (void *__s, int __c, size_t __n)
7596 throw () __asm ("memchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
7597 extern __const void *memchr (__const void *__s, int __c, size_t __n)
7598 throw () __asm ("memchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
7599
7600
7601 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) void *
7602 memchr (void *__s, int __c, size_t __n) throw ()
7603 {
7604 return __builtin_memchr (__s, __c, __n);
7605 }
7606
7607 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __const void *
7608 memchr (__const void *__s, int __c, size_t __n) throw ()
7609 {
7610 return __builtin_memchr (__s, __c, __n);
7611 }
7612
7613 }
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624 extern "C++" void *rawmemchr (void *__s, int __c)
7625 throw () __asm ("rawmemchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
7626 extern "C++" __const void *rawmemchr (__const void *__s, int __c)
7627 throw () __asm ("rawmemchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
7628
7629
7630
7631
7632
7633
7634
7635 extern "C++" void *memrchr (void *__s, int __c, size_t __n)
7636 throw () __asm ("memrchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
7637 extern "C++" __const void *memrchr (__const void *__s, int __c, size_t __n)
7638 throw () __asm ("memrchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648 extern char *strcpy (char *__restrict __dest, __const char *__restrict __src)
7649 throw () __attribute__ ((__nonnull__ (1, 2)));
7650
7651 extern char *strncpy (char *__restrict __dest,
7652 __const char *__restrict __src, size_t __n)
7653 throw () __attribute__ ((__nonnull__ (1, 2)));
7654
7655
7656 extern char *strcat (char *__restrict __dest, __const char *__restrict __src)
7657 throw () __attribute__ ((__nonnull__ (1, 2)));
7658
7659 extern char *strncat (char *__restrict __dest, __const char *__restrict __src,
7660 size_t __n) throw () __attribute__ ((__nonnull__ (1, 2)));
7661
7662
7663 extern int strcmp (__const char *__s1, __const char *__s2)
7664 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
7665
7666 extern int strncmp (__const char *__s1, __const char *__s2, size_t __n)
7667 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
7668
7669
7670 extern int strcoll (__const char *__s1, __const char *__s2)
7671 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
7672
7673 extern size_t strxfrm (char *__restrict __dest,
7674 __const char *__restrict __src, size_t __n)
7675 throw () __attribute__ ((__nonnull__ (2)));
7676
7677 # 165 "/usr/include/string.h" 3 4
7678 extern int strcoll_l (__const char *__s1, __const char *__s2, __locale_t __l)
7679 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));
7680
7681 extern size_t strxfrm_l (char *__dest, __const char *__src, size_t __n,
7682 __locale_t __l) throw () __attribute__ ((__nonnull__ (2, 4)));
7683
7684
7685
7686
7687
7688 extern char *strdup (__const char *__s)
7689 throw () __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
7690
7691
7692
7693
7694
7695
7696 extern char *strndup (__const char *__string, size_t __n)
7697 throw () __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
7698
7699
7700
7701
7702 #define strdupa(s) (__extension__ ({ __const char *__old = (s); size_t __len = strlen (__old) + 1; char *__new = (char *) __builtin_alloca (__len); (char *) memcpy (__new, __old, __len); }))
7703 # 199 "/usr/include/string.h" 3 4
7704 #define strndupa(s,n) (__extension__ ({ __const char *__old = (s); size_t __len = strnlen (__old, (n)); char *__new = (char *) __builtin_alloca (__len + 1); __new[__len] = '\0'; (char *) memcpy (__new, __old, __len); }))
7705 # 210 "/usr/include/string.h" 3 4
7706
7707
7708
7709 extern "C++"
7710 {
7711 extern char *strchr (char *__s, int __c)
7712 throw () __asm ("strchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
7713 extern __const char *strchr (__const char *__s, int __c)
7714 throw () __asm ("strchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
7715
7716
7717 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) char *
7718 strchr (char *__s, int __c) throw ()
7719 {
7720 return __builtin_strchr (__s, __c);
7721 }
7722
7723 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __const char *
7724 strchr (__const char *__s, int __c) throw ()
7725 {
7726 return __builtin_strchr (__s, __c);
7727 }
7728
7729 }
7730
7731
7732
7733
7734
7735
7736 extern "C++"
7737 {
7738 extern char *strrchr (char *__s, int __c)
7739 throw () __asm ("strrchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
7740 extern __const char *strrchr (__const char *__s, int __c)
7741 throw () __asm ("strrchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
7742
7743
7744 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) char *
7745 strrchr (char *__s, int __c) throw ()
7746 {
7747 return __builtin_strrchr (__s, __c);
7748 }
7749
7750 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __const char *
7751 strrchr (__const char *__s, int __c) throw ()
7752 {
7753 return __builtin_strrchr (__s, __c);
7754 }
7755
7756 }
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767 extern "C++" char *strchrnul (char *__s, int __c)
7768 throw () __asm ("strchrnul") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
7769 extern "C++" __const char *strchrnul (__const char *__s, int __c)
7770 throw () __asm ("strchrnul") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780 extern size_t strcspn (__const char *__s, __const char *__reject)
7781 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
7782
7783
7784 extern size_t strspn (__const char *__s, __const char *__accept)
7785 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
7786
7787
7788 extern "C++"
7789 {
7790 extern char *strpbrk (char *__s, __const char *__accept)
7791 throw () __asm ("strpbrk") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
7792 extern __const char *strpbrk (__const char *__s, __const char *__accept)
7793 throw () __asm ("strpbrk") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
7794
7795
7796 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) char *
7797 strpbrk (char *__s, __const char *__accept) throw ()
7798 {
7799 return __builtin_strpbrk (__s, __accept);
7800 }
7801
7802 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __const char *
7803 strpbrk (__const char *__s, __const char *__accept) throw ()
7804 {
7805 return __builtin_strpbrk (__s, __accept);
7806 }
7807
7808 }
7809
7810
7811
7812
7813
7814
7815 extern "C++"
7816 {
7817 extern char *strstr (char *__haystack, __const char *__needle)
7818 throw () __asm ("strstr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
7819 extern __const char *strstr (__const char *__haystack,
7820 __const char *__needle)
7821 throw () __asm ("strstr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
7822
7823
7824 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) char *
7825 strstr (char *__haystack, __const char *__needle) throw ()
7826 {
7827 return __builtin_strstr (__haystack, __needle);
7828 }
7829
7830 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __const char *
7831 strstr (__const char *__haystack, __const char *__needle) throw ()
7832 {
7833 return __builtin_strstr (__haystack, __needle);
7834 }
7835
7836 }
7837
7838
7839
7840
7841
7842
7843
7844 extern char *strtok (char *__restrict __s, __const char *__restrict __delim)
7845 throw () __attribute__ ((__nonnull__ (2)));
7846
7847
7848
7849
7850 extern char *__strtok_r (char *__restrict __s,
7851 __const char *__restrict __delim,
7852 char **__restrict __save_ptr)
7853 throw () __attribute__ ((__nonnull__ (2, 3)));
7854
7855 extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim,
7856 char **__restrict __save_ptr)
7857 throw () __attribute__ ((__nonnull__ (2, 3)));
7858
7859
7860
7861
7862
7863 extern "C++" char *strcasestr (char *__haystack, __const char *__needle)
7864 throw () __asm ("strcasestr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
7865 extern "C++" __const char *strcasestr (__const char *__haystack,
7866 __const char *__needle)
7867 throw () __asm ("strcasestr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
7868 # 382 "/usr/include/string.h" 3 4
7869 extern void *memmem (__const void *__haystack, size_t __haystacklen,
7870 __const void *__needle, size_t __needlelen)
7871 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3)));
7872
7873
7874
7875 extern void *__mempcpy (void *__restrict __dest,
7876 __const void *__restrict __src, size_t __n)
7877 throw () __attribute__ ((__nonnull__ (1, 2)));
7878 extern void *mempcpy (void *__restrict __dest,
7879 __const void *__restrict __src, size_t __n)
7880 throw () __attribute__ ((__nonnull__ (1, 2)));
7881
7882
7883
7884
7885
7886 extern size_t strlen (__const char *__s)
7887 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
7888
7889
7890
7891
7892
7893 extern size_t strnlen (__const char *__string, size_t __maxlen)
7894 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
7895
7896
7897
7898
7899
7900 extern char *strerror (int __errnum) throw ();
7901
7902 # 438 "/usr/include/string.h" 3 4
7903 extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
7904 throw () __attribute__ ((__nonnull__ (2)));
7905
7906
7907
7908
7909
7910 extern char *strerror_l (int __errnum, __locale_t __l) throw ();
7911
7912
7913
7914
7915
7916 extern void __bzero (void *__s, size_t __n) throw () __attribute__ ((__nonnull__ (1)));
7917
7918
7919
7920 extern void bcopy (__const void *__src, void *__dest, size_t __n)
7921 throw () __attribute__ ((__nonnull__ (1, 2)));
7922
7923
7924 extern void bzero (void *__s, size_t __n) throw () __attribute__ ((__nonnull__ (1)));
7925
7926
7927 extern int bcmp (__const void *__s1, __const void *__s2, size_t __n)
7928 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
7929
7930
7931
7932 extern "C++"
7933 {
7934 extern char *index (char *__s, int __c)
7935 throw () __asm ("index") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
7936 extern __const char *index (__const char *__s, int __c)
7937 throw () __asm ("index") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
7938
7939
7940 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) char *
7941 index (char *__s, int __c) throw ()
7942 {
7943 return __builtin_index (__s, __c);
7944 }
7945
7946 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __const char *
7947 index (__const char *__s, int __c) throw ()
7948 {
7949 return __builtin_index (__s, __c);
7950 }
7951
7952 }
7953
7954
7955
7956
7957
7958
7959
7960 extern "C++"
7961 {
7962 extern char *rindex (char *__s, int __c)
7963 throw () __asm ("rindex") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
7964 extern __const char *rindex (__const char *__s, int __c)
7965 throw () __asm ("rindex") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
7966
7967
7968 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) char *
7969 rindex (char *__s, int __c) throw ()
7970 {
7971 return __builtin_rindex (__s, __c);
7972 }
7973
7974 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __const char *
7975 rindex (__const char *__s, int __c) throw ()
7976 {
7977 return __builtin_rindex (__s, __c);
7978 }
7979
7980 }
7981
7982
7983
7984
7985
7986
7987
7988 extern int ffs (int __i) throw () __attribute__ ((__const__));
7989
7990
7991
7992
7993 extern int ffsl (long int __l) throw () __attribute__ ((__const__));
7994
7995 __extension__ extern int ffsll (long long int __ll)
7996 throw () __attribute__ ((__const__));
7997
7998
7999
8000
8001 extern int strcasecmp (__const char *__s1, __const char *__s2)
8002 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
8003
8004
8005 extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n)
8006 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
8007
8008
8009
8010
8011
8012 extern int strcasecmp_l (__const char *__s1, __const char *__s2,
8013 __locale_t __loc)
8014 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));
8015
8016 extern int strncasecmp_l (__const char *__s1, __const char *__s2,
8017 size_t __n, __locale_t __loc)
8018 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));
8019
8020
8021
8022
8023
8024 extern char *strsep (char **__restrict __stringp,
8025 __const char *__restrict __delim)
8026 throw () __attribute__ ((__nonnull__ (1, 2)));
8027
8028
8029
8030
8031 extern char *strsignal (int __sig) throw ();
8032
8033
8034 extern char *__stpcpy (char *__restrict __dest, __const char *__restrict __src)
8035 throw () __attribute__ ((__nonnull__ (1, 2)));
8036 extern char *stpcpy (char *__restrict __dest, __const char *__restrict __src)
8037 throw () __attribute__ ((__nonnull__ (1, 2)));
8038
8039
8040
8041 extern char *__stpncpy (char *__restrict __dest,
8042 __const char *__restrict __src, size_t __n)
8043 throw () __attribute__ ((__nonnull__ (1, 2)));
8044 extern char *stpncpy (char *__restrict __dest,
8045 __const char *__restrict __src, size_t __n)
8046 throw () __attribute__ ((__nonnull__ (1, 2)));
8047
8048
8049
8050
8051 extern int strverscmp (__const char *__s1, __const char *__s2)
8052 throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
8053
8054
8055 extern char *strfry (char *__string) throw () __attribute__ ((__nonnull__ (1)));
8056
8057
8058 extern void *memfrob (void *__s, size_t __n) throw () __attribute__ ((__nonnull__ (1)));
8059
8060
8061
8062
8063
8064
8065
8066 extern "C++" char *basename (char *__filename)
8067 throw () __asm ("basename") __attribute__ ((__nonnull__ (1)));
8068 extern "C++" __const char *basename (__const char *__filename)
8069 throw () __asm ("basename") __attribute__ ((__nonnull__ (1)));
8070 # 642 "/usr/include/string.h" 3 4
8071 # 1 "/usr/include/bits/string3.h" 1 3 4
8072 # 23 "/usr/include/bits/string3.h" 3 4
8073 extern void __warn_memset_zero_len (void) __attribute__((__warning__ ("memset used with constant zero length parameter; this could be due to transposed parameters")))
8074 ;
8075 # 48 "/usr/include/bits/string3.h" 3 4
8076 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) void *
8077 memcpy (void *__restrict __dest, __const void *__restrict __src, size_t __len) throw ()
8078
8079 {
8080 return __builtin___memcpy_chk (__dest, __src, __len, __builtin_object_size (__dest, 0));
8081 }
8082
8083 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) void *
8084 memmove (void *__dest, __const void *__src, size_t __len) throw ()
8085 {
8086 return __builtin___memmove_chk (__dest, __src, __len, __builtin_object_size (__dest, 0));
8087 }
8088
8089
8090 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) void *
8091 mempcpy (void *__restrict __dest, __const void *__restrict __src, size_t __len) throw ()
8092
8093 {
8094 return __builtin___mempcpy_chk (__dest, __src, __len, __builtin_object_size (__dest, 0));
8095 }
8096 # 76 "/usr/include/bits/string3.h" 3 4
8097 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) void *
8098 memset (void *__dest, int __ch, size_t __len) throw ()
8099 {
8100 if (__builtin_constant_p (__len) && __len == 0
8101 && (!__builtin_constant_p (__ch) || __ch != 0))
8102 {
8103 __warn_memset_zero_len ();
8104 return __dest;
8105 }
8106 return __builtin___memset_chk (__dest, __ch, __len, __builtin_object_size (__dest, 0));
8107 }
8108
8109
8110 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) void
8111 bcopy (__const void *__src, void *__dest, size_t __len) throw ()
8112 {
8113 (void) __builtin___memmove_chk (__dest, __src, __len, __builtin_object_size (__dest, 0));
8114 }
8115
8116 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) void
8117 bzero (void *__dest, size_t __len) throw ()
8118 {
8119 (void) __builtin___memset_chk (__dest, '\0', __len, __builtin_object_size (__dest, 0));
8120 }
8121
8122
8123 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) char *
8124 strcpy (char *__restrict __dest, __const char *__restrict __src) throw ()
8125 {
8126 return __builtin___strcpy_chk (__dest, __src, __builtin_object_size (__dest, 2 > 1));
8127 }
8128
8129
8130 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) char *
8131 stpcpy (char *__restrict __dest, __const char *__restrict __src) throw ()
8132 {
8133 return __builtin___stpcpy_chk (__dest, __src, __builtin_object_size (__dest, 2 > 1));
8134 }
8135
8136
8137
8138 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) char *
8139 strncpy (char *__restrict __dest, __const char *__restrict __src, size_t __len) throw ()
8140
8141 {
8142 return __builtin___strncpy_chk (__dest, __src, __len, __builtin_object_size (__dest, 2 > 1));
8143 }
8144
8145
8146 extern char *__stpncpy_chk (char *__dest, __const char *__src, size_t __n,
8147 size_t __destlen) throw ();
8148 extern char *__stpncpy_alias (char *__dest, __const char *__src, size_t __n) throw () __asm__ ("" "stpncpy")
8149
8150 ;
8151
8152 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) char *
8153 stpncpy (char *__dest, __const char *__src, size_t __n) throw ()
8154 {
8155 if (__builtin_object_size (__dest, 2 > 1) != (size_t) -1
8156 && (!__builtin_constant_p (__n) || __n <= __builtin_object_size (__dest, 2 > 1)))
8157 return __stpncpy_chk (__dest, __src, __n, __builtin_object_size (__dest, 2 > 1));
8158 return __stpncpy_alias (__dest, __src, __n);
8159 }
8160
8161
8162 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) char *
8163 strcat (char *__restrict __dest, __const char *__restrict __src) throw ()
8164 {
8165 return __builtin___strcat_chk (__dest, __src, __builtin_object_size (__dest, 2 > 1));
8166 }
8167
8168
8169 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) char *
8170 strncat (char *__restrict __dest, __const char *__restrict __src, size_t __len) throw ()
8171
8172 {
8173 return __builtin___strncat_chk (__dest, __src, __len, __builtin_object_size (__dest, 2 > 1));
8174 }
8175 # 643 "/usr/include/string.h" 2 3 4
8176
8177
8178
8179 }
8180 # 15 "./../../dist/include/js/Utility.h" 2
8181
8182
8183
8184
8185
8186
8187 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jstypes.h" 1
8188 # 22 "./../../dist/include/js/Utility.h" 2
8189
8190
8191
8192
8193 namespace JS {}
8194
8195
8196 namespace mozilla {}
8197
8198
8199 namespace js {
8200
8201
8202 using namespace JS;
8203 using namespace mozilla;
8204
8205 }
8206
8207
8208 extern "C" {
8209
8210
8211
8212
8213
8214 #define JS_FREE_PATTERN 0xDA
8215
8216 #define JS_ASSERT(expr) MOZ_ASSERT(expr)
8217 #define JS_ASSERT_IF(cond,expr) MOZ_ASSERT_IF(cond, expr)
8218 #define JS_NOT_REACHED(reason) MOZ_NOT_REACHED(reason)
8219 #define JS_ALWAYS_TRUE(expr) MOZ_ALWAYS_TRUE(expr)
8220 #define JS_ALWAYS_FALSE(expr) MOZ_ALWAYS_FALSE(expr)
8221 # 62 "./../../dist/include/js/Utility.h"
8222 #define JS_THREADSAFE_ASSERT(expr) ((void) 0)
8223
8224
8225 #define JS_STATIC_ASSERT(cond) MOZ_STATIC_ASSERT(cond, "JS_STATIC_ASSERT")
8226 #define JS_STATIC_ASSERT_IF(cond,expr) MOZ_STATIC_ASSERT_IF(cond, expr, "JS_STATIC_ASSERT_IF")
8227
8228
8229
8230
8231
8232
8233 extern __attribute__((visibility("default"))) void JS_Abort(void);
8234 # 140 "./../../dist/include/js/Utility.h"
8235 #define JS_OOM_POSSIBLY_FAIL() do {} while(0)
8236 #define JS_OOM_POSSIBLY_FAIL_REPORT(cx) do {} while(0)
8237
8238
8239
8240
8241
8242
8243
8244 static inline void* js_malloc(size_t bytes)
8245 {
8246 do {} while(0);
8247 return malloc(bytes);
8248 }
8249
8250 static inline void* js_calloc(size_t bytes)
8251 {
8252 do {} while(0);
8253 return calloc(bytes, 1);
8254 }
8255
8256 static inline void* js_realloc(void* p, size_t bytes)
8257 {
8258 do {} while(0);
8259 return realloc(p, bytes);
8260 }
8261
8262 static inline void js_free(void* p)
8263 {
8264 free(p);
8265 }
8266 # 234 "./../../dist/include/js/Utility.h"
8267 #define js_bitscan_ctz32(val) __builtin_ctz(val)
8268 #define js_bitscan_clz32(val) __builtin_clz(val)
8269 #define JS_HAS_BUILTIN_BITSCAN32
8270 # 255 "./../../dist/include/js/Utility.h"
8271 #define JS_CEILING_LOG2(_log2,_n) JS_BEGIN_MACRO unsigned int j_ = (unsigned int)(_n); (_log2) = (j_ <= 1 ? 0 : 32 - js_bitscan_clz32(j_ - 1)); JS_END_MACRO
8272 # 292 "./../../dist/include/js/Utility.h"
8273 #define JS_FLOOR_LOG2(_log2,_n) JS_BEGIN_MACRO (_log2) = 31 - js_bitscan_clz32(((unsigned int)(_n)) | 1); JS_END_MACRO
8274 # 316 "./../../dist/include/js/Utility.h"
8275 #define js_FloorLog2wImpl(n) ((size_t)(JS_BITS_PER_WORD - 1 - js_bitscan_clz32(n)))
8276 # 338 "./../../dist/include/js/Utility.h"
8277 #define JS_CEILING_LOG2W(n) ((n) <= 1 ? 0 : 1 + JS_FLOOR_LOG2W((n) - 1))
8278
8279
8280
8281
8282
8283
8284
8285 static __attribute__((always_inline)) inline size_t
8286 JS_FLOOR_LOG2W(size_t n)
8287 {
8288 do { } while(0);
8289 return ((size_t)((8 * 4) - 1 - __builtin_clz(n)));
8290 }
8291
8292 }
8293 # 437 "./../../dist/include/js/Utility.h"
8294 #define JS_NEW_BODY(allocator,t,parms) void *memory = allocator(sizeof(t)); return memory ? new(memory) t parms : NULL;
8295 # 450 "./../../dist/include/js/Utility.h"
8296 #define JS_DECLARE_NEW_METHODS(ALLOCATOR,QUALIFIERS) template <class T> QUALIFIERS T *new_() { JS_NEW_BODY(ALLOCATOR, T, ()) } template <class T, class P1> QUALIFIERS T *new_(P1 p1) { JS_NEW_BODY(ALLOCATOR, T, (p1)) } template <class T, class P1, class P2> QUALIFIERS T *new_(P1 p1, P2 p2) { JS_NEW_BODY(ALLOCATOR, T, (p1, p2)) } template <class T, class P1, class P2, class P3> QUALIFIERS T *new_(P1 p1, P2 p2, P3 p3) { JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3)) } template <class T, class P1, class P2, class P3, class P4> QUALIFIERS T *new_(P1 p1, P2 p2, P3 p3, P4 p4) { JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4)) } template <class T, class P1, class P2, class P3, class P4, class P5> QUALIFIERS T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) { JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5)) } template <class T, class P1, class P2, class P3, class P4, class P5, class P6> QUALIFIERS T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6) { JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6)) } template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7> QUALIFIERS T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7) { JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7)) } template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8> QUALIFIERS T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8) { JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8)) } template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9> QUALIFIERS T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9) { JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8, p9)) } template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10> QUALIFIERS T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10) { JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10)) } template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class P11> QUALIFIERS T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11) { JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11)) } template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class P11, class P12> QUALIFIERS T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11, P12 p12) { JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12)) } static const int JSMinAlignment = 8; template <class T> QUALIFIERS T *array_new(size_t n) { uint64_t numBytes64 = uint64_t(JSMinAlignment) + uint64_t(sizeof(T)) * uint64_t(n); size_t numBytes = size_t(numBytes64); if (numBytes64 != numBytes) { JS_ASSERT(0); return NULL; } void *memory = ALLOCATOR(numBytes); if (!memory) return NULL; *(size_t *)memory = n; memory = (void*)(uintptr_t(memory) + JSMinAlignment); return new(memory) T[n]; }
8297 # 534 "./../../dist/include/js/Utility.h"
8298 #define JS_DECLARE_DELETE_METHODS(DEALLOCATOR,QUALIFIERS) template <class T> QUALIFIERS void delete_(T *p) { if (p) { p->~T(); DEALLOCATOR(p); } } template <class T> QUALIFIERS void array_delete(T *p) { if (p) { void* p0 = (void *)(uintptr_t(p) - js::OffTheBooks::JSMinAlignment); size_t n = *(size_t *)p0; for (size_t i = 0; i < n; i++) (p + i)->~T(); DEALLOCATOR(p0); } }
8299 # 561 "./../../dist/include/js/Utility.h"
8300 namespace js {
8301
8302 class OffTheBooks {
8303 public:
8304 template <class T> __attribute__((always_inline)) inline static T *new_() { void *memory = ::js_malloc(sizeof(T)); return memory ? new(memory) T () : __null; } template <class T, class P1> __attribute__((always_inline)) inline static T *new_(P1 p1) { void *memory = ::js_malloc(sizeof(T)); return memory ? new(memory) T (p1) : __null; } template <class T, class P1, class P2> __attribute__((always_inline)) inline static T *new_(P1 p1, P2 p2) { void *memory = ::js_malloc(sizeof(T)); return memory ? new(memory) T (p1, p2) : __null; } template <class T, class P1, class P2, class P3> __attribute__((always_inline)) inline static T *new_(P1 p1, P2 p2, P3 p3) { void *memory = ::js_malloc(sizeof(T)); return memory ? new(memory) T (p1, p2, p3) : __null; } template <class T, class P1, class P2, class P3, class P4> __attribute__((always_inline)) inline static T *new_(P1 p1, P2 p2, P3 p3, P4 p4) { void *memory = ::js_malloc(sizeof(T)); return memory ? new(memory) T (p1, p2, p3, p4) : __null; } template <class T, class P1, class P2, class P3, class P4, class P5> __attribute__((always_inline)) inline static T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) { void *memory = ::js_malloc(sizeof(T)); return memory ? new(memory) T (p1, p2, p3, p4, p5) : __null; } template <class T, class P1, class P2, class P3, class P4, class P5, class P6> __attribute__((always_inline)) inline static T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6) { void *memory = ::js_malloc(sizeof(T)); return memory ? new(memory) T (p1, p2, p3, p4, p5, p6) : __null; } template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7> __attribute__((always_inline)) inline static T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7) { void *memory = ::js_malloc(sizeof(T)); return memory ? new(memory) T (p1, p2, p3, p4, p5, p6, p7) : __null; } template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8> __attribute__((always_inline)) inline static T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8) { void *memory = ::js_malloc(sizeof(T)); return memory ? new(memory) T (p1, p2, p3, p4, p5, p6, p7, p8) : __null; } template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9> __attribute__((always_inline)) inline static T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9) { void *memory = ::js_malloc(sizeof(T)); return memory ? new(memory) T (p1, p2, p3, p4, p5, p6, p7, p8, p9) : __null; } template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10> __attribute__((always_inline)) inline static T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10) { void *memory = ::js_malloc(sizeof(T)); return memory ? new(memory) T (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10) : __null; } template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class P11> __attribute__((always_inline)) inline static T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11) { void *memory = ::js_malloc(sizeof(T)); return memory ? new(memory) T (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11) : __null; } template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class P11, class P12> __attribute__((always_inline)) inline static T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11, P12 p12) { void *memory = ::js_malloc(sizeof(T)); return memory ? new(memory) T (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12) : __null; } static const int JSMinAlignment = 8; template <class T> __attribute__((always_inline)) inline static T *array_new(size_t n) { uint64_t numBytes64 = uint64_t(JSMinAlignment) + uint64_t(sizeof(T)) * uint64_t(n); size_t numBytes = size_t(numBytes64); if (numBytes64 != numBytes) { do { } while(0); return __null; } void *memory = ::js_malloc(numBytes); if (!memory) return __null; *(size_t *)memory = n; memory = (void*)(uintptr_t(memory) + JSMinAlignment); return new(memory) T[n]; }
8305
8306 static inline void* malloc_(size_t bytes) {
8307 return ::js_malloc(bytes);
8308 }
8309
8310 static inline void* calloc_(size_t bytes) {
8311 return ::js_calloc(bytes);
8312 }
8313
8314 static inline void* realloc_(void* p, size_t bytes) {
8315 return ::js_realloc(p, bytes);
8316 }
8317 };
8318
8319
8320
8321
8322
8323 class Foreground {
8324 public:
8325
8326 static __attribute__((always_inline)) inline void free_(void* p) {
8327 ::js_free(p);
8328 }
8329
8330 template <class T> __attribute__((always_inline)) inline static void delete_(T *p) { if (p) { p->~T(); ::js_free(p); } } template <class T> __attribute__((always_inline)) inline static void array_delete(T *p) { if (p) { void* p0 = (void *)(uintptr_t(p) - js::OffTheBooks::JSMinAlignment); size_t n = *(size_t *)p0; for (size_t i = 0; i < n; i++) (p + i)->~T(); ::js_free(p0); } }
8331 };
8332
8333 class UnwantedForeground : public Foreground {
8334 };
8335
8336 }
8337
8338
8339
8340
8341
8342 #define JS_DECLARE_ALLOCATION_FRIENDS_FOR_PRIVATE_CONSTRUCTOR friend class js::OffTheBooks; friend class js::Foreground; friend class js::UnwantedForeground; friend struct ::JSContext; friend struct ::JSRuntime
8343 # 701 "./../../dist/include/js/Utility.h"
8344 #define JS_DECL_USE_GUARD_OBJECT_NOTIFIER
8345 #define JS_GUARD_OBJECT_NOTIFIER_PARAM
8346 #define JS_GUARD_OBJECT_NOTIFIER_PARAM_NO_INIT
8347 #define JS_GUARD_OBJECT_NOTIFIER_PARAM0
8348 #define JS_GUARD_OBJECT_NOTIFIER_INIT JS_BEGIN_MACRO JS_END_MACRO
8349
8350
8351
8352 namespace js {
8353 # 811 "./../../dist/include/js/Utility.h"
8354 template<typename T>
8355 class MoveRef {
8356 public:
8357 typedef T Referent;
8358 explicit MoveRef(T &t) : pointer(&t) { }
8359 T &operator*() const { return *pointer; }
8360 T *operator->() const { return pointer; }
8361 # 830 "./../../dist/include/js/Utility.h"
8362 operator T& () const { return *pointer; }
8363
8364 private:
8365 T *pointer;
8366 };
8367
8368 template<typename T>
8369 MoveRef<T> Move(T &t) { return MoveRef<T>(t); }
8370
8371 template<typename T>
8372 MoveRef<T> Move(const T &t) { return MoveRef<T>(const_cast<T &>(t)); }
8373
8374
8375 class ReentrancyGuard
8376 {
8377
8378 ReentrancyGuard(const ReentrancyGuard &);
8379 void operator=(const ReentrancyGuard &);
8380
8381
8382
8383
8384 public:
8385 template <class T>
8386
8387
8388
8389
8390 ReentrancyGuard(T & )
8391
8392 {
8393
8394
8395
8396
8397 }
8398 ~ReentrancyGuard()
8399 {
8400
8401
8402
8403 }
8404 };
8405
8406
8407
8408
8409
8410 __attribute__((always_inline)) inline size_t
8411 RoundUpPow2(size_t x)
8412 {
8413 return size_t(1) << ((x) <= 1 ? 0 : 1 + JS_FLOOR_LOG2W((x) - 1));
8414 }
8415
8416 }
8417
8418 namespace JS {
8419 # 899 "./../../dist/include/js/Utility.h"
8420 inline void PoisonPtr(uintptr_t *v)
8421 {
8422
8423
8424
8425
8426 }
8427
8428 template <typename T>
8429 inline bool IsPoisonedPtr(T *v)
8430 {
8431
8432
8433
8434
8435 return false;
8436
8437 }
8438
8439 }
8440
8441
8442
8443
8444
8445
8446 typedef size_t(*JSMallocSizeOfFun)(const void *p);
8447
8448
8449
8450 #define HAVE_STATIC_ANNOTATIONS
8451 # 955 "./../../dist/include/js/Utility.h"
8452 #define STATIC_PRECONDITION(COND)
8453 #define STATIC_PRECONDITION_ASSUME(COND)
8454 #define STATIC_POSTCONDITION(COND)
8455 #define STATIC_POSTCONDITION_ASSUME(COND)
8456 #define STATIC_INVARIANT(COND)
8457 #define STATIC_INVARIANT_ASSUME(COND)
8458 #define STATIC_ASSERT(COND) JS_BEGIN_MACRO JS_END_MACRO
8459 #define STATIC_ASSUME(COND) JS_BEGIN_MACRO JS_END_MACRO
8460 #define STATIC_ASSERT_RUNTIME(COND) JS_BEGIN_MACRO JS_END_MACRO
8461
8462 #define STATIC_SKIP_INFERENCE STATIC_INVARIANT(skip_inference())
8463 # 17 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsutil.h" 2
8464
8465
8466 struct JSContext;
8467
8468 static __attribute__((always_inline)) inline void *
8469 js_memcpy(void *dst_, const void *src_, size_t len)
8470 {
8471 char *dst = (char *) dst_;
8472 const char *src = (const char *) src_;
8473 do { } while (0);
8474 do { } while (0);
8475
8476 return memcpy(dst, src, len);
8477 }
8478
8479
8480 namespace js {
8481
8482 template <class T>
8483 struct AlignmentTestStruct
8484 {
8485 char c;
8486 T t;
8487 };
8488
8489
8490 #define JS_ALIGNMENT_OF(t_) (sizeof(js::AlignmentTestStruct<t_>) - sizeof(t_))
8491
8492
8493 template <class T>
8494 class AlignedPtrAndFlag
8495 {
8496 uintptr_t bits;
8497
8498 public:
8499 AlignedPtrAndFlag(T *t, bool flag) {
8500 do { } while(0);
8501 bits = uintptr_t(t) | uintptr_t(flag);
8502 }
8503
8504 T *ptr() const {
8505 return (T *)(bits & ~uintptr_t(1));
8506 }
8507
8508 bool flag() const {
8509 return (bits & 1) != 0;
8510 }
8511
8512 void setPtr(T *t) {
8513 do { } while(0);
8514 bits = uintptr_t(t) | uintptr_t(flag());
8515 }
8516
8517 void setFlag() {
8518 bits |= 1;
8519 }
8520
8521 void unsetFlag() {
8522 bits &= ~uintptr_t(1);
8523 }
8524
8525 void set(T *t, bool flag) {
8526 do { } while(0);
8527 bits = uintptr_t(t) | flag;
8528 }
8529 };
8530
8531 template <class T>
8532 static inline void
8533 Reverse(T *beg, T *end)
8534 {
8535 while (beg != end) {
8536 if (--end == beg)
8537 return;
8538 T tmp = *beg;
8539 *beg = *end;
8540 *end = tmp;
8541 ++beg;
8542 }
8543 }
8544
8545 template <class T>
8546 static inline T *
8547 Find(T *beg, T *end, const T &v)
8548 {
8549 for (T *p = beg; p != end; ++p) {
8550 if (*p == v)
8551 return p;
8552 }
8553 return end;
8554 }
8555
8556 template <class Container>
8557 static inline typename Container::ElementType *
8558 Find(Container &c, const typename Container::ElementType &v)
8559 {
8560 return Find(c.begin(), c.end(), v);
8561 }
8562
8563 template <typename InputIterT, typename CallableT>
8564 void
8565 ForEach(InputIterT begin, InputIterT end, CallableT f)
8566 {
8567 for (; begin != end; ++begin)
8568 f(*begin);
8569 }
8570
8571 template <class T>
8572 static inline T
8573 Min(T t1, T t2)
8574 {
8575 return t1 < t2 ? t1 : t2;
8576 }
8577
8578 template <class T>
8579 static inline T
8580 Max(T t1, T t2)
8581 {
8582 return t1 > t2 ? t1 : t2;
8583 }
8584
8585
8586 template <class T>
8587 static T&
8588 InitConst(const T &t)
8589 {
8590 return const_cast<T &>(t);
8591 }
8592
8593 template <class T, class U>
8594 __attribute__((always_inline)) inline T &
8595 ImplicitCast(U &u)
8596 {
8597 T &t = u;
8598 return t;
8599 }
8600
8601 template<typename T>
8602 class AutoScopedAssign
8603 {
8604 private:
8605
8606 T *addr;
8607 T old;
8608
8609 public:
8610 AutoScopedAssign(T *addr, const T &value )
8611 : addr(addr), old(*addr)
8612 {
8613 do { } while (0);
8614 *addr = value;
8615 }
8616
8617 ~AutoScopedAssign() { *addr = old; }
8618 };
8619
8620 template <class T>
8621 __attribute__((always_inline)) inline static void
8622 PodZero(T *t)
8623 {
8624 memset(t, 0, sizeof(T));
8625 }
8626
8627 template <class T>
8628 __attribute__((always_inline)) inline static void
8629 PodZero(T *t, size_t nelem)
8630 {
8631
8632
8633
8634
8635
8636
8637 for (T *end = t + nelem; t != end; ++t)
8638 memset(t, 0, sizeof(T));
8639 }
8640 # 201 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsutil.h"
8641 template <class T, size_t N> static void PodZero(T (&)[N]);
8642 template <class T, size_t N> static void PodZero(T (&)[N], size_t);
8643
8644 template <class T, size_t N>
8645 __attribute__((always_inline)) inline static void
8646 PodArrayZero(T (&t)[N])
8647 {
8648 memset(t, 0, N * sizeof(T));
8649 }
8650
8651 template <class T>
8652 __attribute__((always_inline)) inline static void
8653 PodAssign(T *dst, const T *src)
8654 {
8655 js_memcpy((char *) dst, (const char *) src, sizeof(T));
8656 }
8657
8658 template <class T>
8659 __attribute__((always_inline)) inline static void
8660 PodCopy(T *dst, const T *src, size_t nelem)
8661 {
8662
8663 do { } while (0);
8664 do { } while (0);
8665
8666 if (nelem < 128) {
8667
8668
8669
8670
8671 for (const T *srcend = src + nelem; src != srcend; ++src, ++dst)
8672 PodAssign(dst, src);
8673 } else {
8674 memcpy(dst, src, nelem * sizeof(T));
8675 }
8676 }
8677
8678 template <class T>
8679 __attribute__((always_inline)) inline static bool
8680 PodEqual(T *one, T *two, size_t len)
8681 {
8682 if (len < 128) {
8683 T *p1end = one + len;
8684 for (T *p1 = one, *p2 = two; p1 != p1end; ++p1, ++p2) {
8685 if (*p1 != *p2)
8686 return false;
8687 }
8688 return true;
8689 }
8690
8691 return !memcmp(one, two, len * sizeof(T));
8692 }
8693
8694 template <class T>
8695 __attribute__((always_inline)) inline static void
8696 Swap(T &t, T &u)
8697 {
8698 T tmp(Move(t));
8699 t = Move(u);
8700 u = Move(tmp);
8701 }
8702
8703 __attribute__((always_inline)) inline static size_t
8704 UnsignedPtrDiff(const void *bigger, const void *smaller)
8705 {
8706 return size_t(bigger) - size_t(smaller);
8707 }
8708 # 276 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsutil.h"
8709 enum MaybeReportError { REPORT_ERROR = true, DONT_REPORT_ERROR = false };
8710
8711
8712
8713
8714
8715 static inline unsigned
8716 NumWordsForBitArrayOfLength(size_t length)
8717 {
8718 return (length + ((8 * 4) - 1)) / (8 * 4);
8719 }
8720
8721 static inline unsigned
8722 BitArrayIndexToWordIndex(size_t length, size_t bitIndex)
8723 {
8724 unsigned wordIndex = bitIndex / (8 * 4);
8725 do { } while(0);
8726 return wordIndex;
8727 }
8728
8729 static inline size_t
8730 BitArrayIndexToWordMask(size_t i)
8731 {
8732 return size_t(1) << (i % (8 * 4));
8733 }
8734
8735 static inline bool
8736 IsBitArrayElementSet(size_t *array, size_t length, size_t i)
8737 {
8738 return array[BitArrayIndexToWordIndex(length, i)] & BitArrayIndexToWordMask(i);
8739 }
8740
8741 static inline bool
8742 IsAnyBitArrayElementSet(size_t *array, size_t length)
8743 {
8744 unsigned numWords = NumWordsForBitArrayOfLength(length);
8745 for (unsigned i = 0; i < numWords; ++i) {
8746 if (array[i])
8747 return true;
8748 }
8749 return false;
8750 }
8751
8752 static inline void
8753 SetBitArrayElement(size_t *array, size_t length, size_t i)
8754 {
8755 array[BitArrayIndexToWordIndex(length, i)] |= BitArrayIndexToWordMask(i);
8756 }
8757
8758 static inline void
8759 ClearBitArrayElement(size_t *array, size_t length, size_t i)
8760 {
8761 array[BitArrayIndexToWordIndex(length, i)] &= ~BitArrayIndexToWordMask(i);
8762 }
8763
8764 static inline void
8765 ClearAllBitArrayElements(size_t *array, size_t length)
8766 {
8767 for (unsigned i = 0; i < length; ++i)
8768 array[i] = 0;
8769 }
8770
8771 }
8772 # 358 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsutil.h"
8773 #define JS_ROTATE_LEFT32(a,bits) (((a) << (bits)) | ((a) >> (32 - (bits))))
8774 # 370 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsutil.h"
8775 #define MUST_FLOW_THROUGH(label) ((void) 0)
8776 #define MUST_FLOW_LABEL(label)
8777 # 385 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsutil.h"
8778 #define JS_POISON(p,val,size) ((void) 0)
8779 #define JS_OPT_ASSERT(expr) ((void) 0)
8780 #define JS_OPT_ASSERT_IF(cond,expr) ((void) 0)
8781 # 419 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsutil.h"
8782 #define JS_BASIC_STATS_ACCUM(bs,val)
8783
8784
8785
8786 typedef size_t jsbitmap;
8787 #define JS_TEST_BIT(_map,_bit) ((_map)[(_bit)>>JS_BITS_PER_WORD_LOG2] & ((jsbitmap)1<<((_bit)&(JS_BITS_PER_WORD-1))))
8788
8789 #define JS_SET_BIT(_map,_bit) ((_map)[(_bit)>>JS_BITS_PER_WORD_LOG2] |= ((jsbitmap)1<<((_bit)&(JS_BITS_PER_WORD-1))))
8790
8791 #define JS_CLEAR_BIT(_map,_bit) ((_map)[(_bit)>>JS_BITS_PER_WORD_LOG2] &= ~((jsbitmap)1<<((_bit)&(JS_BITS_PER_WORD-1))))
8792 # 449 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsutil.h"
8793 #define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr) JS_BEGIN_MACRO expr; JS_END_MACRO
8794 # 23 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h" 2
8795 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsval.h" 1
8796 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsval.h"
8797 #define jsvalimpl_h__
8798 # 19 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsval.h"
8799 extern "C" {
8800
8801
8802
8803
8804
8805
8806 #define JSVAL_ALIGNMENT __attribute__((aligned (8)))
8807 # 54 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsval.h"
8808 #define JS_ENUM_HEADER(id,type) enum id
8809 #define JS_ENUM_FOOTER(id) __attribute__((packed))
8810
8811
8812
8813 enum JSValueType
8814 {
8815 JSVAL_TYPE_DOUBLE = 0x00,
8816 JSVAL_TYPE_INT32 = 0x01,
8817 JSVAL_TYPE_UNDEFINED = 0x02,
8818 JSVAL_TYPE_BOOLEAN = 0x03,
8819 JSVAL_TYPE_MAGIC = 0x04,
8820 JSVAL_TYPE_STRING = 0x05,
8821 JSVAL_TYPE_NULL = 0x06,
8822 JSVAL_TYPE_OBJECT = 0x07,
8823
8824
8825 JSVAL_TYPE_UNKNOWN = 0x20,
8826 JSVAL_TYPE_MISSING = 0x21
8827 } __attribute__((packed));
8828
8829 typedef int moz_static_assert5[(sizeof(JSValueType) == 1) ? 1 : -1];
8830
8831
8832
8833
8834 enum JSValueTag
8835 {
8836 JSVAL_TAG_CLEAR = 0xFFFFFF80,
8837 JSVAL_TAG_INT32 = JSVAL_TAG_CLEAR | JSVAL_TYPE_INT32,
8838 JSVAL_TAG_UNDEFINED = JSVAL_TAG_CLEAR | JSVAL_TYPE_UNDEFINED,
8839 JSVAL_TAG_STRING = JSVAL_TAG_CLEAR | JSVAL_TYPE_STRING,
8840 JSVAL_TAG_BOOLEAN = JSVAL_TAG_CLEAR | JSVAL_TYPE_BOOLEAN,
8841 JSVAL_TAG_MAGIC = JSVAL_TAG_CLEAR | JSVAL_TYPE_MAGIC,
8842 JSVAL_TAG_NULL = JSVAL_TAG_CLEAR | JSVAL_TYPE_NULL,
8843 JSVAL_TAG_OBJECT = JSVAL_TAG_CLEAR | JSVAL_TYPE_OBJECT
8844 } __attribute__((packed));
8845
8846 typedef int moz_static_assert6[(sizeof(JSValueTag) == 4) ? 1 : -1];
8847 # 177 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsval.h"
8848 #define JSVAL_LOWER_INCL_TYPE_OF_OBJ_OR_NULL_SET JSVAL_TYPE_NULL
8849 #define JSVAL_UPPER_EXCL_TYPE_OF_PRIMITIVE_SET JSVAL_TYPE_OBJECT
8850 #define JSVAL_UPPER_INCL_TYPE_OF_NUMBER_SET JSVAL_TYPE_INT32
8851 #define JSVAL_LOWER_INCL_TYPE_OF_PTR_PAYLOAD_SET JSVAL_TYPE_MAGIC
8852
8853
8854
8855 #define JSVAL_TYPE_TO_TAG(type) ((JSValueTag)(JSVAL_TAG_CLEAR | (type)))
8856
8857 #define JSVAL_LOWER_INCL_TAG_OF_OBJ_OR_NULL_SET JSVAL_TAG_NULL
8858 #define JSVAL_UPPER_EXCL_TAG_OF_PRIMITIVE_SET JSVAL_TAG_OBJECT
8859 #define JSVAL_UPPER_INCL_TAG_OF_NUMBER_SET JSVAL_TAG_INT32
8860 #define JSVAL_LOWER_INCL_TAG_OF_GCTHING_SET JSVAL_TAG_STRING
8861 # 205 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsval.h"
8862 typedef enum JSWhyMagic
8863 {
8864 JS_ARRAY_HOLE,
8865 JS_NATIVE_ENUMERATE,
8866
8867
8868 JS_NO_ITER_VALUE,
8869 JS_GENERATOR_CLOSING,
8870 JS_NO_CONSTANT,
8871 JS_THIS_POISON,
8872 JS_ARG_POISON,
8873 JS_SERIALIZE_NO_NODE,
8874 JS_LAZY_ARGUMENTS,
8875 JS_UNASSIGNED_ARGUMENTS,
8876 JS_OPTIMIZED_ARGUMENTS,
8877 JS_IS_CONSTRUCTING,
8878 JS_OVERWRITTEN_CALLEE,
8879 JS_GENERIC_MAGIC
8880 } JSWhyMagic;
8881
8882
8883
8884 typedef union jsval_layout
8885 {
8886 uint64_t asBits;
8887 struct {
8888 union {
8889 int32_t i32;
8890 uint32_t u32;
8891 JSBool boo;
8892 JSString *str;
8893 JSObject *obj;
8894 void *ptr;
8895 JSWhyMagic why;
8896 size_t word;
8897 uintptr_t uintptr;
8898 } payload;
8899 JSValueTag tag;
8900 } s;
8901 double asDouble;
8902 void *asPtr;
8903 } __attribute__((aligned (8))) jsval_layout;
8904 # 317 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsval.h"
8905 typedef int moz_static_assert7[(sizeof(jsval_layout) == 8) ? 1 : -1];
8906 # 327 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsval.h"
8907 static __attribute__((always_inline)) inline jsval_layout
8908 BUILD_JSVAL(JSValueTag tag, uint32_t payload)
8909 {
8910 jsval_layout l;
8911 l.asBits = (((uint64_t)(uint32_t)tag) << 32) | payload;
8912 return l;
8913 }
8914
8915 static __attribute__((always_inline)) inline JSBool
8916 JSVAL_IS_DOUBLE_IMPL(jsval_layout l)
8917 {
8918 return (uint32_t)l.s.tag <= (uint32_t)JSVAL_TAG_CLEAR;
8919 }
8920
8921 static __attribute__((always_inline)) inline jsval_layout
8922 DOUBLE_TO_JSVAL_IMPL(double d)
8923 {
8924 jsval_layout l;
8925 l.asDouble = d;
8926 do { } while(0);
8927 return l;
8928 }
8929
8930 static __attribute__((always_inline)) inline JSBool
8931 JSVAL_IS_INT32_IMPL(jsval_layout l)
8932 {
8933 return l.s.tag == JSVAL_TAG_INT32;
8934 }
8935
8936 static __attribute__((always_inline)) inline int32_t
8937 JSVAL_TO_INT32_IMPL(jsval_layout l)
8938 {
8939 return l.s.payload.i32;
8940 }
8941
8942 static __attribute__((always_inline)) inline jsval_layout
8943 INT32_TO_JSVAL_IMPL(int32_t i)
8944 {
8945 jsval_layout l;
8946 l.s.tag = JSVAL_TAG_INT32;
8947 l.s.payload.i32 = i;
8948 return l;
8949 }
8950
8951 static __attribute__((always_inline)) inline JSBool
8952 JSVAL_IS_NUMBER_IMPL(jsval_layout l)
8953 {
8954 JSValueTag tag = l.s.tag;
8955 do { } while(0);
8956 return (uint32_t)tag <= (uint32_t)JSVAL_TAG_INT32;
8957 }
8958
8959 static __attribute__((always_inline)) inline JSBool
8960 JSVAL_IS_UNDEFINED_IMPL(jsval_layout l)
8961 {
8962 return l.s.tag == JSVAL_TAG_UNDEFINED;
8963 }
8964
8965 static __attribute__((always_inline)) inline JSBool
8966 JSVAL_IS_STRING_IMPL(jsval_layout l)
8967 {
8968 return l.s.tag == JSVAL_TAG_STRING;
8969 }
8970
8971 static __attribute__((always_inline)) inline jsval_layout
8972 STRING_TO_JSVAL_IMPL(JSString *str)
8973 {
8974 jsval_layout l;
8975 do { } while(0);
8976 l.s.tag = JSVAL_TAG_STRING;
8977 l.s.payload.str = str;
8978 return l;
8979 }
8980
8981 static __attribute__((always_inline)) inline JSString *
8982 JSVAL_TO_STRING_IMPL(jsval_layout l)
8983 {
8984 return l.s.payload.str;
8985 }
8986
8987 static __attribute__((always_inline)) inline JSBool
8988 JSVAL_IS_BOOLEAN_IMPL(jsval_layout l)
8989 {
8990 return l.s.tag == JSVAL_TAG_BOOLEAN;
8991 }
8992
8993 static __attribute__((always_inline)) inline JSBool
8994 JSVAL_TO_BOOLEAN_IMPL(jsval_layout l)
8995 {
8996 return l.s.payload.boo;
8997 }
8998
8999 static __attribute__((always_inline)) inline jsval_layout
9000 BOOLEAN_TO_JSVAL_IMPL(JSBool b)
9001 {
9002 jsval_layout l;
9003 do { } while(0);
9004 l.s.tag = JSVAL_TAG_BOOLEAN;
9005 l.s.payload.boo = b;
9006 return l;
9007 }
9008
9009 static __attribute__((always_inline)) inline JSBool
9010 JSVAL_IS_MAGIC_IMPL(jsval_layout l)
9011 {
9012 return l.s.tag == JSVAL_TAG_MAGIC;
9013 }
9014
9015 static __attribute__((always_inline)) inline JSBool
9016 JSVAL_IS_OBJECT_IMPL(jsval_layout l)
9017 {
9018 return l.s.tag == JSVAL_TAG_OBJECT;
9019 }
9020
9021 static __attribute__((always_inline)) inline JSBool
9022 JSVAL_IS_PRIMITIVE_IMPL(jsval_layout l)
9023 {
9024 return (uint32_t)l.s.tag < (uint32_t)JSVAL_TAG_OBJECT;
9025 }
9026
9027 static __attribute__((always_inline)) inline JSBool
9028 JSVAL_IS_OBJECT_OR_NULL_IMPL(jsval_layout l)
9029 {
9030 do { } while(0);
9031 return (uint32_t)l.s.tag >= (uint32_t)JSVAL_TAG_NULL;
9032 }
9033
9034 static __attribute__((always_inline)) inline JSObject *
9035 JSVAL_TO_OBJECT_IMPL(jsval_layout l)
9036 {
9037 return l.s.payload.obj;
9038 }
9039
9040 static __attribute__((always_inline)) inline jsval_layout
9041 OBJECT_TO_JSVAL_IMPL(JSObject *obj)
9042 {
9043 jsval_layout l;
9044 do { } while(0);
9045 l.s.tag = JSVAL_TAG_OBJECT;
9046 l.s.payload.obj = obj;
9047 return l;
9048 }
9049
9050 static __attribute__((always_inline)) inline JSBool
9051 JSVAL_IS_NULL_IMPL(jsval_layout l)
9052 {
9053 return l.s.tag == JSVAL_TAG_NULL;
9054 }
9055
9056 static __attribute__((always_inline)) inline jsval_layout
9057 PRIVATE_PTR_TO_JSVAL_IMPL(void *ptr)
9058 {
9059 jsval_layout l;
9060 do { } while(0);
9061 l.s.tag = (JSValueTag)0;
9062 l.s.payload.ptr = ptr;
9063 do { } while(0);
9064 return l;
9065 }
9066
9067 static __attribute__((always_inline)) inline void *
9068 JSVAL_TO_PRIVATE_PTR_IMPL(jsval_layout l)
9069 {
9070 return l.s.payload.ptr;
9071 }
9072
9073 static __attribute__((always_inline)) inline JSBool
9074 JSVAL_IS_GCTHING_IMPL(jsval_layout l)
9075 {
9076
9077 return (uint32_t)l.s.tag >= (uint32_t)JSVAL_TAG_STRING;
9078 }
9079
9080 static __attribute__((always_inline)) inline void *
9081 JSVAL_TO_GCTHING_IMPL(jsval_layout l)
9082 {
9083 return l.s.payload.ptr;
9084 }
9085
9086 static __attribute__((always_inline)) inline JSBool
9087 JSVAL_IS_TRACEABLE_IMPL(jsval_layout l)
9088 {
9089 return l.s.tag == JSVAL_TAG_STRING || l.s.tag == JSVAL_TAG_OBJECT;
9090 }
9091
9092 static __attribute__((always_inline)) inline uint32_t
9093 JSVAL_TRACE_KIND_IMPL(jsval_layout l)
9094 {
9095 return (uint32_t)(JSBool)JSVAL_IS_STRING_IMPL(l);
9096 }
9097
9098 static __attribute__((always_inline)) inline JSBool
9099 JSVAL_IS_SPECIFIC_INT32_IMPL(jsval_layout l, int32_t i32)
9100 {
9101 return l.s.tag == JSVAL_TAG_INT32 && l.s.payload.i32 == i32;
9102 }
9103
9104 static __attribute__((always_inline)) inline JSBool
9105 JSVAL_IS_SPECIFIC_BOOLEAN(jsval_layout l, JSBool b)
9106 {
9107 return (l.s.tag == JSVAL_TAG_BOOLEAN) && (l.s.payload.boo == b);
9108 }
9109
9110 static __attribute__((always_inline)) inline jsval_layout
9111 MAGIC_TO_JSVAL_IMPL(JSWhyMagic why)
9112 {
9113 jsval_layout l;
9114 l.s.tag = JSVAL_TAG_MAGIC;
9115 l.s.payload.why = why;
9116 return l;
9117 }
9118
9119 static __attribute__((always_inline)) inline JSBool
9120 JSVAL_SAME_TYPE_IMPL(jsval_layout lhs, jsval_layout rhs)
9121 {
9122 JSValueTag ltag = lhs.s.tag, rtag = rhs.s.tag;
9123 return ltag == rtag || (ltag < JSVAL_TAG_CLEAR && rtag < JSVAL_TAG_CLEAR);
9124 }
9125
9126 static __attribute__((always_inline)) inline jsval_layout
9127 PRIVATE_UINT32_TO_JSVAL_IMPL(uint32_t ui)
9128 {
9129 jsval_layout l;
9130 l.s.tag = (JSValueTag)0;
9131 l.s.payload.u32 = ui;
9132 do { } while(0);
9133 return l;
9134 }
9135
9136 static __attribute__((always_inline)) inline uint32_t
9137 JSVAL_TO_PRIVATE_UINT32_IMPL(jsval_layout l)
9138 {
9139 return l.s.payload.u32;
9140 }
9141
9142 static __attribute__((always_inline)) inline JSValueType
9143 JSVAL_EXTRACT_NON_DOUBLE_TYPE_IMPL(jsval_layout l)
9144 {
9145 uint32_t type = l.s.tag & 0xF;
9146 do { } while(0);
9147 return (JSValueType)type;
9148 }
9149 # 820 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsval.h"
9150 static __attribute__((always_inline)) inline double
9151 JS_CANONICALIZE_NAN(double d)
9152 {
9153 if ((__builtin_expect((d != d), 0))) {
9154 jsval_layout l;
9155 l.asBits = 0x7FF8000000000000LL;
9156 return l.asDouble;
9157 }
9158 return d;
9159 }
9160
9161 }
9162
9163
9164 static jsval_layout JSVAL_TO_IMPL(JS::Value);
9165 static JS::Value IMPL_TO_JSVAL(jsval_layout);
9166 # 24 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h" 2
9167
9168
9169 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Root.h" 1
9170 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Root.h"
9171 #define jsgc_root_h__
9172
9173 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jspubtd.h" 1
9174 # 12 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Root.h" 2
9175
9176
9177
9178
9179
9180 namespace JS {
9181 # 62 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Root.h"
9182 template <typename T> class Rooted;
9183
9184 template <typename T>
9185 struct RootMethods { };
9186
9187
9188
9189
9190
9191
9192 template <typename T>
9193 class Handle
9194 {
9195 public:
9196
9197 template <typename S> Handle(Handle<S> handle) {
9198 testAssign<S>();
9199 ptr = reinterpret_cast<const T *>(handle.address());
9200 }
9201 # 89 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Root.h"
9202 static Handle fromMarkedLocation(const T *p) {
9203 Handle h;
9204 h.ptr = p;
9205 return h;
9206 }
9207
9208
9209
9210
9211
9212 template <typename S> inline Handle(const Rooted<S> &root);
9213
9214 const T *address() const { return ptr; }
9215 T value() const { return *ptr; }
9216
9217 operator T () const { return value(); }
9218 T operator ->() const { return value(); }
9219
9220 private:
9221 Handle() {}
9222
9223 const T *ptr;
9224
9225 template <typename S>
9226 void testAssign() {
9227
9228
9229
9230
9231
9232
9233 }
9234 };
9235
9236 typedef Handle<JSObject*> HandleObject;
9237 typedef Handle<JSFunction*> HandleFunction;
9238 typedef Handle<JSString*> HandleString;
9239 typedef Handle<jsid> HandleId;
9240 typedef Handle<Value> HandleValue;
9241
9242 template <typename T>
9243 struct RootMethods<T *>
9244 {
9245 static T *initial() { return __null; }
9246 static ThingRootKind kind() { return T::rootKind(); }
9247 static bool poisoned(T *v) { return IsPoisonedPtr(v); }
9248 };
9249
9250
9251
9252
9253
9254
9255 template <typename T>
9256 class Rooted
9257 {
9258 void init(JSContext *cx_, T initial)
9259 {
9260 # 158 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Root.h"
9261 ptr = initial;
9262 }
9263
9264 public:
9265 Rooted(JSContext *cx) { init(cx, RootMethods<T>::initial()); }
9266 Rooted(JSContext *cx, T initial) { init(cx, initial); }
9267 # 172 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Root.h"
9268 operator Handle<T> () const { return Handle<T>(*this); }
9269
9270 ~Rooted()
9271 {
9272
9273
9274
9275
9276 }
9277
9278
9279
9280
9281
9282 operator T () const { return ptr; }
9283 T operator ->() const { return ptr; }
9284 T * address() { return &ptr; }
9285 const T * address() const { return &ptr; }
9286 T & reference() { return ptr; }
9287 T raw() const { return ptr; }
9288
9289 T & operator =(T value)
9290 {
9291 do { } while(0);
9292 ptr = value;
9293 return ptr;
9294 }
9295
9296 T & operator =(const Rooted &value)
9297 {
9298 ptr = value;
9299 return ptr;
9300 }
9301
9302 private:
9303
9304
9305
9306
9307 T ptr;
9308
9309 Rooted() ;
9310 Rooted(const Rooted &) ;
9311 };
9312
9313 template<typename T> template <typename S>
9314 inline
9315 Handle<T>::Handle(const Rooted<S> &root)
9316 {
9317 testAssign<S>();
9318 ptr = reinterpret_cast<const T *>(root.address());
9319 }
9320
9321 typedef Rooted<JSObject*> RootedObject;
9322 typedef Rooted<JSFunction*> RootedFunction;
9323 typedef Rooted<JSString*> RootedString;
9324 typedef Rooted<jsid> RootedId;
9325 typedef Rooted<Value> RootedValue;
9326
9327
9328
9329
9330
9331
9332
9333 class SkipRoot
9334 {
9335 # 286 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Root.h"
9336 public:
9337 template <typename T>
9338 SkipRoot(JSContext *cx, const T *ptr
9339 )
9340 {
9341 do { } while (0);
9342 }
9343
9344 template <typename T>
9345 SkipRoot(JSContext *cx, const T *ptr, size_t count
9346 )
9347 {
9348 do { } while (0);
9349 }
9350
9351
9352
9353
9354 };
9355 # 314 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Root.h"
9356 inline void MaybeCheckStackRoots(JSContext *cx) {}
9357
9358
9359 }
9360 # 27 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h" 2
9361
9362
9363 # 1 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/limits" 1 3
9364 # 39 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/limits" 3
9365 #define _GLIBCXX_NUMERIC_LIMITS 1
9366
9367
9368 # 42 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/limits" 3
9369 # 81 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/limits" 3
9370 #define __glibcxx_integral_traps true
9371 # 90 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/limits" 3
9372 #define __glibcxx_float_has_denorm_loss false
9373
9374
9375 #define __glibcxx_float_traps false
9376
9377
9378 #define __glibcxx_float_tinyness_before false
9379
9380
9381
9382
9383
9384
9385
9386 #define __glibcxx_double_has_denorm_loss false
9387
9388
9389 #define __glibcxx_double_traps false
9390
9391
9392 #define __glibcxx_double_tinyness_before false
9393
9394
9395
9396
9397
9398
9399
9400 #define __glibcxx_long_double_has_denorm_loss false
9401
9402
9403 #define __glibcxx_long_double_traps false
9404
9405
9406 #define __glibcxx_long_double_tinyness_before false
9407
9408
9409
9410
9411 #define __glibcxx_signed(T) ((T)(-1) < 0)
9412
9413 #define __glibcxx_min(T) (__glibcxx_signed (T) ? (T)1 << __glibcxx_digits (T) : (T)0)
9414
9415
9416 #define __glibcxx_max(T) (__glibcxx_signed (T) ? (((((T)1 << (__glibcxx_digits (T) - 1)) - 1) << 1) + 1) : ~(T)0)
9417
9418
9419
9420 #define __glibcxx_digits(T) (sizeof(T) * __CHAR_BIT__ - __glibcxx_signed (T))
9421
9422
9423
9424 #define __glibcxx_digits10(T) (__glibcxx_digits (T) * 643 / 2136)
9425
9426
9427 #define __glibcxx_max_digits10(T) (2 + (T) * 643 / 2136)
9428
9429
9430 namespace std __attribute__ ((__visibility__ ("default"))) {
9431
9432
9433
9434
9435
9436
9437 enum float_round_style
9438 {
9439 round_indeterminate = -1,
9440 round_toward_zero = 0,
9441 round_to_nearest = 1,
9442 round_toward_infinity = 2,
9443 round_toward_neg_infinity = 3
9444 };
9445
9446
9447
9448
9449
9450
9451
9452 enum float_denorm_style
9453 {
9454
9455 denorm_indeterminate = -1,
9456
9457 denorm_absent = 0,
9458
9459 denorm_present = 1
9460 };
9461 # 190 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/limits" 3
9462 struct __numeric_limits_base
9463 {
9464
9465
9466 static const bool is_specialized = false;
9467
9468
9469
9470
9471 static const int digits = 0;
9472
9473 static const int digits10 = 0;
9474
9475
9476
9477
9478
9479
9480 static const bool is_signed = false;
9481
9482
9483 static const bool is_integer = false;
9484
9485
9486
9487
9488 static const bool is_exact = false;
9489
9490
9491 static const int radix = 0;
9492
9493
9494
9495 static const int min_exponent = 0;
9496
9497
9498 static const int min_exponent10 = 0;
9499
9500
9501
9502 static const int max_exponent = 0;
9503
9504
9505 static const int max_exponent10 = 0;
9506
9507
9508 static const bool has_infinity = false;
9509
9510
9511 static const bool has_quiet_NaN = false;
9512
9513
9514 static const bool has_signaling_NaN = false;
9515
9516 static const float_denorm_style has_denorm = denorm_absent;
9517
9518
9519 static const bool has_denorm_loss = false;
9520
9521
9522
9523 static const bool is_iec559 = false;
9524
9525
9526
9527 static const bool is_bounded = false;
9528
9529
9530
9531
9532 static const bool is_modulo = false;
9533
9534
9535 static const bool traps = false;
9536
9537 static const bool tinyness_before = false;
9538
9539
9540
9541 static const float_round_style round_style = round_toward_zero;
9542 };
9543 # 283 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/limits" 3
9544 template<typename _Tp>
9545 struct numeric_limits : public __numeric_limits_base
9546 {
9547
9548
9549 static _Tp min() throw() { return static_cast<_Tp>(0); }
9550
9551 static _Tp max() throw() { return static_cast<_Tp>(0); }
9552
9553
9554
9555
9556
9557
9558
9559 static _Tp epsilon() throw() { return static_cast<_Tp>(0); }
9560
9561 static _Tp round_error() throw() { return static_cast<_Tp>(0); }
9562
9563 static _Tp infinity() throw() { return static_cast<_Tp>(0); }
9564
9565
9566
9567 static _Tp quiet_NaN() throw() { return static_cast<_Tp>(0); }
9568
9569
9570 static _Tp signaling_NaN() throw() { return static_cast<_Tp>(0); }
9571
9572
9573
9574 static _Tp denorm_min() throw() { return static_cast<_Tp>(0); }
9575 };
9576 # 334 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/limits" 3
9577 template<>
9578 struct numeric_limits<bool>
9579 {
9580 static const bool is_specialized = true;
9581
9582 static bool min() throw()
9583 { return false; }
9584 static bool max() throw()
9585 { return true; }
9586
9587
9588
9589
9590 static const int digits = 1;
9591 static const int digits10 = 0;
9592
9593
9594
9595 static const bool is_signed = false;
9596 static const bool is_integer = true;
9597 static const bool is_exact = true;
9598 static const int radix = 2;
9599 static bool epsilon() throw()
9600 { return false; }
9601 static bool round_error() throw()
9602 { return false; }
9603
9604 static const int min_exponent = 0;
9605 static const int min_exponent10 = 0;
9606 static const int max_exponent = 0;
9607 static const int max_exponent10 = 0;
9608
9609 static const bool has_infinity = false;
9610 static const bool has_quiet_NaN = false;
9611 static const bool has_signaling_NaN = false;
9612 static const float_denorm_style has_denorm = denorm_absent;
9613 static const bool has_denorm_loss = false;
9614
9615 static bool infinity() throw()
9616 { return false; }
9617 static bool quiet_NaN() throw()
9618 { return false; }
9619 static bool signaling_NaN() throw()
9620 { return false; }
9621 static bool denorm_min() throw()
9622 { return false; }
9623
9624 static const bool is_iec559 = false;
9625 static const bool is_bounded = true;
9626 static const bool is_modulo = false;
9627
9628
9629
9630
9631 static const bool traps = true;
9632 static const bool tinyness_before = false;
9633 static const float_round_style round_style = round_toward_zero;
9634 };
9635
9636
9637 template<>
9638 struct numeric_limits<char>
9639 {
9640 static const bool is_specialized = true;
9641
9642 static char min() throw()
9643 { return (((char)(-1) < 0) ? (char)1 << (sizeof(char) * 8 - ((char)(-1) < 0)) : (char)0); }
9644 static char max() throw()
9645 { return (((char)(-1) < 0) ? (((((char)1 << ((sizeof(char) * 8 - ((char)(-1) < 0)) - 1)) - 1) << 1) + 1) : ~(char)0); }
9646
9647
9648
9649
9650
9651 static const int digits = (sizeof(char) * 8 - ((char)(-1) < 0));
9652 static const int digits10 = ((sizeof(char) * 8 - ((char)(-1) < 0)) * 643 / 2136);
9653
9654
9655
9656 static const bool is_signed = ((char)(-1) < 0);
9657 static const bool is_integer = true;
9658 static const bool is_exact = true;
9659 static const int radix = 2;
9660 static char epsilon() throw()
9661 { return 0; }
9662 static char round_error() throw()
9663 { return 0; }
9664
9665 static const int min_exponent = 0;
9666 static const int min_exponent10 = 0;
9667 static const int max_exponent = 0;
9668 static const int max_exponent10 = 0;
9669
9670 static const bool has_infinity = false;
9671 static const bool has_quiet_NaN = false;
9672 static const bool has_signaling_NaN = false;
9673 static const float_denorm_style has_denorm = denorm_absent;
9674 static const bool has_denorm_loss = false;
9675
9676 static char infinity() throw()
9677 { return char(); }
9678 static char quiet_NaN() throw()
9679 { return char(); }
9680 static char signaling_NaN() throw()
9681 { return char(); }
9682 static char denorm_min() throw()
9683 { return static_cast<char>(0); }
9684
9685 static const bool is_iec559 = false;
9686 static const bool is_bounded = true;
9687 static const bool is_modulo = true;
9688
9689 static const bool traps = true;
9690 static const bool tinyness_before = false;
9691 static const float_round_style round_style = round_toward_zero;
9692 };
9693
9694
9695 template<>
9696 struct numeric_limits<signed char>
9697 {
9698 static const bool is_specialized = true;
9699
9700 static signed char min() throw()
9701 { return -127 - 1; }
9702 static signed char max() throw()
9703 { return 127; }
9704
9705
9706
9707
9708
9709 static const int digits = (sizeof(signed char) * 8 - ((signed char)(-1) < 0));
9710 static const int digits10 = ((sizeof(signed char) * 8 - ((signed char)(-1) < 0)) * 643 / 2136);
9711
9712
9713
9714 static const bool is_signed = true;
9715 static const bool is_integer = true;
9716 static const bool is_exact = true;
9717 static const int radix = 2;
9718 static signed char epsilon() throw()
9719 { return 0; }
9720 static signed char round_error() throw()
9721 { return 0; }
9722
9723 static const int min_exponent = 0;
9724 static const int min_exponent10 = 0;
9725 static const int max_exponent = 0;
9726 static const int max_exponent10 = 0;
9727
9728 static const bool has_infinity = false;
9729 static const bool has_quiet_NaN = false;
9730 static const bool has_signaling_NaN = false;
9731 static const float_denorm_style has_denorm = denorm_absent;
9732 static const bool has_denorm_loss = false;
9733
9734 static signed char infinity() throw()
9735 { return static_cast<signed char>(0); }
9736 static signed char quiet_NaN() throw()
9737 { return static_cast<signed char>(0); }
9738 static signed char signaling_NaN() throw()
9739 { return static_cast<signed char>(0); }
9740 static signed char denorm_min() throw()
9741 { return static_cast<signed char>(0); }
9742
9743 static const bool is_iec559 = false;
9744 static const bool is_bounded = true;
9745 static const bool is_modulo = true;
9746
9747 static const bool traps = true;
9748 static const bool tinyness_before = false;
9749 static const float_round_style round_style = round_toward_zero;
9750 };
9751
9752
9753 template<>
9754 struct numeric_limits<unsigned char>
9755 {
9756 static const bool is_specialized = true;
9757
9758 static unsigned char min() throw()
9759 { return 0; }
9760 static unsigned char max() throw()
9761 { return 127 * 2U + 1; }
9762
9763
9764
9765
9766
9767 static const int digits = (sizeof(unsigned char) * 8 - ((unsigned char)(-1) < 0));
9768 static const int digits10 = ((sizeof(unsigned char) * 8 - ((unsigned char)(-1) < 0)) * 643 / 2136);
9769
9770
9771
9772 static const bool is_signed = false;
9773 static const bool is_integer = true;
9774 static const bool is_exact = true;
9775 static const int radix = 2;
9776 static unsigned char epsilon() throw()
9777 { return 0; }
9778 static unsigned char round_error() throw()
9779 { return 0; }
9780
9781 static const int min_exponent = 0;
9782 static const int min_exponent10 = 0;
9783 static const int max_exponent = 0;
9784 static const int max_exponent10 = 0;
9785
9786 static const bool has_infinity = false;
9787 static const bool has_quiet_NaN = false;
9788 static const bool has_signaling_NaN = false;
9789 static const float_denorm_style has_denorm = denorm_absent;
9790 static const bool has_denorm_loss = false;
9791
9792 static unsigned char infinity() throw()
9793 { return static_cast<unsigned char>(0); }
9794 static unsigned char quiet_NaN() throw()
9795 { return static_cast<unsigned char>(0); }
9796 static unsigned char signaling_NaN() throw()
9797 { return static_cast<unsigned char>(0); }
9798 static unsigned char denorm_min() throw()
9799 { return static_cast<unsigned char>(0); }
9800
9801 static const bool is_iec559 = false;
9802 static const bool is_bounded = true;
9803 static const bool is_modulo = true;
9804
9805 static const bool traps = true;
9806 static const bool tinyness_before = false;
9807 static const float_round_style round_style = round_toward_zero;
9808 };
9809
9810
9811 template<>
9812 struct numeric_limits<wchar_t>
9813 {
9814 static const bool is_specialized = true;
9815
9816 static wchar_t min() throw()
9817 { return (((wchar_t)(-1) < 0) ? (wchar_t)1 << (sizeof(wchar_t) * 8 - ((wchar_t)(-1) < 0)) : (wchar_t)0); }
9818 static wchar_t max() throw()
9819 { return (((wchar_t)(-1) < 0) ? (((((wchar_t)1 << ((sizeof(wchar_t) * 8 - ((wchar_t)(-1) < 0)) - 1)) - 1) << 1) + 1) : ~(wchar_t)0); }
9820
9821
9822
9823
9824
9825 static const int digits = (sizeof(wchar_t) * 8 - ((wchar_t)(-1) < 0));
9826 static const int digits10 = ((sizeof(wchar_t) * 8 - ((wchar_t)(-1) < 0)) * 643 / 2136);
9827
9828
9829
9830 static const bool is_signed = ((wchar_t)(-1) < 0);
9831 static const bool is_integer = true;
9832 static const bool is_exact = true;
9833 static const int radix = 2;
9834 static wchar_t epsilon() throw()
9835 { return 0; }
9836 static wchar_t round_error() throw()
9837 { return 0; }
9838
9839 static const int min_exponent = 0;
9840 static const int min_exponent10 = 0;
9841 static const int max_exponent = 0;
9842 static const int max_exponent10 = 0;
9843
9844 static const bool has_infinity = false;
9845 static const bool has_quiet_NaN = false;
9846 static const bool has_signaling_NaN = false;
9847 static const float_denorm_style has_denorm = denorm_absent;
9848 static const bool has_denorm_loss = false;
9849
9850 static wchar_t infinity() throw()
9851 { return wchar_t(); }
9852 static wchar_t quiet_NaN() throw()
9853 { return wchar_t(); }
9854 static wchar_t signaling_NaN() throw()
9855 { return wchar_t(); }
9856 static wchar_t denorm_min() throw()
9857 { return wchar_t(); }
9858
9859 static const bool is_iec559 = false;
9860 static const bool is_bounded = true;
9861 static const bool is_modulo = true;
9862
9863 static const bool traps = true;
9864 static const bool tinyness_before = false;
9865 static const float_round_style round_style = round_toward_zero;
9866 };
9867 # 744 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/g++-v4/limits" 3
9868 template<>
9869 struct numeric_limits<short>
9870 {
9871 static const bool is_specialized = true;
9872
9873 static short min() throw()
9874 { return -32767 - 1; }
9875 static short max() throw()
9876 { return 32767; }
9877
9878
9879
9880
9881
9882 static const int digits = (sizeof(short) * 8 - ((short)(-1) < 0));
9883 static const int digits10 = ((sizeof(short) * 8 - ((short)(-1) < 0)) * 643 / 2136);
9884
9885
9886
9887 static const bool is_signed = true;
9888 static const bool is_integer = true;
9889 static const bool is_exact = true;
9890 static const int radix = 2;
9891 static short epsilon() throw()
9892 { return 0; }
9893 static short round_error() throw()
9894 { return 0; }
9895
9896 static const int min_exponent = 0;
9897 static const int min_exponent10 = 0;
9898 static const int max_exponent = 0;
9899 static const int max_exponent10 = 0;
9900
9901 static const bool has_infinity = false;
9902 static const bool has_quiet_NaN = false;
9903 static const bool has_signaling_NaN = false;
9904 static const float_denorm_style has_denorm = denorm_absent;
9905 static const bool has_denorm_loss = false;
9906
9907 static short infinity() throw()
9908 { return short(); }
9909 static short quiet_NaN() throw()
9910 { return short(); }
9911 static short signaling_NaN() throw()
9912 { return short(); }
9913 static short denorm_min() throw()
9914 { return short(); }
9915
9916 static const bool is_iec559 = false;
9917 static const bool is_bounded = true;
9918 static const bool is_modulo = true;
9919
9920 static const bool traps = true;
9921 static const bool tinyness_before = false;
9922 static const float_round_style round_style = round_toward_zero;
9923 };
9924
9925
9926 template<>
9927 struct numeric_limits<unsigned short>
9928 {
9929 static const bool is_specialized = true;
9930
9931 static unsigned short min() throw()
9932 { return 0; }
9933 static unsigned short max() throw()
9934 { return 32767 * 2U + 1; }
9935
9936
9937
9938
9939
9940 static const int digits = (sizeof(unsigned short) * 8 - ((unsigned short)(-1) < 0));
9941 static const int digits10 = ((sizeof(unsigned short) * 8 - ((unsigned short)(-1) < 0)) * 643 / 2136);
9942
9943
9944
9945 static const bool is_signed = false;
9946 static const bool is_integer = true;
9947 static const bool is_exact = true;
9948 static const int radix = 2;
9949 static unsigned short epsilon() throw()
9950 { return 0; }
9951 static unsigned short round_error() throw()
9952 { return 0; }
9953
9954 static const int min_exponent = 0;
9955 static const int min_exponent10 = 0;
9956 static const int max_exponent = 0;
9957 static const int max_exponent10 = 0;
9958
9959 static const bool has_infinity = false;
9960 static const bool has_quiet_NaN = false;
9961 static const bool has_signaling_NaN = false;
9962 static const float_denorm_style has_denorm = denorm_absent;
9963 static const bool has_denorm_loss = false;
9964
9965 static unsigned short infinity() throw()
9966 { return static_cast<unsigned short>(0); }
9967 static unsigned short quiet_NaN() throw()
9968 { return static_cast<unsigned short>(0); }
9969 static unsigned short signaling_NaN() throw()
9970 { return static_cast<unsigned short>(0); }
9971 static unsigned short denorm_min() throw()
9972 { return static_cast<unsigned short>(0); }
9973
9974 static const bool is_iec559 = false;
9975 static const bool is_bounded = true;
9976 static const bool is_modulo = true;
9977
9978 static const bool traps = true;
9979 static const bool tinyness_before = false;
9980 static const float_round_style round_style = round_toward_zero;
9981 };
9982
9983
9984 template<>
9985 struct numeric_limits<int>
9986 {
9987 static const bool is_specialized = true;
9988
9989 static int min() throw()
9990 { return -2147483647 - 1; }
9991 static int max() throw()
9992 { return 2147483647; }
9993
9994
9995
9996
9997
9998 static const int digits = (sizeof(int) * 8 - ((int)(-1) < 0));
9999 static const int digits10 = ((sizeof(int) * 8 - ((int)(-1) < 0)) * 643 / 2136);
10000
10001
10002
10003 static const bool is_signed = true;
10004 static const bool is_integer = true;
10005 static const bool is_exact = true;
10006 static const int radix = 2;
10007 static int epsilon() throw()
10008 { return 0; }
10009 static int round_error() throw()
10010 { return 0; }
10011
10012 static const int min_exponent = 0;
10013 static const int min_exponent10 = 0;
10014 static const int max_exponent = 0;
10015 static const int max_exponent10 = 0;
10016
10017 static const bool has_infinity = false;
10018 static const bool has_quiet_NaN = false;
10019 static const bool has_signaling_NaN = false;
10020 static const float_denorm_style has_denorm = denorm_absent;
10021 static const bool has_denorm_loss = false;
10022
10023 static int infinity() throw()
10024 { return static_cast<int>(0); }
10025 static int quiet_NaN() throw()
10026 { return static_cast<int>(0); }
10027 static int signaling_NaN() throw()
10028 { return static_cast<int>(0); }
10029 static int denorm_min() throw()
10030 { return static_cast<int>(0); }
10031
10032 static const bool is_iec559 = false;
10033 static const bool is_bounded = true;
10034 static const bool is_modulo = true;
10035
10036 static const bool traps = true;
10037 static const bool tinyness_before = false;
10038 static const float_round_style round_style = round_toward_zero;
10039 };
10040
10041
10042 template<>
10043 struct numeric_limits<unsigned int>
10044 {
10045 static const bool is_specialized = true;
10046
10047 static unsigned int min() throw()
10048 { return 0; }
10049 static unsigned int max() throw()
10050 { return 2147483647 * 2U + 1; }
10051
10052
10053
10054
10055
10056 static const int digits = (sizeof(unsigned int) * 8 - ((unsigned int)(-1) < 0));
10057 static const int digits10 = ((sizeof(unsigned int) * 8 - ((unsigned int)(-1) < 0)) * 643 / 2136);
10058
10059
10060
10061 static const bool is_signed = false;
10062 static const bool is_integer = true;
10063 static const bool is_exact = true;
10064 static const int radix = 2;
10065 static unsigned int epsilon() throw()
10066 { return 0; }
10067 static unsigned int round_error() throw()
10068 { return 0; }
10069
10070 static const int min_exponent = 0;
10071 static const int min_exponent10 = 0;
10072 static const int max_exponent = 0;
10073 static const int max_exponent10 = 0;
10074
10075 static const bool has_infinity = false;
10076 static const bool has_quiet_NaN = false;
10077 static const bool has_signaling_NaN = false;
10078 static const float_denorm_style has_denorm = denorm_absent;
10079 static const bool has_denorm_loss = false;
10080
10081 static unsigned int infinity() throw()
10082 { return static_cast<unsigned int>(0); }
10083 static unsigned int quiet_NaN() throw()
10084 { return static_cast<unsigned int>(0); }
10085 static unsigned int signaling_NaN() throw()
10086 { return static_cast<unsigned int>(0); }
10087 static unsigned int denorm_min() throw()
10088 { return static_cast<unsigned int>(0); }
10089
10090 static const bool is_iec559 = false;
10091 static const bool is_bounded = true;
10092 static const bool is_modulo = true;
10093
10094 static const bool traps = true;
10095 static const bool tinyness_before = false;
10096 static const float_round_style round_style = round_toward_zero;
10097 };
10098
10099
10100 template<>
10101 struct numeric_limits<long>
10102 {
10103 static const bool is_specialized = true;
10104
10105 static long min() throw()
10106 { return -2147483647L - 1; }
10107 static long max() throw()
10108 { return 2147483647L; }
10109
10110
10111
10112
10113
10114 static const int digits = (sizeof(long) * 8 - ((long)(-1) < 0));
10115 static const int digits10 = ((sizeof(long) * 8 - ((long)(-1) < 0)) * 643 / 2136);
10116
10117
10118
10119 static const bool is_signed = true;
10120 static const bool is_integer = true;
10121 static const bool is_exact = true;
10122 static const int radix = 2;
10123 static long epsilon() throw()
10124 { return 0; }
10125 static long round_error() throw()
10126 { return 0; }
10127
10128 static const int min_exponent = 0;
10129 static const int min_exponent10 = 0;
10130 static const int max_exponent = 0;
10131 static const int max_exponent10 = 0;
10132
10133 static const bool has_infinity = false;
10134 static const bool has_quiet_NaN = false;
10135 static const bool has_signaling_NaN = false;
10136 static const float_denorm_style has_denorm = denorm_absent;
10137 static const bool has_denorm_loss = false;
10138
10139 static long infinity() throw()
10140 { return static_cast<long>(0); }
10141 static long quiet_NaN() throw()
10142 { return static_cast<long>(0); }
10143 static long signaling_NaN() throw()
10144 { return static_cast<long>(0); }
10145 static long denorm_min() throw()
10146 { return static_cast<long>(0); }
10147
10148 static const bool is_iec559 = false;
10149 static const bool is_bounded = true;
10150 static const bool is_modulo = true;
10151
10152 static const bool traps = true;
10153 static const bool tinyness_before = false;
10154 static const float_round_style round_style = round_toward_zero;
10155 };
10156
10157
10158 template<>
10159 struct numeric_limits<unsigned long>
10160 {
10161 static const bool is_specialized = true;
10162
10163 static unsigned long min() throw()
10164 { return 0; }
10165 static unsigned long max() throw()
10166 { return 2147483647L * 2UL + 1; }
10167
10168
10169
10170
10171
10172 static const int digits = (sizeof(unsigned long) * 8 - ((unsigned long)(-1) < 0));
10173 static const int digits10 = ((sizeof(unsigned long) * 8 - ((unsigned long)(-1) < 0)) * 643 / 2136);
10174
10175
10176
10177 static const bool is_signed = false;
10178 static const bool is_integer = true;
10179 static const bool is_exact = true;
10180 static const int radix = 2;
10181 static unsigned long epsilon() throw()
10182 { return 0; }
10183 static unsigned long round_error() throw()
10184 { return 0; }
10185
10186 static const int min_exponent = 0;
10187 static const int min_exponent10 = 0;
10188 static const int max_exponent = 0;
10189 static const int max_exponent10 = 0;
10190
10191 static const bool has_infinity = false;
10192 static const bool has_quiet_NaN = false;
10193 static const bool has_signaling_NaN = false;
10194 static const float_denorm_style has_denorm = denorm_absent;
10195 static const bool has_denorm_loss = false;
10196
10197 static unsigned long infinity() throw()
10198 { return static_cast<unsigned long>(0); }
10199 static unsigned long quiet_NaN() throw()
10200 { return static_cast<unsigned long>(0); }
10201 static unsigned long signaling_NaN() throw()
10202 { return static_cast<unsigned long>(0); }
10203 static unsigned long denorm_min() throw()
10204 { return static_cast<unsigned long>(0); }
10205
10206 static const bool is_iec559 = false;
10207 static const bool is_bounded = true;
10208 static const bool is_modulo = true;
10209
10210 static const bool traps = true;
10211 static const bool tinyness_before = false;
10212 static const float_round_style round_style = round_toward_zero;
10213 };
10214
10215
10216 template<>
10217 struct numeric_limits<long long>
10218 {
10219 static const bool is_specialized = true;
10220
10221 static long long min() throw()
10222 { return -9223372036854775807LL - 1; }
10223 static long long max() throw()
10224 { return 9223372036854775807LL; }
10225
10226
10227
10228
10229
10230 static const int digits = (sizeof(long long) * 8 - ((long long)(-1) < 0));
10231 static const int digits10 = ((sizeof(long long) * 8 - ((long long)(-1) < 0)) * 643 / 2136);
10232
10233
10234
10235 static const bool is_signed = true;
10236 static const bool is_integer = true;
10237 static const bool is_exact = true;
10238 static const int radix = 2;
10239 static long long epsilon() throw()
10240 { return 0; }
10241 static long long round_error() throw()
10242 { return 0; }
10243
10244 static const int min_exponent = 0;
10245 static const int min_exponent10 = 0;
10246 static const int max_exponent = 0;
10247 static const int max_exponent10 = 0;
10248
10249 static const bool has_infinity = false;
10250 static const bool has_quiet_NaN = false;
10251 static const bool has_signaling_NaN = false;
10252 static const float_denorm_style has_denorm = denorm_absent;
10253 static const bool has_denorm_loss = false;
10254
10255 static long long infinity() throw()
10256 { return static_cast<long long>(0); }
10257 static long long quiet_NaN() throw()
10258 { return static_cast<long long>(0); }
10259 static long long signaling_NaN() throw()
10260 { return static_cast<long long>(0); }
10261 static long long denorm_min() throw()
10262 { return static_cast<long long>(0); }
10263
10264 static const bool is_iec559 = false;
10265 static const bool is_bounded = true;
10266 static const bool is_modulo = true;
10267
10268 static const bool traps = true;
10269 static const bool tinyness_before = false;
10270 static const float_round_style round_style = round_toward_zero;
10271 };
10272
10273
10274 template<>
10275 struct numeric_limits<unsigned long long>
10276 {
10277 static const bool is_specialized = true;
10278
10279 static unsigned long long min() throw()
10280 { return 0; }
10281 static unsigned long long max() throw()
10282 { return 9223372036854775807LL * 2ULL + 1; }
10283
10284
10285
10286
10287
10288 static const int digits = (sizeof(unsigned long long) * 8 - ((unsigned long long)(-1) < 0));
10289 static const int digits10 = ((sizeof(unsigned long long) * 8 - ((unsigned long long)(-1) < 0)) * 643 / 2136);
10290
10291
10292
10293 static const bool is_signed = false;
10294 static const bool is_integer = true;
10295 static const bool is_exact = true;
10296 static const int radix = 2;
10297 static unsigned long long epsilon() throw()
10298 { return 0; }
10299 static unsigned long long round_error() throw()
10300 { return 0; }
10301
10302 static const int min_exponent = 0;
10303 static const int min_exponent10 = 0;
10304 static const int max_exponent = 0;
10305 static const int max_exponent10 = 0;
10306
10307 static const bool has_infinity = false;
10308 static const bool has_quiet_NaN = false;
10309 static const bool has_signaling_NaN = false;
10310 static const float_denorm_style has_denorm = denorm_absent;
10311 static const bool has_denorm_loss = false;
10312
10313 static unsigned long long infinity() throw()
10314 { return static_cast<unsigned long long>(0); }
10315 static unsigned long long quiet_NaN() throw()
10316 { return static_cast<unsigned long long>(0); }
10317 static unsigned long long signaling_NaN() throw()
10318 { return static_cast<unsigned long long>(0); }
10319 static unsigned long long denorm_min() throw()
10320 { return static_cast<unsigned long long>(0); }
10321
10322 static const bool is_iec559 = false;
10323 static const bool is_bounded = true;
10324 static const bool is_modulo = true;
10325
10326 static const bool traps = true;
10327 static const bool tinyness_before = false;
10328 static const float_round_style round_style = round_toward_zero;
10329 };
10330
10331
10332 template<>
10333 struct numeric_limits<float>
10334 {
10335 static const bool is_specialized = true;
10336
10337 static float min() throw()
10338 { return 1.1754943508222875e-38F; }
10339 static float max() throw()
10340 { return 3.4028234663852886e+38F; }
10341
10342
10343
10344
10345
10346 static const int digits = 24;
10347 static const int digits10 = 6;
10348
10349
10350
10351
10352 static const bool is_signed = true;
10353 static const bool is_integer = false;
10354 static const bool is_exact = false;
10355 static const int radix = 2;
10356 static float epsilon() throw()
10357 { return 1.1920928955078125e-7F; }
10358 static float round_error() throw()
10359 { return 0.5F; }
10360
10361 static const int min_exponent = (-125);
10362 static const int min_exponent10 = (-37);
10363 static const int max_exponent = 128;
10364 static const int max_exponent10 = 38;
10365
10366 static const bool has_infinity = 1;
10367 static const bool has_quiet_NaN = 1;
10368 static const bool has_signaling_NaN = has_quiet_NaN;
10369 static const float_denorm_style has_denorm
10370 = bool(1) ? denorm_present : denorm_absent;
10371 static const bool has_denorm_loss = false;
10372
10373 static float infinity() throw()
10374 { return __builtin_huge_valf (); }
10375 static float quiet_NaN() throw()
10376 { return __builtin_nanf (""); }
10377 static float signaling_NaN() throw()
10378 { return __builtin_nansf (""); }
10379 static float denorm_min() throw()
10380 { return 1.4012984643248171e-45F; }
10381
10382 static const bool is_iec559
10383 = has_infinity && has_quiet_NaN && has_denorm == denorm_present;
10384 static const bool is_bounded = true;
10385 static const bool is_modulo = false;
10386
10387 static const bool traps = false;
10388 static const bool tinyness_before = false;
10389 static const float_round_style round_style = round_to_nearest;
10390 };
10391
10392 #undef __glibcxx_float_has_denorm_loss
10393 #undef __glibcxx_float_traps
10394 #undef __glibcxx_float_tinyness_before
10395
10396
10397 template<>
10398 struct numeric_limits<double>
10399 {
10400 static const bool is_specialized = true;
10401
10402 static double min() throw()
10403 { return ((double)2.2250738585072014e-308L); }
10404 static double max() throw()
10405 { return ((double)1.7976931348623157e+308L); }
10406
10407
10408
10409
10410
10411 static const int digits = 53;
10412 static const int digits10 = 15;
10413
10414
10415
10416
10417 static const bool is_signed = true;
10418 static const bool is_integer = false;
10419 static const bool is_exact = false;
10420 static const int radix = 2;
10421 static double epsilon() throw()
10422 { return ((double)2.2204460492503131e-16L); }
10423 static double round_error() throw()
10424 { return 0.5; }
10425
10426 static const int min_exponent = (-1021);
10427 static const int min_exponent10 = (-307);
10428 static const int max_exponent = 1024;
10429 static const int max_exponent10 = 308;
10430
10431 static const bool has_infinity = 1;
10432 static const bool has_quiet_NaN = 1;
10433 static const bool has_signaling_NaN = has_quiet_NaN;
10434 static const float_denorm_style has_denorm
10435 = bool(1) ? denorm_present : denorm_absent;
10436 static const bool has_denorm_loss = false;
10437
10438 static double infinity() throw()
10439 { return __builtin_huge_val(); }
10440 static double quiet_NaN() throw()
10441 { return __builtin_nan (""); }
10442 static double signaling_NaN() throw()
10443 { return __builtin_nans (""); }
10444 static double denorm_min() throw()
10445 { return ((double)4.9406564584124654e-324L); }
10446
10447 static const bool is_iec559
10448 = has_infinity && has_quiet_NaN && has_denorm == denorm_present;
10449 static const bool is_bounded = true;
10450 static const bool is_modulo = false;
10451
10452 static const bool traps = false;
10453 static const bool tinyness_before = false;
10454 static const float_round_style round_style = round_to_nearest;
10455 };
10456
10457 #undef __glibcxx_double_has_denorm_loss
10458 #undef __glibcxx_double_traps
10459 #undef __glibcxx_double_tinyness_before
10460
10461
10462 template<>
10463 struct numeric_limits<long double>
10464 {
10465 static const bool is_specialized = true;
10466
10467 static long double min() throw()
10468 { return 2.2250738585072014e-308L; }
10469 static long double max() throw()
10470 { return 1.7976931348623157e+308L; }
10471
10472
10473
10474
10475
10476 static const int digits = 53;
10477 static const int digits10 = 15;
10478
10479
10480
10481
10482 static const bool is_signed = true;
10483 static const bool is_integer = false;
10484 static const bool is_exact = false;
10485 static const int radix = 2;
10486 static long double epsilon() throw()
10487 { return 2.2204460492503131e-16L; }
10488 static long double round_error() throw()
10489 { return 0.5L; }
10490
10491 static const int min_exponent = (-1021);
10492 static const int min_exponent10 = (-307);
10493 static const int max_exponent = 1024;
10494 static const int max_exponent10 = 308;
10495
10496 static const bool has_infinity = 1;
10497 static const bool has_quiet_NaN = 1;
10498 static const bool has_signaling_NaN = has_quiet_NaN;
10499 static const float_denorm_style has_denorm
10500 = bool(1) ? denorm_present : denorm_absent;
10501 static const bool has_denorm_loss
10502 = false;
10503
10504 static long double infinity() throw()
10505 { return __builtin_huge_vall (); }
10506 static long double quiet_NaN() throw()
10507 { return __builtin_nanl (""); }
10508 static long double signaling_NaN() throw()
10509 { return __builtin_nansl (""); }
10510 static long double denorm_min() throw()
10511 { return 4.9406564584124654e-324L; }
10512
10513 static const bool is_iec559
10514 = has_infinity && has_quiet_NaN && has_denorm == denorm_present;
10515 static const bool is_bounded = true;
10516 static const bool is_modulo = false;
10517
10518 static const bool traps = false;
10519 static const bool tinyness_before = false;
10520 static const float_round_style round_style = round_to_nearest;
10521 };
10522
10523 #undef __glibcxx_long_double_has_denorm_loss
10524 #undef __glibcxx_long_double_traps
10525 #undef __glibcxx_long_double_tinyness_before
10526
10527 }
10528
10529 #undef __glibcxx_signed
10530 #undef __glibcxx_min
10531 #undef __glibcxx_max
10532 #undef __glibcxx_digits
10533 #undef __glibcxx_digits10
10534 #undef __glibcxx_max_digits10
10535 # 30 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h" 2
10536
10537 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsalloc.h" 1
10538 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsalloc.h"
10539 #define jsalloc_h_
10540
10541
10542
10543
10544 namespace js {
10545 # 32 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsalloc.h"
10546 class SystemAllocPolicy
10547 {
10548 public:
10549 void *malloc_(size_t bytes) { return js_malloc(bytes); }
10550 void *realloc_(void *p, size_t oldBytes, size_t bytes) { return js_realloc(p, bytes); }
10551 void free_(void *p) { js_free(p); }
10552 void reportAllocOverflow() const {}
10553 };
10554 # 50 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsalloc.h"
10555 class TempAllocPolicy
10556 {
10557 JSContext *const cx;
10558
10559
10560
10561
10562
10563 __attribute__((visibility("default"))) void * onOutOfMemory(void *p, size_t nbytes);
10564
10565 public:
10566 TempAllocPolicy(JSContext *cx) : cx(cx) {}
10567
10568 JSContext *context() const {
10569 return cx;
10570 }
10571
10572 void *malloc_(size_t bytes) {
10573 void *p = js_malloc(bytes);
10574 if ((__builtin_expect((!p), 0)))
10575 p = onOutOfMemory(__null, bytes);
10576 return p;
10577 }
10578
10579 void *realloc_(void *p, size_t oldBytes, size_t bytes) {
10580 void *p2 = js_realloc(p, bytes);
10581 if ((__builtin_expect((!p2), 0)))
10582 p2 = onOutOfMemory(p2, bytes);
10583 return p2;
10584 }
10585
10586 void free_(void *p) {
10587 js_free(p);
10588 }
10589
10590 __attribute__((visibility("default"))) void reportAllocOverflow() const;
10591 };
10592
10593 }
10594 # 32 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h" 2
10595 # 1 "./../../dist/include/js/Vector.h" 1
10596 # 9 "./../../dist/include/js/Vector.h"
10597 #define jsvector_h_
10598
10599
10600
10601 # 1 "./../../dist/include/js/TemplateLib.h" 1
10602 # 9 "./../../dist/include/js/TemplateLib.h"
10603 #define js_template_lib_h__
10604 # 20 "./../../dist/include/js/TemplateLib.h"
10605 namespace js {
10606 namespace tl {
10607
10608
10609 template <size_t i, size_t j> struct Min {
10610 static const size_t result = i < j ? i : j;
10611 };
10612 template <size_t i, size_t j> struct Max {
10613 static const size_t result = i > j ? i : j;
10614 };
10615 template <size_t i, size_t min, size_t max> struct Clamp {
10616 static const size_t result = i < min ? min : (i > max ? max : i);
10617 };
10618
10619
10620 template <size_t x, size_t y> struct Pow {
10621 static const size_t result = x * Pow<x, y - 1>::result;
10622 };
10623 template <size_t x> struct Pow<x,0> {
10624 static const size_t result = 1;
10625 };
10626
10627
10628 template <size_t i> struct FloorLog2 {
10629 static const size_t result = 1 + FloorLog2<i / 2>::result;
10630 };
10631 template <> struct FloorLog2<0> { };
10632 template <> struct FloorLog2<1> { static const size_t result = 0; };
10633
10634
10635 template <size_t i> struct CeilingLog2 {
10636 static const size_t result = FloorLog2<2 * i - 1>::result;
10637 };
10638
10639
10640 template <size_t i> struct RoundUpPow2 {
10641 static const size_t result = size_t(1) << CeilingLog2<i>::result;
10642 };
10643 template <> struct RoundUpPow2<0> {
10644 static const size_t result = 1;
10645 };
10646
10647
10648 template <class T> struct BitSize {
10649 static const size_t result = sizeof(T) * 8;
10650 };
10651
10652
10653 template <bool> struct StaticAssert {};
10654 template <> struct StaticAssert<true> { typedef int result; };
10655
10656
10657 template <class T, class U> struct IsSameType {
10658 static const bool result = false;
10659 };
10660 template <class T> struct IsSameType<T,T> {
10661 static const bool result = true;
10662 };
10663
10664
10665
10666
10667
10668 template <size_t N> struct NBitMask {
10669 typedef typename StaticAssert<N < BitSize<size_t>::result>::result _;
10670 static const size_t result = (size_t(1) << N) - 1;
10671 };
10672 template <> struct NBitMask<BitSize<size_t>::result> {
10673 static const size_t result = size_t(-1);
10674 };
10675
10676
10677
10678
10679
10680 template <size_t N> struct MulOverflowMask {
10681 static const size_t result =
10682 ~NBitMask<BitSize<size_t>::result - CeilingLog2<N>::result>::result;
10683 };
10684 template <> struct MulOverflowMask<0> { };
10685 template <> struct MulOverflowMask<1> { static const size_t result = 0; };
10686
10687
10688
10689
10690
10691
10692 template <class T> struct UnsafeRangeSizeMask {
10693
10694
10695
10696
10697 static const size_t result = MulOverflowMask<2 * sizeof(T)>::result;
10698 };
10699
10700
10701 template <class T> struct StripConst { typedef T result; };
10702 template <class T> struct StripConst<const T> { typedef T result; };
10703
10704
10705
10706
10707
10708 template <class T> struct IsPodType { static const bool result = false; };
10709 template <> struct IsPodType<char> { static const bool result = true; };
10710 template <> struct IsPodType<signed char> { static const bool result = true; };
10711 template <> struct IsPodType<unsigned char> { static const bool result = true; };
10712 template <> struct IsPodType<short> { static const bool result = true; };
10713 template <> struct IsPodType<unsigned short> { static const bool result = true; };
10714 template <> struct IsPodType<int> { static const bool result = true; };
10715 template <> struct IsPodType<unsigned int> { static const bool result = true; };
10716 template <> struct IsPodType<long> { static const bool result = true; };
10717 template <> struct IsPodType<unsigned long> { static const bool result = true; };
10718 template <> struct IsPodType<long long> { static const bool result = true; };
10719 template <> struct IsPodType<unsigned long long> { static const bool result = true; };
10720 template <> struct IsPodType<bool> { static const bool result = true; };
10721 template <> struct IsPodType<float> { static const bool result = true; };
10722 template <> struct IsPodType<double> { static const bool result = true; };
10723 template <> struct IsPodType<wchar_t> { static const bool result = true; };
10724 template <typename T> struct IsPodType<T *> { static const bool result = true; };
10725
10726 template <bool cond, typename T, T v1, T v2> struct If { static const T result = v1; };
10727 template <typename T, T v1, T v2> struct If<false, T, v1, v2> { static const T result = v2; };
10728
10729
10730
10731
10732 template <class T> struct IsRelocatableHeapType { static const bool result = true; };
10733
10734 }
10735 }
10736 # 14 "./../../dist/include/js/Vector.h" 2
10737 # 1 "./../../dist/include/js/Utility.h" 1
10738 # 15 "./../../dist/include/js/Vector.h" 2
10739
10740
10741
10742
10743
10744
10745
10746 namespace js {
10747
10748 class TempAllocPolicy;
10749
10750 template <class T,
10751 size_t MinInlineCapacity = 0,
10752 class AllocPolicy = TempAllocPolicy>
10753 class Vector;
10754
10755
10756
10757
10758
10759 template <class T, size_t N, class AP, bool IsPod>
10760 struct VectorImpl
10761 {
10762
10763 static inline void destroy(T *begin, T *end) {
10764 for (T *p = begin; p != end; ++p)
10765 p->~T();
10766 }
10767
10768
10769 static inline void initialize(T *begin, T *end) {
10770 for (T *p = begin; p != end; ++p)
10771 new(p) T();
10772 }
10773
10774
10775
10776
10777
10778 template <class U>
10779 static inline void copyConstruct(T *dst, const U *srcbeg, const U *srcend) {
10780 for (const U *p = srcbeg; p != srcend; ++p, ++dst)
10781 new(dst) T(*p);
10782 }
10783
10784
10785
10786
10787
10788 template <class U>
10789 static inline void moveConstruct(T *dst, const U *srcbeg, const U *srcend) {
10790 for (const U *p = srcbeg; p != srcend; ++p, ++dst)
10791 new(dst) T(Move(*p));
10792 }
10793
10794
10795
10796
10797
10798 template <class U>
10799 static inline void copyConstructN(T *dst, size_t n, const U &u) {
10800 for (T *end = dst + n; dst != end; ++dst)
10801 new(dst) T(u);
10802 }
10803
10804
10805
10806
10807
10808
10809
10810 static inline bool growTo(Vector<T,N,AP> &v, size_t newcap) {
10811 do { } while(0);
10812 T *newbuf = reinterpret_cast<T *>(v.malloc_(newcap * sizeof(T)));
10813 if (!newbuf)
10814 return false;
10815 for (T *dst = newbuf, *src = v.beginNoCheck(); src != v.endNoCheck(); ++dst, ++src)
10816 new(dst) T(Move(*src));
10817 VectorImpl::destroy(v.beginNoCheck(), v.endNoCheck());
10818 v.free_(v.mBegin);
10819 v.mBegin = newbuf;
10820
10821 v.mCapacity = newcap;
10822 return true;
10823 }
10824 };
10825
10826
10827
10828
10829
10830
10831 template <class T, size_t N, class AP>
10832 struct VectorImpl<T, N, AP, true>
10833 {
10834 static inline void destroy(T *, T *) {}
10835
10836 static inline void initialize(T *begin, T *end) {
10837 # 121 "./../../dist/include/js/Vector.h"
10838 for (T *p = begin; p != end; ++p)
10839 new(p) T();
10840 }
10841
10842 template <class U>
10843 static inline void copyConstruct(T *dst, const U *srcbeg, const U *srcend) {
10844
10845
10846
10847
10848
10849
10850
10851 for (const U *p = srcbeg; p != srcend; ++p, ++dst)
10852 *dst = *p;
10853 }
10854
10855 template <class U>
10856 static inline void moveConstruct(T *dst, const U *srcbeg, const U *srcend) {
10857 copyConstruct(dst, srcbeg, srcend);
10858 }
10859
10860 static inline void copyConstructN(T *dst, size_t n, const T &t) {
10861 for (T *p = dst, *end = dst + n; p != end; ++p)
10862 *p = t;
10863 }
10864
10865 static inline bool growTo(Vector<T,N,AP> &v, size_t newcap) {
10866 do { } while(0);
10867 size_t bytes = sizeof(T) * newcap;
10868 size_t oldBytes = sizeof(T) * v.mCapacity;
10869 T *newbuf = reinterpret_cast<T *>(v.realloc_(v.mBegin, oldBytes, bytes));
10870 if (!newbuf)
10871 return false;
10872 v.mBegin = newbuf;
10873
10874 v.mCapacity = newcap;
10875 return true;
10876 }
10877 };
10878 # 180 "./../../dist/include/js/Vector.h"
10879 template <class T, size_t N, class AllocPolicy>
10880 class Vector : private AllocPolicy
10881 {
10882 typedef typename tl::StaticAssert<tl::IsRelocatableHeapType<T>::result>::result _;
10883
10884
10885
10886 static const bool sElemIsPod = tl::IsPodType<T>::result;
10887 typedef VectorImpl<T, N, AllocPolicy, sElemIsPod> Impl;
10888 friend struct VectorImpl<T, N, AllocPolicy, sElemIsPod>;
10889
10890 bool calculateNewCapacity(size_t curLength, size_t lengthInc, size_t &newCap);
10891 bool growStorageBy(size_t lengthInc);
10892 bool growHeapStorageBy(size_t lengthInc);
10893 bool convertToHeapStorage(size_t lengthInc);
10894
10895 template <bool InitNewElems> inline bool growByImpl(size_t inc);
10896
10897
10898
10899 static const int sMaxInlineBytes = 1024;
10900 # 213 "./../../dist/include/js/Vector.h"
10901 template <int M, int Dummy>
10902 struct ElemSize {
10903 static const size_t result = sizeof(T);
10904 };
10905 template <int Dummy>
10906 struct ElemSize<0, Dummy> {
10907 static const size_t result = 1;
10908 };
10909
10910 static const size_t sInlineCapacity =
10911 tl::Min<N, sMaxInlineBytes / ElemSize<N, 0>::result>::result;
10912
10913
10914 static const size_t sInlineBytes =
10915 tl::Max<1, sInlineCapacity * ElemSize<N, 0>::result>::result;
10916 # 238 "./../../dist/include/js/Vector.h"
10917 T *mBegin;
10918 size_t mLength;
10919 size_t mCapacity;
10920
10921
10922
10923
10924 AlignedStorage<sInlineBytes> storage;
10925
10926
10927
10928
10929
10930
10931 Vector(const Vector &) ;
10932 Vector &operator=(const Vector &) ;
10933
10934
10935
10936 bool usingInlineStorage() const {
10937 return mBegin == (T *)storage.addr();
10938 }
10939
10940 T *beginNoCheck() const {
10941 return mBegin;
10942 }
10943
10944 T *endNoCheck() {
10945 return mBegin + mLength;
10946 }
10947
10948 const T *endNoCheck() const {
10949 return mBegin + mLength;
10950 }
10951 # 282 "./../../dist/include/js/Vector.h"
10952 template <class U> void internalAppend(U t);
10953 void internalAppendN(const T &t, size_t n);
10954 template <class U> void internalAppend(const U *begin, size_t length);
10955 template <class U, size_t O, class BP> void internalAppend(const Vector<U,O,BP> &other);
10956
10957 public:
10958 static const size_t sMaxInlineStorage = N;
10959
10960 typedef T ElementType;
10961
10962 Vector(AllocPolicy = AllocPolicy());
10963 Vector(MoveRef<Vector>);
10964 Vector &operator=(MoveRef<Vector>);
10965 ~Vector();
10966
10967
10968
10969 const AllocPolicy &allocPolicy() const {
10970 return *this;
10971 }
10972
10973 AllocPolicy &allocPolicy() {
10974 return *this;
10975 }
10976
10977 enum { InlineLength = N };
10978
10979 size_t length() const {
10980 return mLength;
10981 }
10982
10983 bool empty() const {
10984 return mLength == 0;
10985 }
10986
10987 size_t capacity() const {
10988 return mCapacity;
10989 }
10990
10991 T *begin() {
10992 do { } while(0);
10993 return mBegin;
10994 }
10995
10996 const T *begin() const {
10997 do { } while(0);
10998 return mBegin;
10999 }
11000
11001 T *end() {
11002 do { } while(0);
11003 return mBegin + mLength;
11004 }
11005
11006 const T *end() const {
11007 do { } while(0);
11008 return mBegin + mLength;
11009 }
11010
11011 T &operator[](size_t i) {
11012 do { } while(0);
11013 return begin()[i];
11014 }
11015
11016 const T &operator[](size_t i) const {
11017 do { } while(0);
11018 return begin()[i];
11019 }
11020
11021 T &back() {
11022 do { } while(0);
11023 return *(end() - 1);
11024 }
11025
11026 const T &back() const {
11027 do { } while(0);
11028 return *(end() - 1);
11029 }
11030
11031 class Range {
11032 friend class Vector;
11033 T *cur, *end;
11034 Range(T *cur, T *end) : cur(cur), end(end) {}
11035 public:
11036 Range() {}
11037 bool empty() const { return cur == end; }
11038 size_t remain() const { return end - cur; }
11039 T &front() const { return *cur; }
11040 void popFront() { do { } while(0); ++cur; }
11041 T popCopyFront() { do { } while(0); return *cur++; }
11042 };
11043
11044 Range all() {
11045 return Range(begin(), end());
11046 }
11047
11048
11049
11050
11051 bool reserve(size_t capacity);
11052
11053
11054
11055
11056
11057 void shrinkBy(size_t incr);
11058
11059
11060 bool growBy(size_t incr);
11061
11062
11063 bool resize(size_t newLength);
11064
11065
11066 bool growByUninitialized(size_t incr);
11067 bool resizeUninitialized(size_t newLength);
11068
11069
11070 void clear();
11071
11072
11073 void clearAndFree();
11074 # 413 "./../../dist/include/js/Vector.h"
11075 template <class U> bool append(U t);
11076 bool appendN(const T &t, size_t n);
11077 template <class U> bool append(const U *begin, const U *end);
11078 template <class U> bool append(const U *begin, size_t length);
11079 template <class U, size_t O, class BP> bool append(const Vector<U,O,BP> &other);
11080
11081
11082
11083
11084
11085 void infallibleAppend(const T &t) {
11086 internalAppend(t);
11087 }
11088 void infallibleAppendN(const T &t, size_t n) {
11089 internalAppendN(t, n);
11090 }
11091 template <class U> void infallibleAppend(const U *begin, const U *end) {
11092 internalAppend(begin, PointerRangeSize(begin, end));
11093 }
11094 template <class U> void infallibleAppend(const U *begin, size_t length) {
11095 internalAppend(begin, length);
11096 }
11097 template <class U, size_t O, class BP> void infallibleAppend(const Vector<U,O,BP> &other) {
11098 internalAppend(other);
11099 }
11100
11101 void popBack();
11102
11103 T popCopy();
11104 # 451 "./../../dist/include/js/Vector.h"
11105 T *extractRawBuffer();
11106
11107
11108
11109
11110
11111
11112 void replaceRawBuffer(T *p, size_t length);
11113
11114
11115
11116
11117
11118 bool insert(T *p, const T &val);
11119
11120
11121
11122
11123
11124 void erase(T *t);
11125
11126
11127
11128
11129 size_t sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf) const;
11130
11131
11132
11133
11134
11135 size_t sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf) const;
11136 };
11137
11138
11139 #define REENTRANCY_GUARD_ET_AL ReentrancyGuard g(*this); JS_ASSERT_IF(usingInlineStorage(), mCapacity == sInlineCapacity); JS_ASSERT(reserved() <= mCapacity); JS_ASSERT(mLength <= reserved()); JS_ASSERT(mLength <= mCapacity)
11140 # 494 "./../../dist/include/js/Vector.h"
11141 template <class T, size_t N, class AllocPolicy>
11142 __attribute__((always_inline)) inline
11143 Vector<T,N,AllocPolicy>::Vector(AllocPolicy ap)
11144 : AllocPolicy(ap), mBegin((T *)storage.addr()), mLength(0),
11145 mCapacity(sInlineCapacity)
11146
11147
11148
11149 {}
11150
11151
11152 template <class T, size_t N, class AllocPolicy>
11153 __attribute__((always_inline)) inline
11154 Vector<T, N, AllocPolicy>::Vector(MoveRef<Vector> rhs)
11155 : AllocPolicy(rhs)
11156 {
11157 mLength = rhs->mLength;
11158 mCapacity = rhs->mCapacity;
11159
11160
11161
11162
11163 if (rhs->usingInlineStorage()) {
11164
11165 mBegin = (T *)storage.addr();
11166 Impl::moveConstruct(mBegin, rhs->beginNoCheck(), rhs->endNoCheck());
11167
11168
11169
11170
11171 } else {
11172
11173
11174
11175
11176 mBegin = rhs->mBegin;
11177 rhs->mBegin = (T *) rhs->storage.addr();
11178 rhs->mCapacity = sInlineCapacity;
11179 rhs->mLength = 0;
11180
11181
11182
11183 }
11184 }
11185
11186
11187 template <class T, size_t N, class AP>
11188 __attribute__((always_inline)) inline
11189 Vector<T, N, AP> &
11190 Vector<T, N, AP>::operator=(MoveRef<Vector> rhs)
11191 {
11192 this->~Vector();
11193 new(this) Vector(rhs);
11194 return *this;
11195 }
11196
11197 template <class T, size_t N, class AP>
11198 __attribute__((always_inline)) inline
11199 Vector<T,N,AP>::~Vector()
11200 {
11201 ReentrancyGuard g(*this); do { } while (0); do { } while(0); do { } while(0); do { } while(0);
11202 Impl::destroy(beginNoCheck(), endNoCheck());
11203 if (!usingInlineStorage())
11204 this->free_(beginNoCheck());
11205 }
11206
11207
11208
11209
11210
11211 template <class T, size_t N, class AP>
11212
11213 inline bool
11214 Vector<T,N,AP>::calculateNewCapacity(size_t curLength, size_t lengthInc,
11215 size_t &newCap)
11216 {
11217 size_t newMinCap = curLength + lengthInc;
11218
11219
11220
11221
11222
11223 if (newMinCap < curLength ||
11224 newMinCap & tl::MulOverflowMask<2 * sizeof(T)>::result) {
11225 this->reportAllocOverflow();
11226 return false;
11227 }
11228
11229
11230 newCap = RoundUpPow2(newMinCap);
11231
11232
11233
11234
11235
11236 if (newCap & tl::UnsafeRangeSizeMask<T>::result) {
11237 this->reportAllocOverflow();
11238 return false;
11239 }
11240 return true;
11241 }
11242
11243
11244
11245
11246
11247 template <class T, size_t N, class AP>
11248 __attribute__((always_inline)) inline bool
11249 Vector<T,N,AP>::growHeapStorageBy(size_t lengthInc)
11250 {
11251 do { } while(0);
11252 size_t newCap;
11253 return calculateNewCapacity(mLength, lengthInc, newCap) &&
11254 Impl::growTo(*this, newCap);
11255 }
11256
11257
11258
11259
11260
11261
11262 template <class T, size_t N, class AP>
11263 inline bool
11264 Vector<T,N,AP>::convertToHeapStorage(size_t lengthInc)
11265 {
11266 do { } while(0);
11267 size_t newCap;
11268 if (!calculateNewCapacity(mLength, lengthInc, newCap))
11269 return false;
11270
11271
11272 T *newBuf = reinterpret_cast<T *>(this->malloc_(newCap * sizeof(T)));
11273 if (!newBuf)
11274 return false;
11275
11276
11277 Impl::moveConstruct(newBuf, beginNoCheck(), endNoCheck());
11278 Impl::destroy(beginNoCheck(), endNoCheck());
11279
11280
11281 mBegin = newBuf;
11282
11283 mCapacity = newCap;
11284 return true;
11285 }
11286
11287 template <class T, size_t N, class AP>
11288 __attribute__((noinline)) bool
11289 Vector<T,N,AP>::growStorageBy(size_t incr)
11290 {
11291 do { } while(0);
11292 return usingInlineStorage()
11293 ? convertToHeapStorage(incr)
11294 : growHeapStorageBy(incr);
11295 }
11296
11297 template <class T, size_t N, class AP>
11298 inline bool
11299 Vector<T,N,AP>::reserve(size_t request)
11300 {
11301 ReentrancyGuard g(*this); do { } while (0); do { } while(0); do { } while(0); do { } while(0);
11302 if (request > mCapacity && !growStorageBy(request - mLength))
11303 return false;
11304
11305
11306
11307
11308
11309
11310
11311 return true;
11312 }
11313
11314 template <class T, size_t N, class AP>
11315 inline void
11316 Vector<T,N,AP>::shrinkBy(size_t incr)
11317 {
11318 ReentrancyGuard g(*this); do { } while (0); do { } while(0); do { } while(0); do { } while(0);
11319 do { } while(0);
11320 Impl::destroy(endNoCheck() - incr, endNoCheck());
11321 mLength -= incr;
11322 }
11323
11324 template <class T, size_t N, class AP>
11325 template <bool InitNewElems>
11326 __attribute__((always_inline)) inline bool
11327 Vector<T,N,AP>::growByImpl(size_t incr)
11328 {
11329 ReentrancyGuard g(*this); do { } while (0); do { } while(0); do { } while(0); do { } while(0);
11330 if (incr > mCapacity - mLength && !growStorageBy(incr))
11331 return false;
11332
11333 do { } while(0);
11334 T *newend = endNoCheck() + incr;
11335 if (InitNewElems)
11336 Impl::initialize(endNoCheck(), newend);
11337 mLength += incr;
11338
11339
11340
11341
11342 return true;
11343 }
11344
11345 template <class T, size_t N, class AP>
11346 __attribute__((always_inline)) inline bool
11347 Vector<T,N,AP>::growBy(size_t incr)
11348 {
11349 return growByImpl<true>(incr);
11350 }
11351
11352 template <class T, size_t N, class AP>
11353 __attribute__((always_inline)) inline bool
11354 Vector<T,N,AP>::growByUninitialized(size_t incr)
11355 {
11356 return growByImpl<false>(incr);
11357 }
11358
11359 template <class T, size_t N, class AP>
11360
11361 inline bool
11362 Vector<T,N,AP>::resize(size_t newLength)
11363 {
11364 size_t curLength = mLength;
11365 if (newLength > curLength)
11366 return growBy(newLength - curLength);
11367 shrinkBy(curLength - newLength);
11368 return true;
11369 }
11370
11371 template <class T, size_t N, class AP>
11372 __attribute__((always_inline)) inline bool
11373 Vector<T,N,AP>::resizeUninitialized(size_t newLength)
11374 {
11375 size_t curLength = mLength;
11376 if (newLength > curLength)
11377 return growByUninitialized(newLength - curLength);
11378 shrinkBy(curLength - newLength);
11379 return true;
11380 }
11381
11382 template <class T, size_t N, class AP>
11383 inline void
11384 Vector<T,N,AP>::clear()
11385 {
11386 ReentrancyGuard g(*this); do { } while (0); do { } while(0); do { } while(0); do { } while(0);
11387 Impl::destroy(beginNoCheck(), endNoCheck());
11388 mLength = 0;
11389 }
11390
11391 template <class T, size_t N, class AP>
11392 inline void
11393 Vector<T,N,AP>::clearAndFree()
11394 {
11395 clear();
11396
11397 if (usingInlineStorage())
11398 return;
11399
11400 this->free_(beginNoCheck());
11401 mBegin = (T *)storage.addr();
11402 mCapacity = sInlineCapacity;
11403
11404
11405
11406 }
11407
11408 template <class T, size_t N, class AP>
11409 template <class U>
11410 __attribute__((always_inline)) inline bool
11411 Vector<T,N,AP>::append(U t)
11412 {
11413 ReentrancyGuard g(*this); do { } while (0); do { } while(0); do { } while(0); do { } while(0);
11414 if (mLength == mCapacity && !growStorageBy(1))
11415 return false;
11416
11417
11418
11419
11420
11421 internalAppend(t);
11422 return true;
11423 }
11424
11425 template <class T, size_t N, class AP>
11426 template <class U>
11427 __attribute__((always_inline)) inline void
11428 Vector<T,N,AP>::internalAppend(U t)
11429 {
11430 do { } while(0);
11431 do { } while(0);
11432 new(endNoCheck()) T(t);
11433 ++mLength;
11434 }
11435
11436 template <class T, size_t N, class AP>
11437 __attribute__((always_inline)) inline bool
11438 Vector<T,N,AP>::appendN(const T &t, size_t needed)
11439 {
11440 ReentrancyGuard g(*this); do { } while (0); do { } while(0); do { } while(0); do { } while(0);
11441 if (mLength + needed > mCapacity && !growStorageBy(needed))
11442 return false;
11443
11444
11445
11446
11447
11448 internalAppendN(t, needed);
11449 return true;
11450 }
11451
11452 template <class T, size_t N, class AP>
11453 __attribute__((always_inline)) inline void
11454 Vector<T,N,AP>::internalAppendN(const T &t, size_t needed)
11455 {
11456 do { } while(0);
11457 do { } while(0);
11458 Impl::copyConstructN(endNoCheck(), needed, t);
11459 mLength += needed;
11460 }
11461
11462 template <class T, size_t N, class AP>
11463 inline bool
11464 Vector<T,N,AP>::insert(T *p, const T &val)
11465 {
11466 do { } while(0);
11467 size_t pos = p - begin();
11468 do { } while(0);
11469 size_t oldLength = mLength;
11470 if (pos == oldLength)
11471 return append(val);
11472 {
11473 T oldBack = back();
11474 if (!append(oldBack))
11475 return false;
11476 }
11477 for (size_t i = oldLength; i > pos; --i)
11478 (*this)[i] = (*this)[i - 1];
11479 (*this)[pos] = val;
11480 return true;
11481 }
11482
11483 template<typename T, size_t N, class AP>
11484 inline void
11485 Vector<T,N,AP>::erase(T *it)
11486 {
11487 do { } while(0);
11488 while (it + 1 != end()) {
11489 *it = *(it + 1);
11490 ++it;
11491 }
11492 popBack();
11493 }
11494
11495 template <class T, size_t N, class AP>
11496 template <class U>
11497 __attribute__((always_inline)) inline bool
11498 Vector<T,N,AP>::append(const U *insBegin, const U *insEnd)
11499 {
11500 ReentrancyGuard g(*this); do { } while (0); do { } while(0); do { } while(0); do { } while(0);
11501 size_t needed = PointerRangeSize(insBegin, insEnd);
11502 if (mLength + needed > mCapacity && !growStorageBy(needed))
11503 return false;
11504
11505
11506
11507
11508
11509 internalAppend(insBegin, needed);
11510 return true;
11511 }
11512
11513 template <class T, size_t N, class AP>
11514 template <class U>
11515 __attribute__((always_inline)) inline void
11516 Vector<T,N,AP>::internalAppend(const U *insBegin, size_t length)
11517 {
11518 do { } while(0);
11519 do { } while(0);
11520 Impl::copyConstruct(endNoCheck(), insBegin, insBegin + length);
11521 mLength += length;
11522 }
11523
11524 template <class T, size_t N, class AP>
11525 template <class U, size_t O, class BP>
11526 inline bool
11527 Vector<T,N,AP>::append(const Vector<U,O,BP> &other)
11528 {
11529 return append(other.begin(), other.end());
11530 }
11531
11532 template <class T, size_t N, class AP>
11533 template <class U, size_t O, class BP>
11534 inline void
11535 Vector<T,N,AP>::internalAppend(const Vector<U,O,BP> &other)
11536 {
11537 internalAppend(other.begin(), other.length());
11538 }
11539
11540 template <class T, size_t N, class AP>
11541 template <class U>
11542 __attribute__((always_inline)) inline bool
11543 Vector<T,N,AP>::append(const U *insBegin, size_t length)
11544 {
11545 return this->append(insBegin, insBegin + length);
11546 }
11547
11548 template <class T, size_t N, class AP>
11549 __attribute__((always_inline)) inline void
11550 Vector<T,N,AP>::popBack()
11551 {
11552 ReentrancyGuard g(*this); do { } while (0); do { } while(0); do { } while(0); do { } while(0);
11553 do { } while(0);
11554 --mLength;
11555 endNoCheck()->~T();
11556 }
11557
11558 template <class T, size_t N, class AP>
11559 __attribute__((always_inline)) inline T
11560 Vector<T,N,AP>::popCopy()
11561 {
11562 T ret = back();
11563 popBack();
11564 return ret;
11565 }
11566
11567 template <class T, size_t N, class AP>
11568 inline T *
11569 Vector<T,N,AP>::extractRawBuffer()
11570 {
11571 T *ret;
11572 if (usingInlineStorage()) {
11573 ret = reinterpret_cast<T *>(this->malloc_(mLength * sizeof(T)));
11574 if (!ret)
11575 return __null;
11576 Impl::copyConstruct(ret, beginNoCheck(), endNoCheck());
11577 Impl::destroy(beginNoCheck(), endNoCheck());
11578
11579 mLength = 0;
11580 } else {
11581 ret = mBegin;
11582 mBegin = (T *)storage.addr();
11583 mLength = 0;
11584 mCapacity = sInlineCapacity;
11585
11586
11587
11588 }
11589 return ret;
11590 }
11591
11592 template <class T, size_t N, class AP>
11593 inline void
11594 Vector<T,N,AP>::replaceRawBuffer(T *p, size_t length)
11595 {
11596 ReentrancyGuard g(*this); do { } while (0); do { } while(0); do { } while(0); do { } while(0);
11597
11598
11599 Impl::destroy(beginNoCheck(), endNoCheck());
11600 if (!usingInlineStorage())
11601 this->free_(beginNoCheck());
11602
11603
11604 if (length <= sInlineCapacity) {
11605
11606
11607
11608
11609
11610 mBegin = (T *)storage.addr();
11611 mLength = length;
11612 mCapacity = sInlineCapacity;
11613 Impl::moveConstruct(mBegin, p, p + length);
11614 Impl::destroy(p, p + length);
11615 this->free_(p);
11616 } else {
11617 mBegin = p;
11618 mLength = length;
11619 mCapacity = length;
11620 }
11621
11622
11623
11624 }
11625
11626 template <class T, size_t N, class AP>
11627 inline size_t
11628 Vector<T,N,AP>::sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf) const
11629 {
11630 return usingInlineStorage() ? 0 : mallocSizeOf(beginNoCheck());
11631 }
11632
11633 template <class T, size_t N, class AP>
11634 inline size_t
11635 Vector<T,N,AP>::sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf) const
11636 {
11637 return mallocSizeOf(this) + sizeOfExcludingThis(mallocSizeOf);
11638 }
11639
11640 }
11641 # 33 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h" 2
11642
11643
11644
11645
11646
11647 #define JSVAL_INT_BITS 32
11648 #define JSVAL_INT_MIN ((int32_t)0x80000000)
11649 #define JSVAL_INT_MAX ((int32_t)0x7fffffff)
11650
11651
11652
11653 #define JS_Assert MOZ_Assert
11654
11655
11656 namespace JS {
11657 # 109 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
11658 template<typename T> class AnchorPermitted;
11659 template<> class AnchorPermitted<JSObject *> { };
11660 template<> class AnchorPermitted<const JSObject *> { };
11661 template<> class AnchorPermitted<JSFunction *> { };
11662 template<> class AnchorPermitted<const JSFunction *> { };
11663 template<> class AnchorPermitted<JSString *> { };
11664 template<> class AnchorPermitted<const JSString *> { };
11665 template<> class AnchorPermitted<Value> { };
11666 template<> class AnchorPermitted<const JSScript *> { };
11667 template<> class AnchorPermitted<JSScript *> { };
11668
11669 template<typename T>
11670 class Anchor: AnchorPermitted<T>
11671 {
11672 public:
11673 Anchor() { }
11674 explicit Anchor(T t) { hold = t; }
11675 inline ~Anchor();
11676 T &get() { return hold; }
11677 const T &get() const { return hold; }
11678 void set(const T &t) { hold = t; }
11679 void operator=(const T &t) { hold = t; }
11680 void clear() { hold = 0; }
11681 private:
11682 T hold;
11683 Anchor(const Anchor &) ;
11684 const Anchor &operator=(const Anchor &) ;
11685 };
11686
11687
11688 template<typename T>
11689 inline Anchor<T>::~Anchor()
11690 {
11691 # 153 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
11692 asm volatile("":: "g" (hold) : "memory");
11693 }
11694 # 222 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
11695 class Value
11696 {
11697 public:
11698
11699
11700
11701
11702
11703
11704
11705 __attribute__((always_inline)) inline
11706 void setNull() {
11707 data.asBits = BUILD_JSVAL(JSVAL_TAG_NULL, 0).asBits;
11708 }
11709
11710 __attribute__((always_inline)) inline
11711 void setUndefined() {
11712 data.asBits = BUILD_JSVAL(JSVAL_TAG_UNDEFINED, 0).asBits;
11713 }
11714
11715 __attribute__((always_inline)) inline
11716 void setInt32(int32_t i) {
11717 data = INT32_TO_JSVAL_IMPL(i);
11718 }
11719
11720 __attribute__((always_inline)) inline
11721 int32_t &getInt32Ref() {
11722 do { } while(0);
11723 return data.s.payload.i32;
11724 }
11725
11726 __attribute__((always_inline)) inline
11727 void setDouble(double d) {
11728 data = DOUBLE_TO_JSVAL_IMPL(d);
11729 }
11730
11731 __attribute__((always_inline)) inline
11732 double &getDoubleRef() {
11733 do { } while(0);
11734 return data.asDouble;
11735 }
11736
11737 __attribute__((always_inline)) inline
11738 void setString(JSString *str) {
11739 do { } while(0);
11740 data = STRING_TO_JSVAL_IMPL(str);
11741 }
11742
11743 __attribute__((always_inline)) inline
11744 void setString(const JS::Anchor<JSString *> &str) {
11745 setString(str.get());
11746 }
11747
11748 __attribute__((always_inline)) inline
11749 void setObject(JSObject &obj) {
11750 do { } while(0);
11751 data = OBJECT_TO_JSVAL_IMPL(&obj);
11752 }
11753
11754 __attribute__((always_inline)) inline
11755 void setBoolean(bool b) {
11756 data = BOOLEAN_TO_JSVAL_IMPL(b);
11757 }
11758
11759 __attribute__((always_inline)) inline
11760 void setMagic(JSWhyMagic why) {
11761 data = MAGIC_TO_JSVAL_IMPL(why);
11762 }
11763
11764 __attribute__((always_inline)) inline
11765 bool setNumber(uint32_t ui) {
11766 if (ui > ((int32_t)0x7fffffff)) {
11767 setDouble((double)ui);
11768 return false;
11769 } else {
11770 setInt32((int32_t)ui);
11771 return true;
11772 }
11773 }
11774
11775 __attribute__((always_inline)) inline
11776 bool setNumber(double d) {
11777 int32_t i;
11778 if (MOZ_DOUBLE_IS_INT32(d, &i)) {
11779 setInt32(i);
11780 return true;
11781 } else {
11782 setDouble(d);
11783 return false;
11784 }
11785 }
11786
11787 __attribute__((always_inline)) inline
11788 void setObjectOrNull(JSObject *arg) {
11789 if (arg)
11790 setObject(*arg);
11791 else
11792 setNull();
11793 }
11794
11795 __attribute__((always_inline)) inline
11796 void swap(Value &rhs) {
11797 uint64_t tmp = rhs.data.asBits;
11798 rhs.data.asBits = data.asBits;
11799 data.asBits = tmp;
11800 }
11801
11802
11803
11804 __attribute__((always_inline)) inline
11805 bool isUndefined() const {
11806 return JSVAL_IS_UNDEFINED_IMPL(data);
11807 }
11808
11809 __attribute__((always_inline)) inline
11810 bool isNull() const {
11811 return JSVAL_IS_NULL_IMPL(data);
11812 }
11813
11814 __attribute__((always_inline)) inline
11815 bool isNullOrUndefined() const {
11816 return isNull() || isUndefined();
11817 }
11818
11819 __attribute__((always_inline)) inline
11820 bool isInt32() const {
11821 return JSVAL_IS_INT32_IMPL(data);
11822 }
11823
11824 __attribute__((always_inline)) inline
11825 bool isInt32(int32_t i32) const {
11826 return JSVAL_IS_SPECIFIC_INT32_IMPL(data, i32);
11827 }
11828
11829 __attribute__((always_inline)) inline
11830 bool isDouble() const {
11831 return JSVAL_IS_DOUBLE_IMPL(data);
11832 }
11833
11834 __attribute__((always_inline)) inline
11835 bool isNumber() const {
11836 return JSVAL_IS_NUMBER_IMPL(data);
11837 }
11838
11839 __attribute__((always_inline)) inline
11840 bool isString() const {
11841 return JSVAL_IS_STRING_IMPL(data);
11842 }
11843
11844 __attribute__((always_inline)) inline
11845 bool isObject() const {
11846 return JSVAL_IS_OBJECT_IMPL(data);
11847 }
11848
11849 __attribute__((always_inline)) inline
11850 bool isPrimitive() const {
11851 return JSVAL_IS_PRIMITIVE_IMPL(data);
11852 }
11853
11854 __attribute__((always_inline)) inline
11855 bool isObjectOrNull() const {
11856 return JSVAL_IS_OBJECT_OR_NULL_IMPL(data);
11857 }
11858
11859 __attribute__((always_inline)) inline
11860 bool isGCThing() const {
11861 return JSVAL_IS_GCTHING_IMPL(data);
11862 }
11863
11864 __attribute__((always_inline)) inline
11865 bool isBoolean() const {
11866 return JSVAL_IS_BOOLEAN_IMPL(data);
11867 }
11868
11869 __attribute__((always_inline)) inline
11870 bool isTrue() const {
11871 return JSVAL_IS_SPECIFIC_BOOLEAN(data, true);
11872 }
11873
11874 __attribute__((always_inline)) inline
11875 bool isFalse() const {
11876 return JSVAL_IS_SPECIFIC_BOOLEAN(data, false);
11877 }
11878
11879 __attribute__((always_inline)) inline
11880 bool isMagic() const {
11881 return JSVAL_IS_MAGIC_IMPL(data);
11882 }
11883
11884 __attribute__((always_inline)) inline
11885 bool isMagic(JSWhyMagic why) const {
11886 do { } while (0);
11887 return JSVAL_IS_MAGIC_IMPL(data);
11888 }
11889
11890 __attribute__((always_inline)) inline
11891 bool isMarkable() const {
11892 return JSVAL_IS_TRACEABLE_IMPL(data);
11893 }
11894
11895 __attribute__((always_inline)) inline
11896 JSGCTraceKind gcKind() const {
11897 do { } while(0);
11898 return JSGCTraceKind(JSVAL_TRACE_KIND_IMPL(data));
11899 }
11900
11901 __attribute__((always_inline)) inline
11902 JSWhyMagic whyMagic() const {
11903 do { } while(0);
11904 return data.s.payload.why;
11905 }
11906
11907
11908
11909 __attribute__((always_inline)) inline
11910 bool operator==(const Value &rhs) const {
11911 return data.asBits == rhs.data.asBits;
11912 }
11913
11914 __attribute__((always_inline)) inline
11915 bool operator!=(const Value &rhs) const {
11916 return data.asBits != rhs.data.asBits;
11917 }
11918
11919 friend inline bool SameType(const Value &lhs, const Value &rhs);
11920
11921
11922
11923 __attribute__((always_inline)) inline
11924 int32_t toInt32() const {
11925 do { } while(0);
11926 return JSVAL_TO_INT32_IMPL(data);
11927 }
11928
11929 __attribute__((always_inline)) inline
11930 double toDouble() const {
11931 do { } while(0);
11932 return data.asDouble;
11933 }
11934
11935 __attribute__((always_inline)) inline
11936 double toNumber() const {
11937 do { } while(0);
11938 return isDouble() ? toDouble() : double(toInt32());
11939 }
11940
11941 __attribute__((always_inline)) inline
11942 JSString *toString() const {
11943 do { } while(0);
11944 return JSVAL_TO_STRING_IMPL(data);
11945 }
11946
11947 __attribute__((always_inline)) inline
11948 JSObject &toObject() const {
11949 do { } while(0);
11950 return *JSVAL_TO_OBJECT_IMPL(data);
11951 }
11952
11953 __attribute__((always_inline)) inline
11954 JSObject *toObjectOrNull() const {
11955 do { } while(0);
11956 return JSVAL_TO_OBJECT_IMPL(data);
11957 }
11958
11959 __attribute__((always_inline)) inline
11960 void *toGCThing() const {
11961 do { } while(0);
11962 return JSVAL_TO_GCTHING_IMPL(data);
11963 }
11964
11965 __attribute__((always_inline)) inline
11966 bool toBoolean() const {
11967 do { } while(0);
11968 return JSVAL_TO_BOOLEAN_IMPL(data);
11969 }
11970
11971 __attribute__((always_inline)) inline
11972 uint32_t payloadAsRawUint32() const {
11973 do { } while(0);
11974 return data.s.payload.u32;
11975 }
11976
11977 __attribute__((always_inline)) inline
11978 uint64_t asRawBits() const {
11979 return data.asBits;
11980 }
11981
11982 __attribute__((always_inline)) inline
11983 JSValueType extractNonDoubleType() const {
11984 return JSVAL_EXTRACT_NON_DOUBLE_TYPE_IMPL(data);
11985 }
11986 # 523 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
11987 __attribute__((always_inline)) inline
11988 void setPrivate(void *ptr) {
11989 data = PRIVATE_PTR_TO_JSVAL_IMPL(ptr);
11990 }
11991
11992 __attribute__((always_inline)) inline
11993 void *toPrivate() const {
11994 do { } while(0);
11995 return JSVAL_TO_PRIVATE_PTR_IMPL(data);
11996 }
11997
11998 __attribute__((always_inline)) inline
11999 void setPrivateUint32(uint32_t ui) {
12000 data = PRIVATE_UINT32_TO_JSVAL_IMPL(ui);
12001 }
12002
12003 __attribute__((always_inline)) inline
12004 uint32_t toPrivateUint32() const {
12005 do { } while(0);
12006 return JSVAL_TO_PRIVATE_UINT32_IMPL(data);
12007 }
12008
12009 __attribute__((always_inline)) inline
12010 uint32_t &getPrivateUint32Ref() {
12011 do { } while(0);
12012 return data.s.payload.u32;
12013 }
12014
12015
12016
12017
12018
12019
12020
12021 __attribute__((always_inline)) inline
12022 void setUnmarkedPtr(void *ptr) {
12023 data.asPtr = ptr;
12024 }
12025
12026 __attribute__((always_inline)) inline
12027 void *toUnmarkedPtr() const {
12028 return data.asPtr;
12029 }
12030
12031 const size_t *payloadWord() const {
12032
12033 return &data.s.payload.word;
12034
12035
12036
12037 }
12038
12039 const uintptr_t *payloadUIntPtr() const {
12040
12041 return &data.s.payload.uintptr;
12042
12043
12044
12045 }
12046
12047
12048
12049
12050
12051
12052
12053 private:
12054
12055
12056 jsval_layout data;
12057
12058 private:
12059 void staticAssertions() {
12060 typedef int moz_static_assert8[(sizeof(JSValueType) == 1) ? 1 : -1];
12061 typedef int moz_static_assert9[(sizeof(JSValueTag) == 4) ? 1 : -1];
12062 typedef int moz_static_assert10[(sizeof(JSBool) == 4) ? 1 : -1];
12063 typedef int moz_static_assert11[(sizeof(JSWhyMagic) <= 4) ? 1 : -1];
12064 typedef int moz_static_assert12[(sizeof(Value) == 8) ? 1 : -1];
12065 }
12066
12067 friend jsval_layout (::JSVAL_TO_IMPL)(Value);
12068 friend Value (::IMPL_TO_JSVAL)(jsval_layout l);
12069 };
12070
12071 inline bool
12072 IsPoisonedValue(const Value &v)
12073 {
12074 if (v.isString())
12075 return IsPoisonedPtr(v.toString());
12076 if (v.isObject())
12077 return IsPoisonedPtr(&v.toObject());
12078 return false;
12079 }
12080
12081
12082
12083 static __attribute__((always_inline)) inline Value
12084 NullValue()
12085 {
12086 Value v;
12087 v.setNull();
12088 return v;
12089 }
12090
12091 static __attribute__((always_inline)) inline Value
12092 UndefinedValue()
12093 {
12094 Value v;
12095 v.setUndefined();
12096 return v;
12097 }
12098
12099 static __attribute__((always_inline)) inline Value
12100 Int32Value(int32_t i32)
12101 {
12102 Value v;
12103 v.setInt32(i32);
12104 return v;
12105 }
12106
12107 static __attribute__((always_inline)) inline Value
12108 DoubleValue(double dbl)
12109 {
12110 Value v;
12111 v.setDouble(dbl);
12112 return v;
12113 }
12114
12115 static __attribute__((always_inline)) inline Value
12116 StringValue(JSString *str)
12117 {
12118 Value v;
12119 v.setString(str);
12120 return v;
12121 }
12122
12123 static __attribute__((always_inline)) inline Value
12124 BooleanValue(bool boo)
12125 {
12126 Value v;
12127 v.setBoolean(boo);
12128 return v;
12129 }
12130
12131 static __attribute__((always_inline)) inline Value
12132 ObjectValue(JSObject &obj)
12133 {
12134 Value v;
12135 v.setObject(obj);
12136 return v;
12137 }
12138
12139 static __attribute__((always_inline)) inline Value
12140 MagicValue(JSWhyMagic why)
12141 {
12142 Value v;
12143 v.setMagic(why);
12144 return v;
12145 }
12146
12147 static __attribute__((always_inline)) inline Value
12148 NumberValue(float f)
12149 {
12150 Value v;
12151 v.setNumber(f);
12152 return v;
12153 }
12154
12155 static __attribute__((always_inline)) inline Value
12156 NumberValue(double dbl)
12157 {
12158 Value v;
12159 v.setNumber(dbl);
12160 return v;
12161 }
12162
12163 static __attribute__((always_inline)) inline Value
12164 NumberValue(int8_t i)
12165 {
12166 return Int32Value(i);
12167 }
12168
12169 static __attribute__((always_inline)) inline Value
12170 NumberValue(uint8_t i)
12171 {
12172 return Int32Value(i);
12173 }
12174
12175 static __attribute__((always_inline)) inline Value
12176 NumberValue(int16_t i)
12177 {
12178 return Int32Value(i);
12179 }
12180
12181 static __attribute__((always_inline)) inline Value
12182 NumberValue(uint16_t i)
12183 {
12184 return Int32Value(i);
12185 }
12186
12187 static __attribute__((always_inline)) inline Value
12188 NumberValue(int32_t i)
12189 {
12190 return Int32Value(i);
12191 }
12192
12193 static __attribute__((always_inline)) inline Value
12194 NumberValue(uint32_t i)
12195 {
12196 Value v;
12197 v.setNumber(i);
12198 return v;
12199 }
12200
12201 namespace detail {
12202
12203 template <bool Signed>
12204 class MakeNumberValue
12205 {
12206 public:
12207 template<typename T>
12208 static inline Value create(const T t)
12209 {
12210 Value v;
12211 if (((int32_t)0x80000000) <= t && t <= ((int32_t)0x7fffffff))
12212 v.setInt32(int32_t(t));
12213 else
12214 v.setDouble(double(t));
12215 return v;
12216 }
12217 };
12218
12219 template <>
12220 class MakeNumberValue<false>
12221 {
12222 public:
12223 template<typename T>
12224 static inline Value create(const T t)
12225 {
12226 Value v;
12227 if (t <= ((int32_t)0x7fffffff))
12228 v.setInt32(int32_t(t));
12229 else
12230 v.setDouble(double(t));
12231 return v;
12232 }
12233 };
12234
12235 }
12236
12237 template <typename T>
12238 static __attribute__((always_inline)) inline Value
12239 NumberValue(const T t)
12240 {
12241 do { } while(0);
12242 return detail::MakeNumberValue<std::numeric_limits<T>::is_signed>::create(t);
12243 }
12244
12245 static __attribute__((always_inline)) inline Value
12246 ObjectOrNullValue(JSObject *obj)
12247 {
12248 Value v;
12249 v.setObjectOrNull(obj);
12250 return v;
12251 }
12252
12253 static __attribute__((always_inline)) inline Value
12254 PrivateValue(void *ptr)
12255 {
12256 Value v;
12257 v.setPrivate(ptr);
12258 return v;
12259 }
12260
12261 static __attribute__((always_inline)) inline Value
12262 PrivateUint32Value(uint32_t ui)
12263 {
12264 Value v;
12265 v.setPrivateUint32(ui);
12266 return v;
12267 }
12268
12269 __attribute__((always_inline)) inline bool
12270 SameType(const Value &lhs, const Value &rhs)
12271 {
12272 return JSVAL_SAME_TYPE_IMPL(lhs.data, rhs.data);
12273 }
12274
12275 template <> struct RootMethods<const Value>
12276 {
12277 static Value initial() { return UndefinedValue(); }
12278 static ThingRootKind kind() { return THING_ROOT_VALUE; }
12279 static bool poisoned(const Value &v) { return IsPoisonedValue(v); }
12280 };
12281
12282 template <> struct RootMethods<Value>
12283 {
12284 static Value initial() { return UndefinedValue(); }
12285 static ThingRootKind kind() { return THING_ROOT_VALUE; }
12286 static bool poisoned(const Value &v) { return IsPoisonedValue(v); }
12287 };
12288 # 864 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
12289 #define CHECK_REQUEST(cx) ((void) 0)
12290 # 875 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
12291 inline void AssertArgumentsAreSane(JSContext *cx, const Value &v) {
12292
12293 }
12294
12295
12296 class __attribute__((visibility("default"))) AutoGCRooter {
12297 public:
12298 AutoGCRooter(JSContext *cx, ptrdiff_t tag);
12299
12300 ~AutoGCRooter() {
12301 do { } while(0);
12302 *stackTop = down;
12303 }
12304
12305
12306 inline void trace(JSTracer *trc);
12307 static void traceAll(JSTracer *trc);
12308
12309 protected:
12310 AutoGCRooter * const down;
12311 # 903 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
12312 ptrdiff_t tag;
12313
12314 enum {
12315 JSVAL = -1,
12316 VALARRAY = -2,
12317 PARSER = -3,
12318 SHAPEVECTOR = -4,
12319 ENUMERATOR = -5,
12320 IDARRAY = -6,
12321 DESCRIPTORS = -7,
12322 NAMESPACES = -8,
12323 XML = -9,
12324 OBJECT = -10,
12325 ID = -11,
12326 VALVECTOR = -12,
12327 DESCRIPTOR = -13,
12328 STRING = -14,
12329 IDVECTOR = -15,
12330 OBJVECTOR = -16,
12331 SCRIPTVECTOR =-17,
12332 PROPDESC = -18,
12333 SHAPERANGE = -19,
12334 STACKSHAPE = -20,
12335 STACKBASESHAPE=-21,
12336 BINDINGS = -22,
12337 GETTERSETTER =-23,
12338 REGEXPSTATICS=-24,
12339 HASHABLEVALUE=-25
12340 };
12341
12342 private:
12343 AutoGCRooter ** const stackTop;
12344
12345
12346 AutoGCRooter(AutoGCRooter &ida) ;
12347 void operator=(AutoGCRooter &ida) ;
12348 };
12349
12350 class AutoValueRooter : private AutoGCRooter
12351 {
12352 public:
12353 explicit AutoValueRooter(JSContext *cx
12354 )
12355 : AutoGCRooter(cx, JSVAL), val(NullValue())
12356 {
12357 do { } while (0);
12358 }
12359
12360 AutoValueRooter(JSContext *cx, const Value &v
12361 )
12362 : AutoGCRooter(cx, JSVAL), val(v)
12363 {
12364 do { } while (0);
12365 }
12366
12367
12368
12369
12370
12371
12372
12373 void set(Value v) {
12374 do { } while(0);
12375 val = v;
12376 }
12377
12378 const Value &value() const {
12379 do { } while(0);
12380 return val;
12381 }
12382
12383 Value *addr() {
12384 do { } while(0);
12385 return &val;
12386 }
12387
12388 const Value &jsval_value() const {
12389 do { } while(0);
12390 return val;
12391 }
12392
12393 Value *jsval_addr() {
12394 do { } while(0);
12395 return &val;
12396 }
12397
12398 friend void AutoGCRooter::trace(JSTracer *trc);
12399
12400 private:
12401 Value val;
12402
12403 };
12404
12405 class AutoObjectRooter : private AutoGCRooter {
12406 public:
12407 AutoObjectRooter(JSContext *cx, JSObject *obj = __null
12408 )
12409 : AutoGCRooter(cx, OBJECT), obj(obj)
12410 {
12411 do { } while (0);
12412 }
12413
12414 void setObject(JSObject *obj) {
12415 this->obj = obj;
12416 }
12417
12418 JSObject * object() const {
12419 return obj;
12420 }
12421
12422 JSObject ** addr() {
12423 return &obj;
12424 }
12425
12426 friend void AutoGCRooter::trace(JSTracer *trc);
12427
12428 private:
12429 JSObject *obj;
12430
12431 };
12432
12433 class AutoStringRooter : private AutoGCRooter {
12434 public:
12435 AutoStringRooter(JSContext *cx, JSString *str = __null
12436 )
12437 : AutoGCRooter(cx, STRING), str(str)
12438 {
12439 do { } while (0);
12440 }
12441
12442 void setString(JSString *str) {
12443 this->str = str;
12444 }
12445
12446 JSString * string() const {
12447 return str;
12448 }
12449
12450 JSString ** addr() {
12451 return &str;
12452 }
12453
12454 friend void AutoGCRooter::trace(JSTracer *trc);
12455
12456 private:
12457 JSString *str;
12458
12459 };
12460
12461 class AutoArrayRooter : private AutoGCRooter {
12462 public:
12463 AutoArrayRooter(JSContext *cx, size_t len, Value *vec
12464 )
12465 : AutoGCRooter(cx, len), array(vec), skip(cx, array, len)
12466 {
12467 do { } while (0);
12468 do { } while(0);
12469 }
12470
12471 void changeLength(size_t newLength) {
12472 tag = ptrdiff_t(newLength);
12473 do { } while(0);
12474 }
12475
12476 void changeArray(Value *newArray, size_t newLength) {
12477 changeLength(newLength);
12478 array = newArray;
12479 }
12480
12481 Value *array;
12482
12483 friend void AutoGCRooter::trace(JSTracer *trc);
12484
12485 private:
12486
12487
12488 SkipRoot skip;
12489 };
12490
12491
12492 class AutoEnumStateRooter : private AutoGCRooter
12493 {
12494 public:
12495 AutoEnumStateRooter(JSContext *cx, JSObject *obj
12496 )
12497 : AutoGCRooter(cx, ENUMERATOR), obj(obj), stateValue(), context(cx)
12498 {
12499 do { } while (0);
12500 do { } while(0);
12501 }
12502
12503 ~AutoEnumStateRooter();
12504
12505 friend void AutoGCRooter::trace(JSTracer *trc);
12506
12507 const Value &state() const { return stateValue; }
12508 Value *addr() { return &stateValue; }
12509
12510 protected:
12511 void trace(JSTracer *trc);
12512
12513 JSObject *obj;
12514
12515 private:
12516 Value stateValue;
12517 JSContext *context;
12518
12519 };
12520
12521 template<class T>
12522 class AutoVectorRooter : protected AutoGCRooter
12523 {
12524 public:
12525 explicit AutoVectorRooter(JSContext *cx, ptrdiff_t tag
12526 )
12527 : AutoGCRooter(cx, tag), vector(cx), vectorRoot(cx, &vector)
12528 {
12529 do { } while (0);
12530 }
12531
12532 size_t length() const { return vector.length(); }
12533
12534 bool append(const T &v) { return vector.append(v); }
12535
12536
12537 void infallibleAppend(const T &v) { vector.infallibleAppend(v); }
12538
12539 void popBack() { vector.popBack(); }
12540 T popCopy() { return vector.popCopy(); }
12541
12542 bool growBy(size_t inc) {
12543 size_t oldLength = vector.length();
12544 if (!vector.growByUninitialized(inc))
12545 return false;
12546 makeRangeGCSafe(oldLength);
12547 return true;
12548 }
12549
12550 bool resize(size_t newLength) {
12551 size_t oldLength = vector.length();
12552 if (newLength <= oldLength) {
12553 vector.shrinkBy(oldLength - newLength);
12554 return true;
12555 }
12556 if (!vector.growByUninitialized(newLength - oldLength))
12557 return false;
12558 makeRangeGCSafe(oldLength);
12559 return true;
12560 }
12561
12562 void clear() { vector.clear(); }
12563
12564 bool reserve(size_t newLength) {
12565 return vector.reserve(newLength);
12566 }
12567
12568 T &operator[](size_t i) { return vector[i]; }
12569 const T &operator[](size_t i) const { return vector[i]; }
12570
12571 const T *begin() const { return vector.begin(); }
12572 T *begin() { return vector.begin(); }
12573
12574 const T *end() const { return vector.end(); }
12575 T *end() { return vector.end(); }
12576
12577 const T &back() const { return vector.back(); }
12578
12579 friend void AutoGCRooter::trace(JSTracer *trc);
12580
12581 private:
12582 void makeRangeGCSafe(size_t oldLength) {
12583 T *t = vector.begin() + oldLength;
12584 for (size_t i = oldLength; i < vector.length(); ++i, ++t)
12585 memset(t, 0, sizeof(T));
12586 }
12587
12588 typedef js::Vector<T, 8> VectorImpl;
12589 VectorImpl vector;
12590
12591
12592 SkipRoot vectorRoot;
12593
12594
12595 };
12596
12597 class AutoValueVector : public AutoVectorRooter<Value>
12598 {
12599 public:
12600 explicit AutoValueVector(JSContext *cx
12601 )
12602 : AutoVectorRooter<Value>(cx, VALVECTOR)
12603 {
12604 do { } while (0);
12605 }
12606
12607
12608 };
12609
12610 class AutoIdVector : public AutoVectorRooter<jsid>
12611 {
12612 public:
12613 explicit AutoIdVector(JSContext *cx
12614 )
12615 : AutoVectorRooter<jsid>(cx, IDVECTOR)
12616 {
12617 do { } while (0);
12618 }
12619
12620
12621 };
12622
12623 class AutoScriptVector : public AutoVectorRooter<JSScript *>
12624 {
12625 public:
12626 explicit AutoScriptVector(JSContext *cx
12627 )
12628 : AutoVectorRooter<JSScript *>(cx, SCRIPTVECTOR)
12629 {
12630 do { } while (0);
12631 }
12632
12633
12634 };
12635
12636 }
12637 # 1236 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
12638 typedef JS::Value jsval;
12639
12640 static __attribute__((always_inline)) inline jsval_layout
12641 JSVAL_TO_IMPL(jsval v)
12642 {
12643 return v.data;
12644 }
12645
12646 static __attribute__((always_inline)) inline jsval
12647 IMPL_TO_JSVAL(jsval_layout l)
12648 {
12649 JS::Value v;
12650 v.data = l;
12651 return v;
12652 }
12653 # 1286 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
12654 typedef int moz_static_assert13[(sizeof(jsval_layout) == sizeof(jsval)) ? 1 : -1];
12655
12656
12657
12658
12659
12660 typedef JS::Handle<JSObject*> JSHandleObject;
12661 typedef JS::Handle<jsid> JSHandleId;
12662 # 1322 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
12663 typedef JSBool
12664 (* JSPropertyOp)(JSContext *cx, JSHandleObject obj, JSHandleId id, jsval *vp);
12665 # 1332 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
12666 typedef JSBool
12667 (* JSStrictPropertyOp)(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict, jsval *vp);
12668 # 1367 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
12669 typedef JSBool
12670 (* JSNewEnumerateOp)(JSContext *cx, JSHandleObject obj, JSIterateOp enum_op,
12671 jsval *statep, jsid *idp);
12672
12673
12674
12675
12676
12677 typedef JSBool
12678 (* JSEnumerateOp)(JSContext *cx, JSHandleObject obj);
12679 # 1390 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
12680 typedef JSBool
12681 (* JSResolveOp)(JSContext *cx, JSHandleObject obj, JSHandleId id);
12682 # 1421 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
12683 typedef JSBool
12684 (* JSNewResolveOp)(JSContext *cx, JSHandleObject obj, JSHandleId id, unsigned flags,
12685 JSObject **objp);
12686
12687
12688
12689
12690
12691 typedef JSBool
12692 (* JSConvertOp)(JSContext *cx, JSHandleObject obj, JSType type, jsval *vp);
12693
12694
12695
12696
12697 typedef JSType
12698 (* JSTypeOfOp)(JSContext *cx, JSObject *obj);
12699
12700 typedef struct JSFreeOp JSFreeOp;
12701
12702 struct JSFreeOp {
12703
12704
12705
12706 private:
12707 JSRuntime *runtime_;
12708
12709 protected:
12710 JSFreeOp(JSRuntime *rt)
12711 : runtime_(rt) { }
12712
12713 public:
12714 JSRuntime *runtime() const {
12715 return runtime_;
12716 }
12717
12718 };
12719
12720
12721
12722
12723
12724
12725 typedef void
12726 (* JSFinalizeOp)(JSFreeOp *fop, JSObject *obj);
12727
12728
12729
12730
12731 typedef struct JSStringFinalizer JSStringFinalizer;
12732
12733 struct JSStringFinalizer {
12734 void (*finalize)(const JSStringFinalizer *fin, jschar *chars);
12735 };
12736
12737
12738
12739
12740
12741
12742
12743 typedef JSBool
12744 (* JSCheckAccessOp)(JSContext *cx, JSHandleObject obj, JSHandleId id, JSAccessMode mode,
12745 jsval *vp);
12746
12747
12748
12749
12750
12751
12752 typedef JSBool
12753 (* JSHasInstanceOp)(JSContext *cx, JSHandleObject obj, const jsval *v, JSBool *bp);
12754 # 1510 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
12755 typedef void
12756 (* JSTraceOp)(JSTracer *trc, JSObject *obj);
12757
12758
12759
12760
12761
12762 typedef void
12763 (* JSTraceNamePrinter)(JSTracer *trc, char *buf, size_t bufsize);
12764
12765 typedef JSBool
12766 (* JSEqualityOp)(JSContext *cx, JSHandleObject obj, const jsval *v, JSBool *bp);
12767
12768
12769
12770
12771
12772
12773
12774 typedef JSBool
12775 (* JSNative)(JSContext *cx, unsigned argc, jsval *vp);
12776
12777
12778
12779 typedef enum JSContextOp {
12780 JSCONTEXT_NEW,
12781 JSCONTEXT_DESTROY
12782 } JSContextOp;
12783 # 1552 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
12784 typedef JSBool
12785 (* JSContextCallback)(JSContext *cx, unsigned contextOp);
12786
12787 typedef enum JSGCStatus {
12788 JSGC_BEGIN,
12789 JSGC_END
12790 } JSGCStatus;
12791
12792 typedef void
12793 (* JSGCCallback)(JSRuntime *rt, JSGCStatus status);
12794
12795 typedef enum JSFinalizeStatus {
12796 JSFINALIZE_START,
12797 JSFINALIZE_END
12798 } JSFinalizeStatus;
12799
12800 typedef void
12801 (* JSFinalizeCallback)(JSFreeOp *fop, JSFinalizeStatus status, JSBool isCompartment);
12802
12803
12804
12805
12806
12807 typedef void
12808 (* JSTraceDataOp)(JSTracer *trc, void *data);
12809
12810 typedef JSBool
12811 (* JSOperationCallback)(JSContext *cx);
12812
12813 typedef void
12814 (* JSErrorReporter)(JSContext *cx, const char *message, JSErrorReport *report);
12815 # 1597 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
12816 typedef enum JSExnType {
12817 JSEXN_NONE = -1,
12818 JSEXN_ERR,
12819 JSEXN_INTERNALERR,
12820 JSEXN_EVALERR,
12821 JSEXN_RANGEERR,
12822 JSEXN_REFERENCEERR,
12823 JSEXN_SYNTAXERR,
12824 JSEXN_TYPEERR,
12825 JSEXN_URIERR,
12826 JSEXN_LIMIT
12827 } JSExnType;
12828
12829 typedef struct JSErrorFormatString {
12830
12831 const char *format;
12832
12833
12834 uint16_t argCount;
12835
12836
12837 int16_t exnType;
12838 } JSErrorFormatString;
12839
12840 typedef const JSErrorFormatString *
12841 (* JSErrorCallback)(void *userRef, const char *locale,
12842 const unsigned errorNumber);
12843 # 1633 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
12844 typedef JSBool
12845 (* JSLocaleToUpperCase)(JSContext *cx, JSString *src, jsval *rval);
12846
12847 typedef JSBool
12848 (* JSLocaleToLowerCase)(JSContext *cx, JSString *src, jsval *rval);
12849
12850 typedef JSBool
12851 (* JSLocaleCompare)(JSContext *cx, JSString *src1, JSString *src2,
12852 jsval *rval);
12853
12854 typedef JSBool
12855 (* JSLocaleToUnicode)(JSContext *cx, const char *src, jsval *rval);
12856
12857
12858
12859
12860
12861 typedef void
12862 (* JSDestroyPrincipalsOp)(JSPrincipals *principals);
12863
12864 typedef JSBool
12865 (* JSSubsumePrincipalsOp)(JSPrincipals *principals1, JSPrincipals *principals2);
12866 # 1664 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
12867 typedef JSPrincipals *
12868 (* JSObjectPrincipalsFinder)(JSObject *obj);
12869
12870
12871
12872
12873
12874 typedef JSBool
12875 (* JSCSPEvalChecker)(JSContext *cx);
12876
12877
12878
12879
12880
12881 typedef JSBool
12882 (* JSPushContextPrincipalOp)(JSContext *cx, JSPrincipals *principals);
12883
12884 typedef JSBool
12885 (* JSPopContextPrincipalOp)(JSContext *cx);
12886
12887
12888
12889
12890
12891
12892 typedef JSObject *
12893 (* JSWrapObjectCallback)(JSContext *cx, JSObject *obj, JSObject *proto, JSObject *parent,
12894 unsigned flags);
12895
12896
12897
12898
12899
12900
12901 typedef JSObject *
12902 (* JSPreWrapCallback)(JSContext *cx, JSObject *scope, JSObject *obj, unsigned flags);
12903 # 1711 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
12904 typedef JSObject *
12905 (* JSSameCompartmentWrapObjectCallback)(JSContext *cx, JSObject *obj);
12906
12907 typedef void
12908 (* JSDestroyCompartmentCallback)(JSFreeOp *fop, JSCompartment *compartment);
12909 # 1726 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
12910 typedef JSObject *(*ReadStructuredCloneOp)(JSContext *cx, JSStructuredCloneReader *r,
12911 uint32_t tag, uint32_t data, void *closure);
12912 # 1740 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
12913 typedef JSBool (*WriteStructuredCloneOp)(JSContext *cx, JSStructuredCloneWriter *w,
12914 JSObject *obj, void *closure);
12915
12916
12917
12918
12919
12920
12921 typedef void (*StructuredCloneErrorOp)(JSContext *cx, uint32_t errorid);
12922
12923
12924
12925 extern "C" {
12926 # 1769 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
12927 extern __attribute__((visibility("default"))) const jsval JSVAL_NULL;
12928 extern __attribute__((visibility("default"))) const jsval JSVAL_ZERO;
12929 extern __attribute__((visibility("default"))) const jsval JSVAL_ONE;
12930 extern __attribute__((visibility("default"))) const jsval JSVAL_FALSE;
12931 extern __attribute__((visibility("default"))) const jsval JSVAL_TRUE;
12932 extern __attribute__((visibility("default"))) const jsval JSVAL_VOID;
12933
12934
12935
12936 static __attribute__((always_inline)) inline JSBool
12937 JSVAL_IS_NULL(jsval v)
12938 {
12939 return JSVAL_IS_NULL_IMPL(JSVAL_TO_IMPL(v));
12940 }
12941
12942 static __attribute__((always_inline)) inline JSBool
12943 JSVAL_IS_VOID(jsval v)
12944 {
12945 return JSVAL_IS_UNDEFINED_IMPL(JSVAL_TO_IMPL(v));
12946 }
12947
12948 static __attribute__((always_inline)) inline JSBool
12949 JSVAL_IS_INT(jsval v)
12950 {
12951 return JSVAL_IS_INT32_IMPL(JSVAL_TO_IMPL(v));
12952 }
12953
12954 static __attribute__((always_inline)) inline int32_t
12955 JSVAL_TO_INT(jsval v)
12956 {
12957 do { } while(0);
12958 return JSVAL_TO_INT32_IMPL(JSVAL_TO_IMPL(v));
12959 }
12960
12961 static __attribute__((always_inline)) inline jsval
12962 INT_TO_JSVAL(int32_t i)
12963 {
12964 return IMPL_TO_JSVAL(INT32_TO_JSVAL_IMPL(i));
12965 }
12966
12967 static __attribute__((always_inline)) inline JSBool
12968 JSVAL_IS_DOUBLE(jsval v)
12969 {
12970 return JSVAL_IS_DOUBLE_IMPL(JSVAL_TO_IMPL(v));
12971 }
12972
12973 static __attribute__((always_inline)) inline double
12974 JSVAL_TO_DOUBLE(jsval v)
12975 {
12976 jsval_layout l;
12977 do { } while(0);
12978 l = JSVAL_TO_IMPL(v);
12979 return l.asDouble;
12980 }
12981
12982 static __attribute__((always_inline)) inline jsval
12983 DOUBLE_TO_JSVAL(double d)
12984 {
12985
12986
12987
12988
12989 jsval_layout l;
12990 if ((__builtin_expect((d != d), 0))) {
12991 l.asBits = 0x7FF8000000000000LL;
12992 } else {
12993 l.asDouble = d;
12994 }
12995 return IMPL_TO_JSVAL(l);
12996 }
12997
12998 static __attribute__((always_inline)) inline jsval
12999 UINT_TO_JSVAL(uint32_t i)
13000 {
13001 if (i <= ((int32_t)0x7fffffff))
13002 return INT_TO_JSVAL((int32_t)i);
13003 return DOUBLE_TO_JSVAL((double)i);
13004 }
13005
13006 static __attribute__((always_inline)) inline JSBool
13007 JSVAL_IS_NUMBER(jsval v)
13008 {
13009 return JSVAL_IS_NUMBER_IMPL(JSVAL_TO_IMPL(v));
13010 }
13011
13012 static __attribute__((always_inline)) inline JSBool
13013 JSVAL_IS_STRING(jsval v)
13014 {
13015 return JSVAL_IS_STRING_IMPL(JSVAL_TO_IMPL(v));
13016 }
13017
13018 static __attribute__((always_inline)) inline JSString *
13019 JSVAL_TO_STRING(jsval v)
13020 {
13021 do { } while(0);
13022 return JSVAL_TO_STRING_IMPL(JSVAL_TO_IMPL(v));
13023 }
13024
13025 static __attribute__((always_inline)) inline jsval
13026 STRING_TO_JSVAL(JSString *str)
13027 {
13028 return IMPL_TO_JSVAL(STRING_TO_JSVAL_IMPL(str));
13029 }
13030
13031 static __attribute__((always_inline)) inline JSObject *
13032 JSVAL_TO_OBJECT(jsval v)
13033 {
13034 do { } while(0);
13035 return JSVAL_TO_OBJECT_IMPL(JSVAL_TO_IMPL(v));
13036 }
13037
13038 static __attribute__((always_inline)) inline jsval
13039 OBJECT_TO_JSVAL(JSObject *obj)
13040 {
13041 if (obj)
13042 return IMPL_TO_JSVAL(OBJECT_TO_JSVAL_IMPL(obj));
13043 return JSVAL_NULL;
13044 }
13045
13046 static __attribute__((always_inline)) inline JSBool
13047 JSVAL_IS_BOOLEAN(jsval v)
13048 {
13049 return JSVAL_IS_BOOLEAN_IMPL(JSVAL_TO_IMPL(v));
13050 }
13051
13052 static __attribute__((always_inline)) inline JSBool
13053 JSVAL_TO_BOOLEAN(jsval v)
13054 {
13055 do { } while(0);
13056 return JSVAL_TO_BOOLEAN_IMPL(JSVAL_TO_IMPL(v));
13057 }
13058
13059 static __attribute__((always_inline)) inline jsval
13060 BOOLEAN_TO_JSVAL(JSBool b)
13061 {
13062 return IMPL_TO_JSVAL(BOOLEAN_TO_JSVAL_IMPL(b));
13063 }
13064
13065 static __attribute__((always_inline)) inline JSBool
13066 JSVAL_IS_PRIMITIVE(jsval v)
13067 {
13068 return JSVAL_IS_PRIMITIVE_IMPL(JSVAL_TO_IMPL(v));
13069 }
13070
13071 static __attribute__((always_inline)) inline JSBool
13072 JSVAL_IS_GCTHING(jsval v)
13073 {
13074 return JSVAL_IS_GCTHING_IMPL(JSVAL_TO_IMPL(v));
13075 }
13076
13077 static __attribute__((always_inline)) inline void *
13078 JSVAL_TO_GCTHING(jsval v)
13079 {
13080 do { } while(0);
13081 return JSVAL_TO_GCTHING_IMPL(JSVAL_TO_IMPL(v));
13082 }
13083
13084
13085
13086 static __attribute__((always_inline)) inline jsval
13087 PRIVATE_TO_JSVAL(void *ptr)
13088 {
13089 return IMPL_TO_JSVAL(PRIVATE_PTR_TO_JSVAL_IMPL(ptr));
13090 }
13091
13092 static __attribute__((always_inline)) inline void *
13093 JSVAL_TO_PRIVATE(jsval v)
13094 {
13095 do { } while(0);
13096 return JSVAL_TO_PRIVATE_PTR_IMPL(JSVAL_TO_IMPL(v));
13097 }
13098 # 1955 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
13099 #define JSID_TYPE_STRING 0x0
13100 #define JSID_TYPE_INT 0x1
13101 #define JSID_TYPE_VOID 0x2
13102 #define JSID_TYPE_OBJECT 0x4
13103 #define JSID_TYPE_DEFAULT_XML_NAMESPACE 0x6
13104 #define JSID_TYPE_MASK 0x7
13105
13106
13107
13108
13109
13110 #define id iden
13111
13112 static __attribute__((always_inline)) inline JSBool
13113 JSID_IS_STRING(jsid iden)
13114 {
13115 return ((iden) & 0x7) == 0;
13116 }
13117
13118 static __attribute__((always_inline)) inline JSString *
13119 JSID_TO_STRING(jsid iden)
13120 {
13121 do { } while(0);
13122 return (JSString *)(iden);
13123 }
13124
13125 static __attribute__((always_inline)) inline JSBool
13126 JSID_IS_ZERO(jsid iden)
13127 {
13128 return (iden) == 0;
13129 }
13130
13131 __attribute__((visibility("default"))) JSBool
13132 JS_StringHasBeenInterned(JSContext *cx, JSString *str);
13133 # 1997 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
13134 __attribute__((visibility("default"))) jsid
13135 INTERNED_STRING_TO_JSID(JSContext *cx, JSString *str);
13136
13137 static __attribute__((always_inline)) inline JSBool
13138 JSID_IS_INT(jsid iden)
13139 {
13140 return !!((iden) & 0x1);
13141 }
13142
13143 static __attribute__((always_inline)) inline int32_t
13144 JSID_TO_INT(jsid iden)
13145 {
13146 do { } while(0);
13147 return ((uint32_t)(iden)) >> 1;
13148 }
13149
13150 #define JSID_INT_MIN 0
13151 #define JSID_INT_MAX INT32_MAX
13152
13153 static __attribute__((always_inline)) inline JSBool
13154 INT_FITS_IN_JSID(int32_t i)
13155 {
13156 return i >= 0;
13157 }
13158
13159 static __attribute__((always_inline)) inline jsid
13160 INT_TO_JSID(int32_t i)
13161 {
13162 jsid iden;
13163 do { } while(0);
13164 (iden) = ((i << 1) | 0x1);
13165 return iden;
13166 }
13167
13168 static __attribute__((always_inline)) inline JSBool
13169 JSID_IS_OBJECT(jsid iden)
13170 {
13171 return ((iden) & 0x7) == 0x4 &&
13172 (size_t)(iden) != 0x4;
13173 }
13174
13175 static __attribute__((always_inline)) inline JSObject *
13176 JSID_TO_OBJECT(jsid iden)
13177 {
13178 do { } while(0);
13179 return (JSObject *)((iden) & ~(size_t)0x7);
13180 }
13181
13182 static __attribute__((always_inline)) inline jsid
13183 OBJECT_TO_JSID(JSObject *obj)
13184 {
13185 jsid iden;
13186 do { } while(0);
13187 do { } while(0);
13188 (iden) = ((size_t)obj | 0x4);
13189 return iden;
13190 }
13191
13192 static __attribute__((always_inline)) inline JSBool
13193 JSID_IS_GCTHING(jsid iden)
13194 {
13195 return JSID_IS_STRING(iden) || JSID_IS_OBJECT(iden);
13196 }
13197
13198 static __attribute__((always_inline)) inline void *
13199 JSID_TO_GCTHING(jsid iden)
13200 {
13201 return (void *)((iden) & ~(size_t)0x7);
13202 }
13203
13204
13205
13206
13207
13208
13209 static __attribute__((always_inline)) inline JSBool
13210 JSID_IS_DEFAULT_XML_NAMESPACE(jsid iden)
13211 {
13212 do { } while (0)
13213 ;
13214 return ((size_t)(iden) == 0x6);
13215 }
13216
13217
13218
13219
13220 #define JS_DEFAULT_XML_NAMESPACE_ID ((jsid)JSID_TYPE_DEFAULT_XML_NAMESPACE)
13221 # 2093 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
13222 static __attribute__((always_inline)) inline JSBool
13223 JSID_IS_VOID(jsid iden)
13224 {
13225 do { } while (0)
13226 ;
13227 return ((size_t)(iden) == 0x2);
13228 }
13229
13230 static __attribute__((always_inline)) inline JSBool
13231 JSID_IS_EMPTY(jsid iden)
13232 {
13233 return ((size_t)(iden) == 0x4);
13234 }
13235
13236 #undef id
13237
13238
13239
13240
13241
13242 #define JSID_VOID ((jsid)JSID_TYPE_VOID)
13243 #define JSID_EMPTY ((jsid)JSID_TYPE_OBJECT)
13244
13245
13246
13247
13248
13249
13250 static __attribute__((always_inline)) inline JSBool
13251 JSVAL_IS_UNIVERSAL(jsval v)
13252 {
13253 return !JSVAL_IS_GCTHING(v);
13254 }
13255
13256
13257
13258 namespace JS {
13259
13260 class AutoIdRooter : private AutoGCRooter
13261 {
13262 public:
13263 explicit AutoIdRooter(JSContext *cx, jsid id = INT_TO_JSID(0)
13264 )
13265 : AutoGCRooter(cx, ID), id_(id)
13266 {
13267 do { } while (0);
13268 }
13269
13270 jsid id() {
13271 return id_;
13272 }
13273
13274 jsid * addr() {
13275 return &id_;
13276 }
13277
13278 friend void AutoGCRooter::trace(JSTracer *trc);
13279
13280 private:
13281 jsid id_;
13282
13283 };
13284
13285 }
13286
13287
13288
13289
13290
13291
13292 #define JSVAL_LOCK(cx,v) (JSVAL_IS_GCTHING(v) ? JS_LockGCThing(cx, JSVAL_TO_GCTHING(v)) : JS_TRUE)
13293
13294
13295 #define JSVAL_UNLOCK(cx,v) (JSVAL_IS_GCTHING(v) ? JS_UnlockGCThing(cx, JSVAL_TO_GCTHING(v)) : JS_TRUE)
13296
13297
13298
13299
13300 #define JSPROP_ENUMERATE 0x01
13301 #define JSPROP_READONLY 0x02
13302
13303
13304
13305 #define JSPROP_PERMANENT 0x04
13306 #define JSPROP_GETTER 0x10
13307 #define JSPROP_SETTER 0x20
13308 #define JSPROP_SHARED 0x40
13309
13310
13311
13312
13313 #define JSPROP_INDEX 0x80
13314 #define JSPROP_SHORTID 0x100
13315
13316 #define JSPROP_NATIVE_ACCESSORS 0x08
13317
13318
13319
13320 #define JSFUN_LAMBDA 0x08
13321 #define JSFUN_HEAVYWEIGHT 0x80
13322
13323 #define JSFUN_HEAVYWEIGHT_TEST(f) ((f) & JSFUN_HEAVYWEIGHT)
13324
13325 #define JSFUN_HAS_REST 0x0100
13326 #define JSFUN_CONSTRUCTOR 0x0200
13327
13328 #define JSFUN_HAS_DEFAULTS 0x0400
13329
13330
13331 #define JSFUN_FLAGS_MASK 0x07f8
13332
13333
13334
13335 #define JSFUN_STUB_GSOPS 0x1000
13336 # 2221 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
13337 #define JSFUN_GENERIC_NATIVE JSFUN_LAMBDA
13338 # 2231 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
13339 extern __attribute__((visibility("default"))) JSBool
13340 JS_CallOnce(JSCallOnceType *once, JSInitCallback func);
13341
13342
13343 extern __attribute__((visibility("default"))) int64_t
13344 JS_Now(void);
13345
13346
13347 extern __attribute__((visibility("default"))) jsval
13348 JS_GetNaNValue(JSContext *cx);
13349
13350 extern __attribute__((visibility("default"))) jsval
13351 JS_GetNegativeInfinityValue(JSContext *cx);
13352
13353 extern __attribute__((visibility("default"))) jsval
13354 JS_GetPositiveInfinityValue(JSContext *cx);
13355
13356 extern __attribute__((visibility("default"))) jsval
13357 JS_GetEmptyStringValue(JSContext *cx);
13358
13359 extern __attribute__((visibility("default"))) JSString *
13360 JS_GetEmptyString(JSRuntime *rt);
13361 # 2286 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
13362 extern __attribute__((visibility("default"))) JSBool
13363 JS_ConvertArguments(JSContext *cx, unsigned argc, jsval *argv, const char *format,
13364 ...);
13365 # 2346 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
13366 extern __attribute__((visibility("default"))) JSBool
13367 JS_ConvertValue(JSContext *cx, jsval v, JSType type, jsval *vp);
13368
13369 extern __attribute__((visibility("default"))) JSBool
13370 JS_ValueToObject(JSContext *cx, jsval v, JSObject **objp);
13371
13372 extern __attribute__((visibility("default"))) JSFunction *
13373 JS_ValueToFunction(JSContext *cx, jsval v);
13374
13375 extern __attribute__((visibility("default"))) JSFunction *
13376 JS_ValueToConstructor(JSContext *cx, jsval v);
13377
13378 extern __attribute__((visibility("default"))) JSString *
13379 JS_ValueToString(JSContext *cx, jsval v);
13380
13381 extern __attribute__((visibility("default"))) JSString *
13382 JS_ValueToSource(JSContext *cx, jsval v);
13383
13384 extern __attribute__((visibility("default"))) JSBool
13385 JS_ValueToNumber(JSContext *cx, jsval v, double *dp);
13386
13387
13388 namespace js {
13389
13390
13391
13392 extern __attribute__((visibility("default"))) bool
13393 ToNumberSlow(JSContext *cx, JS::Value v, double *dp);
13394 }
13395
13396 namespace JS {
13397
13398
13399 __attribute__((always_inline)) inline bool
13400 ToNumber(JSContext *cx, const Value &v, double *out)
13401 {
13402 AssertArgumentsAreSane(cx, v);
13403
13404 if (v.isNumber()) {
13405 *out = v.toNumber();
13406 MaybeCheckStackRoots(cx);
13407 return true;
13408 }
13409 return js::ToNumberSlow(cx, v, out);
13410 }
13411
13412 }
13413
13414
13415 extern __attribute__((visibility("default"))) JSBool
13416 JS_DoubleIsInt32(double d, int32_t *ip);
13417
13418 extern __attribute__((visibility("default"))) int32_t
13419 JS_DoubleToInt32(double d);
13420
13421 extern __attribute__((visibility("default"))) uint32_t
13422 JS_DoubleToUint32(double d);
13423
13424
13425
13426
13427
13428 extern __attribute__((visibility("default"))) JSBool
13429 JS_ValueToECMAInt32(JSContext *cx, jsval v, int32_t *ip);
13430
13431
13432 namespace js {
13433
13434
13435
13436 extern __attribute__((visibility("default"))) bool
13437 ToInt32Slow(JSContext *cx, const JS::Value &v, int32_t *out);
13438 }
13439
13440 namespace JS {
13441
13442 __attribute__((always_inline)) inline bool
13443 ToInt32(JSContext *cx, const js::Value &v, int32_t *out)
13444 {
13445 AssertArgumentsAreSane(cx, v);
13446 if (v.isInt32()) {
13447 *out = v.toInt32();
13448 return true;
13449 }
13450 return js::ToInt32Slow(cx, v, out);
13451 }
13452
13453 }
13454
13455
13456
13457
13458
13459
13460 extern __attribute__((visibility("default"))) JSBool
13461 JS_ValueToECMAUint32(JSContext *cx, jsval v, uint32_t *ip);
13462
13463
13464
13465
13466
13467
13468 extern __attribute__((visibility("default"))) JSBool
13469 JS_ValueToInt32(JSContext *cx, jsval v, int32_t *ip);
13470
13471
13472
13473
13474 extern __attribute__((visibility("default"))) JSBool
13475 JS_ValueToUint16(JSContext *cx, jsval v, uint16_t *ip);
13476
13477 extern __attribute__((visibility("default"))) JSBool
13478 JS_ValueToBoolean(JSContext *cx, jsval v, JSBool *bp);
13479
13480 extern __attribute__((visibility("default"))) JSType
13481 JS_TypeOfValue(JSContext *cx, jsval v);
13482
13483 extern __attribute__((visibility("default"))) const char *
13484 JS_GetTypeName(JSContext *cx, JSType type);
13485
13486 extern __attribute__((visibility("default"))) JSBool
13487 JS_StrictlyEqual(JSContext *cx, jsval v1, jsval v2, JSBool *equal);
13488
13489 extern __attribute__((visibility("default"))) JSBool
13490 JS_LooselyEqual(JSContext *cx, jsval v1, jsval v2, JSBool *equal);
13491
13492 extern __attribute__((visibility("default"))) JSBool
13493 JS_SameValue(JSContext *cx, jsval v1, jsval v2, JSBool *same);
13494
13495
13496 extern __attribute__((visibility("default"))) JSBool
13497 JS_IsBuiltinEvalFunction(JSFunction *fun);
13498
13499
13500 extern __attribute__((visibility("default"))) JSBool
13501 JS_IsBuiltinFunctionConstructor(JSFunction *fun);
13502 # 2492 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
13503 #define JS_NewRuntime JS_Init
13504 #define JS_DestroyRuntime JS_Finish
13505 #define JS_LockRuntime JS_Lock
13506 #define JS_UnlockRuntime JS_Unlock
13507
13508 extern __attribute__((visibility("default"))) JSRuntime *
13509 JS_Init(uint32_t maxbytes);
13510
13511
13512 #define JS_CommenceRuntimeShutDown(rt) ((void) 0)
13513
13514 extern __attribute__((visibility("default"))) void
13515 JS_Finish(JSRuntime *rt);
13516
13517 extern __attribute__((visibility("default"))) void
13518 JS_ShutDown(void);
13519
13520 __attribute__((visibility("default"))) void *
13521 JS_GetRuntimePrivate(JSRuntime *rt);
13522
13523 extern __attribute__((visibility("default"))) JSRuntime *
13524 JS_GetRuntime(JSContext *cx);
13525
13526 __attribute__((visibility("default"))) void
13527 JS_SetRuntimePrivate(JSRuntime *rt, void *data);
13528
13529 extern __attribute__((visibility("default"))) void
13530 JS_BeginRequest(JSContext *cx);
13531
13532 extern __attribute__((visibility("default"))) void
13533 JS_EndRequest(JSContext *cx);
13534
13535
13536 extern __attribute__((visibility("default"))) void
13537 JS_YieldRequest(JSContext *cx);
13538
13539 extern __attribute__((visibility("default"))) unsigned
13540 JS_SuspendRequest(JSContext *cx);
13541
13542 extern __attribute__((visibility("default"))) void
13543 JS_ResumeRequest(JSContext *cx, unsigned saveDepth);
13544
13545 extern __attribute__((visibility("default"))) JSBool
13546 JS_IsInRequest(JSRuntime *rt);
13547
13548 extern __attribute__((visibility("default"))) JSBool
13549 JS_IsInSuspendedRequest(JSRuntime *rt);
13550
13551
13552 }
13553
13554 namespace JS {
13555
13556 inline bool
13557 IsPoisonedId(jsid iden)
13558 {
13559 if (JSID_IS_STRING(iden))
13560 return JS::IsPoisonedPtr(JSID_TO_STRING(iden));
13561 if (JSID_IS_OBJECT(iden))
13562 return JS::IsPoisonedPtr(JSID_TO_OBJECT(iden));
13563 return false;
13564 }
13565
13566 template <> struct RootMethods<const jsid>
13567 {
13568 static jsid initial() { return ((jsid)0x2); }
13569 static ThingRootKind kind() { return THING_ROOT_ID; }
13570 static bool poisoned(jsid id) { return IsPoisonedId(id); }
13571 };
13572
13573 template <> struct RootMethods<jsid>
13574 {
13575 static jsid initial() { return ((jsid)0x2); }
13576 static ThingRootKind kind() { return THING_ROOT_ID; }
13577 static bool poisoned(jsid id) { return IsPoisonedId(id); }
13578 };
13579
13580 }
13581
13582 class JSAutoRequest {
13583 public:
13584 JSAutoRequest(JSContext *cx )
13585 : mContext(cx), mSaveDepth(0) {
13586 do { } while (0);
13587 JS_BeginRequest(mContext);
13588 }
13589 ~JSAutoRequest() {
13590 JS_EndRequest(mContext);
13591 }
13592
13593 void suspend() {
13594 mSaveDepth = JS_SuspendRequest(mContext);
13595 }
13596 void resume() {
13597 JS_ResumeRequest(mContext, mSaveDepth);
13598 }
13599
13600 protected:
13601 JSContext *mContext;
13602 unsigned mSaveDepth;
13603
13604
13605
13606
13607
13608
13609
13610 };
13611
13612 class JSAutoSuspendRequest {
13613 public:
13614 JSAutoSuspendRequest(JSContext *cx )
13615 : mContext(cx), mSaveDepth(0) {
13616 do { } while (0);
13617 if (mContext) {
13618 mSaveDepth = JS_SuspendRequest(mContext);
13619 }
13620 }
13621 ~JSAutoSuspendRequest() {
13622 resume();
13623 }
13624
13625 void resume() {
13626 if (mContext) {
13627 JS_ResumeRequest(mContext, mSaveDepth);
13628 mContext = 0;
13629 }
13630 }
13631
13632 protected:
13633 JSContext *mContext;
13634 unsigned mSaveDepth;
13635
13636
13637
13638
13639
13640
13641
13642 };
13643
13644 class JSAutoCheckRequest {
13645 public:
13646 JSAutoCheckRequest(JSContext *cx ) {
13647
13648
13649
13650
13651 do { } while (0);
13652 }
13653
13654 ~JSAutoCheckRequest() {
13655
13656
13657
13658 }
13659
13660
13661 private:
13662
13663
13664
13665
13666 };
13667
13668 extern "C" {
13669
13670
13671 extern __attribute__((visibility("default"))) JSContextCallback
13672 JS_SetContextCallback(JSRuntime *rt, JSContextCallback cxCallback);
13673
13674 extern __attribute__((visibility("default"))) JSContext *
13675 JS_NewContext(JSRuntime *rt, size_t stackChunkSize);
13676
13677 extern __attribute__((visibility("default"))) void
13678 JS_DestroyContext(JSContext *cx);
13679
13680 extern __attribute__((visibility("default"))) void
13681 JS_DestroyContextNoGC(JSContext *cx);
13682
13683 extern __attribute__((visibility("default"))) void *
13684 JS_GetContextPrivate(JSContext *cx);
13685
13686 extern __attribute__((visibility("default"))) void
13687 JS_SetContextPrivate(JSContext *cx, void *data);
13688
13689 extern __attribute__((visibility("default"))) void *
13690 JS_GetSecondContextPrivate(JSContext *cx);
13691
13692 extern __attribute__((visibility("default"))) void
13693 JS_SetSecondContextPrivate(JSContext *cx, void *data);
13694
13695 extern __attribute__((visibility("default"))) JSRuntime *
13696 JS_GetRuntime(JSContext *cx);
13697
13698 extern __attribute__((visibility("default"))) JSContext *
13699 JS_ContextIterator(JSRuntime *rt, JSContext **iterp);
13700
13701 extern __attribute__((visibility("default"))) JSVersion
13702 JS_GetVersion(JSContext *cx);
13703
13704 extern __attribute__((visibility("default"))) JSVersion
13705 JS_SetVersion(JSContext *cx, JSVersion version);
13706
13707 extern __attribute__((visibility("default"))) const char *
13708 JS_VersionToString(JSVersion version);
13709
13710 extern __attribute__((visibility("default"))) JSVersion
13711 JS_StringToVersion(const char *string);
13712 # 2709 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
13713 #define JSOPTION_STRICT JS_BIT(0)
13714 #define JSOPTION_WERROR JS_BIT(1)
13715 #define JSOPTION_VAROBJFIX JS_BIT(2)
13716
13717
13718
13719 #define JSOPTION_PRIVATE_IS_NSISUPPORTS JS_BIT(3)
13720
13721
13722 #define JSOPTION_COMPILE_N_GO JS_BIT(4)
13723
13724
13725
13726
13727 #define JSOPTION_ATLINE JS_BIT(5)
13728
13729
13730
13731 #define JSOPTION_ALLOW_XML JS_BIT(6)
13732
13733
13734
13735 #define JSOPTION_MOAR_XML JS_BIT(7)
13736
13737
13738
13739
13740
13741 #define JSOPTION_DONT_REPORT_UNCAUGHT JS_BIT(8)
13742
13743
13744
13745
13746
13747
13748 #define JSOPTION_RELIMIT JS_BIT(9)
13749 # 2753 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
13750 #define JSOPTION_NO_SCRIPT_RVAL JS_BIT(12)
13751
13752
13753
13754 #define JSOPTION_UNROOTED_GLOBAL JS_BIT(13)
13755
13756
13757
13758
13759
13760 #define JSOPTION_METHODJIT JS_BIT(14)
13761
13762
13763
13764 #define JSOPTION_METHODJIT_ALWAYS JS_BIT(16)
13765
13766
13767 #define JSOPTION_PCCOUNT JS_BIT(17)
13768
13769 #define JSOPTION_TYPE_INFERENCE JS_BIT(18)
13770 #define JSOPTION_STRICT_MODE JS_BIT(19)
13771
13772
13773
13774
13775
13776 #define JSCOMPILEOPTION_MASK (JSOPTION_ALLOW_XML | JSOPTION_MOAR_XML)
13777
13778 #define JSRUNOPTION_MASK (JS_BITMASK(20) & ~JSCOMPILEOPTION_MASK)
13779 #define JSALLOPTION_MASK (JSCOMPILEOPTION_MASK | JSRUNOPTION_MASK)
13780
13781 extern __attribute__((visibility("default"))) uint32_t
13782 JS_GetOptions(JSContext *cx);
13783
13784 extern __attribute__((visibility("default"))) uint32_t
13785 JS_SetOptions(JSContext *cx, uint32_t options);
13786
13787 extern __attribute__((visibility("default"))) uint32_t
13788 JS_ToggleOptions(JSContext *cx, uint32_t options);
13789
13790 extern __attribute__((visibility("default"))) void
13791 JS_SetJitHardening(JSRuntime *rt, JSBool enabled);
13792
13793 extern __attribute__((visibility("default"))) const char *
13794 JS_GetImplementationVersion(void);
13795
13796 extern __attribute__((visibility("default"))) void
13797 JS_SetDestroyCompartmentCallback(JSRuntime *rt, JSDestroyCompartmentCallback callback);
13798
13799 extern __attribute__((visibility("default"))) JSWrapObjectCallback
13800 JS_SetWrapObjectCallbacks(JSRuntime *rt,
13801 JSWrapObjectCallback callback,
13802 JSSameCompartmentWrapObjectCallback sccallback,
13803 JSPreWrapCallback precallback);
13804
13805 extern __attribute__((visibility("default"))) JSCrossCompartmentCall *
13806 JS_EnterCrossCompartmentCall(JSContext *cx, JSObject *target);
13807
13808 extern __attribute__((visibility("default"))) void
13809 JS_LeaveCrossCompartmentCall(JSCrossCompartmentCall *call);
13810
13811 extern __attribute__((visibility("default"))) void
13812 JS_SetCompartmentPrivate(JSCompartment *compartment, void *data);
13813
13814 extern __attribute__((visibility("default"))) void *
13815 JS_GetCompartmentPrivate(JSCompartment *compartment);
13816
13817 extern __attribute__((visibility("default"))) JSBool
13818 JS_WrapObject(JSContext *cx, JSObject **objp);
13819
13820 extern __attribute__((visibility("default"))) JSBool
13821 JS_WrapValue(JSContext *cx, jsval *vp);
13822
13823 extern __attribute__((visibility("default"))) JSObject *
13824 JS_TransplantObject(JSContext *cx, JSObject *origobj, JSObject *target);
13825
13826 extern __attribute__((visibility("default"))) JSObject *
13827 js_TransplantObjectWithWrapper(JSContext *cx,
13828 JSObject *origobj,
13829 JSObject *origwrapper,
13830 JSObject *targetobj,
13831 JSObject *targetwrapper);
13832
13833 extern __attribute__((visibility("default"))) JSBool
13834 JS_RefreshCrossCompartmentWrappers(JSContext *cx, JSObject *ob);
13835
13836
13837 }
13838
13839 namespace js {
13840 class AutoCompartment;
13841 }
13842
13843 class __attribute__((visibility("default"))) JSAutoEnterCompartment
13844 {
13845 # 2856 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
13846 void* bytes[sizeof(void*) == 4 && mozilla::AlignmentFinder<uint64_t>::alignment == 8 ? 16 : 13];
13847
13848 protected:
13849 js::AutoCompartment *getAutoCompartment() {
13850 do { } while(0);
13851 return reinterpret_cast<js::AutoCompartment*>(bytes);
13852 }
13853 # 2872 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
13854 enum State {
13855 STATE_UNENTERED,
13856 STATE_SAME_COMPARTMENT,
13857 STATE_OTHER_COMPARTMENT
13858 } state;
13859
13860 public:
13861 JSAutoEnterCompartment() : state(STATE_UNENTERED) {}
13862
13863 bool enter(JSContext *cx, JSObject *target);
13864
13865 void enterAndIgnoreErrors(JSContext *cx, JSObject *target);
13866
13867 bool entered() const { return state != STATE_UNENTERED; }
13868
13869 ~JSAutoEnterCompartment();
13870 };
13871
13872 extern "C" {
13873
13874
13875 typedef void (*JSIterateCompartmentCallback)(JSRuntime *rt, void *data, JSCompartment *compartment);
13876
13877
13878
13879
13880
13881
13882 extern __attribute__((visibility("default"))) void
13883 JS_IterateCompartments(JSRuntime *rt, void *data,
13884 JSIterateCompartmentCallback compartmentCallback);
13885
13886 extern __attribute__((visibility("default"))) JSObject *
13887 JS_GetGlobalObject(JSContext *cx);
13888
13889 extern __attribute__((visibility("default"))) void
13890 JS_SetGlobalObject(JSContext *cx, JSObject *obj);
13891 # 2917 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
13892 extern __attribute__((visibility("default"))) JSBool
13893 JS_InitStandardClasses(JSContext *cx, JSObject *obj);
13894 # 2933 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
13895 extern __attribute__((visibility("default"))) JSBool
13896 JS_ResolveStandardClass(JSContext *cx, JSObject *obj, jsid id,
13897 JSBool *resolved);
13898
13899 extern __attribute__((visibility("default"))) JSBool
13900 JS_EnumerateStandardClasses(JSContext *cx, JSObject *obj);
13901
13902
13903
13904
13905
13906
13907 extern __attribute__((visibility("default"))) JSIdArray *
13908 JS_EnumerateResolvedStandardClasses(JSContext *cx, JSObject *obj,
13909 JSIdArray *ida);
13910
13911 extern __attribute__((visibility("default"))) JSBool
13912 JS_GetClassObject(JSContext *cx, JSObject *obj, JSProtoKey key,
13913 JSObject **objp);
13914
13915 extern __attribute__((visibility("default"))) JSBool
13916 JS_GetClassPrototype(JSContext *cx, JSProtoKey key, JSObject **objp);
13917
13918 extern __attribute__((visibility("default"))) JSProtoKey
13919 JS_IdentifyClassPrototype(JSContext *cx, JSObject *obj);
13920
13921
13922
13923
13924
13925 extern __attribute__((visibility("default"))) JSObject *
13926 JS_GetFunctionPrototype(JSContext *cx, JSObject *forObj);
13927
13928
13929
13930
13931
13932 extern __attribute__((visibility("default"))) JSObject *
13933 JS_GetObjectPrototype(JSContext *cx, JSObject *forObj);
13934
13935 extern __attribute__((visibility("default"))) JSObject *
13936 JS_GetGlobalForObject(JSContext *cx, JSObject *obj);
13937
13938 extern __attribute__((visibility("default"))) JSObject *
13939 JS_GetGlobalForScopeChain(JSContext *cx);
13940
13941 extern __attribute__((visibility("default"))) JSObject *
13942 JS_GetScriptedGlobal(JSContext *cx);
13943
13944
13945
13946
13947 extern __attribute__((visibility("default"))) JSObject *
13948 JS_InitReflect(JSContext *cx, JSObject *global);
13949
13950
13951
13952
13953
13954
13955 extern __attribute__((visibility("default"))) JSBool
13956 JS_InitCTypesClass(JSContext *cx, JSObject *global);
13957
13958
13959
13960
13961
13962
13963 typedef char *
13964 (* JSCTypesUnicodeToNativeFun)(JSContext *cx, const jschar *source, size_t slen);
13965
13966
13967
13968
13969
13970
13971 struct JSCTypesCallbacks {
13972 JSCTypesUnicodeToNativeFun unicodeToNative;
13973 };
13974
13975 typedef struct JSCTypesCallbacks JSCTypesCallbacks;
13976
13977
13978
13979
13980
13981
13982
13983 extern __attribute__((visibility("default"))) void
13984 JS_SetCTypesCallbacks(JSObject *ctypesObj, JSCTypesCallbacks *callbacks);
13985
13986
13987 typedef JSBool
13988 (* JSEnumerateDiagnosticMemoryCallback)(void *ptr, size_t length);
13989
13990
13991
13992
13993
13994 extern __attribute__((visibility("default"))) void
13995 JS_EnumerateDiagnosticMemoryRegions(JSEnumerateDiagnosticMemoryCallback callback);
13996 # 3063 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
13997 #define JS_CALLEE(cx,vp) ((vp)[0])
13998 #define JS_THIS(cx,vp) JS_ComputeThis(cx, vp)
13999 #define JS_THIS_OBJECT(cx,vp) (JSVAL_TO_OBJECT(JS_THIS(cx,vp)))
14000 #define JS_ARGV(cx,vp) ((vp) + 2)
14001 #define JS_RVAL(cx,vp) (*(vp))
14002 #define JS_SET_RVAL(cx,vp,v) (*(vp) = (v))
14003
14004 extern __attribute__((visibility("default"))) jsval
14005 JS_ComputeThis(JSContext *cx, jsval *vp);
14006
14007
14008 #undef JS_THIS
14009 static inline jsval
14010 JS_THIS(JSContext *cx, jsval *vp)
14011 {
14012 return JSVAL_IS_PRIMITIVE(vp[1]) ? JS_ComputeThis(cx, vp) : vp[1];
14013 }
14014 # 3094 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
14015 #define JS_THIS_VALUE(cx,vp) ((vp)[1])
14016
14017 extern __attribute__((visibility("default"))) void
14018 JS_MallocInCompartment(JSCompartment *comp, size_t nbytes);
14019
14020 extern __attribute__((visibility("default"))) void
14021 JS_FreeInCompartment(JSCompartment *comp, size_t nbytes);
14022
14023 extern __attribute__((visibility("default"))) void *
14024 JS_malloc(JSContext *cx, size_t nbytes);
14025
14026 extern __attribute__((visibility("default"))) void *
14027 JS_realloc(JSContext *cx, void *p, size_t nbytes);
14028
14029
14030
14031
14032
14033 extern __attribute__((visibility("default"))) void
14034 JS_free(JSContext *cx, void *p);
14035
14036
14037
14038
14039
14040 extern __attribute__((visibility("default"))) void
14041 JS_freeop(JSFreeOp *fop, void *p);
14042
14043 extern __attribute__((visibility("default"))) JSFreeOp *
14044 JS_GetDefaultFreeOp(JSRuntime *rt);
14045
14046 extern __attribute__((visibility("default"))) void
14047 JS_updateMallocCounter(JSContext *cx, size_t nbytes);
14048
14049 extern __attribute__((visibility("default"))) char *
14050 JS_strdup(JSContext *cx, const char *s);
14051
14052 extern __attribute__((visibility("default"))) JSBool
14053 JS_NewNumberValue(JSContext *cx, double d, jsval *rval);
14054 # 3159 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
14055 extern __attribute__((visibility("default"))) JSBool
14056 JS_AddValueRoot(JSContext *cx, jsval *vp);
14057
14058 extern __attribute__((visibility("default"))) JSBool
14059 JS_AddStringRoot(JSContext *cx, JSString **rp);
14060
14061 extern __attribute__((visibility("default"))) JSBool
14062 JS_AddObjectRoot(JSContext *cx, JSObject **rp);
14063
14064 extern __attribute__((visibility("default"))) JSBool
14065 JS_AddGCThingRoot(JSContext *cx, void **rp);
14066 # 3180 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
14067 extern __attribute__((visibility("default"))) JSBool
14068 JS_AddNamedValueRoot(JSContext *cx, jsval *vp, const char *name);
14069
14070 extern __attribute__((visibility("default"))) JSBool
14071 JS_AddNamedStringRoot(JSContext *cx, JSString **rp, const char *name);
14072
14073 extern __attribute__((visibility("default"))) JSBool
14074 JS_AddNamedObjectRoot(JSContext *cx, JSObject **rp, const char *name);
14075
14076 extern __attribute__((visibility("default"))) JSBool
14077 JS_AddNamedScriptRoot(JSContext *cx, JSScript **rp, const char *name);
14078
14079 extern __attribute__((visibility("default"))) JSBool
14080 JS_AddNamedGCThingRoot(JSContext *cx, void **rp, const char *name);
14081
14082 extern __attribute__((visibility("default"))) void
14083 JS_RemoveValueRoot(JSContext *cx, jsval *vp);
14084
14085 extern __attribute__((visibility("default"))) void
14086 JS_RemoveStringRoot(JSContext *cx, JSString **rp);
14087
14088 extern __attribute__((visibility("default"))) void
14089 JS_RemoveObjectRoot(JSContext *cx, JSObject **rp);
14090
14091 extern __attribute__((visibility("default"))) void
14092 JS_RemoveScriptRoot(JSContext *cx, JSScript **rp);
14093
14094 extern __attribute__((visibility("default"))) void
14095 JS_RemoveGCThingRoot(JSContext *cx, void **rp);
14096
14097 extern __attribute__((visibility("default"))) void
14098 JS_RemoveValueRootRT(JSRuntime *rt, jsval *vp);
14099
14100 extern __attribute__((visibility("default"))) void
14101 JS_RemoveStringRootRT(JSRuntime *rt, JSString **rp);
14102
14103 extern __attribute__((visibility("default"))) void
14104 JS_RemoveObjectRootRT(JSRuntime *rt, JSObject **rp);
14105
14106 extern __attribute__((visibility("default"))) void
14107 JS_RemoveScriptRootRT(JSRuntime *rt, JSScript **rp);
14108
14109
14110
14111 extern __attribute__((visibility("default"))) JSBool
14112 js_AddRootRT(JSRuntime *rt, jsval *vp, const char *name);
14113
14114 extern __attribute__((visibility("default"))) JSBool
14115 js_AddGCThingRootRT(JSRuntime *rt, void **rp, const char *name);
14116
14117 extern __attribute__((visibility("default"))) void
14118 js_RemoveRoot(JSRuntime *rt, void *rp);
14119
14120
14121
14122
14123
14124 extern __attribute__((noinline)) __attribute__((visibility("default"))) void
14125 JS_AnchorPtr(void *p);
14126
14127
14128
14129
14130
14131 #define JS_TYPED_ROOTING_API
14132
14133
14134 #define JS_EnterLocalRootScope(cx) (JS_TRUE)
14135 #define JS_LeaveLocalRootScope(cx) ((void) 0)
14136 #define JS_LeaveLocalRootScopeWithResult(cx,rval) ((void) 0)
14137 #define JS_ForgetLocalRoot(cx,thing) ((void) 0)
14138
14139 typedef enum JSGCRootType {
14140 JS_GC_ROOT_VALUE_PTR,
14141 JS_GC_ROOT_GCTHING_PTR
14142 } JSGCRootType;
14143 # 3280 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
14144 #define JS_MAP_GCROOT_NEXT 0
14145 #define JS_MAP_GCROOT_STOP 1
14146 #define JS_MAP_GCROOT_REMOVE 2
14147
14148 typedef int
14149 (* JSGCRootMapFun)(void *rp, JSGCRootType type, const char *name, void *data);
14150
14151 extern __attribute__((visibility("default"))) uint32_t
14152 JS_MapGCRoots(JSRuntime *rt, JSGCRootMapFun map, void *data);
14153
14154 extern __attribute__((visibility("default"))) JSBool
14155 JS_LockGCThing(JSContext *cx, void *thing);
14156
14157 extern __attribute__((visibility("default"))) JSBool
14158 JS_LockGCThingRT(JSRuntime *rt, void *thing);
14159
14160 extern __attribute__((visibility("default"))) JSBool
14161 JS_UnlockGCThing(JSContext *cx, void *thing);
14162
14163 extern __attribute__((visibility("default"))) JSBool
14164 JS_UnlockGCThingRT(JSRuntime *rt, void *thing);
14165 # 3309 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
14166 extern __attribute__((visibility("default"))) void
14167 JS_SetExtraGCRootsTracer(JSRuntime *rt, JSTraceDataOp traceOp, void *data);
14168 # 3325 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
14169 static __attribute__((always_inline)) inline JSBool
14170 JSVAL_IS_TRACEABLE(jsval v)
14171 {
14172 return JSVAL_IS_TRACEABLE_IMPL(JSVAL_TO_IMPL(v));
14173 }
14174
14175 static __attribute__((always_inline)) inline void *
14176 JSVAL_TO_TRACEABLE(jsval v)
14177 {
14178 return JSVAL_TO_GCTHING(v);
14179 }
14180
14181 static __attribute__((always_inline)) inline JSGCTraceKind
14182 JSVAL_TRACE_KIND(jsval v)
14183 {
14184 do { } while(0);
14185 return (JSGCTraceKind) JSVAL_TRACE_KIND_IMPL(JSVAL_TO_IMPL(v));
14186 }
14187 # 3360 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
14188 typedef void
14189 (* JSTraceCallback)(JSTracer *trc, void **thingp, JSGCTraceKind kind);
14190
14191 struct JSTracer {
14192 JSRuntime *runtime;
14193 JSTraceCallback callback;
14194 JSTraceNamePrinter debugPrinter;
14195 const void *debugPrintArg;
14196 size_t debugPrintIndex;
14197 JSBool eagerlyTraceWeakMaps;
14198
14199
14200
14201 };
14202
14203
14204
14205
14206
14207
14208
14209 extern __attribute__((visibility("default"))) void
14210 JS_CallTracer(JSTracer *trc, void *thing, JSGCTraceKind kind);
14211 # 3400 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
14212 #define JS_SET_TRACING_DETAILS(trc,printer,arg,index) JS_BEGIN_MACRO (trc)->debugPrinter = (printer); (trc)->debugPrintArg = (arg); (trc)->debugPrintIndex = (index); JS_END_MACRO
14213 # 3417 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
14214 #define JS_SET_TRACING_LOCATION(trc,location) JS_BEGIN_MACRO JS_END_MACRO
14215 # 3427 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
14216 #define JS_SET_TRACING_INDEX(trc,name,index) JS_SET_TRACING_DETAILS(trc, NULL, name, index)
14217
14218
14219
14220
14221
14222 #define JS_SET_TRACING_NAME(trc,name) JS_SET_TRACING_DETAILS(trc, NULL, name, (size_t)-1)
14223
14224
14225
14226
14227
14228
14229 #define JS_CALL_TRACER(trc,thing,kind,name) JS_BEGIN_MACRO JS_SET_TRACING_NAME(trc, name); JS_CallTracer((trc), (thing), (kind)); JS_END_MACRO
14230 # 3450 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
14231 #define JS_CALL_VALUE_TRACER(trc,val,name) JS_BEGIN_MACRO if (JSVAL_IS_TRACEABLE(val)) { JS_CALL_TRACER((trc), JSVAL_TO_GCTHING(val), JSVAL_TRACE_KIND(val), name); } JS_END_MACRO
14232
14233
14234
14235
14236
14237
14238
14239 #define JS_CALL_OBJECT_TRACER(trc,object,name) JS_BEGIN_MACRO JSObject *obj_ = (object); JS_ASSERT(obj_); JS_CALL_TRACER((trc), obj_, JSTRACE_OBJECT, name); JS_END_MACRO
14240
14241
14242
14243
14244
14245
14246 #define JS_CALL_STRING_TRACER(trc,string,name) JS_BEGIN_MACRO JSString *str_ = (string); JS_ASSERT(str_); JS_CALL_TRACER((trc), str_, JSTRACE_STRING, name); JS_END_MACRO
14247 # 3475 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
14248 extern __attribute__((visibility("default"))) void
14249 JS_TracerInit(JSTracer *trc, JSRuntime *rt, JSTraceCallback callback);
14250
14251 extern __attribute__((visibility("default"))) void
14252 JS_TraceChildren(JSTracer *trc, void *thing, JSGCTraceKind kind);
14253
14254 extern __attribute__((visibility("default"))) void
14255 JS_TraceRuntime(JSTracer *trc);
14256 # 3517 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
14257 extern __attribute__((visibility("default"))) void
14258 JS_GC(JSRuntime *rt);
14259
14260 extern __attribute__((visibility("default"))) void
14261 JS_MaybeGC(JSContext *cx);
14262
14263 extern __attribute__((visibility("default"))) void
14264 JS_SetGCCallback(JSRuntime *rt, JSGCCallback cb);
14265
14266 extern __attribute__((visibility("default"))) void
14267 JS_SetFinalizeCallback(JSRuntime *rt, JSFinalizeCallback cb);
14268
14269 extern __attribute__((visibility("default"))) JSBool
14270 JS_IsGCMarkingTracer(JSTracer *trc);
14271
14272 extern __attribute__((visibility("default"))) JSBool
14273 JS_IsAboutToBeFinalized(void *thing);
14274
14275 typedef enum JSGCParamKey {
14276
14277 JSGC_MAX_BYTES = 0,
14278
14279
14280 JSGC_MAX_MALLOC_BYTES = 1,
14281
14282
14283 JSGC_BYTES = 3,
14284
14285
14286 JSGC_NUMBER = 4,
14287
14288
14289 JSGC_MAX_CODE_CACHE_BYTES = 5,
14290
14291
14292 JSGC_MODE = 6,
14293
14294
14295 JSGC_UNUSED_CHUNKS = 7,
14296
14297
14298 JSGC_TOTAL_CHUNKS = 8,
14299
14300
14301 JSGC_SLICE_TIME_BUDGET = 9,
14302
14303
14304 JSGC_MARK_STACK_LIMIT = 10
14305 } JSGCParamKey;
14306
14307 typedef enum JSGCMode {
14308
14309 JSGC_MODE_GLOBAL = 0,
14310
14311
14312 JSGC_MODE_COMPARTMENT = 1,
14313
14314
14315
14316
14317
14318 JSGC_MODE_INCREMENTAL = 2
14319 } JSGCMode;
14320
14321 extern __attribute__((visibility("default"))) void
14322 JS_SetGCParameter(JSRuntime *rt, JSGCParamKey key, uint32_t value);
14323
14324 extern __attribute__((visibility("default"))) uint32_t
14325 JS_GetGCParameter(JSRuntime *rt, JSGCParamKey key);
14326
14327 extern __attribute__((visibility("default"))) void
14328 JS_SetGCParameterForThread(JSContext *cx, JSGCParamKey key, uint32_t value);
14329
14330 extern __attribute__((visibility("default"))) uint32_t
14331 JS_GetGCParameterForThread(JSContext *cx, JSGCParamKey key);
14332
14333
14334
14335
14336
14337 extern __attribute__((visibility("default"))) JSString *
14338 JS_NewExternalString(JSContext *cx, const jschar *chars, size_t length,
14339 const JSStringFinalizer *fin);
14340
14341
14342
14343
14344
14345 extern __attribute__((visibility("default"))) JSBool
14346 JS_IsExternalString(JSString *str);
14347
14348
14349
14350
14351
14352 extern __attribute__((visibility("default"))) const JSStringFinalizer *
14353 JS_GetExternalStringFinalizer(JSString *str);
14354
14355
14356
14357
14358
14359 extern __attribute__((visibility("default"))) void
14360 JS_SetNativeStackQuota(JSRuntime *cx, size_t stackSize);
14361
14362
14363
14364
14365
14366
14367 typedef void (*JSClassInternal)();
14368
14369 struct JSClass {
14370 const char *name;
14371 uint32_t flags;
14372
14373
14374 JSPropertyOp addProperty;
14375 JSPropertyOp delProperty;
14376 JSPropertyOp getProperty;
14377 JSStrictPropertyOp setProperty;
14378 JSEnumerateOp enumerate;
14379 JSResolveOp resolve;
14380 JSConvertOp convert;
14381 JSFinalizeOp finalize;
14382
14383
14384 JSCheckAccessOp checkAccess;
14385 JSNative call;
14386 JSHasInstanceOp hasInstance;
14387 JSNative construct;
14388 JSTraceOp trace;
14389
14390 void *reserved[40];
14391 };
14392
14393 #define JSCLASS_HAS_PRIVATE (1<<0)
14394 #define JSCLASS_NEW_ENUMERATE (1<<1)
14395 #define JSCLASS_NEW_RESOLVE (1<<2)
14396 #define JSCLASS_PRIVATE_IS_NSISUPPORTS (1<<3)
14397 #define JSCLASS_NEW_RESOLVE_GETS_START (1<<4)
14398
14399
14400
14401 #define JSCLASS_IMPLEMENTS_BARRIERS (1<<5)
14402
14403 #define JSCLASS_DOCUMENT_OBSERVER (1<<6)
14404 #define JSCLASS_USERBIT1 (1<<7)
14405
14406
14407
14408
14409
14410
14411 #define JSCLASS_RESERVED_SLOTS_SHIFT 8
14412 #define JSCLASS_RESERVED_SLOTS_WIDTH 8
14413 #define JSCLASS_RESERVED_SLOTS_MASK JS_BITMASK(JSCLASS_RESERVED_SLOTS_WIDTH)
14414 #define JSCLASS_HAS_RESERVED_SLOTS(n) (((n) & JSCLASS_RESERVED_SLOTS_MASK) << JSCLASS_RESERVED_SLOTS_SHIFT)
14415
14416 #define JSCLASS_RESERVED_SLOTS(clasp) (((clasp)->flags >> JSCLASS_RESERVED_SLOTS_SHIFT) & JSCLASS_RESERVED_SLOTS_MASK)
14417
14418
14419
14420 #define JSCLASS_HIGH_FLAGS_SHIFT (JSCLASS_RESERVED_SLOTS_SHIFT + JSCLASS_RESERVED_SLOTS_WIDTH)
14421
14422
14423
14424
14425
14426
14427 #define JSCLASS_FOR_OF_ITERATION (1<<(JSCLASS_HIGH_FLAGS_SHIFT+0))
14428
14429 #define JSCLASS_IS_ANONYMOUS (1<<(JSCLASS_HIGH_FLAGS_SHIFT+1))
14430 #define JSCLASS_IS_GLOBAL (1<<(JSCLASS_HIGH_FLAGS_SHIFT+2))
14431 #define JSCLASS_INTERNAL_FLAG2 (1<<(JSCLASS_HIGH_FLAGS_SHIFT+3))
14432 #define JSCLASS_INTERNAL_FLAG3 (1<<(JSCLASS_HIGH_FLAGS_SHIFT+4))
14433
14434
14435 #define JSCLASS_FREEZE_PROTO (1<<(JSCLASS_HIGH_FLAGS_SHIFT+5))
14436 #define JSCLASS_FREEZE_CTOR (1<<(JSCLASS_HIGH_FLAGS_SHIFT+6))
14437
14438 #define JSCLASS_XPCONNECT_GLOBAL (1<<(JSCLASS_HIGH_FLAGS_SHIFT+7))
14439
14440
14441 #define JSCLASS_USERBIT2 (1<<(JSCLASS_HIGH_FLAGS_SHIFT+8))
14442 #define JSCLASS_USERBIT3 (1<<(JSCLASS_HIGH_FLAGS_SHIFT+9))
14443
14444
14445
14446
14447
14448
14449
14450 #define JSGLOBAL_FLAGS_CLEARED 0x1
14451 # 3723 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
14452 #define JSCLASS_GLOBAL_SLOT_COUNT (JSProto_LIMIT * 3 + 8)
14453 #define JSCLASS_GLOBAL_FLAGS_WITH_SLOTS(n) (JSCLASS_IS_GLOBAL | JSCLASS_HAS_RESERVED_SLOTS(JSCLASS_GLOBAL_SLOT_COUNT + (n)))
14454
14455 #define JSCLASS_GLOBAL_FLAGS JSCLASS_GLOBAL_FLAGS_WITH_SLOTS(0)
14456
14457 #define JSCLASS_HAS_GLOBAL_FLAG_AND_SLOTS(clasp) (((clasp)->flags & JSCLASS_IS_GLOBAL) && JSCLASS_RESERVED_SLOTS(clasp) >= JSCLASS_GLOBAL_SLOT_COUNT)
14458
14459
14460
14461
14462 #define JSCLASS_CACHED_PROTO_SHIFT (JSCLASS_HIGH_FLAGS_SHIFT + 10)
14463 #define JSCLASS_CACHED_PROTO_WIDTH 6
14464 #define JSCLASS_CACHED_PROTO_MASK JS_BITMASK(JSCLASS_CACHED_PROTO_WIDTH)
14465 #define JSCLASS_HAS_CACHED_PROTO(key) (uint32_t(key) << JSCLASS_CACHED_PROTO_SHIFT)
14466 #define JSCLASS_CACHED_PROTO_KEY(clasp) ((JSProtoKey) (((clasp)->flags >> JSCLASS_CACHED_PROTO_SHIFT) & JSCLASS_CACHED_PROTO_MASK))
14467
14468
14469
14470
14471
14472 #define JSCLASS_NO_INTERNAL_MEMBERS {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
14473 #define JSCLASS_NO_OPTIONAL_MEMBERS 0,0,0,0,0,JSCLASS_NO_INTERNAL_MEMBERS
14474
14475 extern __attribute__((visibility("default"))) int
14476 JS_IdArrayLength(JSContext *cx, JSIdArray *ida);
14477
14478 extern __attribute__((visibility("default"))) jsid
14479 JS_IdArrayGet(JSContext *cx, JSIdArray *ida, int index);
14480
14481 extern __attribute__((visibility("default"))) void
14482 JS_DestroyIdArray(JSContext *cx, JSIdArray *ida);
14483
14484
14485
14486 namespace JS {
14487
14488 class AutoIdArray : private AutoGCRooter {
14489 public:
14490 AutoIdArray(JSContext *cx, JSIdArray *ida )
14491 : AutoGCRooter(cx, IDARRAY), context(cx), idArray(ida)
14492 {
14493 do { } while (0);
14494 }
14495 ~AutoIdArray() {
14496 if (idArray)
14497 JS_DestroyIdArray(context, idArray);
14498 }
14499 bool operator!() {
14500 return !idArray;
14501 }
14502 jsid operator[](size_t i) const {
14503 do { } while(0);
14504 do { } while(0);
14505 return JS_IdArrayGet(context, idArray, i);
14506 }
14507 size_t length() const {
14508 return JS_IdArrayLength(context, idArray);
14509 }
14510
14511 friend void AutoGCRooter::trace(JSTracer *trc);
14512
14513 JSIdArray *steal() {
14514 JSIdArray *copy = idArray;
14515 idArray = __null;
14516 return copy;
14517 }
14518
14519 protected:
14520 inline void trace(JSTracer *trc);
14521
14522 private:
14523 JSContext *context;
14524 JSIdArray *idArray;
14525
14526
14527
14528 AutoIdArray(AutoIdArray &ida) ;
14529 void operator=(AutoIdArray &ida) ;
14530 };
14531
14532 }
14533
14534
14535
14536 extern __attribute__((visibility("default"))) JSBool
14537 JS_ValueToId(JSContext *cx, jsval v, jsid *idp);
14538
14539 extern __attribute__((visibility("default"))) JSBool
14540 JS_IdToValue(JSContext *cx, jsid id, jsval *vp);
14541
14542
14543
14544
14545 #define JSRESOLVE_QUALIFIED 0x01
14546 #define JSRESOLVE_ASSIGNING 0x02
14547 #define JSRESOLVE_DETECTING 0x04
14548 #define JSRESOLVE_DECLARING 0x08
14549 #define JSRESOLVE_WITH 0x10
14550
14551
14552
14553
14554
14555
14556
14557 extern __attribute__((visibility("default"))) JSBool
14558 JS_DefaultValue(JSContext *cx, JSObject *obj, JSType hint, jsval *vp);
14559
14560 extern __attribute__((visibility("default"))) JSBool
14561 JS_PropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId id, jsval *vp);
14562
14563 extern __attribute__((visibility("default"))) JSBool
14564 JS_StrictPropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict, jsval *vp);
14565
14566 extern __attribute__((visibility("default"))) JSBool
14567 JS_EnumerateStub(JSContext *cx, JSHandleObject obj);
14568
14569 extern __attribute__((visibility("default"))) JSBool
14570 JS_ResolveStub(JSContext *cx, JSHandleObject obj, JSHandleId id);
14571
14572 extern __attribute__((visibility("default"))) JSBool
14573 JS_ConvertStub(JSContext *cx, JSHandleObject obj, JSType type, jsval *vp);
14574
14575 struct JSConstDoubleSpec {
14576 double dval;
14577 const char *name;
14578 uint8_t flags;
14579 uint8_t spare[3];
14580 };
14581
14582
14583
14584
14585
14586
14587 struct JSPropertySpec {
14588 const char *name;
14589 int8_t tinyid;
14590 uint8_t flags;
14591 JSPropertyOp getter;
14592 JSStrictPropertyOp setter;
14593 };
14594
14595 struct JSFunctionSpec {
14596 const char *name;
14597 JSNative call;
14598 uint16_t nargs;
14599 uint16_t flags;
14600 };
14601
14602
14603
14604
14605
14606 #define JS_FS_END JS_FS(NULL,NULL,0,0)
14607
14608
14609
14610
14611
14612
14613 #define JS_FS(name,call,nargs,flags) {name, call, nargs, flags}
14614
14615 #define JS_FN(name,call,nargs,flags) {name, call, nargs, (flags) | JSFUN_STUB_GSOPS}
14616
14617
14618 extern __attribute__((visibility("default"))) JSObject *
14619 JS_InitClass(JSContext *cx, JSObject *obj, JSObject *parent_proto,
14620 JSClass *clasp, JSNative constructor, unsigned nargs,
14621 JSPropertySpec *ps, JSFunctionSpec *fs,
14622 JSPropertySpec *static_ps, JSFunctionSpec *static_fs);
14623
14624
14625
14626
14627
14628 extern __attribute__((visibility("default"))) JSBool
14629 JS_LinkConstructorAndPrototype(JSContext *cx, JSObject *ctor, JSObject *proto);
14630
14631 extern __attribute__((visibility("default"))) JSClass *
14632 JS_GetClass(JSObject *obj);
14633
14634 extern __attribute__((visibility("default"))) JSBool
14635 JS_InstanceOf(JSContext *cx, JSObject *obj, JSClass *clasp, jsval *argv);
14636
14637 extern __attribute__((visibility("default"))) JSBool
14638 JS_HasInstance(JSContext *cx, JSObject *obj, jsval v, JSBool *bp);
14639
14640 extern __attribute__((visibility("default"))) void *
14641 JS_GetPrivate(JSObject *obj);
14642
14643 extern __attribute__((visibility("default"))) void
14644 JS_SetPrivate(JSObject *obj, void *data);
14645
14646 extern __attribute__((visibility("default"))) void *
14647 JS_GetInstancePrivate(JSContext *cx, JSObject *obj, JSClass *clasp,
14648 jsval *argv);
14649
14650 extern __attribute__((visibility("default"))) JSObject *
14651 JS_GetPrototype(JSObject *obj);
14652
14653 extern __attribute__((visibility("default"))) JSBool
14654 JS_SetPrototype(JSContext *cx, JSObject *obj, JSObject *proto);
14655
14656 extern __attribute__((visibility("default"))) JSObject *
14657 JS_GetParent(JSObject *obj);
14658
14659 extern __attribute__((visibility("default"))) JSBool
14660 JS_SetParent(JSContext *cx, JSObject *obj, JSObject *parent);
14661
14662 extern __attribute__((visibility("default"))) JSObject *
14663 JS_GetConstructor(JSContext *cx, JSObject *proto);
14664
14665
14666
14667
14668
14669
14670 extern __attribute__((visibility("default"))) JSBool
14671 JS_GetObjectId(JSContext *cx, JSObject *obj, jsid *idp);
14672
14673 extern __attribute__((visibility("default"))) JSObject *
14674 JS_NewGlobalObject(JSContext *cx, JSClass *clasp);
14675
14676 extern __attribute__((visibility("default"))) JSObject *
14677 JS_NewCompartmentAndGlobalObject(JSContext *cx, JSClass *clasp, JSPrincipals *principals);
14678
14679 extern __attribute__((visibility("default"))) JSObject *
14680 JS_NewObject(JSContext *cx, JSClass *clasp, JSObject *proto, JSObject *parent);
14681
14682
14683 extern __attribute__((visibility("default"))) JSBool
14684 JS_IsExtensible(JSObject *obj);
14685
14686 extern __attribute__((visibility("default"))) JSBool
14687 JS_IsNative(JSObject *obj);
14688
14689 extern __attribute__((visibility("default"))) JSRuntime *
14690 JS_GetObjectRuntime(JSObject *obj);
14691
14692
14693
14694
14695
14696 extern __attribute__((visibility("default"))) JSObject *
14697 JS_NewObjectWithGivenProto(JSContext *cx, JSClass *clasp, JSObject *proto,
14698 JSObject *parent);
14699
14700
14701
14702
14703
14704
14705 extern __attribute__((visibility("default"))) JSBool
14706 JS_DeepFreezeObject(JSContext *cx, JSObject *obj);
14707
14708
14709
14710
14711 extern __attribute__((visibility("default"))) JSBool
14712 JS_FreezeObject(JSContext *cx, JSObject *obj);
14713
14714 extern __attribute__((visibility("default"))) JSObject *
14715 JS_ConstructObject(JSContext *cx, JSClass *clasp, JSObject *parent);
14716
14717 extern __attribute__((visibility("default"))) JSObject *
14718 JS_ConstructObjectWithArguments(JSContext *cx, JSClass *clasp, JSObject *parent,
14719 unsigned argc, jsval *argv);
14720
14721 extern __attribute__((visibility("default"))) JSObject *
14722 JS_New(JSContext *cx, JSObject *ctor, unsigned argc, jsval *argv);
14723
14724 extern __attribute__((visibility("default"))) JSObject *
14725 JS_DefineObject(JSContext *cx, JSObject *obj, const char *name, JSClass *clasp,
14726 JSObject *proto, unsigned attrs);
14727
14728 extern __attribute__((visibility("default"))) JSBool
14729 JS_DefineConstDoubles(JSContext *cx, JSObject *obj, JSConstDoubleSpec *cds);
14730
14731 extern __attribute__((visibility("default"))) JSBool
14732 JS_DefineProperties(JSContext *cx, JSObject *obj, JSPropertySpec *ps);
14733
14734 extern __attribute__((visibility("default"))) JSBool
14735 JS_DefineProperty(JSContext *cx, JSObject *obj, const char *name, jsval value,
14736 JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs);
14737
14738 extern __attribute__((visibility("default"))) JSBool
14739 JS_DefinePropertyById(JSContext *cx, JSObject *obj, jsid id, jsval value,
14740 JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs);
14741
14742 extern __attribute__((visibility("default"))) JSBool
14743 JS_DefineOwnProperty(JSContext *cx, JSObject *obj, jsid id, jsval descriptor, JSBool *bp);
14744
14745
14746
14747
14748
14749
14750
14751 extern __attribute__((visibility("default"))) JSBool
14752 JS_GetPropertyAttributes(JSContext *cx, JSObject *obj, const char *name,
14753 unsigned *attrsp, JSBool *foundp);
14754
14755
14756
14757
14758
14759
14760 extern __attribute__((visibility("default"))) JSBool
14761 JS_GetPropertyAttrsGetterAndSetter(JSContext *cx, JSObject *obj,
14762 const char *name,
14763 unsigned *attrsp, JSBool *foundp,
14764 JSPropertyOp *getterp,
14765 JSStrictPropertyOp *setterp);
14766
14767 extern __attribute__((visibility("default"))) JSBool
14768 JS_GetPropertyAttrsGetterAndSetterById(JSContext *cx, JSObject *obj,
14769 jsid id,
14770 unsigned *attrsp, JSBool *foundp,
14771 JSPropertyOp *getterp,
14772 JSStrictPropertyOp *setterp);
14773
14774
14775
14776
14777
14778
14779
14780 extern __attribute__((visibility("default"))) JSBool
14781 JS_SetPropertyAttributes(JSContext *cx, JSObject *obj, const char *name,
14782 unsigned attrs, JSBool *foundp);
14783
14784 extern __attribute__((visibility("default"))) JSBool
14785 JS_DefinePropertyWithTinyId(JSContext *cx, JSObject *obj, const char *name,
14786 int8_t tinyid, jsval value,
14787 JSPropertyOp getter, JSStrictPropertyOp setter,
14788 unsigned attrs);
14789
14790 extern __attribute__((visibility("default"))) JSBool
14791 JS_AlreadyHasOwnProperty(JSContext *cx, JSObject *obj, const char *name,
14792 JSBool *foundp);
14793
14794 extern __attribute__((visibility("default"))) JSBool
14795 JS_AlreadyHasOwnPropertyById(JSContext *cx, JSObject *obj, jsid id,
14796 JSBool *foundp);
14797
14798 extern __attribute__((visibility("default"))) JSBool
14799 JS_HasProperty(JSContext *cx, JSObject *obj, const char *name, JSBool *foundp);
14800
14801 extern __attribute__((visibility("default"))) JSBool
14802 JS_HasPropertyById(JSContext *cx, JSObject *obj, jsid id, JSBool *foundp);
14803
14804 extern __attribute__((visibility("default"))) JSBool
14805 JS_LookupProperty(JSContext *cx, JSObject *obj, const char *name, jsval *vp);
14806
14807 extern __attribute__((visibility("default"))) JSBool
14808 JS_LookupPropertyById(JSContext *cx, JSObject *obj, jsid id, jsval *vp);
14809
14810 extern __attribute__((visibility("default"))) JSBool
14811 JS_LookupPropertyWithFlags(JSContext *cx, JSObject *obj, const char *name,
14812 unsigned flags, jsval *vp);
14813
14814 extern __attribute__((visibility("default"))) JSBool
14815 JS_LookupPropertyWithFlagsById(JSContext *cx, JSObject *obj, jsid id,
14816 unsigned flags, JSObject **objp, jsval *vp);
14817
14818 struct JSPropertyDescriptor {
14819 JSObject *obj;
14820 unsigned attrs;
14821 unsigned shortid;
14822 JSPropertyOp getter;
14823 JSStrictPropertyOp setter;
14824 jsval value;
14825 };
14826
14827
14828
14829
14830
14831
14832 extern __attribute__((visibility("default"))) JSBool
14833 JS_GetPropertyDescriptorById(JSContext *cx, JSObject *obj, jsid id, unsigned flags,
14834 JSPropertyDescriptor *desc);
14835
14836 extern __attribute__((visibility("default"))) JSBool
14837 JS_GetOwnPropertyDescriptor(JSContext *cx, JSObject *obj, jsid id, jsval *vp);
14838
14839 extern __attribute__((visibility("default"))) JSBool
14840 JS_GetProperty(JSContext *cx, JSObject *obj, const char *name, jsval *vp);
14841
14842 extern __attribute__((visibility("default"))) JSBool
14843 JS_GetPropertyDefault(JSContext *cx, JSObject *obj, const char *name, jsval def, jsval *vp);
14844
14845 extern __attribute__((visibility("default"))) JSBool
14846 JS_GetPropertyById(JSContext *cx, JSObject *obj, jsid id, jsval *vp);
14847
14848 extern __attribute__((visibility("default"))) JSBool
14849 JS_GetPropertyByIdDefault(JSContext *cx, JSObject *obj, jsid id, jsval def, jsval *vp);
14850
14851 extern __attribute__((visibility("default"))) JSBool
14852 JS_ForwardGetPropertyTo(JSContext *cx, JSObject *obj, jsid id, JSObject *onBehalfOf, jsval *vp);
14853
14854 extern __attribute__((visibility("default"))) JSBool
14855 JS_GetMethodById(JSContext *cx, JSObject *obj, jsid id, JSObject **objp,
14856 jsval *vp);
14857
14858 extern __attribute__((visibility("default"))) JSBool
14859 JS_GetMethod(JSContext *cx, JSObject *obj, const char *name, JSObject **objp,
14860 jsval *vp);
14861
14862 extern __attribute__((visibility("default"))) JSBool
14863 JS_SetProperty(JSContext *cx, JSObject *obj, const char *name, jsval *vp);
14864
14865 extern __attribute__((visibility("default"))) JSBool
14866 JS_SetPropertyById(JSContext *cx, JSObject *obj, jsid id, jsval *vp);
14867
14868 extern __attribute__((visibility("default"))) JSBool
14869 JS_DeleteProperty(JSContext *cx, JSObject *obj, const char *name);
14870
14871 extern __attribute__((visibility("default"))) JSBool
14872 JS_DeleteProperty2(JSContext *cx, JSObject *obj, const char *name,
14873 jsval *rval);
14874
14875 extern __attribute__((visibility("default"))) JSBool
14876 JS_DeletePropertyById(JSContext *cx, JSObject *obj, jsid id);
14877
14878 extern __attribute__((visibility("default"))) JSBool
14879 JS_DeletePropertyById2(JSContext *cx, JSObject *obj, jsid id, jsval *rval);
14880
14881 extern __attribute__((visibility("default"))) JSBool
14882 JS_DefineUCProperty(JSContext *cx, JSObject *obj,
14883 const jschar *name, size_t namelen, jsval value,
14884 JSPropertyOp getter, JSStrictPropertyOp setter,
14885 unsigned attrs);
14886
14887
14888
14889
14890
14891
14892
14893 extern __attribute__((visibility("default"))) JSBool
14894 JS_GetUCPropertyAttributes(JSContext *cx, JSObject *obj,
14895 const jschar *name, size_t namelen,
14896 unsigned *attrsp, JSBool *foundp);
14897
14898
14899
14900
14901
14902
14903 extern __attribute__((visibility("default"))) JSBool
14904 JS_GetUCPropertyAttrsGetterAndSetter(JSContext *cx, JSObject *obj,
14905 const jschar *name, size_t namelen,
14906 unsigned *attrsp, JSBool *foundp,
14907 JSPropertyOp *getterp,
14908 JSStrictPropertyOp *setterp);
14909
14910
14911
14912
14913
14914
14915
14916 extern __attribute__((visibility("default"))) JSBool
14917 JS_SetUCPropertyAttributes(JSContext *cx, JSObject *obj,
14918 const jschar *name, size_t namelen,
14919 unsigned attrs, JSBool *foundp);
14920
14921
14922 extern __attribute__((visibility("default"))) JSBool
14923 JS_DefineUCPropertyWithTinyId(JSContext *cx, JSObject *obj,
14924 const jschar *name, size_t namelen,
14925 int8_t tinyid, jsval value,
14926 JSPropertyOp getter, JSStrictPropertyOp setter,
14927 unsigned attrs);
14928
14929 extern __attribute__((visibility("default"))) JSBool
14930 JS_AlreadyHasOwnUCProperty(JSContext *cx, JSObject *obj, const jschar *name,
14931 size_t namelen, JSBool *foundp);
14932
14933 extern __attribute__((visibility("default"))) JSBool
14934 JS_HasUCProperty(JSContext *cx, JSObject *obj,
14935 const jschar *name, size_t namelen,
14936 JSBool *vp);
14937
14938 extern __attribute__((visibility("default"))) JSBool
14939 JS_LookupUCProperty(JSContext *cx, JSObject *obj,
14940 const jschar *name, size_t namelen,
14941 jsval *vp);
14942
14943 extern __attribute__((visibility("default"))) JSBool
14944 JS_GetUCProperty(JSContext *cx, JSObject *obj,
14945 const jschar *name, size_t namelen,
14946 jsval *vp);
14947
14948 extern __attribute__((visibility("default"))) JSBool
14949 JS_SetUCProperty(JSContext *cx, JSObject *obj,
14950 const jschar *name, size_t namelen,
14951 jsval *vp);
14952
14953 extern __attribute__((visibility("default"))) JSBool
14954 JS_DeleteUCProperty2(JSContext *cx, JSObject *obj,
14955 const jschar *name, size_t namelen,
14956 jsval *rval);
14957
14958 extern __attribute__((visibility("default"))) JSObject *
14959 JS_NewArrayObject(JSContext *cx, int length, jsval *vector);
14960
14961 extern __attribute__((visibility("default"))) JSBool
14962 JS_IsArrayObject(JSContext *cx, JSObject *obj);
14963
14964 extern __attribute__((visibility("default"))) JSBool
14965 JS_GetArrayLength(JSContext *cx, JSObject *obj, uint32_t *lengthp);
14966
14967 extern __attribute__((visibility("default"))) JSBool
14968 JS_SetArrayLength(JSContext *cx, JSObject *obj, uint32_t length);
14969
14970 extern __attribute__((visibility("default"))) JSBool
14971 JS_DefineElement(JSContext *cx, JSObject *obj, uint32_t index, jsval value,
14972 JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs);
14973
14974 extern __attribute__((visibility("default"))) JSBool
14975 JS_AlreadyHasOwnElement(JSContext *cx, JSObject *obj, uint32_t index, JSBool *foundp);
14976
14977 extern __attribute__((visibility("default"))) JSBool
14978 JS_HasElement(JSContext *cx, JSObject *obj, uint32_t index, JSBool *foundp);
14979
14980 extern __attribute__((visibility("default"))) JSBool
14981 JS_LookupElement(JSContext *cx, JSObject *obj, uint32_t index, jsval *vp);
14982
14983 extern __attribute__((visibility("default"))) JSBool
14984 JS_GetElement(JSContext *cx, JSObject *obj, uint32_t index, jsval *vp);
14985
14986 extern __attribute__((visibility("default"))) JSBool
14987 JS_ForwardGetElementTo(JSContext *cx, JSObject *obj, uint32_t index, JSObject *onBehalfOf,
14988 jsval *vp);
14989
14990
14991
14992
14993
14994
14995 extern __attribute__((visibility("default"))) JSBool
14996 JS_GetElementIfPresent(JSContext *cx, JSObject *obj, uint32_t index, JSObject *onBehalfOf,
14997 jsval *vp, JSBool* present);
14998
14999 extern __attribute__((visibility("default"))) JSBool
15000 JS_SetElement(JSContext *cx, JSObject *obj, uint32_t index, jsval *vp);
15001
15002 extern __attribute__((visibility("default"))) JSBool
15003 JS_DeleteElement(JSContext *cx, JSObject *obj, uint32_t index);
15004
15005 extern __attribute__((visibility("default"))) JSBool
15006 JS_DeleteElement2(JSContext *cx, JSObject *obj, uint32_t index, jsval *rval);
15007
15008 extern __attribute__((visibility("default"))) void
15009 JS_ClearScope(JSContext *cx, JSObject *obj);
15010
15011 extern __attribute__((visibility("default"))) JSIdArray *
15012 JS_Enumerate(JSContext *cx, JSObject *obj);
15013
15014
15015
15016
15017
15018
15019 extern __attribute__((visibility("default"))) JSObject *
15020 JS_NewPropertyIterator(JSContext *cx, JSObject *obj);
15021
15022
15023
15024
15025
15026
15027 extern __attribute__((visibility("default"))) JSBool
15028 JS_NextProperty(JSContext *cx, JSObject *iterobj, jsid *idp);
15029
15030
15031
15032
15033
15034 extern __attribute__((visibility("default"))) JSObject *
15035 JS_NewElementIterator(JSContext *cx, JSObject *obj);
15036
15037
15038
15039
15040
15041
15042 extern __attribute__((visibility("default"))) JSObject *
15043 JS_ElementIteratorStub(JSContext *cx, JSHandleObject obj, JSBool keysonly);
15044
15045 extern __attribute__((visibility("default"))) JSBool
15046 JS_CheckAccess(JSContext *cx, JSObject *obj, jsid id, JSAccessMode mode,
15047 jsval *vp, unsigned *attrsp);
15048
15049 extern __attribute__((visibility("default"))) jsval
15050 JS_GetReservedSlot(JSObject *obj, uint32_t index);
15051
15052 extern __attribute__((visibility("default"))) void
15053 JS_SetReservedSlot(JSObject *obj, uint32_t index, jsval v);
15054
15055
15056
15057
15058
15059
15060 struct JSPrincipals {
15061
15062 int refcount;
15063
15064
15065
15066
15067
15068
15069
15070 void setDebugToken(uint32_t token) {
15071
15072
15073
15074 }
15075
15076
15077
15078
15079
15080 __attribute__((visibility("default"))) void dump();
15081
15082 };
15083
15084 extern __attribute__((visibility("default"))) void
15085 JS_HoldPrincipals(JSPrincipals *principals);
15086
15087 extern __attribute__((visibility("default"))) void
15088 JS_DropPrincipals(JSRuntime *rt, JSPrincipals *principals);
15089
15090 struct JSSecurityCallbacks {
15091 JSCheckAccessOp checkObjectAccess;
15092 JSSubsumePrincipalsOp subsumePrincipals;
15093 JSObjectPrincipalsFinder findObjectPrincipals;
15094 JSCSPEvalChecker contentSecurityPolicyAllows;
15095 JSPushContextPrincipalOp pushContextPrincipal;
15096 JSPopContextPrincipalOp popContextPrincipal;
15097 };
15098
15099 extern __attribute__((visibility("default"))) void
15100 JS_SetSecurityCallbacks(JSRuntime *rt, const JSSecurityCallbacks *callbacks);
15101
15102 extern __attribute__((visibility("default"))) const JSSecurityCallbacks *
15103 JS_GetSecurityCallbacks(JSRuntime *rt);
15104 # 4388 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
15105 extern __attribute__((visibility("default"))) void
15106 JS_SetTrustedPrincipals(JSRuntime *rt, JSPrincipals *prin);
15107
15108
15109
15110
15111
15112
15113 extern __attribute__((visibility("default"))) void
15114 JS_InitDestroyPrincipalsCallback(JSRuntime *rt, JSDestroyPrincipalsOp destroyPrincipals);
15115
15116
15117
15118
15119
15120
15121 extern __attribute__((visibility("default"))) JSFunction *
15122 JS_NewFunction(JSContext *cx, JSNative call, unsigned nargs, unsigned flags,
15123 JSObject *parent, const char *name);
15124
15125
15126
15127
15128
15129 extern __attribute__((visibility("default"))) JSFunction *
15130 JS_NewFunctionById(JSContext *cx, JSNative call, unsigned nargs, unsigned flags,
15131 JSObject *parent, jsid id);
15132
15133 extern __attribute__((visibility("default"))) JSObject *
15134 JS_GetFunctionObject(JSFunction *fun);
15135
15136
15137
15138
15139
15140
15141
15142 extern __attribute__((visibility("default"))) JSString *
15143 JS_GetFunctionId(JSFunction *fun);
15144
15145
15146
15147
15148 extern __attribute__((visibility("default"))) unsigned
15149 JS_GetFunctionFlags(JSFunction *fun);
15150
15151
15152
15153
15154 extern __attribute__((visibility("default"))) uint16_t
15155 JS_GetFunctionArity(JSFunction *fun);
15156
15157
15158
15159
15160
15161
15162
15163 extern __attribute__((visibility("default"))) JSBool
15164 JS_ObjectIsFunction(JSContext *cx, JSObject *obj);
15165
15166 extern __attribute__((visibility("default"))) JSBool
15167 JS_ObjectIsCallable(JSContext *cx, JSObject *obj);
15168
15169 extern __attribute__((visibility("default"))) JSBool
15170 JS_IsNativeFunction(JSObject *funobj, JSNative call);
15171
15172
15173
15174
15175
15176
15177 extern __attribute__((visibility("default"))) JSObject*
15178 JS_BindCallable(JSContext *cx, JSObject *callable, JSObject *newThis);
15179
15180 extern __attribute__((visibility("default"))) JSBool
15181 JS_DefineFunctions(JSContext *cx, JSObject *obj, JSFunctionSpec *fs);
15182
15183 extern __attribute__((visibility("default"))) JSFunction *
15184 JS_DefineFunction(JSContext *cx, JSObject *obj, const char *name, JSNative call,
15185 unsigned nargs, unsigned attrs);
15186
15187 extern __attribute__((visibility("default"))) JSFunction *
15188 JS_DefineUCFunction(JSContext *cx, JSObject *obj,
15189 const jschar *name, size_t namelen, JSNative call,
15190 unsigned nargs, unsigned attrs);
15191
15192 extern __attribute__((visibility("default"))) JSFunction *
15193 JS_DefineFunctionById(JSContext *cx, JSObject *obj, jsid id, JSNative call,
15194 unsigned nargs, unsigned attrs);
15195
15196 extern __attribute__((visibility("default"))) JSObject *
15197 JS_CloneFunctionObject(JSContext *cx, JSObject *funobj, JSObject *parent);
15198 # 4489 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
15199 extern __attribute__((visibility("default"))) JSBool
15200 JS_BufferIsCompilableUnit(JSContext *cx, JSBool bytes_are_utf8,
15201 JSObject *obj, const char *bytes, size_t length);
15202
15203 extern __attribute__((visibility("default"))) JSScript *
15204 JS_CompileScript(JSContext *cx, JSObject *obj,
15205 const char *bytes, size_t length,
15206 const char *filename, unsigned lineno);
15207
15208 extern __attribute__((visibility("default"))) JSScript *
15209 JS_CompileScriptForPrincipals(JSContext *cx, JSObject *obj,
15210 JSPrincipals *principals,
15211 const char *bytes, size_t length,
15212 const char *filename, unsigned lineno);
15213
15214 extern __attribute__((visibility("default"))) JSScript *
15215 JS_CompileScriptForPrincipalsVersion(JSContext *cx, JSObject *obj,
15216 JSPrincipals *principals,
15217 const char *bytes, size_t length,
15218 const char *filename, unsigned lineno,
15219 JSVersion version);
15220
15221 extern __attribute__((visibility("default"))) JSScript *
15222 JS_CompileUCScript(JSContext *cx, JSObject *obj,
15223 const jschar *chars, size_t length,
15224 const char *filename, unsigned lineno);
15225
15226 extern __attribute__((visibility("default"))) JSScript *
15227 JS_CompileUCScriptForPrincipals(JSContext *cx, JSObject *obj,
15228 JSPrincipals *principals,
15229 const jschar *chars, size_t length,
15230 const char *filename, unsigned lineno);
15231
15232 extern __attribute__((visibility("default"))) JSScript *
15233 JS_CompileUCScriptForPrincipalsVersion(JSContext *cx, JSObject *obj,
15234 JSPrincipals *principals,
15235 const jschar *chars, size_t length,
15236 const char *filename, unsigned lineno,
15237 JSVersion version);
15238
15239
15240
15241
15242 extern __attribute__((visibility("default"))) JSScript *
15243 JS_CompileUCScriptForPrincipalsVersionOrigin(JSContext *cx, JSObject *obj,
15244 JSPrincipals *principals,
15245 JSPrincipals *originPrincipals,
15246 const jschar *chars, size_t length,
15247 const char *filename, unsigned lineno,
15248 JSVersion version);
15249
15250 extern __attribute__((visibility("default"))) JSScript *
15251 JS_CompileUTF8File(JSContext *cx, JSObject *obj, const char *filename);
15252
15253 extern __attribute__((visibility("default"))) JSScript *
15254 JS_CompileUTF8FileHandle(JSContext *cx, JSObject *obj, const char *filename,
15255 FILE *fh);
15256
15257 extern __attribute__((visibility("default"))) JSScript *
15258 JS_CompileUTF8FileHandleForPrincipals(JSContext *cx, JSObject *obj,
15259 const char *filename, FILE *fh,
15260 JSPrincipals *principals);
15261
15262 extern __attribute__((visibility("default"))) JSScript *
15263 JS_CompileUTF8FileHandleForPrincipalsVersion(JSContext *cx, JSObject *obj,
15264 const char *filename, FILE *fh,
15265 JSPrincipals *principals,
15266 JSVersion version);
15267
15268 extern __attribute__((visibility("default"))) JSObject *
15269 JS_GetGlobalFromScript(JSScript *script);
15270
15271 extern __attribute__((visibility("default"))) JSFunction *
15272 JS_CompileFunction(JSContext *cx, JSObject *obj, const char *name,
15273 unsigned nargs, const char **argnames,
15274 const char *bytes, size_t length,
15275 const char *filename, unsigned lineno);
15276
15277 extern __attribute__((visibility("default"))) JSFunction *
15278 JS_CompileFunctionForPrincipals(JSContext *cx, JSObject *obj,
15279 JSPrincipals *principals, const char *name,
15280 unsigned nargs, const char **argnames,
15281 const char *bytes, size_t length,
15282 const char *filename, unsigned lineno);
15283
15284 extern __attribute__((visibility("default"))) JSFunction *
15285 JS_CompileUCFunction(JSContext *cx, JSObject *obj, const char *name,
15286 unsigned nargs, const char **argnames,
15287 const jschar *chars, size_t length,
15288 const char *filename, unsigned lineno);
15289
15290 extern __attribute__((visibility("default"))) JSFunction *
15291 JS_CompileUCFunctionForPrincipals(JSContext *cx, JSObject *obj,
15292 JSPrincipals *principals, const char *name,
15293 unsigned nargs, const char **argnames,
15294 const jschar *chars, size_t length,
15295 const char *filename, unsigned lineno);
15296
15297 extern __attribute__((visibility("default"))) JSFunction *
15298 JS_CompileUCFunctionForPrincipalsVersion(JSContext *cx, JSObject *obj,
15299 JSPrincipals *principals, const char *name,
15300 unsigned nargs, const char **argnames,
15301 const jschar *chars, size_t length,
15302 const char *filename, unsigned lineno,
15303 JSVersion version);
15304
15305 extern __attribute__((visibility("default"))) JSString *
15306 JS_DecompileScript(JSContext *cx, JSScript *script, const char *name, unsigned indent);
15307
15308
15309
15310
15311
15312 #define JS_DONT_PRETTY_PRINT ((unsigned)0x8000)
15313
15314 extern __attribute__((visibility("default"))) JSString *
15315 JS_DecompileFunction(JSContext *cx, JSFunction *fun, unsigned indent);
15316
15317 extern __attribute__((visibility("default"))) JSString *
15318 JS_DecompileFunctionBody(JSContext *cx, JSFunction *fun, unsigned indent);
15319 # 4645 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
15320 extern __attribute__((visibility("default"))) JSBool
15321 JS_ExecuteScript(JSContext *cx, JSObject *obj, JSScript *script, jsval *rval);
15322
15323 extern __attribute__((visibility("default"))) JSBool
15324 JS_ExecuteScriptVersion(JSContext *cx, JSObject *obj, JSScript *script, jsval *rval,
15325 JSVersion version);
15326
15327
15328
15329
15330
15331 typedef enum JSExecPart { JSEXEC_PROLOG, JSEXEC_MAIN } JSExecPart;
15332
15333 extern __attribute__((visibility("default"))) JSBool
15334 JS_EvaluateScript(JSContext *cx, JSObject *obj,
15335 const char *bytes, unsigned length,
15336 const char *filename, unsigned lineno,
15337 jsval *rval);
15338
15339 extern __attribute__((visibility("default"))) JSBool
15340 JS_EvaluateScriptForPrincipals(JSContext *cx, JSObject *obj,
15341 JSPrincipals *principals,
15342 const char *bytes, unsigned length,
15343 const char *filename, unsigned lineno,
15344 jsval *rval);
15345
15346 extern __attribute__((visibility("default"))) JSBool
15347 JS_EvaluateScriptForPrincipalsVersion(JSContext *cx, JSObject *obj,
15348 JSPrincipals *principals,
15349 const char *bytes, unsigned length,
15350 const char *filename, unsigned lineno,
15351 jsval *rval, JSVersion version);
15352
15353 extern __attribute__((visibility("default"))) JSBool
15354 JS_EvaluateUCScript(JSContext *cx, JSObject *obj,
15355 const jschar *chars, unsigned length,
15356 const char *filename, unsigned lineno,
15357 jsval *rval);
15358
15359 extern __attribute__((visibility("default"))) JSBool
15360 JS_EvaluateUCScriptForPrincipals(JSContext *cx, JSObject *obj,
15361 JSPrincipals *principals,
15362 const jschar *chars, unsigned length,
15363 const char *filename, unsigned lineno,
15364 jsval *rval);
15365
15366 extern __attribute__((visibility("default"))) JSBool
15367 JS_EvaluateUCScriptForPrincipalsVersion(JSContext *cx, JSObject *obj,
15368 JSPrincipals *principals,
15369 const jschar *chars, unsigned length,
15370 const char *filename, unsigned lineno,
15371 jsval *rval, JSVersion version);
15372 # 4706 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
15373 extern __attribute__((visibility("default"))) JSBool
15374 JS_EvaluateUCScriptForPrincipalsVersionOrigin(JSContext *cx, JSObject *obj,
15375 JSPrincipals *principals,
15376 JSPrincipals *originPrincipals,
15377 const jschar *chars, unsigned length,
15378 const char *filename, unsigned lineno,
15379 jsval *rval, JSVersion version);
15380
15381 extern __attribute__((visibility("default"))) JSBool
15382 JS_CallFunction(JSContext *cx, JSObject *obj, JSFunction *fun, unsigned argc,
15383 jsval *argv, jsval *rval);
15384
15385 extern __attribute__((visibility("default"))) JSBool
15386 JS_CallFunctionName(JSContext *cx, JSObject *obj, const char *name, unsigned argc,
15387 jsval *argv, jsval *rval);
15388
15389 extern __attribute__((visibility("default"))) JSBool
15390 JS_CallFunctionValue(JSContext *cx, JSObject *obj, jsval fval, unsigned argc,
15391 jsval *argv, jsval *rval);
15392
15393
15394 }
15395
15396 namespace JS {
15397
15398 static inline bool
15399 Call(JSContext *cx, JSObject *thisObj, JSFunction *fun, unsigned argc, jsval *argv, jsval *rval) {
15400 return !!JS_CallFunction(cx, thisObj, fun, argc, argv, rval);
15401 }
15402
15403 static inline bool
15404 Call(JSContext *cx, JSObject *thisObj, const char *name, unsigned argc, jsval *argv, jsval *rval) {
15405 return !!JS_CallFunctionName(cx, thisObj, name, argc, argv, rval);
15406 }
15407
15408 static inline bool
15409 Call(JSContext *cx, JSObject *thisObj, jsval fun, unsigned argc, jsval *argv, jsval *rval) {
15410 return !!JS_CallFunctionValue(cx, thisObj, fun, argc, argv, rval);
15411 }
15412
15413 extern __attribute__((visibility("default"))) bool
15414 Call(JSContext *cx, jsval thisv, jsval fun, unsigned argc, jsval *argv, jsval *rval);
15415
15416 static inline bool
15417 Call(JSContext *cx, jsval thisv, JSObject *funObj, unsigned argc, jsval *argv, jsval *rval) {
15418 return Call(cx, thisv, OBJECT_TO_JSVAL(funObj), argc, argv, rval);
15419 }
15420
15421 }
15422
15423 extern "C" {
15424 # 4772 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
15425 extern __attribute__((visibility("default"))) JSOperationCallback
15426 JS_SetOperationCallback(JSContext *cx, JSOperationCallback callback);
15427
15428 extern __attribute__((visibility("default"))) JSOperationCallback
15429 JS_GetOperationCallback(JSContext *cx);
15430
15431 extern __attribute__((visibility("default"))) void
15432 JS_TriggerOperationCallback(JSRuntime *rt);
15433
15434 extern __attribute__((visibility("default"))) JSBool
15435 JS_IsRunning(JSContext *cx);
15436 # 4795 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
15437 extern __attribute__((visibility("default"))) JSBool
15438 JS_SaveFrameChain(JSContext *cx);
15439
15440 extern __attribute__((visibility("default"))) void
15441 JS_RestoreFrameChain(JSContext *cx);
15442 # 4829 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
15443 extern __attribute__((visibility("default"))) JSString *
15444 JS_NewStringCopyN(JSContext *cx, const char *s, size_t n);
15445
15446 extern __attribute__((visibility("default"))) JSString *
15447 JS_NewStringCopyZ(JSContext *cx, const char *s);
15448
15449 extern __attribute__((visibility("default"))) JSString *
15450 JS_InternJSString(JSContext *cx, JSString *str);
15451
15452 extern __attribute__((visibility("default"))) JSString *
15453 JS_InternString(JSContext *cx, const char *s);
15454
15455 extern __attribute__((visibility("default"))) JSString *
15456 JS_NewUCString(JSContext *cx, jschar *chars, size_t length);
15457
15458 extern __attribute__((visibility("default"))) JSString *
15459 JS_NewUCStringCopyN(JSContext *cx, const jschar *s, size_t n);
15460
15461 extern __attribute__((visibility("default"))) JSString *
15462 JS_NewUCStringCopyZ(JSContext *cx, const jschar *s);
15463
15464 extern __attribute__((visibility("default"))) JSString *
15465 JS_InternUCStringN(JSContext *cx, const jschar *s, size_t length);
15466
15467 extern __attribute__((visibility("default"))) JSString *
15468 JS_InternUCString(JSContext *cx, const jschar *s);
15469
15470 extern __attribute__((visibility("default"))) JSBool
15471 JS_CompareStrings(JSContext *cx, JSString *str1, JSString *str2, int32_t *result);
15472
15473 extern __attribute__((visibility("default"))) JSBool
15474 JS_StringEqualsAscii(JSContext *cx, JSString *str, const char *asciiBytes, JSBool *match);
15475
15476 extern __attribute__((visibility("default"))) size_t
15477 JS_PutEscapedString(JSContext *cx, char *buffer, size_t size, JSString *str, char quote);
15478
15479 extern __attribute__((visibility("default"))) JSBool
15480 JS_FileEscapedString(FILE *fp, JSString *str, char quote);
15481 # 4903 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
15482 extern __attribute__((visibility("default"))) size_t
15483 JS_GetStringLength(JSString *str);
15484
15485 extern __attribute__((visibility("default"))) const jschar *
15486 JS_GetStringCharsAndLength(JSContext *cx, JSString *str, size_t *length);
15487
15488 extern __attribute__((visibility("default"))) const jschar *
15489 JS_GetInternedStringChars(JSString *str);
15490
15491 extern __attribute__((visibility("default"))) const jschar *
15492 JS_GetInternedStringCharsAndLength(JSString *str, size_t *length);
15493
15494 extern __attribute__((visibility("default"))) const jschar *
15495 JS_GetStringCharsZ(JSContext *cx, JSString *str);
15496
15497 extern __attribute__((visibility("default"))) const jschar *
15498 JS_GetStringCharsZAndLength(JSContext *cx, JSString *str, size_t *length);
15499
15500 extern __attribute__((visibility("default"))) JSFlatString *
15501 JS_FlattenString(JSContext *cx, JSString *str);
15502
15503 extern __attribute__((visibility("default"))) const jschar *
15504 JS_GetFlatStringChars(JSFlatString *str);
15505
15506 static __attribute__((always_inline)) inline JSFlatString *
15507 JSID_TO_FLAT_STRING(jsid id)
15508 {
15509 do { } while(0);
15510 return (JSFlatString *)((id));
15511 }
15512
15513 static __attribute__((always_inline)) inline JSFlatString *
15514 JS_ASSERT_STRING_IS_FLAT(JSString *str)
15515 {
15516 do { } while(0);
15517 return (JSFlatString *)str;
15518 }
15519
15520 static __attribute__((always_inline)) inline JSString *
15521 JS_FORGET_STRING_FLATNESS(JSFlatString *fstr)
15522 {
15523 return (JSString *)fstr;
15524 }
15525
15526
15527
15528
15529
15530 extern __attribute__((visibility("default"))) JSBool
15531 JS_FlatStringEqualsAscii(JSFlatString *str, const char *asciiBytes);
15532
15533 extern __attribute__((visibility("default"))) size_t
15534 JS_PutEscapedFlatString(char *buffer, size_t size, JSFlatString *str, char quote);
15535
15536
15537
15538
15539
15540 extern __attribute__((visibility("default"))) JSString *
15541 JS_NewGrowableString(JSContext *cx, jschar *chars, size_t length);
15542 # 4990 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
15543 extern __attribute__((visibility("default"))) JSString *
15544 JS_NewDependentString(JSContext *cx, JSString *str, size_t start,
15545 size_t length);
15546
15547
15548
15549
15550
15551 extern __attribute__((visibility("default"))) JSString *
15552 JS_ConcatStrings(JSContext *cx, JSString *left, JSString *right);
15553
15554
15555
15556
15557
15558 extern __attribute__((visibility("default"))) const jschar *
15559 JS_UndependString(JSContext *cx, JSString *str);
15560
15561
15562
15563
15564
15565 extern __attribute__((visibility("default"))) JSBool
15566 JS_MakeStringImmutable(JSContext *cx, JSString *str);
15567
15568
15569
15570
15571
15572 __attribute__((visibility("default"))) JSBool
15573 JS_CStringsAreUTF8(void);
15574
15575
15576
15577
15578
15579
15580 __attribute__((visibility("default"))) void
15581 JS_SetCStringsAreUTF8(void);
15582 # 5053 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
15583 __attribute__((visibility("default"))) JSBool
15584 JS_EncodeCharacters(JSContext *cx, const jschar *src, size_t srclen, char *dst,
15585 size_t *dstlenp);
15586
15587 __attribute__((visibility("default"))) JSBool
15588 JS_DecodeBytes(JSContext *cx, const char *src, size_t srclen, jschar *dst,
15589 size_t *dstlenp);
15590
15591 __attribute__((visibility("default"))) JSBool
15592 JS_DecodeUTF8(JSContext *cx, const char *src, size_t srclen, jschar *dst,
15593 size_t *dstlenp);
15594
15595
15596
15597
15598
15599 __attribute__((visibility("default"))) char *
15600 JS_EncodeString(JSContext *cx, JSString *str);
15601
15602
15603
15604
15605
15606
15607 __attribute__((visibility("default"))) size_t
15608 JS_GetStringEncodingLength(JSContext *cx, JSString *str);
15609 # 5093 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
15610 __attribute__((visibility("default"))) size_t
15611 JS_EncodeStringToBuffer(JSString *str, char *buffer, size_t length);
15612
15613
15614
15615 class JSAutoByteString {
15616 public:
15617 JSAutoByteString(JSContext *cx, JSString *str )
15618 : mBytes(JS_EncodeString(cx, str)) {
15619 do { } while(0);
15620 do { } while (0);
15621 }
15622
15623 JSAutoByteString()
15624 : mBytes(__null) {
15625 do { } while (0);
15626 }
15627
15628 ~JSAutoByteString() {
15629 js::UnwantedForeground::free_(mBytes);
15630 }
15631
15632
15633 void initBytes(char *bytes) {
15634 do { } while(0);
15635 mBytes = bytes;
15636 }
15637
15638 char *encode(JSContext *cx, JSString *str) {
15639 do { } while(0);
15640 do { } while(0);
15641 mBytes = JS_EncodeString(cx, str);
15642 return mBytes;
15643 }
15644
15645 void clear() {
15646 js::UnwantedForeground::free_(mBytes);
15647 mBytes = __null;
15648 }
15649
15650 char *ptr() const {
15651 return mBytes;
15652 }
15653
15654 bool operator!() const {
15655 return !mBytes;
15656 }
15657
15658 private:
15659 char *mBytes;
15660
15661
15662
15663 JSAutoByteString(const JSAutoByteString &another);
15664 JSAutoByteString &operator=(const JSAutoByteString &another);
15665 };
15666
15667
15668
15669
15670
15671
15672
15673 typedef JSBool (* JSONWriteCallback)(const jschar *buf, uint32_t len, void *data);
15674
15675
15676
15677
15678 __attribute__((visibility("default"))) JSBool
15679 JS_Stringify(JSContext *cx, jsval *vp, JSObject *replacer, jsval space,
15680 JSONWriteCallback callback, void *data);
15681
15682
15683
15684
15685 __attribute__((visibility("default"))) JSBool
15686 JS_ParseJSON(JSContext *cx, const jschar *chars, uint32_t len, jsval *vp);
15687
15688 __attribute__((visibility("default"))) JSBool
15689 JS_ParseJSONWithReviver(JSContext *cx, const jschar *chars, uint32_t len, jsval reviver,
15690 jsval *vp);
15691
15692
15693
15694
15695
15696
15697 #define JS_STRUCTURED_CLONE_VERSION 1
15698
15699 struct JSStructuredCloneCallbacks {
15700 ReadStructuredCloneOp read;
15701 WriteStructuredCloneOp write;
15702 StructuredCloneErrorOp reportError;
15703 };
15704
15705 __attribute__((visibility("default"))) JSBool
15706 JS_ReadStructuredClone(JSContext *cx, const uint64_t *data, size_t nbytes,
15707 uint32_t version, jsval *vp,
15708 const JSStructuredCloneCallbacks *optionalCallbacks,
15709 void *closure);
15710
15711
15712 __attribute__((visibility("default"))) JSBool
15713 JS_WriteStructuredClone(JSContext *cx, jsval v, uint64_t **datap, size_t *nbytesp,
15714 const JSStructuredCloneCallbacks *optionalCallbacks,
15715 void *closure);
15716
15717 __attribute__((visibility("default"))) JSBool
15718 JS_StructuredClone(JSContext *cx, jsval v, jsval *vp,
15719 const JSStructuredCloneCallbacks *optionalCallbacks,
15720 void *closure);
15721
15722
15723 }
15724
15725
15726 class __attribute__((visibility("default"))) JSAutoStructuredCloneBuffer {
15727 uint64_t *data_;
15728 size_t nbytes_;
15729 uint32_t version_;
15730
15731 public:
15732 JSAutoStructuredCloneBuffer()
15733 : data_(__null), nbytes_(0), version_(1) {}
15734
15735 ~JSAutoStructuredCloneBuffer() { clear(); }
15736
15737 uint64_t *data() const { return data_; }
15738 size_t nbytes() const { return nbytes_; }
15739
15740 void clear();
15741
15742
15743 bool copy(const uint64_t *data, size_t nbytes, uint32_t version=1);
15744
15745
15746
15747
15748
15749
15750 void adopt(uint64_t *data, size_t nbytes, uint32_t version=1);
15751
15752
15753
15754
15755
15756
15757 void steal(uint64_t **datap, size_t *nbytesp, uint32_t *versionp=__null);
15758
15759 bool read(JSContext *cx, jsval *vp,
15760 const JSStructuredCloneCallbacks *optionalCallbacks=__null,
15761 void *closure=__null) const;
15762
15763 bool write(JSContext *cx, jsval v,
15764 const JSStructuredCloneCallbacks *optionalCallbacks=__null,
15765 void *closure=__null);
15766
15767
15768
15769
15770 void swap(JSAutoStructuredCloneBuffer &other);
15771
15772 private:
15773
15774 JSAutoStructuredCloneBuffer(const JSAutoStructuredCloneBuffer &other);
15775 JSAutoStructuredCloneBuffer &operator=(const JSAutoStructuredCloneBuffer &other);
15776 };
15777
15778 extern "C" {
15779
15780
15781
15782
15783
15784 #define JS_SCTAG_USER_MIN ((uint32_t) 0xFFFF8000)
15785 #define JS_SCTAG_USER_MAX ((uint32_t) 0xFFFFFFFF)
15786
15787 #define JS_SCERR_RECURSION 0
15788
15789 __attribute__((visibility("default"))) void
15790 JS_SetStructuredCloneCallbacks(JSRuntime *rt, const JSStructuredCloneCallbacks *callbacks);
15791
15792 __attribute__((visibility("default"))) JSBool
15793 JS_ReadUint32Pair(JSStructuredCloneReader *r, uint32_t *p1, uint32_t *p2);
15794
15795 __attribute__((visibility("default"))) JSBool
15796 JS_ReadBytes(JSStructuredCloneReader *r, void *p, size_t len);
15797
15798 __attribute__((visibility("default"))) JSBool
15799 JS_ReadTypedArray(JSStructuredCloneReader *r, jsval *vp);
15800
15801 __attribute__((visibility("default"))) JSBool
15802 JS_WriteUint32Pair(JSStructuredCloneWriter *w, uint32_t tag, uint32_t data);
15803
15804 __attribute__((visibility("default"))) JSBool
15805 JS_WriteBytes(JSStructuredCloneWriter *w, const void *p, size_t len);
15806
15807 __attribute__((visibility("default"))) JSBool
15808 JS_WriteTypedArray(JSStructuredCloneWriter *w, jsval v);
15809
15810
15811
15812
15813
15814
15815 struct JSLocaleCallbacks {
15816 JSLocaleToUpperCase localeToUpperCase;
15817 JSLocaleToLowerCase localeToLowerCase;
15818 JSLocaleCompare localeCompare;
15819 JSLocaleToUnicode localeToUnicode;
15820 JSErrorCallback localeGetErrorMessage;
15821 };
15822
15823
15824
15825
15826
15827 extern __attribute__((visibility("default"))) void
15828 JS_SetLocaleCallbacks(JSContext *cx, JSLocaleCallbacks *callbacks);
15829
15830
15831
15832
15833
15834 extern __attribute__((visibility("default"))) JSLocaleCallbacks *
15835 JS_GetLocaleCallbacks(JSContext *cx);
15836 # 5331 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
15837 extern __attribute__((visibility("default"))) void
15838 JS_ReportError(JSContext *cx, const char *format, ...);
15839
15840
15841
15842
15843 extern __attribute__((visibility("default"))) void
15844 JS_ReportErrorNumber(JSContext *cx, JSErrorCallback errorCallback,
15845 void *userRef, const unsigned errorNumber, ...);
15846
15847
15848
15849
15850 extern __attribute__((visibility("default"))) void
15851 JS_ReportErrorNumberUC(JSContext *cx, JSErrorCallback errorCallback,
15852 void *userRef, const unsigned errorNumber, ...);
15853
15854
15855
15856
15857
15858
15859
15860 extern __attribute__((visibility("default"))) JSBool
15861 JS_ReportWarning(JSContext *cx, const char *format, ...);
15862
15863 extern __attribute__((visibility("default"))) JSBool
15864 JS_ReportErrorFlagsAndNumber(JSContext *cx, unsigned flags,
15865 JSErrorCallback errorCallback, void *userRef,
15866 const unsigned errorNumber, ...);
15867
15868 extern __attribute__((visibility("default"))) JSBool
15869 JS_ReportErrorFlagsAndNumberUC(JSContext *cx, unsigned flags,
15870 JSErrorCallback errorCallback, void *userRef,
15871 const unsigned errorNumber, ...);
15872
15873
15874
15875
15876 extern __attribute__((visibility("default"))) void
15877 JS_ReportOutOfMemory(JSContext *cx);
15878
15879
15880
15881
15882 extern __attribute__((visibility("default"))) void
15883 JS_ReportAllocationOverflow(JSContext *cx);
15884
15885 struct JSErrorReport {
15886 const char *filename;
15887 JSPrincipals *originPrincipals;
15888 unsigned lineno;
15889 const char *linebuf;
15890 const char *tokenptr;
15891 const jschar *uclinebuf;
15892 const jschar *uctokenptr;
15893 unsigned flags;
15894 unsigned errorNumber;
15895 const jschar *ucmessage;
15896 const jschar **messageArgs;
15897 };
15898
15899
15900
15901
15902 #define JSREPORT_ERROR 0x0
15903 #define JSREPORT_WARNING 0x1
15904 #define JSREPORT_EXCEPTION 0x2
15905 #define JSREPORT_STRICT 0x4
15906 # 5408 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
15907 #define JSREPORT_STRICT_MODE_ERROR 0x8
15908 # 5417 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
15909 #define JSREPORT_IS_WARNING(flags) (((flags) & JSREPORT_WARNING) != 0)
15910 #define JSREPORT_IS_EXCEPTION(flags) (((flags) & JSREPORT_EXCEPTION) != 0)
15911 #define JSREPORT_IS_STRICT(flags) (((flags) & JSREPORT_STRICT) != 0)
15912 #define JSREPORT_IS_STRICT_MODE_ERROR(flags) (((flags) & JSREPORT_STRICT_MODE_ERROR) != 0)
15913
15914 extern __attribute__((visibility("default"))) JSErrorReporter
15915 JS_GetErrorReporter(JSContext *cx);
15916
15917 extern __attribute__((visibility("default"))) JSErrorReporter
15918 JS_SetErrorReporter(JSContext *cx, JSErrorReporter er);
15919
15920
15921
15922
15923
15924
15925
15926 extern __attribute__((visibility("default"))) JSObject *
15927 JS_NewDateObject(JSContext *cx, int year, int mon, int mday, int hour, int min, int sec);
15928
15929 extern __attribute__((visibility("default"))) JSObject *
15930 JS_NewDateObjectMsec(JSContext *cx, double msec);
15931
15932
15933
15934
15935 extern __attribute__((visibility("default"))) JSBool
15936 JS_ObjectIsDate(JSContext *cx, JSObject *obj);
15937
15938
15939
15940
15941
15942
15943 #define JSREG_FOLD 0x01
15944 #define JSREG_GLOB 0x02
15945 #define JSREG_MULTILINE 0x04
15946 #define JSREG_STICKY 0x08
15947
15948 extern __attribute__((visibility("default"))) JSObject *
15949 JS_NewRegExpObject(JSContext *cx, JSObject *obj, char *bytes, size_t length, unsigned flags);
15950
15951 extern __attribute__((visibility("default"))) JSObject *
15952 JS_NewUCRegExpObject(JSContext *cx, JSObject *obj, jschar *chars, size_t length, unsigned flags);
15953
15954 extern __attribute__((visibility("default"))) void
15955 JS_SetRegExpInput(JSContext *cx, JSObject *obj, JSString *input, JSBool multiline);
15956
15957 extern __attribute__((visibility("default"))) void
15958 JS_ClearRegExpStatics(JSContext *cx, JSObject *obj);
15959
15960 extern __attribute__((visibility("default"))) JSBool
15961 JS_ExecuteRegExp(JSContext *cx, JSObject *obj, JSObject *reobj, jschar *chars, size_t length,
15962 size_t *indexp, JSBool test, jsval *rval);
15963
15964
15965
15966 extern __attribute__((visibility("default"))) JSObject *
15967 JS_NewRegExpObjectNoStatics(JSContext *cx, char *bytes, size_t length, unsigned flags);
15968
15969 extern __attribute__((visibility("default"))) JSObject *
15970 JS_NewUCRegExpObjectNoStatics(JSContext *cx, jschar *chars, size_t length, unsigned flags);
15971
15972 extern __attribute__((visibility("default"))) JSBool
15973 JS_ExecuteRegExpNoStatics(JSContext *cx, JSObject *reobj, jschar *chars, size_t length,
15974 size_t *indexp, JSBool test, jsval *rval);
15975
15976 extern __attribute__((visibility("default"))) JSBool
15977 JS_ObjectIsRegExp(JSContext *cx, JSObject *obj);
15978
15979 extern __attribute__((visibility("default"))) unsigned
15980 JS_GetRegExpFlags(JSContext *cx, JSObject *obj);
15981
15982 extern __attribute__((visibility("default"))) JSString *
15983 JS_GetRegExpSource(JSContext *cx, JSObject *obj);
15984
15985
15986
15987 extern __attribute__((visibility("default"))) JSBool
15988 JS_IsExceptionPending(JSContext *cx);
15989
15990 extern __attribute__((visibility("default"))) JSBool
15991 JS_GetPendingException(JSContext *cx, jsval *vp);
15992
15993 extern __attribute__((visibility("default"))) void
15994 JS_SetPendingException(JSContext *cx, jsval v);
15995
15996 extern __attribute__((visibility("default"))) void
15997 JS_ClearPendingException(JSContext *cx);
15998
15999 extern __attribute__((visibility("default"))) JSBool
16000 JS_ReportPendingException(JSContext *cx);
16001 # 5521 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
16002 extern __attribute__((visibility("default"))) JSExceptionState *
16003 JS_SaveExceptionState(JSContext *cx);
16004
16005 extern __attribute__((visibility("default"))) void
16006 JS_RestoreExceptionState(JSContext *cx, JSExceptionState *state);
16007
16008 extern __attribute__((visibility("default"))) void
16009 JS_DropExceptionState(JSContext *cx, JSExceptionState *state);
16010 # 5537 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
16011 extern __attribute__((visibility("default"))) JSErrorReport *
16012 JS_ErrorFromException(JSContext *cx, jsval v);
16013
16014
16015
16016
16017
16018 extern __attribute__((visibility("default"))) JSBool
16019 JS_ThrowReportedError(JSContext *cx, const char *message,
16020 JSErrorReport *reportp);
16021
16022
16023
16024
16025 extern __attribute__((visibility("default"))) JSBool
16026 JS_ThrowStopIteration(JSContext *cx);
16027
16028 extern __attribute__((visibility("default"))) intptr_t
16029 JS_GetCurrentThread();
16030 # 5573 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
16031 extern __attribute__((visibility("default"))) void
16032 JS_AbortIfWrongThread(JSRuntime *rt);
16033
16034 extern __attribute__((visibility("default"))) void
16035 JS_ClearRuntimeThread(JSRuntime *rt);
16036
16037 extern __attribute__((visibility("default"))) void
16038 JS_SetRuntimeThread(JSRuntime *rt);
16039
16040
16041 }
16042
16043 class JSAutoSetRuntimeThread
16044 {
16045 JSRuntime *runtime;
16046
16047 public:
16048 JSAutoSetRuntimeThread(JSRuntime *runtime) : runtime(runtime) {
16049 JS_SetRuntimeThread(runtime);
16050 }
16051
16052 ~JSAutoSetRuntimeThread() {
16053 JS_ClearRuntimeThread(runtime);
16054 }
16055 };
16056
16057 extern "C" {
16058 # 5611 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
16059 static __attribute__((always_inline)) inline JSBool
16060 JS_IsConstructing(JSContext *cx, const jsval *vp)
16061 {
16062 # 5623 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
16063 (void)cx;
16064
16065
16066 return JSVAL_IS_MAGIC_IMPL(JSVAL_TO_IMPL(vp[1]));
16067 }
16068
16069
16070
16071
16072
16073
16074 extern __attribute__((visibility("default"))) JSObject *
16075 JS_NewObjectForConstructor(JSContext *cx, JSClass *clasp, const jsval *vp);
16076 # 5656 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h"
16077 extern __attribute__((visibility("default"))) JSBool
16078 JS_IndexToId(JSContext *cx, uint32_t index, jsid *id);
16079
16080
16081
16082
16083 extern __attribute__((visibility("default"))) JSBool
16084 JS_IsIdentifier(JSContext *cx, JSString *str, JSBool *isIdentifier);
16085
16086
16087
16088
16089
16090 extern __attribute__((visibility("default"))) JSBool
16091 JS_DescribeScriptedCaller(JSContext *cx, JSScript **script, unsigned *lineno);
16092
16093
16094
16095
16096
16097
16098 extern __attribute__((visibility("default"))) void *
16099 JS_EncodeScript(JSContext *cx, JSScript *script, uint32_t *lengthp);
16100
16101 extern __attribute__((visibility("default"))) void *
16102 JS_EncodeInterpretedFunction(JSContext *cx, JSObject *funobj, uint32_t *lengthp);
16103
16104 extern __attribute__((visibility("default"))) JSScript *
16105 JS_DecodeScript(JSContext *cx, const void *data, uint32_t length,
16106 JSPrincipals *principals, JSPrincipals *originPrincipals);
16107
16108 extern __attribute__((visibility("default"))) JSObject *
16109 JS_DecodeInterpretedFunction(JSContext *cx, const void *data, uint32_t length,
16110 JSPrincipals *principals, JSPrincipals *originPrincipals);
16111
16112 }
16113 # 20 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobj.h" 2
16114 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsatom.h" 1
16115
16116
16117
16118
16119
16120
16121
16122 #define jsatom_h___
16123
16124 # 1 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 1 3 4
16125 # 11 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsatom.h" 2
16126 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsversion.h" 1
16127 # 42 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsversion.h"
16128 #define JS_VERSION_ECMA_3 148
16129 #define JS_VERSION_ECMA_3_TEST 149
16130 # 124 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsversion.h"
16131 #define JS_HAS_STR_HTML_HELPERS 1
16132 #define JS_HAS_OBJ_PROTO_PROP 1
16133 #define JS_HAS_OBJ_WATCHPOINT 1
16134 #define JS_HAS_TOSOURCE 1
16135 #define JS_HAS_CATCH_GUARD 1
16136 #define JS_HAS_UNEVAL 1
16137 #define JS_HAS_CONST 1
16138 #define JS_HAS_FUN_EXPR_STMT 1
16139 #define JS_HAS_NO_SUCH_METHOD 1
16140 #define JS_HAS_GENERATORS 1
16141 #define JS_HAS_BLOCK_SCOPE 1
16142 #define JS_HAS_DESTRUCTURING 2
16143 #define JS_HAS_GENERATOR_EXPRS 1
16144 #define JS_HAS_EXPR_CLOSURES 1
16145 # 146 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsversion.h"
16146 #define JS_HAS_NEW_GLOBAL_OBJECT 1
16147
16148
16149 #define JS_HAS_MAKE_SYSTEM_OBJECT 1
16150
16151
16152 #define JS_HAS_DESTRUCTURING_SHORTHAND (JS_HAS_DESTRUCTURING == 2)
16153
16154
16155
16156
16157
16158 #define OLD_GETTER_SETTER_METHODS 1
16159
16160
16161 #define USE_NEW_OBJECT_REPRESENTATION 0
16162
16163
16164
16165
16166 #define NEW_OBJECT_REPRESENTATION_ONLY() MOZ_NOT_REACHED("don't call this! to be used in the new object representation")
16167 # 12 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsatom.h" 2
16168
16169
16170 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsprvtd.h" 1
16171
16172
16173
16174
16175
16176
16177
16178 #define jsprvtd_h___
16179 # 28 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsprvtd.h"
16180 # 1 "./../../dist/include/js/HashTable.h" 1
16181 # 9 "./../../dist/include/js/HashTable.h"
16182 #define jshashtable_h_
16183
16184
16185
16186
16187 namespace js {
16188
16189 class TempAllocPolicy;
16190
16191
16192 typedef uint32_t HashNumber;
16193
16194
16195
16196 namespace detail {
16197
16198 template <class T, class HashPolicy, class AllocPolicy>
16199 class HashTable;
16200
16201 template <class T>
16202 class HashTableEntry {
16203 HashNumber keyHash;
16204
16205 typedef typename tl::StripConst<T>::result NonConstT;
16206
16207 static const HashNumber sFreeKey = 0;
16208 static const HashNumber sRemovedKey = 1;
16209 static const HashNumber sCollisionBit = 1;
16210
16211 template <class, class, class> friend class HashTable;
16212
16213 static bool isLiveHash(HashNumber hash)
16214 {
16215 return hash > sRemovedKey;
16216 }
16217
16218 public:
16219 HashTableEntry() : keyHash(0), t() {}
16220 HashTableEntry(MoveRef<HashTableEntry> rhs) : keyHash(rhs->keyHash), t(Move(rhs->t)) { }
16221 void operator=(const HashTableEntry &rhs) { keyHash = rhs.keyHash; t = rhs.t; }
16222 void operator=(MoveRef<HashTableEntry> rhs) { keyHash = rhs->keyHash; t = Move(rhs->t); }
16223
16224 NonConstT t;
16225
16226 bool isFree() const { return keyHash == sFreeKey; }
16227 void setFree() { keyHash = sFreeKey; t = T(); }
16228 bool isRemoved() const { return keyHash == sRemovedKey; }
16229 void setRemoved() { keyHash = sRemovedKey; t = T(); }
16230 bool isLive() const { return isLiveHash(keyHash); }
16231 void setLive(HashNumber hn) { do { } while(0); keyHash = hn; }
16232
16233 void setCollision() { do { } while(0); keyHash |= sCollisionBit; }
16234 void setCollision(HashNumber collisionBit) {
16235 do { } while(0); keyHash |= collisionBit;
16236 }
16237 void unsetCollision() { keyHash &= ~sCollisionBit; }
16238 bool hasCollision() const { do { } while(0); return keyHash & sCollisionBit; }
16239 bool matchHash(HashNumber hn) { return (keyHash & ~sCollisionBit) == hn; }
16240 HashNumber getKeyHash() const { do { } while(0); return keyHash; }
16241 };
16242 # 77 "./../../dist/include/js/HashTable.h"
16243 template <class T, class HashPolicy, class AllocPolicy>
16244 class HashTable : private AllocPolicy
16245 {
16246 typedef typename tl::StripConst<T>::result NonConstT;
16247 typedef typename HashPolicy::KeyType Key;
16248 typedef typename HashPolicy::Lookup Lookup;
16249
16250 public:
16251 typedef HashTableEntry<T> Entry;
16252
16253
16254
16255
16256
16257
16258
16259 class Ptr
16260 {
16261 friend class HashTable;
16262 typedef void (Ptr::* ConvertibleToBool)();
16263 void nonNull() {}
16264
16265 Entry *entry;
16266
16267 protected:
16268 Ptr(Entry &entry) : entry(&entry) {}
16269
16270 public:
16271
16272 Ptr() {
16273
16274
16275
16276 }
16277
16278 bool found() const { return entry->isLive(); }
16279 operator ConvertibleToBool() const { return found() ? &Ptr::nonNull : 0; }
16280 bool operator==(const Ptr &rhs) const { do { } while(0); return entry == rhs.entry; }
16281 bool operator!=(const Ptr &rhs) const { return !(*this == rhs); }
16282
16283 T &operator*() const { return entry->t; }
16284 T *operator->() const { return &entry->t; }
16285 };
16286
16287
16288 class AddPtr : public Ptr
16289 {
16290 friend class HashTable;
16291 HashNumber keyHash;
16292 DebugOnly<uint64_t> mutationCount;
16293
16294 AddPtr(Entry &entry, HashNumber hn) : Ptr(entry), keyHash(hn) {}
16295 public:
16296
16297 AddPtr() {}
16298 };
16299
16300
16301
16302
16303
16304
16305
16306 class Range
16307 {
16308 protected:
16309 friend class HashTable;
16310
16311 Range(Entry *c, Entry *e) : cur(c), end(e), validEntry(true) {
16312 while (cur < end && !cur->isLive())
16313 ++cur;
16314 }
16315
16316 Entry *cur, *end;
16317 DebugOnly<bool> validEntry;
16318
16319 public:
16320 Range() : cur(__null), end(__null), validEntry(false) {}
16321
16322 bool empty() const {
16323 return cur == end;
16324 }
16325
16326 T &front() const {
16327 do { } while(0);
16328 do { } while(0);
16329 return cur->t;
16330 }
16331
16332 void popFront() {
16333 do { } while(0);
16334 while (++cur < end && !cur->isLive())
16335 continue;
16336 validEntry = true;
16337 }
16338 };
16339 # 183 "./../../dist/include/js/HashTable.h"
16340 class Enum : public Range
16341 {
16342 friend class HashTable;
16343
16344 HashTable &table;
16345 bool added;
16346 bool removed;
16347
16348
16349 Enum(const Enum &);
16350 void operator=(const Enum &);
16351
16352 public:
16353 template<class Map> explicit
16354 Enum(Map &map) : Range(map.all()), table(map.impl), added(false), removed(false) {}
16355 # 208 "./../../dist/include/js/HashTable.h"
16356 void removeFront() {
16357 table.remove(*this->cur);
16358 removed = true;
16359 this->validEntry = false;
16360 }
16361
16362
16363
16364
16365
16366
16367 void rekeyFront(const Lookup &l, const Key &k) {
16368 do { } while(0);
16369 if (match(*this->cur, l))
16370 return;
16371 Entry e = *this->cur;
16372 HashPolicy::setKey(e.t, const_cast<Key &>(k));
16373 table.remove(*this->cur);
16374 table.add(l, e);
16375 added = true;
16376 this->validEntry = false;
16377 }
16378
16379 void rekeyFront(const Key &k) {
16380 rekeyFront(k, k);
16381 }
16382
16383
16384 ~Enum() {
16385 if (added)
16386 table.checkOverloaded();
16387 if (removed)
16388 table.checkUnderloaded();
16389 }
16390
16391
16392 void endEnumeration() {
16393 if (added) {
16394 table.checkOverloaded();
16395 added = false;
16396 }
16397 if (removed) {
16398 table.checkUnderloaded();
16399 removed = false;
16400 }
16401 }
16402 };
16403
16404 private:
16405 uint32_t hashShift;
16406 uint32_t entryCount;
16407 uint32_t gen;
16408 uint32_t removedCount;
16409 Entry *table;
16410
16411 void setTableSizeLog2(unsigned sizeLog2) {
16412 hashShift = sHashBits - sizeLog2;
16413 }
16414 # 282 "./../../dist/include/js/HashTable.h"
16415 #define METER(x)
16416
16417
16418 friend class js::ReentrancyGuard;
16419 mutable DebugOnly<bool> entered;
16420 DebugOnly<uint64_t> mutationCount;
16421
16422
16423 static const unsigned sMinSizeLog2 = 2;
16424 static const unsigned sMinSize = 1 << sMinSizeLog2;
16425 static const unsigned sDefaultInitSizeLog2 = 4;
16426 public:
16427 static const unsigned sDefaultInitSize = 1 << sDefaultInitSizeLog2;
16428 private:
16429 static const unsigned sMaxInit = ((uint32_t)1 << (23));
16430 static const unsigned sMaxCapacity = ((uint32_t)1 << (24));
16431 static const unsigned sHashBits = tl::BitSize<HashNumber>::result;
16432 static const uint8_t sMinAlphaFrac = 64;
16433 static const uint8_t sMaxAlphaFrac = 192;
16434 static const uint8_t sInvMaxAlpha = 171;
16435 static const HashNumber sGoldenRatio = 0x9E3779B9U;
16436 static const HashNumber sFreeKey = Entry::sFreeKey;
16437 static const HashNumber sRemovedKey = Entry::sRemovedKey;
16438 static const HashNumber sCollisionBit = Entry::sCollisionBit;
16439
16440 static void staticAsserts()
16441 {
16442
16443 typedef int moz_static_assert14[(((sMaxInit * sInvMaxAlpha) >> 7) < sMaxCapacity) ? 1 : -1];
16444 typedef int moz_static_assert15[((sMaxCapacity * sInvMaxAlpha) <= (4294967295U)) ? 1 : -1];
16445 typedef int moz_static_assert16[((sMaxCapacity * sizeof(Entry)) <= (4294967295U)) ? 1 : -1];
16446 }
16447
16448 static bool isLiveHash(HashNumber hash)
16449 {
16450 return Entry::isLiveHash(hash);
16451 }
16452
16453 static HashNumber prepareHash(const Lookup& l)
16454 {
16455 HashNumber keyHash = HashPolicy::hash(l);
16456
16457
16458 keyHash *= sGoldenRatio;
16459
16460
16461 if (!isLiveHash(keyHash))
16462 keyHash -= (sRemovedKey + 1);
16463 return keyHash & ~sCollisionBit;
16464 }
16465
16466 static Entry *createTable(AllocPolicy &alloc, uint32_t capacity)
16467 {
16468 Entry *newTable = (Entry *)alloc.malloc_(capacity * sizeof(Entry));
16469 if (!newTable)
16470 return __null;
16471 for (Entry *e = newTable, *end = e + capacity; e < end; ++e)
16472 new(e) Entry();
16473 return newTable;
16474 }
16475
16476 static void destroyTable(AllocPolicy &alloc, Entry *oldTable, uint32_t capacity)
16477 {
16478 for (Entry *e = oldTable, *end = e + capacity; e < end; ++e)
16479 e->~Entry();
16480 alloc.free_(oldTable);
16481 }
16482
16483 public:
16484 HashTable(AllocPolicy ap)
16485 : AllocPolicy(ap),
16486 hashShift(sHashBits),
16487 entryCount(0),
16488 gen(0),
16489 removedCount(0),
16490 table(__null),
16491 entered(false),
16492 mutationCount(0)
16493 {}
16494
16495 __attribute__ ((warn_unused_result)) bool init(uint32_t length)
16496 {
16497
16498 do { } while(0);
16499
16500
16501
16502
16503
16504 if (length > sMaxInit) {
16505 this->reportAllocOverflow();
16506 return false;
16507 }
16508 uint32_t capacity = (length * sInvMaxAlpha) >> 7;
16509
16510 if (capacity < sMinSize)
16511 capacity = sMinSize;
16512
16513
16514 uint32_t roundUp = sMinSize, roundUpLog2 = sMinSizeLog2;
16515 while (roundUp < capacity) {
16516 roundUp <<= 1;
16517 ++roundUpLog2;
16518 }
16519
16520 capacity = roundUp;
16521 do { } while(0);
16522
16523 table = createTable(*this, capacity);
16524 if (!table)
16525 return false;
16526
16527 setTableSizeLog2(roundUpLog2);
16528 ;
16529 return true;
16530 }
16531
16532 bool initialized() const
16533 {
16534 return !!table;
16535 }
16536
16537 ~HashTable()
16538 {
16539 if (table)
16540 destroyTable(*this, table, capacity());
16541 }
16542
16543 private:
16544 static HashNumber hash1(HashNumber hash0, uint32_t shift) {
16545 return hash0 >> shift;
16546 }
16547
16548 struct DoubleHash {
16549 HashNumber h2;
16550 HashNumber sizeMask;
16551 };
16552
16553 DoubleHash hash2(HashNumber curKeyHash, uint32_t hashShift) const {
16554 unsigned sizeLog2 = sHashBits - hashShift;
16555 DoubleHash dh = {
16556 ((curKeyHash << sizeLog2) >> hashShift) | 1,
16557 (HashNumber(1) << sizeLog2) - 1
16558 };
16559 return dh;
16560 }
16561
16562 static HashNumber applyDoubleHash(HashNumber h1, const DoubleHash &dh) {
16563 return (h1 - dh.h2) & dh.sizeMask;
16564 }
16565
16566 bool overloaded() {
16567 return entryCount + removedCount >= ((sMaxAlphaFrac * capacity()) >> 8);
16568 }
16569
16570 bool underloaded() {
16571 uint32_t tableCapacity = capacity();
16572 return tableCapacity > sMinSize &&
16573 entryCount <= ((sMinAlphaFrac * tableCapacity) >> 8);
16574 }
16575
16576 static bool match(Entry &e, const Lookup &l) {
16577 return HashPolicy::match(HashPolicy::getKey(e.t), l);
16578 }
16579
16580 Entry &lookup(const Lookup &l, HashNumber keyHash, unsigned collisionBit) const
16581 {
16582 do { } while(0);
16583 do { } while(0);
16584 do { } while(0);
16585 do { } while(0);
16586 ;
16587
16588
16589 HashNumber h1 = hash1(keyHash, hashShift);
16590 Entry *entry = &table[h1];
16591
16592
16593 if (entry->isFree()) {
16594 ;
16595 return *entry;
16596 }
16597
16598
16599 if (entry->matchHash(keyHash) && match(*entry, l)) {
16600 ;
16601 return *entry;
16602 }
16603
16604
16605 DoubleHash dh = hash2(keyHash, hashShift);
16606
16607
16608 Entry *firstRemoved = __null;
16609
16610 while(true) {
16611 if ((__builtin_expect((entry->isRemoved()), 0))) {
16612 if (!firstRemoved)
16613 firstRemoved = entry;
16614 } else {
16615 entry->setCollision(collisionBit);
16616 }
16617
16618 ;
16619 h1 = applyDoubleHash(h1, dh);
16620
16621 entry = &table[h1];
16622 if (entry->isFree()) {
16623 ;
16624 return firstRemoved ? *firstRemoved : *entry;
16625 }
16626
16627 if (entry->matchHash(keyHash) && match(*entry, l)) {
16628 ;
16629 return *entry;
16630 }
16631 }
16632 }
16633 # 509 "./../../dist/include/js/HashTable.h"
16634 Entry &findFreeEntry(HashNumber keyHash)
16635 {
16636 ;
16637 do { } while(0);
16638
16639
16640
16641
16642 HashNumber h1 = hash1(keyHash, hashShift);
16643 Entry *entry = &table[h1];
16644
16645
16646 if (entry->isFree()) {
16647 ;
16648 return *entry;
16649 }
16650
16651
16652 DoubleHash dh = hash2(keyHash, hashShift);
16653
16654 while(true) {
16655 do { } while(0);
16656 entry->setCollision();
16657
16658 ;
16659 h1 = applyDoubleHash(h1, dh);
16660
16661 entry = &table[h1];
16662 if (entry->isFree()) {
16663 ;
16664 return *entry;
16665 }
16666 }
16667 }
16668
16669 bool changeTableSize(int deltaLog2)
16670 {
16671
16672 Entry *oldTable = table;
16673 uint32_t oldCap = capacity();
16674 uint32_t newLog2 = sHashBits - hashShift + deltaLog2;
16675 uint32_t newCapacity = ((uint32_t)1 << (newLog2));
16676 if (newCapacity > sMaxCapacity) {
16677 this->reportAllocOverflow();
16678 return false;
16679 }
16680
16681 Entry *newTable = createTable(*this, newCapacity);
16682 if (!newTable)
16683 return false;
16684
16685
16686 setTableSizeLog2(newLog2);
16687 removedCount = 0;
16688 gen++;
16689 table = newTable;
16690
16691
16692 for (Entry *src = oldTable, *end = src + oldCap; src < end; ++src) {
16693 if (src->isLive()) {
16694 src->unsetCollision();
16695 findFreeEntry(src->getKeyHash()) = Move(*src);
16696 }
16697 }
16698
16699 destroyTable(*this, oldTable, oldCap);
16700 return true;
16701 }
16702
16703 void add(const Lookup &l, const Entry &e)
16704 {
16705 HashNumber keyHash = prepareHash(l);
16706 Entry &entry = lookup(l, keyHash, sCollisionBit);
16707
16708 if (entry.isRemoved()) {
16709 ;
16710 removedCount--;
16711 keyHash |= sCollisionBit;
16712 }
16713
16714 entry.t = e.t;
16715 entry.setLive(keyHash);
16716 entryCount++;
16717 mutationCount++;
16718 }
16719
16720 bool checkOverloaded()
16721 {
16722 if (!overloaded())
16723 return false;
16724
16725
16726 int deltaLog2;
16727 if (removedCount >= (capacity() >> 2)) {
16728 ;
16729 deltaLog2 = 0;
16730 } else {
16731 ;
16732 deltaLog2 = 1;
16733 }
16734
16735 return changeTableSize(deltaLog2);
16736 }
16737
16738 void remove(Entry &e)
16739 {
16740 ;
16741 if (e.hasCollision()) {
16742 e.setRemoved();
16743 removedCount++;
16744 } else {
16745 ;
16746 e.setFree();
16747 }
16748 entryCount--;
16749 mutationCount++;
16750 }
16751
16752 void checkUnderloaded()
16753 {
16754 if (underloaded()) {
16755 ;
16756 (void) changeTableSize(-1);
16757 }
16758 }
16759
16760 public:
16761 void clear()
16762 {
16763 if (tl::IsPodType<Entry>::result) {
16764 memset(table, 0, sizeof(*table) * capacity());
16765 } else {
16766 uint32_t tableCapacity = capacity();
16767 for (Entry *e = table, *end = table + tableCapacity; e < end; ++e)
16768 *e = Move(Entry());
16769 }
16770 removedCount = 0;
16771 entryCount = 0;
16772 mutationCount++;
16773 }
16774
16775 void finish()
16776 {
16777 do { } while(0);
16778
16779 if (!table)
16780 return;
16781
16782 destroyTable(*this, table, capacity());
16783 table = __null;
16784 gen++;
16785 entryCount = 0;
16786 removedCount = 0;
16787 mutationCount++;
16788 }
16789
16790 Range all() const {
16791 return Range(table, table + capacity());
16792 }
16793
16794 bool empty() const {
16795 return !entryCount;
16796 }
16797
16798 uint32_t count() const {
16799 return entryCount;
16800 }
16801
16802 uint32_t capacity() const {
16803 return ((uint32_t)1 << (sHashBits - hashShift));
16804 }
16805
16806 uint32_t generation() const {
16807 return gen;
16808 }
16809
16810 size_t sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf) const {
16811 return mallocSizeOf(table);
16812 }
16813
16814 size_t sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf) const {
16815 return mallocSizeOf(this) + sizeOfExcludingThis(mallocSizeOf);
16816 }
16817
16818 Ptr lookup(const Lookup &l) const {
16819 ReentrancyGuard g(*this);
16820 HashNumber keyHash = prepareHash(l);
16821 return Ptr(lookup(l, keyHash, 0));
16822 }
16823
16824 AddPtr lookupForAdd(const Lookup &l) const {
16825 ReentrancyGuard g(*this);
16826 HashNumber keyHash = prepareHash(l);
16827 Entry &entry = lookup(l, keyHash, sCollisionBit);
16828 AddPtr p(entry, keyHash);
16829 p.mutationCount = mutationCount;
16830 return p;
16831 }
16832
16833 bool add(AddPtr &p)
16834 {
16835 ReentrancyGuard g(*this);
16836 do { } while(0);
16837 do { } while(0);
16838 do { } while(0);
16839 do { } while(0);
16840
16841
16842
16843
16844
16845 if (p.entry->isRemoved()) {
16846 ;
16847 removedCount--;
16848 p.keyHash |= sCollisionBit;
16849 } else {
16850 if (checkOverloaded())
16851
16852 p.entry = &findFreeEntry(p.keyHash);
16853 }
16854
16855 p.entry->setLive(p.keyHash);
16856 entryCount++;
16857 mutationCount++;
16858 return true;
16859 }
16860
16861
16862
16863
16864
16865
16866 bool add(AddPtr &p, T** pentry)
16867 {
16868 if (!add(p))
16869 return false;
16870 *pentry = &p.entry->t;
16871 return true;
16872 }
16873
16874 bool add(AddPtr &p, const T &t)
16875 {
16876 if (!add(p))
16877 return false;
16878 p.entry->t = t;
16879 return true;
16880 }
16881
16882 bool relookupOrAdd(AddPtr& p, const Lookup &l, const T& t)
16883 {
16884 p.mutationCount = mutationCount;
16885 {
16886 ReentrancyGuard g(*this);
16887 p.entry = &lookup(l, p.keyHash, sCollisionBit);
16888 }
16889 return p.found() || add(p, t);
16890 }
16891
16892 void remove(Ptr p)
16893 {
16894 ReentrancyGuard g(*this);
16895 do { } while(0);
16896 remove(*p.entry);
16897 checkUnderloaded();
16898 }
16899
16900 #undef METER
16901 };
16902
16903 }
16904 # 810 "./../../dist/include/js/HashTable.h"
16905 template <class Key>
16906 struct DefaultHasher
16907 {
16908 typedef Key Lookup;
16909 static HashNumber hash(const Lookup &l) {
16910
16911 return l;
16912 }
16913 static bool match(const Key &k, const Lookup &l) {
16914
16915 return k == l;
16916 }
16917 };
16918
16919
16920
16921
16922
16923 template <typename Key, size_t zeroBits>
16924 struct PointerHasher
16925 {
16926 typedef Key Lookup;
16927 static HashNumber hash(const Lookup &l) {
16928 size_t word = reinterpret_cast<size_t>(l) >> zeroBits;
16929 typedef int moz_static_assert17[(sizeof(HashNumber) == 4) ? 1 : -1];
16930
16931 return HashNumber(word);
16932
16933
16934
16935
16936 }
16937 static bool match(const Key &k, const Lookup &l) {
16938 return k == l;
16939 }
16940 };
16941
16942 template <typename Key, size_t zeroBits>
16943 struct TaggedPointerHasher
16944 {
16945 typedef Key Lookup;
16946
16947 static HashNumber hash(const Lookup &l) {
16948 return PointerHasher<Key, zeroBits>::hash(l);
16949 }
16950
16951 static const uintptr_t COMPARE_MASK = uintptr_t(-1) - 1;
16952
16953 static bool match(const Key &k, const Lookup &l) {
16954 return (uintptr_t(k) & COMPARE_MASK) == uintptr_t(l);
16955 }
16956 };
16957
16958
16959
16960
16961
16962 template <class T>
16963 struct DefaultHasher<T *>: PointerHasher<T *, tl::FloorLog2<sizeof(void *)>::result> { };
16964
16965
16966
16967 template <class Key, class Value>
16968 class HashMapEntry
16969 {
16970 template <class, class, class> friend class detail::HashTable;
16971 template <class> friend class detail::HashTableEntry;
16972 void operator=(const HashMapEntry &rhs) {
16973 const_cast<Key &>(key) = rhs.key;
16974 value = rhs.value;
16975 }
16976
16977 public:
16978 HashMapEntry() : key(), value() {}
16979
16980 template<typename KeyInput, typename ValueInput>
16981 HashMapEntry(const KeyInput &k, const ValueInput &v) : key(k), value(v) {}
16982
16983 HashMapEntry(MoveRef<HashMapEntry> rhs)
16984 : key(Move(rhs->key)), value(Move(rhs->value)) { }
16985 void operator=(MoveRef<HashMapEntry> rhs) {
16986 const_cast<Key &>(key) = Move(rhs->key);
16987 value = Move(rhs->value);
16988 }
16989
16990 const Key key;
16991 Value value;
16992 };
16993
16994 namespace tl {
16995
16996 template <class T>
16997 struct IsPodType<detail::HashTableEntry<T> > {
16998 static const bool result = IsPodType<T>::result;
16999 };
17000
17001 template <class K, class V>
17002 struct IsPodType<HashMapEntry<K, V> >
17003 {
17004 static const bool result = IsPodType<K>::result && IsPodType<V>::result;
17005 };
17006
17007 }
17008 # 930 "./../../dist/include/js/HashTable.h"
17009 template <class Key,
17010 class Value,
17011 class HashPolicy = DefaultHasher<Key>,
17012 class AllocPolicy = TempAllocPolicy>
17013 class HashMap
17014 {
17015 public:
17016 typedef typename HashPolicy::Lookup Lookup;
17017
17018 typedef HashMapEntry<Key, Value> Entry;
17019
17020 private:
17021
17022 struct MapHashPolicy : HashPolicy
17023 {
17024 typedef Key KeyType;
17025 static const Key &getKey(Entry &e) { return e.key; }
17026 static void setKey(Entry &e, Key &k) { const_cast<Key &>(e.key) = k; }
17027 };
17028 typedef detail::HashTable<Entry, MapHashPolicy, AllocPolicy> Impl;
17029
17030 friend class Impl::Enum;
17031
17032
17033 HashMap(const HashMap &);
17034 HashMap &operator=(const HashMap &);
17035
17036 Impl impl;
17037
17038 public:
17039 const static unsigned sDefaultInitSize = Impl::sDefaultInitSize;
17040
17041
17042
17043
17044
17045 HashMap(AllocPolicy a = AllocPolicy()) : impl(a) {}
17046 bool init(uint32_t len = sDefaultInitSize) { return impl.init(len); }
17047 bool initialized() const { return impl.initialized(); }
17048 # 983 "./../../dist/include/js/HashTable.h"
17049 typedef typename Impl::Ptr Ptr;
17050 Ptr lookup(const Lookup &l) const { return impl.lookup(l); }
17051
17052
17053 void remove(Ptr p) { impl.remove(p); }
17054 # 1024 "./../../dist/include/js/HashTable.h"
17055 typedef typename Impl::AddPtr AddPtr;
17056 AddPtr lookupForAdd(const Lookup &l) const {
17057 return impl.lookupForAdd(l);
17058 }
17059
17060 template<typename KeyInput, typename ValueInput>
17061 bool add(AddPtr &p, const KeyInput &k, const ValueInput &v) {
17062 Entry *pentry;
17063 if (!impl.add(p, &pentry))
17064 return false;
17065 const_cast<Key &>(pentry->key) = k;
17066 pentry->value = v;
17067 return true;
17068 }
17069
17070 bool add(AddPtr &p, const Key &k, MoveRef<Value> v) {
17071 Entry *pentry;
17072 if (!impl.add(p, &pentry))
17073 return false;
17074 const_cast<Key &>(pentry->key) = k;
17075 pentry->value = v;
17076 return true;
17077 }
17078
17079 bool add(AddPtr &p, const Key &k) {
17080 Entry *pentry;
17081 if (!impl.add(p, &pentry))
17082 return false;
17083 const_cast<Key &>(pentry->key) = k;
17084 return true;
17085 }
17086
17087 template<typename KeyInput, typename ValueInput>
17088 bool relookupOrAdd(AddPtr &p, const KeyInput &k, const ValueInput &v) {
17089 return impl.relookupOrAdd(p, k, Entry(k, v));
17090 }
17091 # 1071 "./../../dist/include/js/HashTable.h"
17092 typedef typename Impl::Range Range;
17093 Range all() const { return impl.all(); }
17094 uint32_t count() const { return impl.count(); }
17095 size_t capacity() const { return impl.capacity(); }
17096 size_t sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf) const {
17097 return impl.sizeOfExcludingThis(mallocSizeOf);
17098 }
17099 size_t sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf) const {
17100
17101
17102
17103
17104 return mallocSizeOf(this) + impl.sizeOfExcludingThis(mallocSizeOf);
17105 }
17106 # 1099 "./../../dist/include/js/HashTable.h"
17107 typedef typename Impl::Enum Enum;
17108
17109
17110
17111
17112
17113 void clear() { impl.clear(); }
17114
17115
17116
17117
17118
17119 void finish() { impl.finish(); }
17120
17121
17122 bool empty() const { return impl.empty(); }
17123
17124
17125
17126
17127
17128 unsigned generation() const { return impl.generation(); }
17129
17130
17131
17132 bool has(const Lookup &l) const {
17133 return impl.lookup(l) != __null;
17134 }
17135
17136
17137 template<typename KeyInput, typename ValueInput>
17138 bool put(const KeyInput &k, const ValueInput &v) {
17139 AddPtr p = lookupForAdd(k);
17140 if (p) {
17141 p->value = v;
17142 return true;
17143 }
17144 return add(p, k, v);
17145 }
17146
17147
17148 bool putNew(const Key &k, const Value &v) {
17149 AddPtr p = lookupForAdd(k);
17150 do { } while(0);
17151 return add(p, k, v);
17152 }
17153
17154
17155 Ptr lookupWithDefault(const Key &k, const Value &defaultValue) {
17156 AddPtr p = lookupForAdd(k);
17157 if (p)
17158 return p;
17159 (void)add(p, k, defaultValue);
17160 return p;
17161 }
17162
17163
17164 void remove(const Lookup &l) {
17165 if (Ptr p = lookup(l))
17166 remove(p);
17167 }
17168 };
17169 # 1178 "./../../dist/include/js/HashTable.h"
17170 template <class T, class HashPolicy = DefaultHasher<T>, class AllocPolicy = TempAllocPolicy>
17171 class HashSet
17172 {
17173 typedef typename HashPolicy::Lookup Lookup;
17174
17175
17176 struct SetOps : HashPolicy {
17177 typedef T KeyType;
17178 static const KeyType &getKey(const T &t) { return t; }
17179 static void setKey(T &t, KeyType &k) { t = k; }
17180 };
17181 typedef detail::HashTable<const T, SetOps, AllocPolicy> Impl;
17182
17183 friend class Impl::Enum;
17184
17185
17186 HashSet(const HashSet &);
17187 HashSet &operator=(const HashSet &);
17188
17189 Impl impl;
17190
17191 public:
17192 const static unsigned sDefaultInitSize = Impl::sDefaultInitSize;
17193
17194
17195
17196
17197
17198 HashSet(AllocPolicy a = AllocPolicy()) : impl(a) {}
17199 bool init(uint32_t len = sDefaultInitSize) { return impl.init(len); }
17200 bool initialized() const { return impl.initialized(); }
17201 # 1221 "./../../dist/include/js/HashTable.h"
17202 typedef typename Impl::Ptr Ptr;
17203 Ptr lookup(const Lookup &l) const { return impl.lookup(l); }
17204
17205
17206 void remove(Ptr p) { impl.remove(p); }
17207 # 1261 "./../../dist/include/js/HashTable.h"
17208 typedef typename Impl::AddPtr AddPtr;
17209 AddPtr lookupForAdd(const Lookup &l) const {
17210 return impl.lookupForAdd(l);
17211 }
17212
17213 bool add(AddPtr &p, const T &t) {
17214 return impl.add(p, t);
17215 }
17216
17217 bool relookupOrAdd(AddPtr &p, const Lookup &l, const T &t) {
17218 return impl.relookupOrAdd(p, l, t);
17219 }
17220 # 1284 "./../../dist/include/js/HashTable.h"
17221 typedef typename Impl::Range Range;
17222 Range all() const { return impl.all(); }
17223 uint32_t count() const { return impl.count(); }
17224 size_t capacity() const { return impl.capacity(); }
17225 size_t sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf) const {
17226 return impl.sizeOfExcludingThis(mallocSizeOf);
17227 }
17228 size_t sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf) const {
17229
17230
17231
17232
17233 return mallocSizeOf(this) + impl.sizeOfExcludingThis(mallocSizeOf);
17234 }
17235 # 1312 "./../../dist/include/js/HashTable.h"
17236 typedef typename Impl::Enum Enum;
17237
17238
17239
17240
17241
17242 void clear() { impl.clear(); }
17243
17244
17245
17246
17247
17248 void finish() { impl.finish(); }
17249
17250
17251 bool empty() const { return impl.empty(); }
17252
17253
17254
17255
17256
17257 unsigned generation() const { return impl.generation(); }
17258
17259
17260
17261 bool has(const Lookup &l) const {
17262 return impl.lookup(l) != __null;
17263 }
17264
17265
17266 bool put(const T &t) {
17267 AddPtr p = lookupForAdd(t);
17268 return p ? true : add(p, t);
17269 }
17270
17271
17272 bool putNew(const T &t) {
17273 AddPtr p = lookupForAdd(t);
17274 do { } while(0);
17275 return add(p, t);
17276 }
17277
17278 bool putNew(const Lookup &l, const T &t) {
17279 AddPtr p = lookupForAdd(l);
17280 do { } while(0);
17281 return add(p, t);
17282 }
17283
17284 void remove(const Lookup &l) {
17285 if (Ptr p = lookup(l))
17286 remove(p);
17287 }
17288 };
17289
17290 }
17291 # 29 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsprvtd.h" 2
17292
17293
17294
17295 extern "C" {
17296
17297
17298
17299
17300 #define JS_BITS_PER_UINT32_LOG2 5
17301 #define JS_BITS_PER_UINT32 32
17302
17303
17304 static const unsigned JS_GCTHING_ALIGN = 8;
17305 static const unsigned JS_GCTHING_ZEROBITS = 3;
17306
17307
17308 typedef uint8_t jsbytecode;
17309 typedef uint8_t jssrcnote;
17310 typedef uintptr_t jsatomid;
17311
17312
17313 typedef struct JSArgumentFormatMap JSArgumentFormatMap;
17314 typedef struct JSGCThing JSGCThing;
17315 typedef struct JSGenerator JSGenerator;
17316 typedef struct JSNativeEnumerator JSNativeEnumerator;
17317 typedef struct JSProperty JSProperty;
17318 typedef struct JSSharpObjectMap JSSharpObjectMap;
17319 typedef struct JSTryNote JSTryNote;
17320
17321
17322 typedef struct JSAtomState JSAtomState;
17323 typedef struct JSCodeSpec JSCodeSpec;
17324 typedef struct JSPrinter JSPrinter;
17325 typedef struct JSStackHeader JSStackHeader;
17326 typedef struct JSSubString JSSubString;
17327 typedef struct JSSpecializedNative JSSpecializedNative;
17328
17329
17330 typedef struct JSXML JSXML;
17331 # 79 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsprvtd.h"
17332 extern "C++" {
17333
17334 class JSDependentString;
17335 class JSExtensibleString;
17336 class JSExternalString;
17337 class JSLinearString;
17338 class JSFixedString;
17339 class JSStaticAtom;
17340 class JSRope;
17341 class JSAtom;
17342 class JSWrapper;
17343
17344 namespace js {
17345
17346 struct ArgumentsData;
17347 struct Class;
17348
17349 class RegExpGuard;
17350 class RegExpObject;
17351 class RegExpObjectBuilder;
17352 class RegExpShared;
17353 class RegExpStatics;
17354 class MatchPairs;
17355 class PropertyName;
17356
17357 namespace detail { class RegExpCode; }
17358
17359 enum RegExpFlag
17360 {
17361 IgnoreCaseFlag = 0x01,
17362 GlobalFlag = 0x02,
17363 MultilineFlag = 0x04,
17364 StickyFlag = 0x08,
17365
17366 NoFlags = 0x00,
17367 AllFlags = 0x0f
17368 };
17369
17370 enum RegExpExecType
17371 {
17372 RegExpExec,
17373 RegExpTest
17374 };
17375
17376 class ExecuteArgsGuard;
17377 class InvokeFrameGuard;
17378 class InvokeArgsGuard;
17379 class StringBuffer;
17380
17381 class FrameRegs;
17382 class StackFrame;
17383 class StackSegment;
17384 class StackSpace;
17385 class ContextStack;
17386 class ScriptFrameIter;
17387 class CallReceiver;
17388 class CallArgs;
17389
17390 struct BytecodeEmitter;
17391 struct Definition;
17392 struct FunctionBox;
17393 struct ObjectBox;
17394 struct ParseNode;
17395 struct Parser;
17396 struct SharedContext;
17397 class TokenStream;
17398 struct Token;
17399 struct TokenPos;
17400 struct TokenPtr;
17401 struct TreeContext;
17402 class UpvarCookie;
17403
17404 class Proxy;
17405 class BaseProxyHandler;
17406 class DirectWrapper;
17407 class CrossCompartmentWrapper;
17408
17409 class TempAllocPolicy;
17410 class RuntimeAllocPolicy;
17411
17412 class GlobalObject;
17413
17414 template <typename K,
17415 typename V,
17416 size_t InlineElems>
17417 class InlineMap;
17418
17419 class LifoAlloc;
17420
17421 class BaseShape;
17422 class UnownedBaseShape;
17423 struct Shape;
17424 struct EmptyShape;
17425 class ShapeKindArray;
17426 class Bindings;
17427
17428 struct StackBaseShape;
17429 struct StackShape;
17430
17431 class MultiDeclRange;
17432 class ParseMapPool;
17433 class DefnOrHeader;
17434 typedef InlineMap<JSAtom *, Definition *, 24> AtomDefnMap;
17435 typedef InlineMap<JSAtom *, jsatomid, 24> AtomIndexMap;
17436 typedef InlineMap<JSAtom *, DefnOrHeader, 24> AtomDOHMap;
17437 typedef Vector<UpvarCookie, 8> UpvarCookies;
17438
17439 class Breakpoint;
17440 class BreakpointSite;
17441 class Debugger;
17442 class WatchpointMap;
17443
17444
17445
17446
17447
17448
17449
17450 typedef JSObject Env;
17451
17452 typedef JSNative Native;
17453 typedef JSPropertyOp PropertyOp;
17454 typedef JSStrictPropertyOp StrictPropertyOp;
17455 typedef JSPropertyDescriptor PropertyDescriptor;
17456
17457 namespace analyze {
17458
17459 struct LifetimeVariable;
17460 class LoopAnalysis;
17461 class ScriptAnalysis;
17462 class SlotValue;
17463 class SSAValue;
17464 class SSAUseChain;
17465
17466 }
17467
17468 namespace types {
17469
17470 class TypeSet;
17471 struct TypeCallsite;
17472 struct TypeObject;
17473 struct TypeCompartment;
17474
17475 }
17476
17477 typedef JS::Handle<Shape*> HandleShape;
17478 typedef JS::Handle<BaseShape*> HandleBaseShape;
17479 typedef JS::Handle<types::TypeObject*> HandleTypeObject;
17480 typedef JS::Handle<JSAtom*> HandleAtom;
17481 typedef JS::Handle<PropertyName*> HandlePropertyName;
17482
17483 typedef JS::Rooted<Shape*> RootedShape;
17484 typedef JS::Rooted<BaseShape*> RootedBaseShape;
17485 typedef JS::Rooted<types::TypeObject*> RootedTypeObject;
17486 typedef JS::Rooted<JSAtom*> RootedAtom;
17487 typedef JS::Rooted<PropertyName*> RootedPropertyName;
17488
17489 enum XDRMode {
17490 XDR_ENCODE,
17491 XDR_DECODE
17492 };
17493
17494 template <XDRMode mode>
17495 class XDRState;
17496
17497 class FreeOp;
17498
17499 }
17500
17501 namespace JSC {
17502
17503 class ExecutableAllocator;
17504
17505 }
17506
17507 namespace WTF {
17508
17509 class BumpPointerAllocator;
17510
17511 }
17512
17513 }
17514 # 269 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsprvtd.h"
17515 typedef enum JSTrapStatus {
17516 JSTRAP_ERROR,
17517 JSTRAP_CONTINUE,
17518 JSTRAP_RETURN,
17519 JSTRAP_THROW,
17520 JSTRAP_LIMIT
17521 } JSTrapStatus;
17522
17523 typedef JSTrapStatus
17524 (* JSTrapHandler)(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval,
17525 jsval closure);
17526
17527 typedef JSTrapStatus
17528 (* JSInterruptHook)(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval,
17529 void *closure);
17530
17531 typedef JSTrapStatus
17532 (* JSDebuggerHandler)(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval,
17533 void *closure);
17534
17535 typedef JSTrapStatus
17536 (* JSThrowHook)(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval,
17537 void *closure);
17538
17539 typedef JSBool
17540 (* JSWatchPointHandler)(JSContext *cx, JSObject *obj, jsid id, jsval old,
17541 jsval *newp, void *closure);
17542
17543
17544 typedef void
17545 (* JSNewScriptHook)(JSContext *cx,
17546 const char *filename,
17547 unsigned lineno,
17548 JSScript *script,
17549 JSFunction *fun,
17550 void *callerdata);
17551
17552
17553 typedef void
17554 (* JSDestroyScriptHook)(JSFreeOp *fop,
17555 JSScript *script,
17556 void *callerdata);
17557
17558 typedef void
17559 (* JSSourceHandler)(const char *filename, unsigned lineno, const jschar *str,
17560 size_t length, void **listenerTSData, void *closure);
17561 # 341 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsprvtd.h"
17562 typedef void *
17563 (* JSInterpreterHook)(JSContext *cx, JSStackFrame *fp, JSBool before,
17564 JSBool *ok, void *closure);
17565
17566 typedef JSBool
17567 (* JSDebugErrorHook)(JSContext *cx, const char *message, JSErrorReport *report,
17568 void *closure);
17569
17570 typedef struct JSDebugHooks {
17571 JSInterruptHook interruptHook;
17572 void *interruptHookData;
17573 JSNewScriptHook newScriptHook;
17574 void *newScriptHookData;
17575 JSDestroyScriptHook destroyScriptHook;
17576 void *destroyScriptHookData;
17577 JSDebuggerHandler debuggerHandler;
17578 void *debuggerHandlerData;
17579 JSSourceHandler sourceHandler;
17580 void *sourceHandlerData;
17581 JSInterpreterHook executeHook;
17582 void *executeHookData;
17583 JSInterpreterHook callHook;
17584 void *callHookData;
17585 JSThrowHook throwHook;
17586 void *throwHookData;
17587 JSDebugErrorHook debugErrorHook;
17588 void *debugErrorHookData;
17589 } JSDebugHooks;
17590
17591
17592
17593
17594
17595
17596
17597 typedef JSObject *
17598 (* JSObjectOp)(JSContext *cx, JSHandleObject obj);
17599
17600
17601 typedef JSObject *
17602 (* JSClassInitializerOp)(JSContext *cx, JSObject *obj);
17603
17604
17605
17606
17607
17608 typedef JSObject *
17609 (* JSIteratorOp)(JSContext *cx, JSHandleObject obj, JSBool keysonly);
17610 # 397 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsprvtd.h"
17611 extern JSBool js_CStringsAreUTF8;
17612
17613
17614 }
17615 # 15 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsatom.h" 2
17616 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jshash.h" 1
17617
17618
17619
17620
17621
17622
17623
17624 #define jshash_h___
17625
17626
17627
17628
17629 # 1 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 1 3 4
17630 # 14 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jshash.h" 2
17631
17632
17633
17634 extern "C" {
17635
17636 typedef uint32_t JSHashNumber;
17637 typedef struct JSHashEntry JSHashEntry;
17638 typedef struct JSHashTable JSHashTable;
17639
17640 #define JS_HASH_BITS 32
17641 #define JS_GOLDEN_RATIO 0x9E3779B9U
17642
17643 typedef JSHashNumber (* JSHashFunction)(const void *key);
17644 typedef int (* JSHashComparator)(const void *v1, const void *v2);
17645 typedef int (* JSHashEnumerator)(JSHashEntry *he, int i, void *arg);
17646
17647
17648 #define HT_ENUMERATE_NEXT 0
17649 #define HT_ENUMERATE_STOP 1
17650 #define HT_ENUMERATE_REMOVE 2
17651
17652 typedef struct JSHashAllocOps {
17653 void * (*allocTable)(void *pool, size_t size);
17654 void (*freeTable)(void *pool, void *item, size_t size);
17655 JSHashEntry * (*allocEntry)(void *pool, const void *key);
17656 void (*freeEntry)(void *pool, JSHashEntry *he, unsigned flag);
17657 } JSHashAllocOps;
17658
17659 #define HT_FREE_VALUE 0
17660 #define HT_FREE_ENTRY 1
17661
17662 struct JSHashEntry {
17663 JSHashEntry *next;
17664 JSHashNumber keyHash;
17665 const void *key;
17666 void *value;
17667 };
17668
17669 struct JSHashTable {
17670 JSHashEntry **buckets;
17671 uint32_t nentries;
17672 uint32_t shift;
17673 JSHashFunction keyHash;
17674 JSHashComparator keyCompare;
17675 JSHashComparator valueCompare;
17676 JSHashAllocOps *allocOps;
17677 void *allocPriv;
17678
17679
17680
17681
17682
17683
17684 };
17685
17686
17687
17688
17689
17690 extern __attribute__((visibility("default"))) JSHashTable *
17691 JS_NewHashTable(uint32_t n, JSHashFunction keyHash,
17692 JSHashComparator keyCompare, JSHashComparator valueCompare,
17693 JSHashAllocOps *allocOps, void *allocPriv);
17694
17695 extern __attribute__((visibility("default"))) void
17696 JS_HashTableDestroy(JSHashTable *ht);
17697
17698
17699 extern __attribute__((visibility("default"))) JSHashEntry **
17700 JS_HashTableRawLookup(JSHashTable *ht, JSHashNumber keyHash, const void *key);
17701
17702
17703 extern __attribute__((visibility("default"))) JSHashEntry *
17704 JS_HashTableRawAdd(JSHashTable *ht, JSHashEntry **&hep, JSHashNumber keyHash,
17705 const void *key, void *value);
17706
17707
17708 extern __attribute__((visibility("default"))) void
17709 JS_HashTableRawRemove(JSHashTable *ht, JSHashEntry **hep, JSHashEntry *he);
17710
17711
17712 extern __attribute__((visibility("default"))) JSHashEntry *
17713 JS_HashTableAdd(JSHashTable *ht, const void *key, void *value);
17714
17715 extern __attribute__((visibility("default"))) JSBool
17716 JS_HashTableRemove(JSHashTable *ht, const void *key);
17717
17718 extern __attribute__((visibility("default"))) int
17719 JS_HashTableEnumerateEntries(JSHashTable *ht, JSHashEnumerator f, void *arg);
17720
17721 extern __attribute__((visibility("default"))) void *
17722 JS_HashTableLookup(JSHashTable *ht, const void *key);
17723
17724 extern __attribute__((visibility("default"))) int
17725 JS_HashTableDump(JSHashTable *ht, JSHashEnumerator dump, FILE *fp);
17726
17727
17728 extern __attribute__((visibility("default"))) JSHashNumber
17729 JS_HashString(const void *key);
17730
17731
17732 extern __attribute__((visibility("default"))) int
17733 JS_CompareValues(const void *v1, const void *v2);
17734
17735 }
17736 # 16 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsatom.h" 2
17737
17738 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jslock.h" 1
17739
17740
17741
17742
17743
17744
17745 #define jslock_h__
17746
17747
17748
17749
17750
17751 # 1 "/usr/include/nspr/pratom.h" 1
17752 # 12 "/usr/include/nspr/pratom.h"
17753 #define pratom_h___
17754
17755 # 1 "/usr/include/nspr/prtypes.h" 1
17756 # 21 "/usr/include/nspr/prtypes.h"
17757 #define prtypes_h___
17758
17759
17760
17761
17762 # 1 "/usr/include/nspr/prcpucfg.h" 1
17763 # 12 "/usr/include/nspr/prcpucfg.h"
17764 #define nspr_cpucfg___
17765
17766
17767
17768
17769
17770
17771 #define LINUX
17772
17773
17774
17775
17776
17777
17778
17779 #define PR_AF_INET6 10
17780 # 547 "/usr/include/nspr/prcpucfg.h"
17781 #define IS_LITTLE_ENDIAN 1
17782 #undef IS_BIG_ENDIAN
17783
17784
17785
17786
17787 #define PR_BYTES_PER_BYTE 1
17788 #define PR_BYTES_PER_SHORT 2
17789 #define PR_BYTES_PER_INT 4
17790 #define PR_BYTES_PER_INT64 8
17791 #define PR_BYTES_PER_LONG 4
17792 #define PR_BYTES_PER_FLOAT 4
17793 #define PR_BYTES_PER_DOUBLE 8
17794 #define PR_BYTES_PER_WORD 4
17795 #define PR_BYTES_PER_DWORD 8
17796
17797 #define PR_BITS_PER_BYTE 8
17798 #define PR_BITS_PER_SHORT 16
17799 #define PR_BITS_PER_INT 32
17800 #define PR_BITS_PER_INT64 64
17801 #define PR_BITS_PER_LONG 32
17802 #define PR_BITS_PER_FLOAT 32
17803 #define PR_BITS_PER_DOUBLE 64
17804 #define PR_BITS_PER_WORD 32
17805
17806 #define PR_BITS_PER_BYTE_LOG2 3
17807 #define PR_BITS_PER_SHORT_LOG2 4
17808 #define PR_BITS_PER_INT_LOG2 5
17809 #define PR_BITS_PER_INT64_LOG2 6
17810 #define PR_BITS_PER_LONG_LOG2 5
17811 #define PR_BITS_PER_FLOAT_LOG2 5
17812 #define PR_BITS_PER_DOUBLE_LOG2 6
17813 #define PR_BITS_PER_WORD_LOG2 5
17814
17815 #define PR_ALIGN_OF_SHORT 2
17816 #define PR_ALIGN_OF_INT 4
17817 #define PR_ALIGN_OF_LONG 4
17818 #define PR_ALIGN_OF_INT64 4
17819 #define PR_ALIGN_OF_FLOAT 4
17820 #define PR_ALIGN_OF_DOUBLE 4
17821 #define PR_ALIGN_OF_POINTER 4
17822 #define PR_ALIGN_OF_WORD 4
17823
17824 #define PR_BYTES_PER_WORD_LOG2 2
17825 #define PR_BYTES_PER_DWORD_LOG2 3
17826 # 871 "/usr/include/nspr/prcpucfg.h"
17827 #define HAVE_LONG_LONG
17828 # 27 "/usr/include/nspr/prtypes.h" 2
17829
17830
17831 # 1 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 1 3 4
17832 # 30 "/usr/include/nspr/prtypes.h" 2
17833 # 125 "/usr/include/nspr/prtypes.h"
17834 #define PR_VISIBILITY_DEFAULT __attribute__((visibility("default")))
17835
17836
17837
17838
17839 #define PR_EXPORT(__type) extern PR_VISIBILITY_DEFAULT __type
17840 #define PR_EXPORT_DATA(__type) extern PR_VISIBILITY_DEFAULT __type
17841 #define PR_IMPORT(__type) extern PR_VISIBILITY_DEFAULT __type
17842 #define PR_IMPORT_DATA(__type) extern PR_VISIBILITY_DEFAULT __type
17843
17844 #define PR_EXTERN(__type) extern PR_VISIBILITY_DEFAULT __type
17845 #define PR_IMPLEMENT(__type) PR_VISIBILITY_DEFAULT __type
17846 #define PR_EXTERN_DATA(__type) extern PR_VISIBILITY_DEFAULT __type
17847 #define PR_IMPLEMENT_DATA(__type) PR_VISIBILITY_DEFAULT __type
17848 #define PR_CALLBACK
17849 #define PR_CALLBACK_DECL
17850 #define PR_STATIC_CALLBACK(__x) static __x
17851
17852
17853
17854
17855
17856
17857
17858 #define NSPR_API(__type) PR_IMPORT(__type)
17859 #define NSPR_DATA_API(__type) PR_IMPORT_DATA(__type)
17860 # 160 "/usr/include/nspr/prtypes.h"
17861 #define PR_BEGIN_MACRO do {
17862 #define PR_END_MACRO } while (0)
17863 # 170 "/usr/include/nspr/prtypes.h"
17864 #define PR_BEGIN_EXTERN_C extern "C" {
17865 #define PR_END_EXTERN_C }
17866 # 183 "/usr/include/nspr/prtypes.h"
17867 #define PR_BIT(n) ((PRUint32)1 << (n))
17868 #define PR_BITMASK(n) (PR_BIT(n) - 1)
17869 # 194 "/usr/include/nspr/prtypes.h"
17870 #define PR_ROUNDUP(x,y) ((((x)+((y)-1))/(y))*(y))
17871 #define PR_MIN(x,y) ((x)<(y)?(x):(y))
17872 #define PR_MAX(x,y) ((x)>(y)?(x):(y))
17873 #define PR_ABS(x) ((x)<0?-(x):(x))
17874
17875
17876
17877
17878
17879
17880 #define PR_ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
17881
17882 extern "C" {
17883 # 216 "/usr/include/nspr/prtypes.h"
17884 typedef unsigned char PRUint8;
17885 # 230 "/usr/include/nspr/prtypes.h"
17886 typedef signed char PRInt8;
17887 # 244 "/usr/include/nspr/prtypes.h"
17888 #define PR_INT8_MAX 127
17889 #define PR_INT8_MIN (-128)
17890 #define PR_UINT8_MAX 255U
17891 # 255 "/usr/include/nspr/prtypes.h"
17892 typedef unsigned short PRUint16;
17893 typedef short PRInt16;
17894 # 269 "/usr/include/nspr/prtypes.h"
17895 #define PR_INT16_MAX 32767
17896 #define PR_INT16_MIN (-32768)
17897 #define PR_UINT16_MAX 65535U
17898 # 280 "/usr/include/nspr/prtypes.h"
17899 typedef unsigned int PRUint32;
17900 typedef int PRInt32;
17901 #define PR_INT32(x) x
17902 #define PR_UINT32(x) x ## U
17903 # 301 "/usr/include/nspr/prtypes.h"
17904 #define PR_INT32_MAX PR_INT32(2147483647)
17905 #define PR_INT32_MIN (-PR_INT32_MAX - 1)
17906 #define PR_UINT32_MAX PR_UINT32(4294967295)
17907 # 350 "/usr/include/nspr/prtypes.h"
17908 typedef long long PRInt64;
17909 typedef unsigned long long PRUint64;
17910 #define PR_INT64(x) x ## LL
17911 #define PR_UINT64(x) x ## ULL
17912
17913
17914 #define PR_INT64_MAX PR_INT64(0x7fffffffffffffff)
17915 #define PR_INT64_MIN (-PR_INT64_MAX - 1)
17916 #define PR_UINT64_MAX PR_UINT64(-1)
17917 # 385 "/usr/include/nspr/prtypes.h"
17918 typedef int PRIntn;
17919 typedef unsigned int PRUintn;
17920 # 396 "/usr/include/nspr/prtypes.h"
17921 typedef double PRFloat64;
17922
17923
17924
17925
17926
17927
17928 typedef size_t PRSize;
17929
17930
17931
17932
17933
17934
17935
17936 typedef PRInt32 PROffset32;
17937 typedef PRInt64 PROffset64;
17938
17939
17940
17941
17942
17943
17944
17945 typedef ptrdiff_t PRPtrdiff;
17946 # 431 "/usr/include/nspr/prtypes.h"
17947 typedef unsigned long PRUptrdiff;
17948 # 442 "/usr/include/nspr/prtypes.h"
17949 typedef PRIntn PRBool;
17950 #define PR_TRUE 1
17951 #define PR_FALSE 0
17952
17953
17954
17955
17956
17957
17958
17959 typedef PRUint8 PRPackedBool;
17960
17961
17962
17963
17964
17965 typedef enum { PR_FAILURE = -1, PR_SUCCESS = 0 } PRStatus;
17966
17967
17968 #define __PRUNICHAR__
17969
17970
17971
17972 typedef PRUint16 PRUnichar;
17973 # 484 "/usr/include/nspr/prtypes.h"
17974 typedef long PRWord;
17975 typedef unsigned long PRUword;
17976 # 534 "/usr/include/nspr/prtypes.h"
17977 #define PR_STATIC_ASSERT(condition) extern void pr_static_assert(int arg[(condition) ? 1 : -1])
17978
17979
17980 }
17981 # 15 "/usr/include/nspr/pratom.h" 2
17982 # 1 "/usr/include/nspr/prlock.h" 1
17983 # 17 "/usr/include/nspr/prlock.h"
17984 #define prlock_h___
17985
17986
17987
17988 extern "C" {
17989 # 34 "/usr/include/nspr/prlock.h"
17990 typedef struct PRLock PRLock;
17991 # 51 "/usr/include/nspr/prlock.h"
17992 extern __attribute__((visibility("default"))) PRLock* PR_NewLock(void);
17993 # 62 "/usr/include/nspr/prlock.h"
17994 extern __attribute__((visibility("default"))) void PR_DestroyLock(PRLock *lock);
17995 # 73 "/usr/include/nspr/prlock.h"
17996 extern __attribute__((visibility("default"))) void PR_Lock(PRLock *lock);
17997 # 85 "/usr/include/nspr/prlock.h"
17998 extern __attribute__((visibility("default"))) PRStatus PR_Unlock(PRLock *lock);
17999 # 101 "/usr/include/nspr/prlock.h"
18000 #define PR_ASSERT_CURRENT_THREAD_OWNS_LOCK(lock)
18001
18002
18003
18004 extern __attribute__((visibility("default"))) void PR_AssertCurrentThreadOwnsLock(PRLock *lock);
18005
18006 }
18007 # 16 "/usr/include/nspr/pratom.h" 2
18008
18009 extern "C" {
18010 # 28 "/usr/include/nspr/pratom.h"
18011 extern __attribute__((visibility("default"))) PRInt32 PR_AtomicIncrement(PRInt32 *val);
18012 # 39 "/usr/include/nspr/pratom.h"
18013 extern __attribute__((visibility("default"))) PRInt32 PR_AtomicDecrement(PRInt32 *val);
18014 # 51 "/usr/include/nspr/pratom.h"
18015 extern __attribute__((visibility("default"))) PRInt32 PR_AtomicSet(PRInt32 *val, PRInt32 newval);
18016 # 63 "/usr/include/nspr/pratom.h"
18017 extern __attribute__((visibility("default"))) PRInt32 PR_AtomicAdd(PRInt32 *ptr, PRInt32 val);
18018 # 128 "/usr/include/nspr/pratom.h"
18019 #define PR_ATOMIC_INCREMENT(val) PR_AtomicIncrement(val)
18020 #define PR_ATOMIC_DECREMENT(val) PR_AtomicDecrement(val)
18021 #define PR_ATOMIC_SET(val,newval) PR_AtomicSet(val, newval)
18022 #define PR_ATOMIC_ADD(ptr,val) PR_AtomicAdd(ptr, val)
18023
18024
18025
18026
18027
18028
18029 typedef struct PRStackElemStr PRStackElem;
18030
18031 struct PRStackElemStr {
18032 PRStackElem *prstk_elem_next;
18033
18034 };
18035
18036 typedef struct PRStackStr PRStack;
18037 # 156 "/usr/include/nspr/pratom.h"
18038 extern __attribute__((visibility("default"))) PRStack * PR_CreateStack(const char *stack_name);
18039 # 168 "/usr/include/nspr/pratom.h"
18040 extern __attribute__((visibility("default"))) void PR_StackPush(PRStack *stack, PRStackElem *stack_elem);
18041 # 181 "/usr/include/nspr/pratom.h"
18042 extern __attribute__((visibility("default"))) PRStackElem * PR_StackPop(PRStack *stack);
18043 # 195 "/usr/include/nspr/pratom.h"
18044 extern __attribute__((visibility("default"))) PRStatus PR_DestroyStack(PRStack *stack);
18045
18046 }
18047 # 14 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jslock.h" 2
18048 # 1 "/usr/include/nspr/prlock.h" 1
18049 # 15 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jslock.h" 2
18050 # 1 "/usr/include/nspr/prcvar.h" 1
18051
18052
18053
18054
18055
18056
18057 #define prcvar_h___
18058
18059
18060 # 1 "/usr/include/nspr/prinrval.h" 1
18061 # 19 "/usr/include/nspr/prinrval.h"
18062 #define prinrval_h
18063
18064
18065
18066 extern "C" {
18067
18068
18069
18070
18071
18072 typedef PRUint32 PRIntervalTime;
18073 # 39 "/usr/include/nspr/prinrval.h"
18074 #define PR_INTERVAL_MIN 1000UL
18075 #define PR_INTERVAL_MAX 100000UL
18076 # 53 "/usr/include/nspr/prinrval.h"
18077 #define PR_INTERVAL_NO_WAIT 0UL
18078 #define PR_INTERVAL_NO_TIMEOUT 0xffffffffUL
18079 # 79 "/usr/include/nspr/prinrval.h"
18080 extern __attribute__((visibility("default"))) PRIntervalTime PR_IntervalNow(void);
18081 # 97 "/usr/include/nspr/prinrval.h"
18082 extern __attribute__((visibility("default"))) PRUint32 PR_TicksPerSecond(void);
18083 # 116 "/usr/include/nspr/prinrval.h"
18084 extern __attribute__((visibility("default"))) PRIntervalTime PR_SecondsToInterval(PRUint32 seconds);
18085 extern __attribute__((visibility("default"))) PRIntervalTime PR_MillisecondsToInterval(PRUint32 milli);
18086 extern __attribute__((visibility("default"))) PRIntervalTime PR_MicrosecondsToInterval(PRUint32 micro);
18087 # 137 "/usr/include/nspr/prinrval.h"
18088 extern __attribute__((visibility("default"))) PRUint32 PR_IntervalToSeconds(PRIntervalTime ticks);
18089 extern __attribute__((visibility("default"))) PRUint32 PR_IntervalToMilliseconds(PRIntervalTime ticks);
18090 extern __attribute__((visibility("default"))) PRUint32 PR_IntervalToMicroseconds(PRIntervalTime ticks);
18091
18092 }
18093 # 11 "/usr/include/nspr/prcvar.h" 2
18094
18095 extern "C" {
18096
18097 typedef struct PRCondVar PRCondVar;
18098 # 27 "/usr/include/nspr/prcvar.h"
18099 extern __attribute__((visibility("default"))) PRCondVar* PR_NewCondVar(PRLock *lock);
18100
18101
18102
18103
18104
18105
18106
18107 extern __attribute__((visibility("default"))) void PR_DestroyCondVar(PRCondVar *cvar);
18108 # 65 "/usr/include/nspr/prcvar.h"
18109 extern __attribute__((visibility("default"))) PRStatus PR_WaitCondVar(PRCondVar *cvar, PRIntervalTime timeout);
18110 # 80 "/usr/include/nspr/prcvar.h"
18111 extern __attribute__((visibility("default"))) PRStatus PR_NotifyCondVar(PRCondVar *cvar);
18112 # 90 "/usr/include/nspr/prcvar.h"
18113 extern __attribute__((visibility("default"))) PRStatus PR_NotifyAllCondVar(PRCondVar *cvar);
18114
18115 }
18116 # 16 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jslock.h" 2
18117 # 1 "/usr/include/nspr/prthread.h" 1
18118
18119
18120
18121
18122
18123
18124 #define prthread_h___
18125 # 49 "/usr/include/nspr/prthread.h"
18126 extern "C" {
18127
18128 typedef struct PRThread PRThread;
18129 typedef struct PRThreadStack PRThreadStack;
18130
18131 typedef enum PRThreadType {
18132 PR_USER_THREAD,
18133 PR_SYSTEM_THREAD
18134 } PRThreadType;
18135
18136 typedef enum PRThreadScope {
18137 PR_LOCAL_THREAD,
18138 PR_GLOBAL_THREAD,
18139 PR_GLOBAL_BOUND_THREAD
18140 } PRThreadScope;
18141
18142 typedef enum PRThreadState {
18143 PR_JOINABLE_THREAD,
18144 PR_UNJOINABLE_THREAD
18145 } PRThreadState;
18146
18147 typedef enum PRThreadPriority
18148 {
18149 PR_PRIORITY_FIRST = 0,
18150 PR_PRIORITY_LOW = 0,
18151 PR_PRIORITY_NORMAL = 1,
18152 PR_PRIORITY_HIGH = 2,
18153 PR_PRIORITY_URGENT = 3,
18154 PR_PRIORITY_LAST = 3
18155 } PRThreadPriority;
18156 # 105 "/usr/include/nspr/prthread.h"
18157 extern __attribute__((visibility("default"))) PRThread* PR_CreateThread(PRThreadType type,
18158 void ( *start)(void *arg),
18159 void *arg,
18160 PRThreadPriority priority,
18161 PRThreadScope scope,
18162 PRThreadState state,
18163 PRUint32 stackSize);
18164 # 126 "/usr/include/nspr/prthread.h"
18165 extern __attribute__((visibility("default"))) PRStatus PR_JoinThread(PRThread *thread);
18166
18167
18168
18169
18170
18171 extern __attribute__((visibility("default"))) PRThread* PR_GetCurrentThread(void);
18172
18173
18174
18175
18176
18177
18178
18179 extern __attribute__((visibility("default"))) PRThreadPriority PR_GetThreadPriority(const PRThread *thread);
18180
18181
18182
18183
18184 extern __attribute__((visibility("default"))) void PR_SetThreadPriority(PRThread *thread, PRThreadPriority priority);
18185
18186
18187
18188
18189
18190 extern __attribute__((visibility("default"))) PRStatus PR_SetCurrentThreadName(const char *name);
18191
18192
18193
18194
18195 extern __attribute__((visibility("default"))) const char * PR_GetThreadName(const PRThread *thread);
18196 # 182 "/usr/include/nspr/prthread.h"
18197 typedef void ( *PRThreadPrivateDTOR)(void *priv);
18198
18199 extern __attribute__((visibility("default"))) PRStatus PR_NewThreadPrivateIndex(
18200 PRUintn *newIndex, PRThreadPrivateDTOR destructor);
18201 # 198 "/usr/include/nspr/prthread.h"
18202 extern __attribute__((visibility("default"))) PRStatus PR_SetThreadPrivate(PRUintn tpdIndex, void *priv);
18203 # 209 "/usr/include/nspr/prthread.h"
18204 extern __attribute__((visibility("default"))) void* PR_GetThreadPrivate(PRUintn tpdIndex);
18205 # 221 "/usr/include/nspr/prthread.h"
18206 extern __attribute__((visibility("default"))) PRStatus PR_Interrupt(PRThread *thread);
18207
18208
18209
18210
18211
18212 extern __attribute__((visibility("default"))) void PR_ClearInterrupt(void);
18213
18214
18215
18216
18217 extern __attribute__((visibility("default"))) void PR_BlockInterrupt(void);
18218
18219
18220
18221
18222 extern __attribute__((visibility("default"))) void PR_UnblockInterrupt(void);
18223 # 246 "/usr/include/nspr/prthread.h"
18224 extern __attribute__((visibility("default"))) PRStatus PR_Sleep(PRIntervalTime ticks);
18225
18226
18227
18228
18229 extern __attribute__((visibility("default"))) PRThreadScope PR_GetThreadScope(const PRThread *thread);
18230
18231
18232
18233
18234 extern __attribute__((visibility("default"))) PRThreadType PR_GetThreadType(const PRThread *thread);
18235
18236
18237
18238
18239 extern __attribute__((visibility("default"))) PRThreadState PR_GetThreadState(const PRThread *thread);
18240
18241 }
18242 # 17 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jslock.h" 2
18243 # 1 "/usr/include/nspr/prinit.h" 1
18244
18245
18246
18247
18248
18249
18250 #define prinit_h___
18251
18252 # 1 "/usr/include/nspr/prthread.h" 1
18253 # 10 "/usr/include/nspr/prinit.h" 2
18254
18255 # 1 "/usr/include/nspr/prwin16.h" 1
18256
18257
18258
18259
18260
18261
18262 #define prwin16_h___
18263 # 153 "/usr/include/nspr/prwin16.h"
18264 #define PR_STDIO_INIT()
18265 # 12 "/usr/include/nspr/prinit.h" 2
18266
18267
18268 extern "C" {
18269 # 24 "/usr/include/nspr/prinit.h"
18270 #define PR_NAME "NSPR"
18271 # 34 "/usr/include/nspr/prinit.h"
18272 #define PR_VERSION "4.9.2"
18273 #define PR_VMAJOR 4
18274 #define PR_VMINOR 9
18275 #define PR_VPATCH 2
18276 #define PR_BETA PR_FALSE
18277 # 56 "/usr/include/nspr/prinit.h"
18278 typedef PRBool (*PRVersionCheck)(const char*);
18279 # 66 "/usr/include/nspr/prinit.h"
18280 extern __attribute__((visibility("default"))) PRBool PR_VersionCheck(const char *importedVersion);
18281
18282
18283
18284
18285 extern __attribute__((visibility("default"))) const char* PR_GetVersion(void);
18286 # 84 "/usr/include/nspr/prinit.h"
18287 extern __attribute__((visibility("default"))) void PR_Init(
18288 PRThreadType type, PRThreadPriority priority, PRUintn maxPTDs);
18289 # 105 "/usr/include/nspr/prinit.h"
18290 typedef PRIntn ( *PRPrimordialFn)(PRIntn argc, char **argv);
18291
18292 extern __attribute__((visibility("default"))) PRIntn PR_Initialize(
18293 PRPrimordialFn prmain, PRIntn argc, char **argv, PRUintn maxPTDs);
18294
18295
18296
18297
18298 extern __attribute__((visibility("default"))) PRBool PR_Initialized(void);
18299 # 131 "/usr/include/nspr/prinit.h"
18300 extern __attribute__((visibility("default"))) PRStatus PR_Cleanup(void);
18301
18302
18303
18304
18305
18306 extern __attribute__((visibility("default"))) void PR_DisableClockInterrupts(void);
18307
18308
18309
18310
18311
18312 extern __attribute__((visibility("default"))) void PR_EnableClockInterrupts(void);
18313
18314
18315
18316
18317
18318 extern __attribute__((visibility("default"))) void PR_BlockClockInterrupts(void);
18319
18320
18321
18322
18323
18324 extern __attribute__((visibility("default"))) void PR_UnblockClockInterrupts(void);
18325
18326
18327
18328
18329 extern __attribute__((visibility("default"))) void PR_SetConcurrency(PRUintn numCPUs);
18330
18331
18332
18333
18334
18335
18336 extern __attribute__((visibility("default"))) PRStatus PR_SetFDCacheSize(PRIntn low, PRIntn high);
18337
18338
18339
18340
18341
18342
18343 extern __attribute__((visibility("default"))) void PR_ProcessExit(PRIntn status);
18344
18345
18346
18347
18348
18349
18350 extern __attribute__((visibility("default"))) void PR_Abort(void);
18351 # 191 "/usr/include/nspr/prinit.h"
18352 typedef struct PRCallOnceType {
18353 PRIntn initialized;
18354 PRInt32 inProgress;
18355 PRStatus status;
18356 } PRCallOnceType;
18357
18358 typedef PRStatus ( *PRCallOnceFN)(void);
18359
18360 typedef PRStatus ( *PRCallOnceWithArgFN)(void *arg);
18361
18362 extern __attribute__((visibility("default"))) PRStatus PR_CallOnce(
18363 PRCallOnceType *once,
18364 PRCallOnceFN func
18365 );
18366
18367 extern __attribute__((visibility("default"))) PRStatus PR_CallOnceWithArg(
18368 PRCallOnceType *once,
18369 PRCallOnceWithArgFN func,
18370 void *arg
18371 );
18372
18373
18374 }
18375 # 18 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jslock.h" 2
18376
18377 #define JS_ATOMIC_INCREMENT(p) PR_ATOMIC_INCREMENT((PRInt32 *)(p))
18378 #define JS_ATOMIC_DECREMENT(p) PR_ATOMIC_DECREMENT((PRInt32 *)(p))
18379 #define JS_ATOMIC_ADD(p,v) PR_ATOMIC_ADD((PRInt32 *)(p), (PRInt32)(v))
18380 #define JS_ATOMIC_SET(p,v) PR_ATOMIC_SET((PRInt32 *)(p), (PRInt32)(v))
18381 # 33 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jslock.h"
18382 namespace js {
18383
18384 class AutoAtomicIncrement
18385 {
18386 int32_t *p;
18387
18388
18389 public:
18390 AutoAtomicIncrement(int32_t *p )
18391 : p(p) {
18392 do { } while (0);
18393 PR_AtomicIncrement((PRInt32 *)(p));
18394 }
18395
18396 ~AutoAtomicIncrement() {
18397 PR_AtomicDecrement((PRInt32 *)(p));
18398 }
18399 };
18400
18401 }
18402 # 18 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsatom.h" 2
18403
18404 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Barrier.h" 1
18405 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Barrier.h"
18406 #define jsgc_barrier_h___
18407
18408 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsapi.h" 1
18409 # 12 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Barrier.h" 2
18410
18411 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Heap.h" 1
18412
18413
18414
18415
18416
18417
18418
18419 #define gc_heap_h___
18420
18421
18422
18423
18424 # 1 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 1 3 4
18425 # 14 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Heap.h" 2
18426
18427
18428 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsutil.h" 1
18429 # 17 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Heap.h" 2
18430
18431 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/ds/BitArray.h" 1
18432 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/ds/BitArray.h"
18433 #define BitArray_h__
18434
18435
18436
18437 # 1 "./../../dist/include/js/TemplateLib.h" 1
18438 # 14 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/ds/BitArray.h" 2
18439
18440 namespace js {
18441
18442 template <size_t nbits>
18443 class BitArray {
18444 private:
18445 uintptr_t map[nbits / (8 * 4) + (nbits % (8 * 4) == 0 ? 0 : 1)];
18446
18447 public:
18448 void clear(bool value) {
18449 if (value)
18450 memset(map, 0xFF, sizeof(map));
18451 else
18452 memset(map, 0, sizeof(map));
18453 }
18454
18455 inline bool get(size_t offset) const {
18456 uintptr_t index, mask;
18457 getMarkWordAndMask(offset, &index, &mask);
18458 return map[index] & mask;
18459 }
18460
18461 inline void set(size_t offset) {
18462 uintptr_t index, mask;
18463 getMarkWordAndMask(offset, &index, &mask);
18464 map[index] |= mask;
18465 }
18466
18467 inline void unset(size_t offset) {
18468 uintptr_t index, mask;
18469 getMarkWordAndMask(offset, &index, &mask);
18470 map[index] &= ~mask;
18471 }
18472
18473 private:
18474 inline void getMarkWordAndMask(size_t offset,
18475 uintptr_t *indexp, uintptr_t *maskp) const {
18476 *indexp = offset >> tl::FloorLog2<(8 * 4)>::result;
18477 *maskp = uintptr_t(1) << (offset & ((8 * 4) - 1));
18478 }
18479 };
18480
18481 }
18482 # 19 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Heap.h" 2
18483
18484 struct JSCompartment;
18485
18486 extern "C" {
18487 struct JSRuntime;
18488 }
18489
18490 namespace js {
18491
18492 class FreeOp;
18493
18494 namespace gc {
18495
18496 struct Arena;
18497 struct ArenaHeader;
18498 struct Chunk;
18499
18500
18501
18502
18503
18504
18505 static const uint32_t BLACK = 0;
18506 static const uint32_t GRAY = 1;
18507
18508
18509 enum AllocKind {
18510 FINALIZE_OBJECT0,
18511 FINALIZE_OBJECT0_BACKGROUND,
18512 FINALIZE_OBJECT2,
18513 FINALIZE_OBJECT2_BACKGROUND,
18514 FINALIZE_OBJECT4,
18515 FINALIZE_OBJECT4_BACKGROUND,
18516 FINALIZE_OBJECT8,
18517 FINALIZE_OBJECT8_BACKGROUND,
18518 FINALIZE_OBJECT12,
18519 FINALIZE_OBJECT12_BACKGROUND,
18520 FINALIZE_OBJECT16,
18521 FINALIZE_OBJECT16_BACKGROUND,
18522 FINALIZE_OBJECT_LAST = FINALIZE_OBJECT16_BACKGROUND,
18523 FINALIZE_SCRIPT,
18524 FINALIZE_SHAPE,
18525 FINALIZE_BASE_SHAPE,
18526 FINALIZE_TYPE_OBJECT,
18527
18528 FINALIZE_XML,
18529
18530 FINALIZE_SHORT_STRING,
18531 FINALIZE_STRING,
18532 FINALIZE_EXTERNAL_STRING,
18533 FINALIZE_LAST = FINALIZE_EXTERNAL_STRING
18534 };
18535
18536 static const unsigned FINALIZE_LIMIT = FINALIZE_LAST + 1;
18537 static const unsigned FINALIZE_OBJECT_LIMIT = FINALIZE_OBJECT_LAST + 1;
18538
18539
18540
18541
18542
18543 static const size_t MAX_BACKGROUND_FINALIZE_KINDS = FINALIZE_LIMIT - FINALIZE_OBJECT_LIMIT / 2;
18544
18545
18546
18547
18548 struct Cell
18549 {
18550 static const size_t CellShift = 3;
18551 static const size_t CellSize = size_t(1) << CellShift;
18552 static const size_t CellMask = CellSize - 1;
18553
18554 inline uintptr_t address() const;
18555 inline ArenaHeader *arenaHeader() const;
18556 inline Chunk *chunk() const;
18557 inline AllocKind getAllocKind() const;
18558 __attribute__((always_inline)) inline bool isMarked(uint32_t color = BLACK) const;
18559 __attribute__((always_inline)) inline bool markIfUnmarked(uint32_t color = BLACK) const;
18560 __attribute__((always_inline)) inline void unmark(uint32_t color) const;
18561
18562 inline JSCompartment *compartment() const;
18563
18564
18565
18566
18567 };
18568 # 114 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Heap.h"
18569 const size_t PageShift = 12;
18570
18571 const size_t PageSize = size_t(1) << PageShift;
18572
18573 const size_t ChunkShift = 20;
18574 const size_t ChunkSize = size_t(1) << ChunkShift;
18575 const size_t ChunkMask = ChunkSize - 1;
18576
18577 const size_t ArenaShift = PageShift;
18578 const size_t ArenaSize = PageSize;
18579 const size_t ArenaMask = ArenaSize - 1;
18580
18581
18582
18583
18584
18585 const static uint32_t FreeCommittedArenasThreshold = (32 << 20) / ArenaSize;
18586
18587
18588
18589
18590
18591
18592
18593 const size_t ArenaCellCount = size_t(1) << (ArenaShift - Cell::CellShift);
18594 const size_t ArenaBitmapBits = ArenaCellCount;
18595 const size_t ArenaBitmapBytes = ArenaBitmapBits / 8;
18596 const size_t ArenaBitmapWords = ArenaBitmapBits / (8 * 4);
18597 # 169 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Heap.h"
18598 struct FreeSpan
18599 {
18600 uintptr_t first;
18601 uintptr_t last;
18602
18603 public:
18604 FreeSpan() {}
18605
18606 FreeSpan(uintptr_t first, uintptr_t last)
18607 : first(first), last(last) {
18608 checkSpan();
18609 }
18610
18611
18612
18613
18614
18615 static size_t encodeOffsets(size_t firstOffset, size_t lastOffset) {
18616
18617 typedef int moz_static_assert18[(ArenaShift < 16) ? 1 : -1];
18618 do { } while(0);
18619 do { } while(0);
18620 do { } while(0);
18621 return firstOffset | (lastOffset << 16);
18622 }
18623
18624
18625
18626
18627
18628 static const size_t FullArenaOffsets = ArenaSize | ((ArenaSize - 1) << 16);
18629
18630 static FreeSpan decodeOffsets(uintptr_t arenaAddr, size_t offsets) {
18631 do { } while(0);
18632
18633 size_t firstOffset = offsets & 0xFFFF;
18634 size_t lastOffset = offsets >> 16;
18635 do { } while(0);
18636 do { } while(0);
18637
18638
18639
18640
18641
18642 return FreeSpan(arenaAddr + firstOffset, arenaAddr | lastOffset);
18643 }
18644
18645 void initAsEmpty(uintptr_t arenaAddr = 0) {
18646 do { } while(0);
18647 first = arenaAddr + ArenaSize;
18648 last = arenaAddr | (ArenaSize - 1);
18649 do { } while(0);
18650 }
18651
18652 bool isEmpty() const {
18653 checkSpan();
18654 return first > last;
18655 }
18656
18657 bool hasNext() const {
18658 checkSpan();
18659 return !(last & uintptr_t(1));
18660 }
18661
18662 const FreeSpan *nextSpan() const {
18663 do { } while(0);
18664 return reinterpret_cast<FreeSpan *>(last);
18665 }
18666
18667 FreeSpan *nextSpanUnchecked(size_t thingSize) const {
18668
18669
18670
18671
18672
18673 return reinterpret_cast<FreeSpan *>(last);
18674 }
18675
18676 uintptr_t arenaAddressUnchecked() const {
18677 return last & ~ArenaMask;
18678 }
18679
18680 uintptr_t arenaAddress() const {
18681 checkSpan();
18682 return arenaAddressUnchecked();
18683 }
18684
18685 ArenaHeader *arenaHeader() const {
18686 return reinterpret_cast<ArenaHeader *>(arenaAddress());
18687 }
18688
18689 bool isSameNonEmptySpan(const FreeSpan *another) const {
18690 do { } while(0);
18691 do { } while(0);
18692 return first == another->first && last == another->last;
18693 }
18694
18695 bool isWithinArena(uintptr_t arenaAddr) const {
18696 do { } while(0);
18697
18698
18699 return arenaAddress() == arenaAddr;
18700 }
18701
18702 size_t encodeAsOffsets() const {
18703
18704
18705
18706
18707 uintptr_t arenaAddr = arenaAddress();
18708 return encodeOffsets(first - arenaAddr, last & ArenaMask);
18709 }
18710
18711
18712 __attribute__((always_inline)) inline void *allocate(size_t thingSize) {
18713 do { } while(0);
18714 checkSpan();
18715 uintptr_t thing = first;
18716 if (thing < last) {
18717
18718 first = thing + thingSize;
18719 } else if ((__builtin_expect((thing == last), 1))) {
18720
18721
18722
18723
18724 *this = *reinterpret_cast<FreeSpan *>(thing);
18725 } else {
18726 return __null;
18727 }
18728 checkSpan();
18729 return reinterpret_cast<void *>(thing);
18730 }
18731
18732
18733 __attribute__((always_inline)) inline void *infallibleAllocate(size_t thingSize) {
18734 do { } while(0);
18735 checkSpan();
18736 uintptr_t thing = first;
18737 if (thing < last) {
18738 first = thing + thingSize;
18739 } else {
18740 do { } while(0);
18741 *this = *reinterpret_cast<FreeSpan *>(thing);
18742 }
18743 checkSpan();
18744 return reinterpret_cast<void *>(thing);
18745 }
18746
18747
18748
18749
18750
18751
18752
18753 __attribute__((always_inline)) inline void *allocateFromNewArena(uintptr_t arenaAddr, size_t firstThingOffset,
18754 size_t thingSize) {
18755 do { } while(0);
18756 uintptr_t thing = arenaAddr | firstThingOffset;
18757 first = thing + thingSize;
18758 last = arenaAddr | ArenaMask;
18759 checkSpan();
18760 return reinterpret_cast<void *>(thing);
18761 }
18762
18763 void checkSpan() const {
18764 # 394 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Heap.h"
18765 }
18766
18767 };
18768
18769
18770 struct ArenaHeader
18771 {
18772 friend struct FreeLists;
18773
18774 JSCompartment *compartment;
18775
18776
18777
18778
18779
18780
18781 ArenaHeader *next;
18782
18783 private:
18784
18785
18786
18787
18788
18789 size_t firstFreeSpanOffsets;
18790 # 427 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Heap.h"
18791 size_t allocKind : 8;
18792 # 446 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Heap.h"
18793 public:
18794 size_t hasDelayedMarking : 1;
18795 size_t allocatedDuringIncremental : 1;
18796 size_t markOverflow : 1;
18797 size_t nextDelayedMarking : (8 * 4) - 8 - 1 - 1 - 1;
18798
18799 static void staticAsserts() {
18800
18801 typedef int moz_static_assert19[(FINALIZE_LIMIT <= 255) ? 1 : -1];
18802
18803
18804
18805
18806
18807 typedef int moz_static_assert20[(ArenaShift >= 8 + 1 + 1 + 1) ? 1 : -1];
18808 }
18809
18810 inline uintptr_t address() const;
18811 inline Chunk *chunk() const;
18812
18813 bool allocated() const {
18814 do { } while(0);
18815 return allocKind < size_t(FINALIZE_LIMIT);
18816 }
18817
18818 void init(JSCompartment *comp, AllocKind kind) {
18819 do { } while(0);
18820 do { } while(0);
18821 do { } while(0);
18822 do { } while(0);
18823 compartment = comp;
18824
18825 typedef int moz_static_assert21[(FINALIZE_LIMIT <= 255) ? 1 : -1];
18826 allocKind = size_t(kind);
18827
18828
18829 firstFreeSpanOffsets = FreeSpan::FullArenaOffsets;
18830 }
18831
18832 void setAsNotAllocated() {
18833 allocKind = size_t(FINALIZE_LIMIT);
18834 markOverflow = 0;
18835 allocatedDuringIncremental = 0;
18836 hasDelayedMarking = 0;
18837 nextDelayedMarking = 0;
18838 }
18839
18840 inline uintptr_t arenaAddress() const;
18841 inline Arena *getArena();
18842
18843 AllocKind getAllocKind() const {
18844 do { } while(0);
18845 return AllocKind(allocKind);
18846 }
18847
18848 inline size_t getThingSize() const;
18849
18850 bool hasFreeThings() const {
18851 return firstFreeSpanOffsets != FreeSpan::FullArenaOffsets;
18852 }
18853
18854 inline bool isEmpty() const;
18855
18856 void setAsFullyUsed() {
18857 firstFreeSpanOffsets = FreeSpan::FullArenaOffsets;
18858 }
18859
18860 inline FreeSpan getFirstFreeSpan() const;
18861 inline void setFirstFreeSpan(const FreeSpan *span);
18862
18863
18864
18865
18866
18867 inline ArenaHeader *getNextDelayedMarking() const;
18868 inline void setNextDelayedMarking(ArenaHeader *aheader);
18869 };
18870
18871 struct Arena
18872 {
18873 # 540 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Heap.h"
18874 ArenaHeader aheader;
18875 uint8_t data[ArenaSize - sizeof(ArenaHeader)];
18876
18877 private:
18878 static __attribute__((visibility("default"))) const uint32_t ThingSizes[];
18879 static __attribute__((visibility("default"))) const uint32_t FirstThingOffsets[];
18880
18881 public:
18882 static void staticAsserts();
18883
18884 static size_t thingSize(AllocKind kind) {
18885 return ThingSizes[kind];
18886 }
18887
18888 static size_t firstThingOffset(AllocKind kind) {
18889 return FirstThingOffsets[kind];
18890 }
18891
18892 static size_t thingsPerArena(size_t thingSize) {
18893 do { } while(0);
18894
18895
18896 do { } while(0);
18897
18898 return (ArenaSize - sizeof(ArenaHeader)) / thingSize;
18899 }
18900
18901 static size_t thingsSpan(size_t thingSize) {
18902 return thingsPerArena(thingSize) * thingSize;
18903 }
18904
18905 static bool isAligned(uintptr_t thing, size_t thingSize) {
18906
18907 uintptr_t tailOffset = (ArenaSize - thing) & ArenaMask;
18908 return tailOffset % thingSize == 0;
18909 }
18910
18911 uintptr_t address() const {
18912 return aheader.address();
18913 }
18914
18915 uintptr_t thingsStart(AllocKind thingKind) {
18916 return address() | firstThingOffset(thingKind);
18917 }
18918
18919 uintptr_t thingsEnd() {
18920 return address() + ArenaSize;
18921 }
18922
18923 template <typename T>
18924 bool finalize(FreeOp *fop, AllocKind thingKind, size_t thingSize);
18925 };
18926
18927 inline size_t
18928 ArenaHeader::getThingSize() const
18929 {
18930 do { } while(0);
18931 return Arena::thingSize(getAllocKind());
18932 }
18933
18934
18935 struct ChunkInfo
18936 {
18937 Chunk *next;
18938 Chunk **prevp;
18939
18940
18941 ArenaHeader *freeArenasHead;
18942
18943
18944
18945
18946
18947
18948 uint32_t lastDecommittedArenaOffset;
18949
18950
18951 uint32_t numArenasFree;
18952
18953
18954 uint32_t numArenasFreeCommitted;
18955
18956
18957 uint32_t age;
18958 };
18959 # 655 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Heap.h"
18960 const size_t BytesPerArenaWithHeader = ArenaSize + ArenaBitmapBytes;
18961 const size_t ChunkDecommitBitmapBytes = ChunkSize / ArenaSize / 8;
18962 const size_t ChunkBytesAvailable = ChunkSize - sizeof(ChunkInfo) - ChunkDecommitBitmapBytes;
18963 const size_t ArenasPerChunk = ChunkBytesAvailable / BytesPerArenaWithHeader;
18964
18965
18966 struct ChunkBitmap
18967 {
18968 uintptr_t bitmap[ArenaBitmapWords * ArenasPerChunk];
18969
18970 __attribute__((always_inline)) inline void getMarkWordAndMask(const Cell *cell, uint32_t color,
18971 uintptr_t **wordp, uintptr_t *maskp);
18972
18973 __attribute__((always_inline)) inline bool isMarked(const Cell *cell, uint32_t color) {
18974 uintptr_t *word, mask;
18975 getMarkWordAndMask(cell, color, &word, &mask);
18976 return *word & mask;
18977 }
18978
18979 __attribute__((always_inline)) inline bool markIfUnmarked(const Cell *cell, uint32_t color) {
18980 uintptr_t *word, mask;
18981 getMarkWordAndMask(cell, BLACK, &word, &mask);
18982 if (*word & mask)
18983 return false;
18984 *word |= mask;
18985 if (color != BLACK) {
18986
18987
18988
18989
18990 getMarkWordAndMask(cell, color, &word, &mask);
18991 if (*word & mask)
18992 return false;
18993 *word |= mask;
18994 }
18995 return true;
18996 }
18997
18998 __attribute__((always_inline)) inline void unmark(const Cell *cell, uint32_t color) {
18999 uintptr_t *word, mask;
19000 getMarkWordAndMask(cell, color, &word, &mask);
19001 *word &= ~mask;
19002 }
19003
19004 void clear() {
19005 PodArrayZero(bitmap);
19006 }
19007 # 721 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Heap.h"
19008 };
19009
19010 typedef int moz_static_assert22[(ArenaBitmapBytes * ArenasPerChunk == sizeof(ChunkBitmap)) ? 1 : -1];
19011
19012 typedef BitArray<ArenasPerChunk> PerArenaBitmap;
19013
19014 const size_t ChunkPadSize = ChunkSize
19015 - (sizeof(Arena) * ArenasPerChunk)
19016 - sizeof(ChunkBitmap)
19017 - sizeof(PerArenaBitmap)
19018 - sizeof(ChunkInfo);
19019 typedef int moz_static_assert23[(ChunkPadSize < BytesPerArenaWithHeader) ? 1 : -1];
19020
19021
19022
19023
19024
19025 struct Chunk
19026 {
19027 Arena arenas[ArenasPerChunk];
19028
19029
19030 uint8_t padding[ChunkPadSize];
19031
19032 ChunkBitmap bitmap;
19033 PerArenaBitmap decommittedArenas;
19034 ChunkInfo info;
19035
19036 static Chunk *fromAddress(uintptr_t addr) {
19037 addr &= ~ChunkMask;
19038 return reinterpret_cast<Chunk *>(addr);
19039 }
19040
19041 static bool withinArenasRange(uintptr_t addr) {
19042 uintptr_t offset = addr & ChunkMask;
19043 return offset < ArenasPerChunk * ArenaSize;
19044 }
19045
19046 static size_t arenaIndex(uintptr_t addr) {
19047 do { } while(0);
19048 return (addr & ChunkMask) >> ArenaShift;
19049 }
19050
19051 uintptr_t address() const {
19052 uintptr_t addr = reinterpret_cast<uintptr_t>(this);
19053 do { } while(0);
19054 return addr;
19055 }
19056
19057 bool unused() const {
19058 return info.numArenasFree == ArenasPerChunk;
19059 }
19060
19061 bool hasAvailableArenas() const {
19062 return info.numArenasFree != 0;
19063 }
19064
19065 inline void addToAvailableList(JSCompartment *compartment);
19066 inline void insertToAvailableList(Chunk **insertPoint);
19067 inline void removeFromAvailableList();
19068
19069 ArenaHeader *allocateArena(JSCompartment *comp, AllocKind kind);
19070
19071 void releaseArena(ArenaHeader *aheader);
19072
19073 static Chunk *allocate(JSRuntime *rt);
19074
19075
19076 static inline void release(JSRuntime *rt, Chunk *chunk);
19077 static inline void releaseList(JSRuntime *rt, Chunk *chunkListHead);
19078
19079
19080 inline void prepareToBeFreed(JSRuntime *rt);
19081
19082
19083
19084
19085
19086 Chunk *getPrevious() {
19087 do { } while(0);
19088 return fromPointerToNext(info.prevp);
19089 }
19090
19091
19092 static Chunk *fromPointerToNext(Chunk **nextFieldPtr) {
19093 uintptr_t addr = reinterpret_cast<uintptr_t>(nextFieldPtr);
19094 do { } while(0);
19095 return reinterpret_cast<Chunk *>(addr - __builtin_offsetof (Chunk, info.next));
19096 }
19097
19098 private:
19099 inline void init();
19100
19101
19102 unsigned findDecommittedArenaOffset();
19103 ArenaHeader* fetchNextDecommittedArena();
19104
19105 public:
19106
19107 inline ArenaHeader* fetchNextFreeArena(JSRuntime *rt);
19108
19109 inline void addArenaToFreeList(JSRuntime *rt, ArenaHeader *aheader);
19110 };
19111
19112 typedef int moz_static_assert24[(sizeof(Chunk) == ChunkSize) ? 1 : -1];
19113
19114 inline uintptr_t
19115 Cell::address() const
19116 {
19117 uintptr_t addr = uintptr_t(this);
19118 do { } while(0);
19119 do { } while(0);
19120 return addr;
19121 }
19122
19123 inline uintptr_t
19124 ArenaHeader::address() const
19125 {
19126 uintptr_t addr = reinterpret_cast<uintptr_t>(this);
19127 do { } while(0);
19128 do { } while(0);
19129 return addr;
19130 }
19131
19132 inline Chunk *
19133 ArenaHeader::chunk() const
19134 {
19135 return Chunk::fromAddress(address());
19136 }
19137
19138 inline uintptr_t
19139 ArenaHeader::arenaAddress() const
19140 {
19141 return address();
19142 }
19143
19144 inline Arena *
19145 ArenaHeader::getArena()
19146 {
19147 return reinterpret_cast<Arena *>(arenaAddress());
19148 }
19149
19150 inline bool
19151 ArenaHeader::isEmpty() const
19152 {
19153
19154 do { } while(0);
19155 size_t firstThingOffset = Arena::firstThingOffset(getAllocKind());
19156 return firstFreeSpanOffsets == FreeSpan::encodeOffsets(firstThingOffset, ArenaMask);
19157 }
19158
19159 FreeSpan
19160 ArenaHeader::getFirstFreeSpan() const
19161 {
19162
19163
19164
19165 return FreeSpan::decodeOffsets(arenaAddress(), firstFreeSpanOffsets);
19166 }
19167
19168 void
19169 ArenaHeader::setFirstFreeSpan(const FreeSpan *span)
19170 {
19171 do { } while(0);
19172 firstFreeSpanOffsets = span->encodeAsOffsets();
19173 }
19174
19175 inline ArenaHeader *
19176 ArenaHeader::getNextDelayedMarking() const
19177 {
19178 return &reinterpret_cast<Arena *>(nextDelayedMarking << ArenaShift)->aheader;
19179 }
19180
19181 inline void
19182 ArenaHeader::setNextDelayedMarking(ArenaHeader *aheader)
19183 {
19184 do { } while(0);
19185 hasDelayedMarking = 1;
19186 nextDelayedMarking = aheader->arenaAddress() >> ArenaShift;
19187 }
19188
19189 __attribute__((always_inline)) inline void
19190 ChunkBitmap::getMarkWordAndMask(const Cell *cell, uint32_t color,
19191 uintptr_t **wordp, uintptr_t *maskp)
19192 {
19193 size_t bit = (cell->address() & ChunkMask) / Cell::CellSize + color;
19194 do { } while(0);
19195 *maskp = uintptr_t(1) << (bit % (8 * 4));
19196 *wordp = &bitmap[bit / (8 * 4)];
19197 }
19198
19199 static void
19200 AssertValidColor(const void *thing, uint32_t color)
19201 {
19202
19203
19204
19205
19206 }
19207
19208 inline ArenaHeader *
19209 Cell::arenaHeader() const
19210 {
19211 uintptr_t addr = address();
19212 addr &= ~ArenaMask;
19213 return reinterpret_cast<ArenaHeader *>(addr);
19214 }
19215
19216 Chunk *
19217 Cell::chunk() const
19218 {
19219 uintptr_t addr = uintptr_t(this);
19220 do { } while(0);
19221 addr &= ~(ChunkSize - 1);
19222 return reinterpret_cast<Chunk *>(addr);
19223 }
19224
19225 AllocKind
19226 Cell::getAllocKind() const
19227 {
19228 return arenaHeader()->getAllocKind();
19229 }
19230
19231 bool
19232 Cell::isMarked(uint32_t color ) const
19233 {
19234 AssertValidColor(this, color);
19235 return chunk()->bitmap.isMarked(this, color);
19236 }
19237
19238 bool
19239 Cell::markIfUnmarked(uint32_t color ) const
19240 {
19241 AssertValidColor(this, color);
19242 return chunk()->bitmap.markIfUnmarked(this, color);
19243 }
19244
19245 void
19246 Cell::unmark(uint32_t color) const
19247 {
19248 do { } while(0);
19249 AssertValidColor(this, color);
19250 chunk()->bitmap.unmark(this, color);
19251 }
19252
19253 JSCompartment *
19254 Cell::compartment() const
19255 {
19256 return arenaHeader()->compartment;
19257 }
19258 # 980 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Heap.h"
19259 }
19260
19261 }
19262 # 14 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Barrier.h" 2
19263 # 117 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Barrier.h"
19264 struct JSXML;
19265
19266 namespace js {
19267
19268 template<class T, typename Unioned = uintptr_t>
19269 class EncapsulatedPtr
19270 {
19271 protected:
19272 union {
19273 T *value;
19274 Unioned other;
19275 };
19276
19277 public:
19278 EncapsulatedPtr() : value(__null) {}
19279 explicit EncapsulatedPtr(T *v) : value(v) {}
19280 explicit EncapsulatedPtr(const EncapsulatedPtr<T> &v) : value(v.value) {}
19281
19282 ~EncapsulatedPtr() { pre(); }
19283
19284
19285 void clear() {
19286 pre();
19287 value = __null;
19288 }
19289
19290 EncapsulatedPtr<T, Unioned> &operator=(T *v) {
19291 pre();
19292 do { } while(0);
19293 value = v;
19294 return *this;
19295 }
19296
19297 EncapsulatedPtr<T, Unioned> &operator=(const EncapsulatedPtr<T> &v) {
19298 pre();
19299 do { } while(0);
19300 value = v.value;
19301 return *this;
19302 }
19303
19304
19305 T *get() const { return value; }
19306
19307
19308
19309
19310
19311 T **unsafeGet() { return &value; }
19312 void unsafeSet(T *v) { value = v; }
19313
19314 Unioned *unsafeGetUnioned() { return &other; }
19315
19316 T &operator*() const { return *value; }
19317 T *operator->() const { return value; }
19318
19319 operator T*() const { return value; }
19320
19321 protected:
19322 void pre() { T::writeBarrierPre(value); }
19323 };
19324
19325 template <class T, class Unioned = uintptr_t>
19326 class HeapPtr : public EncapsulatedPtr<T, Unioned>
19327 {
19328 public:
19329 HeapPtr() : EncapsulatedPtr<T>(__null) {}
19330 explicit HeapPtr(T *v) : EncapsulatedPtr<T>(v) { post(); }
19331 explicit HeapPtr(const HeapPtr<T> &v)
19332 : EncapsulatedPtr<T>(v) { post(); }
19333
19334 void init(T *v) {
19335 do { } while(0);
19336 this->value = v;
19337 post();
19338 }
19339
19340 HeapPtr<T, Unioned> &operator=(T *v) {
19341 this->pre();
19342 do { } while(0);
19343 this->value = v;
19344 post();
19345 return *this;
19346 }
19347
19348 HeapPtr<T, Unioned> &operator=(const HeapPtr<T> &v) {
19349 this->pre();
19350 do { } while(0);
19351 this->value = v.value;
19352 post();
19353 return *this;
19354 }
19355
19356 protected:
19357 void post() { T::writeBarrierPost(this->value, (void *)&this->value); }
19358
19359
19360 template<class T1, class T2>
19361 friend inline void
19362 BarrieredSetPair(JSCompartment *comp,
19363 HeapPtr<T1> &v1, T1 *val1,
19364 HeapPtr<T2> &v2, T2 *val2);
19365 };
19366
19367 template <class T>
19368 class RelocatablePtr : public EncapsulatedPtr<T>
19369 {
19370 public:
19371 RelocatablePtr() : EncapsulatedPtr<T>(__null) {}
19372 explicit RelocatablePtr(T *v) : EncapsulatedPtr<T>(v) { post(); }
19373 explicit RelocatablePtr(const RelocatablePtr<T> &v)
19374 : EncapsulatedPtr<T>(v) { post(); }
19375
19376 ~RelocatablePtr() {
19377 this->pre();
19378 relocate();
19379 }
19380
19381 RelocatablePtr<T> &operator=(T *v) {
19382 this->pre();
19383 do { } while(0);
19384 this->value = v;
19385 post();
19386 return *this;
19387 }
19388
19389 RelocatablePtr<T> &operator=(const RelocatablePtr<T> &v) {
19390 this->pre();
19391 do { } while(0);
19392 this->value = v.value;
19393 post();
19394 return *this;
19395 }
19396
19397 protected:
19398 void post() { T::writeBarrierRelocPost(this->value, (void *)&this->value); }
19399 void relocate() { T::writeBarrierRelocated(this->value, (void *)&this->value); }
19400 };
19401
19402
19403
19404
19405
19406 template<class T1, class T2>
19407 static inline void
19408 BarrieredSetPair(JSCompartment *comp,
19409 HeapPtr<T1> &v1, T1 *val1,
19410 HeapPtr<T2> &v2, T2 *val2)
19411 {
19412 if (T1::needWriteBarrierPre(comp)) {
19413 v1.pre();
19414 v2.pre();
19415 }
19416 v1.unsafeSet(val1);
19417 v2.unsafeSet(val2);
19418 v1.post();
19419 v2.post();
19420 }
19421
19422 struct Shape;
19423 class BaseShape;
19424 namespace types { struct TypeObject; }
19425
19426 typedef RelocatablePtr<JSObject> RelocatablePtrObject;
19427 typedef RelocatablePtr<JSScript> RelocatablePtrScript;
19428
19429 typedef HeapPtr<JSObject> HeapPtrObject;
19430 typedef HeapPtr<JSFunction> HeapPtrFunction;
19431 typedef HeapPtr<JSString> HeapPtrString;
19432 typedef HeapPtr<JSScript> HeapPtrScript;
19433 typedef HeapPtr<Shape> HeapPtrShape;
19434 typedef HeapPtr<BaseShape> HeapPtrBaseShape;
19435 typedef HeapPtr<types::TypeObject> HeapPtrTypeObject;
19436 typedef HeapPtr<JSXML> HeapPtrXML;
19437
19438
19439 template<class T>
19440 struct HeapPtrHasher
19441 {
19442 typedef HeapPtr<T> Key;
19443 typedef T *Lookup;
19444
19445 static HashNumber hash(Lookup obj) { return DefaultHasher<T *>::hash(obj); }
19446 static bool match(const Key &k, Lookup l) { return k.get() == l; }
19447 };
19448
19449
19450 template <class T>
19451 struct DefaultHasher< HeapPtr<T> > : HeapPtrHasher<T> { };
19452
19453 class EncapsulatedValue
19454 {
19455 protected:
19456 Value value;
19457
19458
19459
19460
19461
19462 EncapsulatedValue() ;
19463 EncapsulatedValue(const EncapsulatedValue &v) ;
19464 EncapsulatedValue &operator=(const Value &v) ;
19465 EncapsulatedValue &operator=(const EncapsulatedValue &v) ;
19466
19467 EncapsulatedValue(const Value &v) : value(v) {}
19468 ~EncapsulatedValue() {}
19469
19470 public:
19471 inline bool operator==(const EncapsulatedValue &v) const { return value == v.value; }
19472 inline bool operator!=(const EncapsulatedValue &v) const { return value != v.value; }
19473
19474 const Value &get() const { return value; }
19475 Value *unsafeGet() { return &value; }
19476 operator const Value &() const { return value; }
19477
19478 bool isUndefined() const { return value.isUndefined(); }
19479 bool isNull() const { return value.isNull(); }
19480 bool isBoolean() const { return value.isBoolean(); }
19481 bool isTrue() const { return value.isTrue(); }
19482 bool isFalse() const { return value.isFalse(); }
19483 bool isNumber() const { return value.isNumber(); }
19484 bool isInt32() const { return value.isInt32(); }
19485 bool isDouble() const { return value.isDouble(); }
19486 bool isString() const { return value.isString(); }
19487 bool isObject() const { return value.isObject(); }
19488 bool isMagic(JSWhyMagic why) const { return value.isMagic(why); }
19489 bool isGCThing() const { return value.isGCThing(); }
19490 bool isMarkable() const { return value.isMarkable(); }
19491
19492 bool toBoolean() const { return value.toBoolean(); }
19493 double toNumber() const { return value.toNumber(); }
19494 int32_t toInt32() const { return value.toInt32(); }
19495 double toDouble() const { return value.toDouble(); }
19496 JSString *toString() const { return value.toString(); }
19497 JSObject &toObject() const { return value.toObject(); }
19498 JSObject *toObjectOrNull() const { return value.toObjectOrNull(); }
19499 void *toGCThing() const { return value.toGCThing(); }
19500
19501 JSGCTraceKind gcKind() const { return value.gcKind(); }
19502
19503 uint64_t asRawBits() const { return value.asRawBits(); }
19504
19505
19506
19507
19508
19509 static inline void writeBarrierPre(const Value &v);
19510 static inline void writeBarrierPre(JSCompartment *comp, const Value &v);
19511
19512 protected:
19513 inline void pre();
19514 inline void pre(JSCompartment *comp);
19515 };
19516
19517 class HeapValue : public EncapsulatedValue
19518 {
19519 public:
19520 explicit inline HeapValue();
19521 explicit inline HeapValue(const Value &v);
19522 explicit inline HeapValue(const HeapValue &v);
19523 inline ~HeapValue();
19524
19525 inline void init(const Value &v);
19526 inline void init(JSCompartment *comp, const Value &v);
19527
19528 inline HeapValue &operator=(const Value &v);
19529 inline HeapValue &operator=(const HeapValue &v);
19530
19531
19532
19533
19534
19535
19536
19537 inline void set(JSCompartment *comp, const Value &v);
19538
19539 static inline void writeBarrierPost(const Value &v, Value *addr);
19540 static inline void writeBarrierPost(JSCompartment *comp, const Value &v, Value *addr);
19541
19542 private:
19543 inline void post();
19544 inline void post(JSCompartment *comp);
19545 };
19546
19547 class RelocatableValue : public EncapsulatedValue
19548 {
19549 public:
19550 explicit inline RelocatableValue();
19551 explicit inline RelocatableValue(const Value &v);
19552 explicit inline RelocatableValue(const RelocatableValue &v);
19553 inline ~RelocatableValue();
19554
19555 inline RelocatableValue &operator=(const Value &v);
19556 inline RelocatableValue &operator=(const RelocatableValue &v);
19557
19558 private:
19559 inline void post();
19560 inline void post(JSCompartment *comp);
19561 inline void relocate();
19562 };
19563
19564 class HeapSlot : public EncapsulatedValue
19565 {
19566
19567
19568
19569
19570 inline HeapSlot &operator=(const Value &v) ;
19571 inline HeapSlot &operator=(const HeapValue &v) ;
19572 inline HeapSlot &operator=(const HeapSlot &v) ;
19573
19574 public:
19575 explicit inline HeapSlot() ;
19576 explicit inline HeapSlot(JSObject *obj, uint32_t slot, const Value &v);
19577 explicit inline HeapSlot(JSObject *obj, uint32_t slot, const HeapSlot &v);
19578 inline ~HeapSlot();
19579
19580 inline void init(JSObject *owner, uint32_t slot, const Value &v);
19581 inline void init(JSCompartment *comp, JSObject *owner, uint32_t slot, const Value &v);
19582
19583 inline void set(JSObject *owner, uint32_t slot, const Value &v);
19584 inline void set(JSCompartment *comp, JSObject *owner, uint32_t slot, const Value &v);
19585
19586 static inline void writeBarrierPost(JSObject *obj, uint32_t slot);
19587 static inline void writeBarrierPost(JSCompartment *comp, JSObject *obj, uint32_t slotno);
19588
19589 private:
19590 inline void post(JSObject *owner, uint32_t slot);
19591 inline void post(JSCompartment *comp, JSObject *owner, uint32_t slot);
19592 };
19593
19594
19595
19596
19597
19598
19599
19600 inline void
19601 SlotRangeWriteBarrierPost(JSCompartment *comp, JSObject *obj, uint32_t start, uint32_t count)
19602 {
19603 }
19604
19605 static inline const Value *
19606 Valueify(const EncapsulatedValue *array)
19607 {
19608 typedef int moz_static_assert25[(sizeof(HeapValue) == sizeof(Value)) ? 1 : -1];
19609 typedef int moz_static_assert26[(sizeof(HeapSlot) == sizeof(Value)) ? 1 : -1];
19610 return (const Value *)array;
19611 }
19612
19613 class HeapSlotArray
19614 {
19615 HeapSlot *array;
19616
19617 public:
19618 HeapSlotArray(HeapSlot *array) : array(array) {}
19619
19620 operator const Value *() const { return Valueify(array); }
19621 operator HeapSlot *() const { return array; }
19622
19623 HeapSlotArray operator +(int offset) const { return HeapSlotArray(array + offset); }
19624 HeapSlotArray operator +(uint32_t offset) const { return HeapSlotArray(array + offset); }
19625 };
19626
19627 class EncapsulatedId
19628 {
19629 protected:
19630 jsid value;
19631
19632 explicit EncapsulatedId() : value(((jsid)0x2)) {}
19633 explicit inline EncapsulatedId(jsid id) : value(id) {}
19634 ~EncapsulatedId() {}
19635
19636 private:
19637 EncapsulatedId(const EncapsulatedId &v) ;
19638 EncapsulatedId &operator=(const EncapsulatedId &v) ;
19639
19640 public:
19641 bool operator==(jsid id) const { return value == id; }
19642 bool operator!=(jsid id) const { return value != id; }
19643
19644 jsid get() const { return value; }
19645 jsid *unsafeGet() { return &value; }
19646 operator jsid() const { return value; }
19647
19648 protected:
19649 inline void pre();
19650 };
19651
19652 class RelocatableId : public EncapsulatedId
19653 {
19654 public:
19655 explicit RelocatableId() : EncapsulatedId() {}
19656 explicit inline RelocatableId(jsid id) : EncapsulatedId(id) {}
19657 inline ~RelocatableId();
19658
19659 inline RelocatableId &operator=(jsid id);
19660 inline RelocatableId &operator=(const RelocatableId &v);
19661 };
19662
19663 class HeapId : public EncapsulatedId
19664 {
19665 public:
19666 explicit HeapId() : EncapsulatedId() {}
19667 explicit inline HeapId(jsid id);
19668 inline ~HeapId();
19669
19670 inline void init(jsid id);
19671
19672 inline HeapId &operator=(jsid id);
19673 inline HeapId &operator=(const HeapId &v);
19674
19675 private:
19676 inline void post();
19677
19678 HeapId(const HeapId &v) ;
19679 };
19680 # 544 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Barrier.h"
19681 template<class T>
19682 class ReadBarriered
19683 {
19684 T *value;
19685
19686 public:
19687 ReadBarriered() : value(__null) {}
19688 ReadBarriered(T *value) : value(value) {}
19689
19690 T *get() const {
19691 if (!value)
19692 return __null;
19693 T::readBarrier(value);
19694 return value;
19695 }
19696
19697 operator T*() const { return get(); }
19698
19699 T &operator*() const { return *get(); }
19700 T *operator->() const { return get(); }
19701
19702 T **unsafeGet() { return &value; }
19703
19704 void set(T *v) { value = v; }
19705
19706 operator bool() { return !!value; }
19707 };
19708
19709 class ReadBarrieredValue
19710 {
19711 Value value;
19712
19713 public:
19714 ReadBarrieredValue() : value(UndefinedValue()) {}
19715 ReadBarrieredValue(const Value &value) : value(value) {}
19716
19717 inline const Value &get() const;
19718 Value *unsafeGet() { return &value; }
19719 inline operator const Value &() const;
19720
19721 inline JSObject &toObject() const;
19722 };
19723
19724 namespace tl {
19725
19726 template <class T> struct IsRelocatableHeapType<HeapPtr<T> >
19727 { static const bool result = false; };
19728 template <> struct IsRelocatableHeapType<HeapSlot> { static const bool result = false; };
19729 template <> struct IsRelocatableHeapType<HeapValue> { static const bool result = false; };
19730 template <> struct IsRelocatableHeapType<HeapId> { static const bool result = false; };
19731
19732 }
19733 }
19734 # 20 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsatom.h" 2
19735
19736
19737 struct JSIdArray {
19738 int length;
19739 js::HeapId vector[1];
19740 };
19741
19742
19743
19744 static __attribute__((always_inline)) inline jsid
19745 JSID_FROM_BITS(size_t bits)
19746 {
19747 jsid id;
19748 (id) = bits;
19749 return id;
19750 }
19751 # 58 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsatom.h"
19752 static __attribute__((always_inline)) inline jsid
19753 NON_INTEGER_ATOM_TO_JSID(JSAtom *atom)
19754 {
19755 do { } while(0);
19756 jsid id = JSID_FROM_BITS((size_t)atom);
19757 do { } while(0);
19758 return id;
19759 }
19760
19761
19762 static __attribute__((always_inline)) inline JSBool
19763 JSID_IS_ATOM(jsid id)
19764 {
19765 return JSID_IS_STRING(id);
19766 }
19767
19768 static __attribute__((always_inline)) inline JSBool
19769 JSID_IS_ATOM(jsid id, JSAtom *atom)
19770 {
19771 return id == JSID_FROM_BITS((size_t)atom);
19772 }
19773
19774 static __attribute__((always_inline)) inline JSAtom *
19775 JSID_TO_ATOM(jsid id)
19776 {
19777 return (JSAtom *)JSID_TO_STRING(id);
19778 }
19779
19780 typedef int moz_static_assert27[(sizeof(JSHashNumber) == 4) ? 1 : -1];
19781 typedef int moz_static_assert28[(sizeof(jsid) == 4) ? 1 : -1];
19782
19783 namespace js {
19784
19785 static __attribute__((always_inline)) inline JSHashNumber
19786 HashId(jsid id)
19787 {
19788 JSHashNumber n =
19789
19790 JSHashNumber((id));
19791
19792
19793
19794
19795
19796 return n * 0x9E3779B9U;
19797 }
19798
19799 static __attribute__((always_inline)) inline Value
19800 IdToValue(jsid id)
19801 {
19802 if (JSID_IS_STRING(id))
19803 return StringValue(JSID_TO_STRING(id));
19804 if ((__builtin_expect((JSID_IS_INT(id)), 1)))
19805 return Int32Value(JSID_TO_INT(id));
19806 if ((__builtin_expect((JSID_IS_OBJECT(id)), 1)))
19807 return ObjectValue(*JSID_TO_OBJECT(id));
19808 do { } while(0);
19809 return UndefinedValue();
19810 }
19811
19812 static __attribute__((always_inline)) inline jsval
19813 IdToJsval(jsid id)
19814 {
19815 return IdToValue(id);
19816 }
19817
19818 template<>
19819 struct DefaultHasher<jsid>
19820 {
19821 typedef jsid Lookup;
19822 static HashNumber hash(const Lookup &l) {
19823 return HashNumber((l));
19824 }
19825 static bool match(const jsid &id, const Lookup &l) {
19826 return id == l;
19827 }
19828 };
19829
19830 }
19831
19832
19833 #define ATOM_HASH(atom) ((JSHashNumber)(atom) >> 2)
19834 # 151 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsatom.h"
19835 extern const char *
19836 js_AtomToPrintableString(JSContext *cx, JSAtom *atom, JSAutoByteString *bytes);
19837
19838 namespace js {
19839
19840
19841 inline uint32_t
19842 HashChars(const jschar *chars, size_t length)
19843 {
19844 uint32_t h = 0;
19845 for (; length; chars++, length--)
19846 h = (((h) << (4)) | ((h) >> (32 - (4)))) ^ *chars;
19847 return h;
19848 }
19849
19850 class AtomStateEntry
19851 {
19852 uintptr_t bits;
19853
19854 static const uintptr_t NO_TAG_MASK = uintptr_t(-1) - 1;
19855
19856 public:
19857 AtomStateEntry() : bits(0) {}
19858 AtomStateEntry(const AtomStateEntry &other) : bits(other.bits) {}
19859 AtomStateEntry(JSAtom *ptr, bool tagged)
19860 : bits(uintptr_t(ptr) | uintptr_t(tagged))
19861 {
19862 do { } while(0);
19863 }
19864
19865 bool isTagged() const {
19866 return bits & 0x1;
19867 }
19868
19869
19870
19871
19872
19873 void setTagged(bool enabled) const {
19874 const_cast<AtomStateEntry *>(this)->bits |= uintptr_t(enabled);
19875 }
19876
19877 JSAtom *asPtr() const;
19878 };
19879
19880 struct AtomHasher
19881 {
19882 struct Lookup
19883 {
19884 const jschar *chars;
19885 size_t length;
19886 const JSAtom *atom;
19887
19888 Lookup(const jschar *chars, size_t length) : chars(chars), length(length), atom(__null) {}
19889 inline Lookup(const JSAtom *atom);
19890 };
19891
19892 static HashNumber hash(const Lookup &l) { return HashChars(l.chars, l.length); }
19893 static inline bool match(const AtomStateEntry &entry, const Lookup &lookup);
19894 };
19895
19896 typedef HashSet<AtomStateEntry, AtomHasher, SystemAllocPolicy> AtomSet;
19897 # 231 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsatom.h"
19898 enum FlationCoding
19899 {
19900 NormalEncoding,
19901 CESU8Encoding
19902 };
19903
19904 class PropertyName;
19905
19906 }
19907
19908 struct JSAtomState
19909 {
19910 js::AtomSet atoms;
19911 # 256 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsatom.h"
19912 js::PropertyName *emptyAtom;
19913
19914
19915
19916
19917
19918 js::PropertyName *booleanAtoms[2];
19919 js::PropertyName *typeAtoms[JSTYPE_LIMIT];
19920 js::PropertyName *nullAtom;
19921
19922
19923 js::PropertyName *classAtoms[JSProto_LIMIT];
19924
19925
19926 #define DEFINE_ATOM(id,text) js::PropertyName *id ##Atom;
19927 #define DEFINE_PROTOTYPE_ATOM(id) js::PropertyName *id ##Atom;
19928 #define DEFINE_KEYWORD_ATOM(id) js::PropertyName *id ##Atom;
19929 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsatom.tbl" 1
19930 # 37 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsatom.tbl"
19931 js::PropertyName *anonymousAtom;
19932 js::PropertyName *applyAtom;
19933 js::PropertyName *argumentsAtom;
19934 js::PropertyName *arityAtom;
19935 js::PropertyName *BYTES_PER_ELEMENTAtom;
19936 js::PropertyName *callAtom;
19937 js::PropertyName *calleeAtom;
19938 js::PropertyName *callerAtom;
19939 js::PropertyName *classPrototypeAtom;
19940 js::PropertyName *constructorAtom;
19941 js::PropertyName *eachAtom;
19942 js::PropertyName *evalAtom;
19943 js::PropertyName *fileNameAtom;
19944 js::PropertyName *getAtom;
19945 js::PropertyName *globalAtom;
19946 js::PropertyName *ignoreCaseAtom;
19947 js::PropertyName *indexAtom;
19948 js::PropertyName *inputAtom;
19949 js::PropertyName *toISOStringAtom;
19950 js::PropertyName *iteratorAtom;
19951 js::PropertyName *joinAtom;
19952 js::PropertyName *lastIndexAtom;
19953 js::PropertyName *lengthAtom;
19954 js::PropertyName *lineNumberAtom;
19955 js::PropertyName *messageAtom;
19956 js::PropertyName *multilineAtom;
19957 js::PropertyName *nameAtom;
19958 js::PropertyName *nextAtom;
19959 js::PropertyName *noSuchMethodAtom;
19960 js::PropertyName *objectNullAtom;
19961 js::PropertyName *objectUndefinedAtom;
19962 js::PropertyName *ofAtom;
19963 js::PropertyName *protoAtom;
19964 js::PropertyName *setAtom;
19965 js::PropertyName *sourceAtom;
19966 js::PropertyName *stackAtom;
19967 js::PropertyName *stickyAtom;
19968 js::PropertyName *toGMTStringAtom;
19969 js::PropertyName *toLocaleStringAtom;
19970 js::PropertyName *toSourceAtom;
19971 js::PropertyName *toStringAtom;
19972 js::PropertyName *toUTCStringAtom;
19973 js::PropertyName *valueOfAtom;
19974 js::PropertyName *toJSONAtom;
19975 js::PropertyName *void0Atom;
19976 js::PropertyName *enumerableAtom;
19977 js::PropertyName *configurableAtom;
19978 js::PropertyName *writableAtom;
19979 js::PropertyName *valueAtom;
19980 js::PropertyName *testAtom;
19981 js::PropertyName *useStrictAtom;
19982 js::PropertyName *locAtom;
19983 js::PropertyName *lineAtom;
19984 js::PropertyName *InfinityAtom;
19985 js::PropertyName *NaNAtom;
19986 js::PropertyName *builderAtom;
19987
19988
19989 js::PropertyName *etagoAtom;
19990 js::PropertyName *namespaceAtom;
19991 js::PropertyName *ptagcAtom;
19992 js::PropertyName *qualifierAtom;
19993 js::PropertyName *spaceAtom;
19994 js::PropertyName *stagoAtom;
19995 js::PropertyName *starAtom;
19996 js::PropertyName *starQualifierAtom;
19997 js::PropertyName *tagcAtom;
19998 js::PropertyName *xmlAtom;
19999 js::PropertyName *functionNamespaceURIAtom;
20000
20001
20002 js::PropertyName *ProxyAtom;
20003 js::PropertyName *getOwnPropertyDescriptorAtom;
20004 js::PropertyName *getPropertyDescriptorAtom;
20005 js::PropertyName *definePropertyAtom;
20006 js::PropertyName *deleteAtom;
20007 js::PropertyName *getOwnPropertyNamesAtom;
20008 js::PropertyName *enumerateAtom;
20009 js::PropertyName *fixAtom;
20010 js::PropertyName *hasAtom;
20011 js::PropertyName *hasOwnAtom;
20012 js::PropertyName *keysAtom;
20013 js::PropertyName *iterateAtom;
20014 js::PropertyName *WeakMapAtom;
20015 js::PropertyName *byteLengthAtom;
20016 js::PropertyName *returnAtom;
20017 js::PropertyName *throwAtom;
20018 js::PropertyName *urlAtom;
20019 js::PropertyName *innermostAtom;
20020
20021 js::PropertyName *XMLListAtom;
20022 js::PropertyName *decodeURIAtom;
20023 js::PropertyName *decodeURIComponentAtom;
20024 js::PropertyName *defineGetterAtom;
20025 js::PropertyName *defineSetterAtom;
20026 js::PropertyName *encodeURIAtom;
20027 js::PropertyName *encodeURIComponentAtom;
20028 js::PropertyName *escapeAtom;
20029 js::PropertyName *hasOwnPropertyAtom;
20030 js::PropertyName *isFiniteAtom;
20031 js::PropertyName *isNaNAtom;
20032 js::PropertyName *isPrototypeOfAtom;
20033 js::PropertyName *isXMLNameAtom;
20034 js::PropertyName *lookupGetterAtom;
20035 js::PropertyName *lookupSetterAtom;
20036 js::PropertyName *parseFloatAtom;
20037 js::PropertyName *parseIntAtom;
20038 js::PropertyName *propertyIsEnumerableAtom;
20039 js::PropertyName *unescapeAtom;
20040 js::PropertyName *unevalAtom;
20041 js::PropertyName *unwatchAtom;
20042 js::PropertyName *watchAtom;
20043 # 274 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsatom.h" 2
20044 #undef DEFINE_ATOM
20045 #undef DEFINE_PROTOTYPE_ATOM
20046 #undef DEFINE_KEYWORD_ATOM
20047
20048 static const size_t commonAtomsOffset;
20049
20050 void junkAtoms() {
20051
20052
20053
20054 }
20055
20056 JSAtom **commonAtomsStart() {
20057 return reinterpret_cast<JSAtom **>(&emptyAtom);
20058 }
20059
20060 void checkStaticInvariants();
20061 };
20062
20063 extern bool
20064 AtomIsInterned(JSContext *cx, JSAtom *atom);
20065
20066 #define ATOM(name) cx->runtime->atomState.name ##Atom
20067
20068 #define COMMON_ATOM_INDEX(name) ((offsetof(JSAtomState, name ##Atom) - JSAtomState::commonAtomsOffset) / sizeof(JSAtom*))
20069
20070
20071 #define COMMON_TYPE_ATOM_INDEX(type) ((offsetof(JSAtomState, typeAtoms[type]) - JSAtomState::commonAtomsOffset) / sizeof(JSAtom*))
20072
20073
20074
20075 #define NAME_OFFSET(name) offsetof(JSAtomState, name ##Atom)
20076 #define OFFSET_TO_NAME(rt,off) (*(js::PropertyName **)((char*)&(rt)->atomState + (off)))
20077 #define CLASS_NAME_OFFSET(name) offsetof(JSAtomState, classAtoms[JSProto_ ##name])
20078 #define CLASS_NAME(cx,name) ((cx)->runtime->atomState.classAtoms[JSProto_ ##name])
20079
20080 extern const char *const js_common_atom_names[];
20081 extern const size_t js_common_atom_count;
20082
20083
20084
20085
20086 #define JS_BOOLEAN_STR(type) (js_common_atom_names[1 + (type)])
20087 #define JS_TYPE_STR(type) (js_common_atom_names[1 + 2 + (type)])
20088
20089
20090 extern const char js_object_str[];
20091 extern const char js_undefined_str[];
20092
20093
20094 #define JS_PROTO(name,code,init) extern const char js_ ##name ##_str[];
20095 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsproto.tbl" 1
20096
20097
20098
20099
20100
20101
20102
20103 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsversion.h" 1
20104 # 42 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsversion.h"
20105 #define JS_VERSION_ECMA_3 148
20106 #define JS_VERSION_ECMA_3_TEST 149
20107 # 124 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsversion.h"
20108 #define JS_HAS_STR_HTML_HELPERS 1
20109 #define JS_HAS_OBJ_PROTO_PROP 1
20110 #define JS_HAS_OBJ_WATCHPOINT 1
20111 #define JS_HAS_TOSOURCE 1
20112 #define JS_HAS_CATCH_GUARD 1
20113 #define JS_HAS_UNEVAL 1
20114 #define JS_HAS_CONST 1
20115 #define JS_HAS_FUN_EXPR_STMT 1
20116 #define JS_HAS_NO_SUCH_METHOD 1
20117 #define JS_HAS_GENERATORS 1
20118 #define JS_HAS_BLOCK_SCOPE 1
20119 #define JS_HAS_DESTRUCTURING 2
20120 #define JS_HAS_GENERATOR_EXPRS 1
20121 #define JS_HAS_EXPR_CLOSURES 1
20122 # 146 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsversion.h"
20123 #define JS_HAS_NEW_GLOBAL_OBJECT 1
20124
20125
20126 #define JS_HAS_MAKE_SYSTEM_OBJECT 1
20127
20128
20129 #define JS_HAS_DESTRUCTURING_SHORTHAND (JS_HAS_DESTRUCTURING == 2)
20130
20131
20132
20133
20134
20135 #define OLD_GETTER_SETTER_METHODS 1
20136
20137
20138 #define USE_NEW_OBJECT_REPRESENTATION 0
20139
20140
20141
20142
20143 #define NEW_OBJECT_REPRESENTATION_ONLY() MOZ_NOT_REACHED("don't call this! to be used in the new object representation")
20144 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsproto.tbl" 2
20145
20146
20147 #define XML_INIT js_InitXMLClass
20148 #define NAMESPACE_INIT js_InitNamespaceClass
20149 #define QNAME_INIT js_InitQNameClass
20150 #define XMLFILTER_INIT js_InitXMLFilterClass
20151 # 27 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsproto.tbl"
20152 extern const char js_Null_str[];
20153 extern const char js_Object_str[];
20154 extern const char js_Function_str[];
20155 extern const char js_Array_str[];
20156 extern const char js_Boolean_str[];
20157 extern const char js_JSON_str[];
20158 extern const char js_Date_str[];
20159 extern const char js_Math_str[];
20160 extern const char js_Number_str[];
20161 extern const char js_String_str[];
20162 extern const char js_RegExp_str[];
20163 extern const char js_XML_str[];
20164 extern const char js_Namespace_str[];
20165 extern const char js_QName_str[];
20166 extern const char js_Error_str[];
20167 extern const char js_InternalError_str[];
20168 extern const char js_EvalError_str[];
20169 extern const char js_RangeError_str[];
20170 extern const char js_ReferenceError_str[];
20171 extern const char js_SyntaxError_str[];
20172 extern const char js_TypeError_str[];
20173 extern const char js_URIError_str[];
20174 extern const char js_Iterator_str[];
20175 extern const char js_StopIteration_str[];
20176 extern const char js_ArrayBuffer_str[];
20177 extern const char js_Int8Array_str[];
20178 extern const char js_Uint8Array_str[];
20179 extern const char js_Int16Array_str[];
20180 extern const char js_Uint16Array_str[];
20181 extern const char js_Int32Array_str[];
20182 extern const char js_Uint32Array_str[];
20183 extern const char js_Float32Array_str[];
20184 extern const char js_Float64Array_str[];
20185 extern const char js_Uint8ClampedArray_str[];
20186 extern const char js_Proxy_str[];
20187 extern const char js_AnyName_str[];
20188 extern const char js_WeakMap_str[];
20189 extern const char js_Map_str[];
20190 extern const char js_Set_str[];
20191 extern const char js_DataView_str[];
20192
20193 #undef XML_INIT
20194 #undef NAMESPACE_INIT
20195 #undef QNAME_INIT
20196 # 326 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsatom.h" 2
20197 #undef JS_PROTO
20198
20199 #define DEFINE_ATOM(id,text) extern const char js_ ##id ##_str[];
20200 #define DEFINE_PROTOTYPE_ATOM(id)
20201 #define DEFINE_KEYWORD_ATOM(id)
20202 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsatom.tbl" 1
20203 # 37 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsatom.tbl"
20204 extern const char js_anonymous_str[];
20205 extern const char js_apply_str[];
20206 extern const char js_arguments_str[];
20207 extern const char js_arity_str[];
20208 extern const char js_BYTES_PER_ELEMENT_str[];
20209 extern const char js_call_str[];
20210 extern const char js_callee_str[];
20211 extern const char js_caller_str[];
20212 extern const char js_classPrototype_str[];
20213 extern const char js_constructor_str[];
20214 extern const char js_each_str[];
20215 extern const char js_eval_str[];
20216 extern const char js_fileName_str[];
20217 extern const char js_get_str[];
20218 extern const char js_global_str[];
20219 extern const char js_ignoreCase_str[];
20220 extern const char js_index_str[];
20221 extern const char js_input_str[];
20222 extern const char js_toISOString_str[];
20223 extern const char js_iterator_str[];
20224 extern const char js_join_str[];
20225 extern const char js_lastIndex_str[];
20226 extern const char js_length_str[];
20227 extern const char js_lineNumber_str[];
20228 extern const char js_message_str[];
20229 extern const char js_multiline_str[];
20230 extern const char js_name_str[];
20231 extern const char js_next_str[];
20232 extern const char js_noSuchMethod_str[];
20233 extern const char js_objectNull_str[];
20234 extern const char js_objectUndefined_str[];
20235 extern const char js_of_str[];
20236 extern const char js_proto_str[];
20237 extern const char js_set_str[];
20238 extern const char js_source_str[];
20239 extern const char js_stack_str[];
20240 extern const char js_sticky_str[];
20241 extern const char js_toGMTString_str[];
20242 extern const char js_toLocaleString_str[];
20243 extern const char js_toSource_str[];
20244 extern const char js_toString_str[];
20245 extern const char js_toUTCString_str[];
20246 extern const char js_valueOf_str[];
20247 extern const char js_toJSON_str[];
20248 extern const char js_void0_str[];
20249 extern const char js_enumerable_str[];
20250 extern const char js_configurable_str[];
20251 extern const char js_writable_str[];
20252 extern const char js_value_str[];
20253 extern const char js_test_str[];
20254 extern const char js_useStrict_str[];
20255 extern const char js_loc_str[];
20256 extern const char js_line_str[];
20257 extern const char js_Infinity_str[];
20258 extern const char js_NaN_str[];
20259 extern const char js_builder_str[];
20260
20261
20262 extern const char js_etago_str[];
20263 extern const char js_namespace_str[];
20264 extern const char js_ptagc_str[];
20265 extern const char js_qualifier_str[];
20266 extern const char js_space_str[];
20267 extern const char js_stago_str[];
20268 extern const char js_star_str[];
20269 extern const char js_starQualifier_str[];
20270 extern const char js_tagc_str[];
20271 extern const char js_xml_str[];
20272 extern const char js_functionNamespaceURI_str[];
20273
20274
20275
20276 extern const char js_getOwnPropertyDescriptor_str[];
20277 extern const char js_getPropertyDescriptor_str[];
20278 extern const char js_defineProperty_str[];
20279
20280 extern const char js_getOwnPropertyNames_str[];
20281 extern const char js_enumerate_str[];
20282 extern const char js_fix_str[];
20283 extern const char js_has_str[];
20284 extern const char js_hasOwn_str[];
20285 extern const char js_keys_str[];
20286 extern const char js_iterate_str[];
20287
20288 extern const char js_byteLength_str[];
20289
20290
20291 extern const char js_url_str[];
20292 extern const char js_innermost_str[];
20293
20294 extern const char js_XMLList_str[];
20295 extern const char js_decodeURI_str[];
20296 extern const char js_decodeURIComponent_str[];
20297 extern const char js_defineGetter_str[];
20298 extern const char js_defineSetter_str[];
20299 extern const char js_encodeURI_str[];
20300 extern const char js_encodeURIComponent_str[];
20301 extern const char js_escape_str[];
20302 extern const char js_hasOwnProperty_str[];
20303 extern const char js_isFinite_str[];
20304 extern const char js_isNaN_str[];
20305 extern const char js_isPrototypeOf_str[];
20306 extern const char js_isXMLName_str[];
20307 extern const char js_lookupGetter_str[];
20308 extern const char js_lookupSetter_str[];
20309 extern const char js_parseFloat_str[];
20310 extern const char js_parseInt_str[];
20311 extern const char js_propertyIsEnumerable_str[];
20312 extern const char js_unescape_str[];
20313 extern const char js_uneval_str[];
20314 extern const char js_unwatch_str[];
20315 extern const char js_watch_str[];
20316 # 332 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsatom.h" 2
20317 #undef DEFINE_ATOM
20318 #undef DEFINE_PROTOTYPE_ATOM
20319 #undef DEFINE_KEYWORD_ATOM
20320
20321
20322 extern const char js_close_str[];
20323 extern const char js_send_str[];
20324
20325
20326
20327 extern const char js_getter_str[];
20328 extern const char js_setter_str[];
20329
20330
20331
20332
20333
20334
20335 extern JSBool
20336 js_InitAtomState(JSRuntime *rt);
20337
20338
20339
20340
20341
20342 extern void
20343 js_FinishAtomState(JSRuntime *rt);
20344
20345
20346
20347
20348
20349 namespace js {
20350
20351 extern void
20352 MarkAtomState(JSTracer *trc, bool markAll);
20353
20354 extern void
20355 SweepAtomState(JSRuntime *rt);
20356
20357 extern bool
20358 InitCommonAtoms(JSContext *cx);
20359
20360 extern void
20361 FinishCommonAtoms(JSRuntime *rt);
20362
20363
20364 enum InternBehavior
20365 {
20366 DoNotInternAtom = false,
20367 InternAtom = true
20368 };
20369
20370 }
20371
20372 extern JSAtom *
20373 js_Atomize(JSContext *cx, const char *bytes, size_t length,
20374 js::InternBehavior ib = js::DoNotInternAtom,
20375 js::FlationCoding fc = js::NormalEncoding);
20376
20377 extern JSAtom *
20378 js_AtomizeChars(JSContext *cx, const jschar *chars, size_t length,
20379 js::InternBehavior ib = js::DoNotInternAtom);
20380
20381 extern JSAtom *
20382 js_AtomizeString(JSContext *cx, JSString *str, js::InternBehavior ib = js::DoNotInternAtom);
20383
20384
20385
20386
20387
20388 extern JSAtom *
20389 js_GetExistingStringAtom(JSContext *cx, const jschar *chars, size_t length);
20390 # 413 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsatom.h"
20391 inline bool
20392 js_ValueToAtom(JSContext *cx, const js::Value &v, JSAtom **atomp);
20393
20394 namespace js {
20395
20396 bool
20397 InternNonIntElementId(JSContext *cx, JSObject *obj, const Value &idval,
20398 jsid *idp, Value *vp);
20399
20400 inline bool
20401 InternNonIntElementId(JSContext *cx, JSObject *obj, const Value &idval, jsid *idp)
20402 {
20403 Value dummy;
20404 return InternNonIntElementId(cx, obj, idval, idp, &dummy);
20405 }
20406
20407
20408
20409
20410
20411
20412 extern void
20413 InitAtomMap(JSContext *cx, AtomIndexMap *indices, HeapPtr<JSAtom> *atoms);
20414
20415 template<XDRMode mode>
20416 bool
20417 XDRAtom(XDRState<mode> *xdr, JSAtom **atomp);
20418
20419 }
20420 # 21 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobj.h" 2
20421 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsclass.h" 1
20422 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsclass.h"
20423 #define jsclass_h__
20424 # 21 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsclass.h"
20425 namespace js {
20426
20427 class PropertyName;
20428 class SpecialId;
20429
20430 static __attribute__((always_inline)) inline jsid
20431 SPECIALID_TO_JSID(const SpecialId &sid);
20432 # 41 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsclass.h"
20433 class SpecialId {
20434 uintptr_t bits;
20435
20436
20437 friend __attribute__((always_inline)) inline jsid SPECIALID_TO_JSID(const SpecialId &sid);
20438
20439 static const uintptr_t TYPE_VOID = 0x2;
20440 static const uintptr_t TYPE_OBJECT = 0x4;
20441 static const uintptr_t TYPE_DEFAULT_XML_NAMESPACE = 0x6;
20442 static const uintptr_t TYPE_MASK = 0x7;
20443
20444 SpecialId(uintptr_t bits) : bits(bits) { }
20445
20446 public:
20447 SpecialId() : bits(TYPE_VOID) { }
20448
20449
20450
20451 SpecialId(JSObject &obj)
20452 : bits(uintptr_t(&obj) | TYPE_OBJECT)
20453 {
20454 do { } while(0);
20455 do { } while(0);
20456 }
20457
20458 bool isObject() const {
20459 return (bits & TYPE_MASK) == TYPE_OBJECT && bits != TYPE_OBJECT;
20460 }
20461
20462 JSObject *toObject() const {
20463 do { } while(0);
20464 return reinterpret_cast<JSObject *>(bits & ~TYPE_MASK);
20465 }
20466
20467
20468
20469 static SpecialId empty() {
20470 SpecialId sid(TYPE_OBJECT);
20471 do { } while(0);
20472 return sid;
20473 }
20474
20475 bool isEmpty() const {
20476 return bits == TYPE_OBJECT;
20477 }
20478
20479
20480
20481 static SpecialId voidId() {
20482 SpecialId sid(TYPE_VOID);
20483 do { } while(0);
20484 return sid;
20485 }
20486
20487 bool isVoid() const {
20488 return bits == TYPE_VOID;
20489 }
20490
20491
20492
20493 static SpecialId defaultXMLNamespace() {
20494 SpecialId sid(TYPE_DEFAULT_XML_NAMESPACE);
20495 do { } while(0);
20496 return sid;
20497 }
20498
20499 bool isDefaultXMLNamespace() const {
20500 return bits == TYPE_DEFAULT_XML_NAMESPACE;
20501 }
20502 };
20503
20504 static __attribute__((always_inline)) inline jsid
20505 SPECIALID_TO_JSID(const SpecialId &sid)
20506 {
20507 jsid id;
20508 (id) = sid.bits;
20509 do { } while (0);
20510 do { } while (0);
20511 do { } while (0);
20512 do { } while (0);
20513 return id;
20514 }
20515
20516 static __attribute__((always_inline)) inline bool
20517 JSID_IS_SPECIAL(jsid id)
20518 {
20519 return JSID_IS_OBJECT(id) || JSID_IS_EMPTY(id) || JSID_IS_VOID(id) ||
20520 JSID_IS_DEFAULT_XML_NAMESPACE(id);
20521 }
20522
20523 static __attribute__((always_inline)) inline SpecialId
20524 JSID_TO_SPECIALID(jsid id)
20525 {
20526 do { } while(0);
20527 if (JSID_IS_OBJECT(id))
20528 return SpecialId(*JSID_TO_OBJECT(id));
20529 if (JSID_IS_EMPTY(id))
20530 return SpecialId::empty();
20531 if (JSID_IS_VOID(id))
20532 return SpecialId::voidId();
20533 do { } while(0);
20534 return SpecialId::defaultXMLNamespace();
20535 }
20536
20537 typedef JS::Handle<SpecialId> HandleSpecialId;
20538
20539
20540
20541 typedef JSBool
20542 (* LookupGenericOp)(JSContext *cx, HandleObject obj, HandleId id, JSObject **objp,
20543 JSProperty **propp);
20544 typedef JSBool
20545 (* LookupPropOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, JSObject **objp,
20546 JSProperty **propp);
20547 typedef JSBool
20548 (* LookupElementOp)(JSContext *cx, HandleObject obj, uint32_t index, JSObject **objp,
20549 JSProperty **propp);
20550 typedef JSBool
20551 (* LookupSpecialOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, JSObject **objp,
20552 JSProperty **propp);
20553 typedef JSBool
20554 (* DefineGenericOp)(JSContext *cx, HandleObject obj, HandleId id, const Value *value,
20555 PropertyOp getter, StrictPropertyOp setter, unsigned attrs);
20556 typedef JSBool
20557 (* DefinePropOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, const Value *value,
20558 PropertyOp getter, StrictPropertyOp setter, unsigned attrs);
20559 typedef JSBool
20560 (* DefineElementOp)(JSContext *cx, HandleObject obj, uint32_t index, const Value *value,
20561 PropertyOp getter, StrictPropertyOp setter, unsigned attrs);
20562 typedef JSBool
20563 (* DefineSpecialOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, const Value *value,
20564 PropertyOp getter, StrictPropertyOp setter, unsigned attrs);
20565 typedef JSBool
20566 (* GenericIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, HandleId id, Value *vp);
20567 typedef JSBool
20568 (* PropertyIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, HandlePropertyName name, Value *vp);
20569 typedef JSBool
20570 (* ElementIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_t index, Value *vp);
20571 typedef JSBool
20572 (* ElementIfPresentOp)(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_t index, Value *vp, bool* present);
20573 typedef JSBool
20574 (* SpecialIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, HandleSpecialId sid, Value *vp);
20575 typedef JSBool
20576 (* StrictGenericIdOp)(JSContext *cx, HandleObject obj, HandleId id, Value *vp, JSBool strict);
20577 typedef JSBool
20578 (* StrictPropertyIdOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, Value *vp, JSBool strict);
20579 typedef JSBool
20580 (* StrictElementIdOp)(JSContext *cx, HandleObject obj, uint32_t index, Value *vp, JSBool strict);
20581 typedef JSBool
20582 (* StrictSpecialIdOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, Value *vp, JSBool strict);
20583 typedef JSBool
20584 (* GenericAttributesOp)(JSContext *cx, HandleObject obj, HandleId id, unsigned *attrsp);
20585 typedef JSBool
20586 (* PropertyAttributesOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, unsigned *attrsp);
20587 typedef JSBool
20588 (* ElementAttributesOp)(JSContext *cx, HandleObject obj, uint32_t index, unsigned *attrsp);
20589 typedef JSBool
20590 (* SpecialAttributesOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, unsigned *attrsp);
20591 typedef JSBool
20592 (* DeletePropertyOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, Value *vp, JSBool strict);
20593 typedef JSBool
20594 (* DeleteElementOp)(JSContext *cx, HandleObject obj, uint32_t index, Value *vp, JSBool strict);
20595 typedef JSBool
20596 (* DeleteSpecialOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, Value *vp, JSBool strict);
20597 typedef JSType
20598 (* TypeOfOp)(JSContext *cx, HandleObject obj);
20599
20600 typedef JSObject *
20601 (* ObjectOp)(JSContext *cx, HandleObject obj);
20602 typedef void
20603 (* ClearOp)(JSContext *cx, HandleObject obj);
20604 typedef void
20605 (* FinalizeOp)(FreeOp *fop, JSObject *obj);
20606
20607 #define JS_CLASS_MEMBERS const char *name; uint32_t flags; JSPropertyOp addProperty; JSPropertyOp delProperty; JSPropertyOp getProperty; JSStrictPropertyOp setProperty; JSEnumerateOp enumerate; JSResolveOp resolve; JSConvertOp convert; FinalizeOp finalize; JSCheckAccessOp checkAccess; JSNative call; JSHasInstanceOp hasInstance; JSNative construct; JSTraceOp trace
20608 # 240 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsclass.h"
20609 struct ClassSizeMeasurement
20610 {
20611 const char *name; uint32_t flags; JSPropertyOp addProperty; JSPropertyOp delProperty; JSPropertyOp getProperty; JSStrictPropertyOp setProperty; JSEnumerateOp enumerate; JSResolveOp resolve; JSConvertOp convert; FinalizeOp finalize; JSCheckAccessOp checkAccess; JSNative call; JSHasInstanceOp hasInstance; JSNative construct; JSTraceOp trace;
20612 };
20613
20614 struct ClassExtension
20615 {
20616 JSEqualityOp equality;
20617 JSObjectOp outerObject;
20618 JSObjectOp innerObject;
20619 JSIteratorOp iteratorObject;
20620 void *unused;
20621
20622
20623
20624
20625
20626 bool isWrappedNative;
20627 };
20628
20629 #define JS_NULL_CLASS_EXT {NULL,NULL,NULL,NULL,NULL,false}
20630
20631 struct ObjectOps
20632 {
20633 LookupGenericOp lookupGeneric;
20634 LookupPropOp lookupProperty;
20635 LookupElementOp lookupElement;
20636 LookupSpecialOp lookupSpecial;
20637 DefineGenericOp defineGeneric;
20638 DefinePropOp defineProperty;
20639 DefineElementOp defineElement;
20640 DefineSpecialOp defineSpecial;
20641 GenericIdOp getGeneric;
20642 PropertyIdOp getProperty;
20643 ElementIdOp getElement;
20644 ElementIfPresentOp getElementIfPresent;
20645 SpecialIdOp getSpecial;
20646 StrictGenericIdOp setGeneric;
20647 StrictPropertyIdOp setProperty;
20648 StrictElementIdOp setElement;
20649 StrictSpecialIdOp setSpecial;
20650 GenericAttributesOp getGenericAttributes;
20651 PropertyAttributesOp getPropertyAttributes;
20652 ElementAttributesOp getElementAttributes;
20653 SpecialAttributesOp getSpecialAttributes;
20654 GenericAttributesOp setGenericAttributes;
20655 PropertyAttributesOp setPropertyAttributes;
20656 ElementAttributesOp setElementAttributes;
20657 SpecialAttributesOp setSpecialAttributes;
20658 DeletePropertyOp deleteProperty;
20659 DeleteElementOp deleteElement;
20660 DeleteSpecialOp deleteSpecial;
20661
20662 JSNewEnumerateOp enumerate;
20663 TypeOfOp typeOf;
20664 ObjectOp thisObject;
20665 ClearOp clear;
20666 };
20667
20668 #define JS_NULL_OBJECT_OPS {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, NULL,NULL,NULL,NULL,NULL}
20669
20670
20671
20672
20673 struct Class
20674 {
20675 const char *name; uint32_t flags; JSPropertyOp addProperty; JSPropertyOp delProperty; JSPropertyOp getProperty; JSStrictPropertyOp setProperty; JSEnumerateOp enumerate; JSResolveOp resolve; JSConvertOp convert; FinalizeOp finalize; JSCheckAccessOp checkAccess; JSNative call; JSHasInstanceOp hasInstance; JSNative construct; JSTraceOp trace;
20676 ClassExtension ext;
20677 ObjectOps ops;
20678 uint8_t pad[sizeof(JSClass) - sizeof(ClassSizeMeasurement) -
20679 sizeof(ClassExtension) - sizeof(ObjectOps)];
20680
20681
20682 static const uint32_t NON_NATIVE = (1<<((8 + 8)+3));
20683
20684 bool isNative() const {
20685 return !(flags & NON_NATIVE);
20686 }
20687
20688 bool hasPrivate() const {
20689 return !!(flags & (1<<0));
20690 }
20691 };
20692
20693 typedef int moz_static_assert29[(__builtin_offsetof (JSClass, name) == __builtin_offsetof (Class, name)) ? 1 : -1];
20694 typedef int moz_static_assert30[(__builtin_offsetof (JSClass, flags) == __builtin_offsetof (Class, flags)) ? 1 : -1];
20695 typedef int moz_static_assert31[(__builtin_offsetof (JSClass, addProperty) == __builtin_offsetof (Class, addProperty)) ? 1 : -1];
20696 typedef int moz_static_assert32[(__builtin_offsetof (JSClass, delProperty) == __builtin_offsetof (Class, delProperty)) ? 1 : -1];
20697 typedef int moz_static_assert33[(__builtin_offsetof (JSClass, getProperty) == __builtin_offsetof (Class, getProperty)) ? 1 : -1];
20698 typedef int moz_static_assert34[(__builtin_offsetof (JSClass, setProperty) == __builtin_offsetof (Class, setProperty)) ? 1 : -1];
20699 typedef int moz_static_assert35[(__builtin_offsetof (JSClass, enumerate) == __builtin_offsetof (Class, enumerate)) ? 1 : -1];
20700 typedef int moz_static_assert36[(__builtin_offsetof (JSClass, resolve) == __builtin_offsetof (Class, resolve)) ? 1 : -1];
20701 typedef int moz_static_assert37[(__builtin_offsetof (JSClass, convert) == __builtin_offsetof (Class, convert)) ? 1 : -1];
20702 typedef int moz_static_assert38[(__builtin_offsetof (JSClass, finalize) == __builtin_offsetof (Class, finalize)) ? 1 : -1];
20703 typedef int moz_static_assert39[(__builtin_offsetof (JSClass, checkAccess) == __builtin_offsetof (Class, checkAccess)) ? 1 : -1];
20704 typedef int moz_static_assert40[(__builtin_offsetof (JSClass, call) == __builtin_offsetof (Class, call)) ? 1 : -1];
20705 typedef int moz_static_assert41[(__builtin_offsetof (JSClass, construct) == __builtin_offsetof (Class, construct)) ? 1 : -1];
20706 typedef int moz_static_assert42[(__builtin_offsetof (JSClass, hasInstance) == __builtin_offsetof (Class, hasInstance)) ? 1 : -1];
20707 typedef int moz_static_assert43[(__builtin_offsetof (JSClass, trace) == __builtin_offsetof (Class, trace)) ? 1 : -1];
20708 typedef int moz_static_assert44[(sizeof(JSClass) == sizeof(Class)) ? 1 : -1];
20709
20710 static __attribute__((always_inline)) inline JSClass *
20711 Jsvalify(Class *c)
20712 {
20713 return (JSClass *)c;
20714 }
20715 static __attribute__((always_inline)) inline const JSClass *
20716 Jsvalify(const Class *c)
20717 {
20718 return (const JSClass *)c;
20719 }
20720
20721 static __attribute__((always_inline)) inline Class *
20722 Valueify(JSClass *c)
20723 {
20724 return (Class *)c;
20725 }
20726 static __attribute__((always_inline)) inline const Class *
20727 Valueify(const JSClass *c)
20728 {
20729 return (const Class *)c;
20730 }
20731
20732
20733
20734
20735
20736 enum ESClassValue {
20737 ESClass_Array, ESClass_Number, ESClass_String, ESClass_Boolean,
20738 ESClass_RegExp, ESClass_ArrayBuffer
20739 };
20740
20741
20742
20743
20744
20745
20746
20747 inline bool
20748 ObjectClassIs(JSObject &obj, ESClassValue classValue, JSContext *cx);
20749
20750
20751 inline bool
20752 IsObjectWithClass(const Value &v, ESClassValue classValue, JSContext *cx);
20753
20754 }
20755
20756 namespace JS {
20757
20758 inline bool
20759 IsPoisonedSpecialId(js::SpecialId iden)
20760 {
20761 if (iden.isObject())
20762 return IsPoisonedPtr(iden.toObject());
20763 return false;
20764 }
20765
20766 template <> struct RootMethods<js::SpecialId>
20767 {
20768 static js::SpecialId initial() { return js::SpecialId(); }
20769 static ThingRootKind kind() { return THING_ROOT_ID; }
20770 static bool poisoned(js::SpecialId id) { return IsPoisonedSpecialId(id); }
20771 };
20772
20773 }
20774 # 22 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobj.h" 2
20775 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsfriendapi.h" 1
20776
20777
20778
20779
20780
20781
20782
20783 #define jsfriendapi_h___
20784
20785
20786
20787
20788
20789 # 1 "./../../dist/include/mozilla/GuardObjects.h" 1
20790 # 10 "./../../dist/include/mozilla/GuardObjects.h"
20791 #define mozilla_GuardObjects_h
20792 # 137 "./../../dist/include/mozilla/GuardObjects.h"
20793 #define MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
20794 #define MOZ_GUARD_OBJECT_NOTIFIER_PARAM
20795 #define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM
20796 #define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL
20797 #define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT
20798 #define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT
20799 #define MOZ_GUARD_OBJECT_NOTIFIER_INIT do { } while (0)
20800 # 15 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsfriendapi.h" 2
20801
20802 extern "C" {
20803
20804 extern __attribute__((visibility("default"))) void
20805 JS_SetGrayGCRootsTracer(JSRuntime *rt, JSTraceDataOp traceOp, void *data);
20806
20807 extern __attribute__((visibility("default"))) JSString *
20808 JS_GetAnonymousString(JSRuntime *rt);
20809
20810 extern __attribute__((visibility("default"))) JSObject *
20811 JS_FindCompilationScope(JSContext *cx, JSObject *obj);
20812
20813 extern __attribute__((visibility("default"))) JSFunction *
20814 JS_GetObjectFunction(JSObject *obj);
20815
20816 extern __attribute__((visibility("default"))) JSObject *
20817 JS_GetGlobalForFrame(JSStackFrame *fp);
20818
20819 extern __attribute__((visibility("default"))) JSBool
20820 JS_SplicePrototype(JSContext *cx, JSObject *obj, JSObject *proto);
20821
20822 extern __attribute__((visibility("default"))) JSObject *
20823 JS_NewObjectWithUniqueType(JSContext *cx, JSClass *clasp, JSObject *proto, JSObject *parent);
20824
20825 extern __attribute__((visibility("default"))) uint32_t
20826 JS_ObjectCountDynamicSlots(JSObject *obj);
20827
20828 extern __attribute__((visibility("default"))) void
20829 JS_ShrinkGCBuffers(JSRuntime *rt);
20830
20831 extern __attribute__((visibility("default"))) size_t
20832 JS_GetE4XObjectsCreated(JSContext *cx);
20833
20834 extern __attribute__((visibility("default"))) size_t
20835 JS_SetProtoCalled(JSContext *cx);
20836
20837 extern __attribute__((visibility("default"))) size_t
20838 JS_GetCustomIteratorCount(JSContext *cx);
20839
20840 extern __attribute__((visibility("default"))) JSBool
20841 JS_NondeterministicGetWeakMapKeys(JSContext *cx, JSObject *obj, JSObject **ret);
20842
20843
20844
20845
20846
20847
20848
20849 extern __attribute__((visibility("default"))) JSBool
20850 JS_IsDeadWrapper(JSObject *obj);
20851
20852
20853
20854
20855
20856
20857 extern __attribute__((visibility("default"))) void
20858 JS_TraceShapeCycleCollectorChildren(JSTracer *trc, void *shape);
20859
20860 enum {
20861 JS_TELEMETRY_GC_REASON,
20862 JS_TELEMETRY_GC_IS_COMPARTMENTAL,
20863 JS_TELEMETRY_GC_MS,
20864 JS_TELEMETRY_GC_MARK_MS,
20865 JS_TELEMETRY_GC_SWEEP_MS,
20866 JS_TELEMETRY_GC_SLICE_MS,
20867 JS_TELEMETRY_GC_MMU_50,
20868 JS_TELEMETRY_GC_RESET,
20869 JS_TELEMETRY_GC_INCREMENTAL_DISABLED,
20870 JS_TELEMETRY_GC_NON_INCREMENTAL
20871 };
20872
20873 typedef void
20874 (* JSAccumulateTelemetryDataCallback)(int id, uint32_t sample);
20875
20876 extern __attribute__((visibility("default"))) void
20877 JS_SetAccumulateTelemetryCallback(JSRuntime *rt, JSAccumulateTelemetryDataCallback callback);
20878
20879 extern __attribute__((visibility("default"))) JSPrincipals *
20880 JS_GetCompartmentPrincipals(JSCompartment *compartment);
20881
20882 extern __attribute__((visibility("default"))) void
20883 JS_SetCompartmentPrincipals(JSCompartment *compartment, JSPrincipals *principals);
20884
20885
20886 extern __attribute__((visibility("default"))) JSObject *
20887 JS_ObjectToInnerObject(JSContext *cx, JSObject *obj);
20888
20889
20890 extern __attribute__((visibility("default"))) JSObject *
20891 JS_ObjectToOuterObject(JSContext *cx, JSObject *obj);
20892
20893 extern __attribute__((visibility("default"))) JSObject *
20894 JS_CloneObject(JSContext *cx, JSObject *obj, JSObject *proto, JSObject *parent);
20895
20896 extern __attribute__((visibility("default"))) JSBool
20897 js_GetterOnlyPropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict, jsval *vp);
20898
20899 __attribute__((visibility("default"))) void
20900 js_ReportOverRecursed(JSContext *maybecx);
20901 # 139 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsfriendapi.h"
20902 extern __attribute__((visibility("default"))) bool
20903 JS_CopyPropertiesFrom(JSContext *cx, JSObject *target, JSObject *obj);
20904
20905 extern __attribute__((visibility("default"))) JSBool
20906 JS_WrapPropertyDescriptor(JSContext *cx, js::PropertyDescriptor *desc);
20907
20908 extern __attribute__((visibility("default"))) JSBool
20909 JS_WrapAutoIdVector(JSContext *cx, JS::AutoIdVector &props);
20910
20911 extern __attribute__((visibility("default"))) JSBool
20912 JS_EnumerateState(JSContext *cx, JSHandleObject obj, JSIterateOp enum_op, js::Value *statep, jsid *idp);
20913
20914 struct JSFunctionSpecWithHelp {
20915 const char *name;
20916 JSNative call;
20917 uint16_t nargs;
20918 uint16_t flags;
20919 const char *usage;
20920 const char *help;
20921 };
20922
20923 #define JS_FN_HELP(name,call,nargs,flags,usage,help) {name, call, nargs, (flags) | JSPROP_ENUMERATE | JSFUN_STUB_GSOPS, usage, help}
20924
20925
20926 extern __attribute__((visibility("default"))) bool
20927 JS_DefineFunctionsWithHelp(JSContext *cx, JSObject *obj, const JSFunctionSpecWithHelp *fs);
20928
20929
20930
20931 }
20932
20933
20934
20935 namespace js {
20936
20937 struct RuntimeFriendFields {
20938
20939
20940
20941
20942 volatile int32_t interrupt;
20943
20944
20945 uintptr_t nativeStackLimit;
20946
20947 RuntimeFriendFields()
20948 : interrupt(0),
20949 nativeStackLimit(0) { }
20950
20951 static const RuntimeFriendFields *get(const JSRuntime *rt) {
20952 return reinterpret_cast<const RuntimeFriendFields *>(rt);
20953 }
20954 };
20955
20956 inline JSRuntime *
20957 GetRuntime(const JSContext *cx)
20958 {
20959 return ContextFriendFields::get(cx)->runtime;
20960 }
20961
20962 typedef bool
20963 (* PreserveWrapperCallback)(JSContext *cx, JSObject *obj);
20964 # 212 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsfriendapi.h"
20965 class __attribute__((visibility("default"))) AutoSwitchCompartment {
20966 private:
20967 JSContext *cx;
20968 JSCompartment *oldCompartment;
20969 public:
20970 AutoSwitchCompartment(JSContext *cx, JSCompartment *newCompartment
20971 );
20972 AutoSwitchCompartment(JSContext *cx, JSObject *target );
20973 ~AutoSwitchCompartment();
20974
20975 };
20976
20977
20978 __attribute__((visibility("default"))) JSBool obj_defineGetter(JSContext *cx, unsigned argc, js::Value *vp);
20979 __attribute__((visibility("default"))) JSBool obj_defineSetter(JSContext *cx, unsigned argc, js::Value *vp);
20980
20981
20982 extern __attribute__((visibility("default"))) bool
20983 IsSystemCompartment(const JSCompartment *compartment);
20984
20985 extern __attribute__((visibility("default"))) bool
20986 IsAtomsCompartment(const JSCompartment *c);
20987
20988
20989
20990
20991
20992
20993
20994 extern __attribute__((visibility("default"))) bool
20995 CheckUndeclaredVarAssignment(JSContext *cx, JSString *propname);
20996
20997 struct WeakMapTracer;
20998
20999
21000
21001
21002
21003
21004
21005 typedef void
21006 (* WeakMapTraceCallback)(WeakMapTracer *trc, JSObject *m,
21007 void *k, JSGCTraceKind kkind,
21008 void *v, JSGCTraceKind vkind);
21009
21010 struct WeakMapTracer {
21011 JSRuntime *runtime;
21012 WeakMapTraceCallback callback;
21013
21014 WeakMapTracer(JSRuntime *rt, WeakMapTraceCallback cb)
21015 : runtime(rt), callback(cb) {}
21016 };
21017
21018 extern __attribute__((visibility("default"))) void
21019 TraceWeakMaps(WeakMapTracer *trc);
21020
21021 extern __attribute__((visibility("default"))) bool
21022 GCThingIsMarkedGray(void *thing);
21023
21024
21025
21026
21027
21028
21029
21030 namespace shadow {
21031
21032 struct TypeObject {
21033 JSObject *proto;
21034 };
21035
21036 struct BaseShape {
21037 js::Class *clasp;
21038 JSObject *parent;
21039 };
21040
21041 struct Shape {
21042 BaseShape *base;
21043 jsid _1;
21044 uint32_t slotInfo;
21045
21046 static const uint32_t FIXED_SLOTS_SHIFT = 27;
21047 };
21048
21049 struct Object {
21050 Shape *shape;
21051 TypeObject *type;
21052 js::Value *slots;
21053 js::Value *_1;
21054
21055 size_t numFixedSlots() const { return shape->slotInfo >> Shape::FIXED_SLOTS_SHIFT; }
21056 Value *fixedSlots() const {
21057 return (Value *)(uintptr_t(this) + sizeof(shadow::Object));
21058 }
21059
21060 js::Value &slotRef(size_t slot) const {
21061 size_t nfixed = numFixedSlots();
21062 if (slot < nfixed)
21063 return fixedSlots()[slot];
21064 return slots[slot - nfixed];
21065 }
21066 };
21067
21068 struct Atom {
21069 size_t _;
21070 const jschar *chars;
21071 };
21072
21073 }
21074
21075 extern __attribute__((visibility("default"))) js::Class AnyNameClass;
21076 extern __attribute__((visibility("default"))) js::Class AttributeNameClass;
21077 extern __attribute__((visibility("default"))) js::Class CallClass;
21078 extern __attribute__((visibility("default"))) js::Class DeclEnvClass;
21079 extern __attribute__((visibility("default"))) js::Class FunctionClass;
21080 extern __attribute__((visibility("default"))) js::Class FunctionProxyClass;
21081 extern __attribute__((visibility("default"))) js::Class NamespaceClass;
21082 extern __attribute__((visibility("default"))) js::Class OuterWindowProxyClass;
21083 extern __attribute__((visibility("default"))) js::Class ObjectProxyClass;
21084 extern __attribute__((visibility("default"))) js::Class QNameClass;
21085 extern __attribute__((visibility("default"))) js::Class XMLClass;
21086 extern __attribute__((visibility("default"))) js::Class ObjectClass;
21087
21088 inline js::Class *
21089 GetObjectClass(const JSObject *obj)
21090 {
21091 return reinterpret_cast<const shadow::Object*>(obj)->shape->base->clasp;
21092 }
21093
21094 inline JSClass *
21095 GetObjectJSClass(const JSObject *obj)
21096 {
21097 return js::Jsvalify(GetObjectClass(obj));
21098 }
21099
21100 __attribute__((visibility("default"))) bool
21101 IsScopeObject(JSObject *obj);
21102
21103 inline JSObject *
21104 GetObjectParent(JSObject *obj)
21105 {
21106 do { } while(0);
21107 return reinterpret_cast<shadow::Object*>(obj)->shape->base->parent;
21108 }
21109
21110 __attribute__((visibility("default"))) JSObject *
21111 GetObjectParentMaybeScope(JSObject *obj);
21112
21113 __attribute__((visibility("default"))) JSObject *
21114 GetGlobalForObjectCrossCompartment(JSObject *obj);
21115
21116 __attribute__((visibility("default"))) void
21117 NotifyAnimationActivity(JSObject *obj);
21118
21119 __attribute__((visibility("default"))) bool
21120 IsOriginalScriptFunction(JSFunction *fun);
21121
21122 __attribute__((visibility("default"))) JSFunction *
21123 DefineFunctionWithReserved(JSContext *cx, JSObject *obj, const char *name, JSNative call,
21124 unsigned nargs, unsigned attrs);
21125
21126 __attribute__((visibility("default"))) JSFunction *
21127 NewFunctionWithReserved(JSContext *cx, JSNative call, unsigned nargs, unsigned flags,
21128 JSObject *parent, const char *name);
21129
21130 __attribute__((visibility("default"))) JSFunction *
21131 NewFunctionByIdWithReserved(JSContext *cx, JSNative native, unsigned nargs, unsigned flags,
21132 JSObject *parent, jsid id);
21133
21134 __attribute__((visibility("default"))) JSObject *
21135 InitClassWithReserved(JSContext *cx, JSObject *obj, JSObject *parent_proto,
21136 JSClass *clasp, JSNative constructor, unsigned nargs,
21137 JSPropertySpec *ps, JSFunctionSpec *fs,
21138 JSPropertySpec *static_ps, JSFunctionSpec *static_fs);
21139
21140 __attribute__((visibility("default"))) const Value &
21141 GetFunctionNativeReserved(JSObject *fun, size_t which);
21142
21143 __attribute__((visibility("default"))) void
21144 SetFunctionNativeReserved(JSObject *fun, size_t which, const Value &val);
21145
21146 inline JSObject *
21147 GetObjectProto(JSObject *obj)
21148 {
21149 return reinterpret_cast<const shadow::Object*>(obj)->type->proto;
21150 }
21151
21152 inline void *
21153 GetObjectPrivate(JSObject *obj)
21154 {
21155 const shadow::Object *nobj = reinterpret_cast<const shadow::Object*>(obj);
21156 void **addr = reinterpret_cast<void**>(&nobj->fixedSlots()[nobj->numFixedSlots()]);
21157 return *addr;
21158 }
21159
21160
21161
21162
21163
21164 inline const Value &
21165 GetReservedSlot(const JSObject *obj, size_t slot)
21166 {
21167 do { } while(0);
21168 return reinterpret_cast<const shadow::Object *>(obj)->slotRef(slot);
21169 }
21170
21171 __attribute__((visibility("default"))) void
21172 SetReservedSlotWithBarrier(JSObject *obj, size_t slot, const Value &value);
21173
21174 inline void
21175 SetReservedSlot(JSObject *obj, size_t slot, const Value &value)
21176 {
21177 do { } while(0);
21178 shadow::Object *sobj = reinterpret_cast<shadow::Object *>(obj);
21179 if (sobj->slotRef(slot).isMarkable())
21180 SetReservedSlotWithBarrier(obj, slot, value);
21181 else
21182 sobj->slotRef(slot) = value;
21183 }
21184
21185 __attribute__((visibility("default"))) uint32_t
21186 GetObjectSlotSpan(JSObject *obj);
21187
21188 inline const Value &
21189 GetObjectSlot(JSObject *obj, size_t slot)
21190 {
21191 do { } while(0);
21192 return reinterpret_cast<const shadow::Object *>(obj)->slotRef(slot);
21193 }
21194
21195 inline Shape *
21196 GetObjectShape(JSObject *obj)
21197 {
21198 shadow::Shape *shape = reinterpret_cast<const shadow::Object*>(obj)->shape;
21199 return reinterpret_cast<Shape *>(shape);
21200 }
21201
21202 inline const jschar *
21203 GetAtomChars(JSAtom *atom)
21204 {
21205 return reinterpret_cast<shadow::Atom *>(atom)->chars;
21206 }
21207
21208 inline JSLinearString *
21209 AtomToLinearString(JSAtom *atom)
21210 {
21211 return reinterpret_cast<JSLinearString *>(atom);
21212 }
21213
21214 static inline js::PropertyOp
21215 CastAsJSPropertyOp(JSObject *object)
21216 {
21217 return (__extension__ (js::PropertyOp) (size_t) (object));
21218 }
21219
21220 static inline js::StrictPropertyOp
21221 CastAsJSStrictPropertyOp(JSObject *object)
21222 {
21223 return (__extension__ (js::StrictPropertyOp) (size_t) (object));
21224 }
21225
21226 __attribute__((visibility("default"))) bool
21227 GetPropertyNames(JSContext *cx, JSObject *obj, unsigned flags, js::AutoIdVector *props);
21228
21229 __attribute__((visibility("default"))) bool
21230 GetGeneric(JSContext *cx, JSObject *obj, JSObject *receiver, jsid id, Value *vp);
21231
21232 __attribute__((visibility("default"))) bool
21233 StringIsArrayIndex(JSLinearString *str, uint32_t *indexp);
21234
21235 __attribute__((visibility("default"))) void
21236 SetPreserveWrapperCallback(JSRuntime *rt, PreserveWrapperCallback callback);
21237
21238 __attribute__((visibility("default"))) bool
21239 IsObjectInContextCompartment(const JSObject *obj, const JSContext *cx);
21240
21241
21242
21243
21244
21245
21246 #define JSITER_ENUMERATE 0x1
21247 #define JSITER_FOREACH 0x2
21248 #define JSITER_KEYVALUE 0x4
21249 #define JSITER_OWNONLY 0x8
21250 #define JSITER_HIDDEN 0x10
21251 #define JSITER_FOR_OF 0x20
21252
21253 inline uintptr_t
21254 GetNativeStackLimit(const JSRuntime *rt)
21255 {
21256 return RuntimeFriendFields::get(rt)->nativeStackLimit;
21257 }
21258
21259 #define JS_CHECK_RECURSION(cx,onerror) JS_BEGIN_MACRO int stackDummy_; if (!JS_CHECK_STACK_SIZE(js::GetNativeStackLimit(js::GetRuntime(cx)), &stackDummy_)) { js_ReportOverRecursed(cx); onerror; } JS_END_MACRO
21260 # 515 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsfriendapi.h"
21261 __attribute__((visibility("default"))) void
21262 StartPCCountProfiling(JSContext *cx);
21263
21264 __attribute__((visibility("default"))) void
21265 StopPCCountProfiling(JSContext *cx);
21266
21267 __attribute__((visibility("default"))) void
21268 PurgePCCounts(JSContext *cx);
21269
21270 __attribute__((visibility("default"))) size_t
21271 GetPCCountScriptCount(JSContext *cx);
21272
21273 __attribute__((visibility("default"))) JSString *
21274 GetPCCountScriptSummary(JSContext *cx, size_t script);
21275
21276 __attribute__((visibility("default"))) JSString *
21277 GetPCCountScriptContents(JSContext *cx, size_t script);
21278
21279
21280 __attribute__((visibility("default"))) void *
21281 GetOwnerThread(const JSContext *cx);
21282
21283 __attribute__((visibility("default"))) unsigned
21284 GetContextOutstandingRequests(const JSContext *cx);
21285
21286
21287 __attribute__((visibility("default"))) JSCompartment *
21288 GetContextCompartment(const JSContext *cx);
21289
21290 __attribute__((visibility("default"))) bool
21291 HasUnrootedGlobal(const JSContext *cx);
21292
21293 typedef void
21294 (* ActivityCallback)(void *arg, JSBool active);
21295
21296
21297
21298
21299
21300
21301 __attribute__((visibility("default"))) void
21302 SetActivityCallback(JSRuntime *rt, ActivityCallback cb, void *arg);
21303
21304 extern __attribute__((visibility("default"))) const JSStructuredCloneCallbacks *
21305 GetContextStructuredCloneCallbacks(JSContext *cx);
21306
21307 extern __attribute__((visibility("default"))) JSVersion
21308 VersionSetMoarXML(JSVersion version, bool enable);
21309
21310 extern __attribute__((visibility("default"))) bool
21311 CanCallContextDebugHandler(JSContext *cx);
21312
21313 extern __attribute__((visibility("default"))) JSTrapStatus
21314 CallContextDebugHandler(JSContext *cx, JSScript *script, jsbytecode *bc, Value *rval);
21315
21316 extern __attribute__((visibility("default"))) bool
21317 IsContextRunningJS(JSContext *cx);
21318
21319 class SystemAllocPolicy;
21320 typedef Vector<JSCompartment*, 0, SystemAllocPolicy> CompartmentVector;
21321 extern __attribute__((visibility("default"))) const CompartmentVector&
21322 GetRuntimeCompartments(JSRuntime *rt);
21323
21324 extern __attribute__((visibility("default"))) size_t
21325 SizeOfJSContext();
21326
21327 #define GCREASONS(D) D(API) D(MAYBEGC) D(LAST_CONTEXT) D(DESTROY_CONTEXT) D(LAST_DITCH) D(TOO_MUCH_MALLOC) D(ALLOC_TRIGGER) D(DEBUG_GC) D(DEBUG_MODE_GC) D(UNUSED3) D(DOM_WINDOW_UTILS) D(COMPONENT_UTILS) D(MEM_PRESSURE) D(CC_WAITING) D(CC_FORCED) D(LOAD_END) D(POST_COMPARTMENT) D(PAGE_HIDE) D(NSJSCONTEXT_DESTROY) D(SET_NEW_DOCUMENT) D(SET_DOC_SHELL) D(DOM_UTILS) D(DOM_IPC) D(DOM_WORKER) D(INTER_SLICE_GC) D(REFRESH_FRAME) D(FULL_GC_TIMER)
21328 # 613 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsfriendapi.h"
21329 namespace gcreason {
21330
21331
21332 enum Reason {
21333 #define MAKE_REASON(name) name,
21334 API, MAYBEGC, LAST_CONTEXT, DESTROY_CONTEXT, LAST_DITCH, TOO_MUCH_MALLOC, ALLOC_TRIGGER, DEBUG_GC, DEBUG_MODE_GC, UNUSED3, DOM_WINDOW_UTILS, COMPONENT_UTILS, MEM_PRESSURE, CC_WAITING, CC_FORCED, LOAD_END, POST_COMPARTMENT, PAGE_HIDE, NSJSCONTEXT_DESTROY, SET_NEW_DOCUMENT, SET_DOC_SHELL, DOM_UTILS, DOM_IPC, DOM_WORKER, INTER_SLICE_GC, REFRESH_FRAME, FULL_GC_TIMER,
21335 #undef MAKE_REASON
21336 NO_REASON,
21337 NUM_REASONS
21338 };
21339
21340 }
21341
21342 extern __attribute__((visibility("default"))) void
21343 PrepareCompartmentForGC(JSCompartment *comp);
21344
21345 extern __attribute__((visibility("default"))) void
21346 PrepareForFullGC(JSRuntime *rt);
21347
21348 extern __attribute__((visibility("default"))) bool
21349 IsGCScheduled(JSRuntime *rt);
21350
21351 extern __attribute__((visibility("default"))) void
21352 SkipCompartmentForGC(JSCompartment *comp);
21353 # 645 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsfriendapi.h"
21354 extern __attribute__((visibility("default"))) void
21355 GCForReason(JSRuntime *rt, gcreason::Reason reason);
21356
21357 extern __attribute__((visibility("default"))) void
21358 ShrinkingGC(JSRuntime *rt, gcreason::Reason reason);
21359
21360 extern __attribute__((visibility("default"))) void
21361 IncrementalGC(JSRuntime *rt, gcreason::Reason reason);
21362
21363 extern __attribute__((visibility("default"))) void
21364 SetGCSliceTimeBudget(JSContext *cx, int64_t millis);
21365
21366 enum GCProgress {
21367 # 668 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsfriendapi.h"
21368 GC_CYCLE_BEGIN,
21369 GC_SLICE_BEGIN,
21370 GC_SLICE_END,
21371 GC_CYCLE_END
21372 };
21373
21374 struct __attribute__((visibility("default"))) GCDescription {
21375 bool isCompartment;
21376
21377 GCDescription(bool isCompartment)
21378 : isCompartment(isCompartment) {}
21379
21380 jschar *formatMessage(JSRuntime *rt) const;
21381 jschar *formatJSON(JSRuntime *rt, uint64_t timestamp) const;
21382 };
21383
21384 typedef void
21385 (* GCSliceCallback)(JSRuntime *rt, GCProgress progress, const GCDescription &desc);
21386
21387 extern __attribute__((visibility("default"))) GCSliceCallback
21388 SetGCSliceCallback(JSRuntime *rt, GCSliceCallback callback);
21389
21390
21391
21392
21393
21394 extern __attribute__((visibility("default"))) void
21395 NotifyDidPaint(JSRuntime *rt);
21396
21397 extern __attribute__((visibility("default"))) bool
21398 IsIncrementalGCEnabled(JSRuntime *rt);
21399
21400 extern __attribute__((visibility("default"))) void
21401 DisableIncrementalGC(JSRuntime *rt);
21402
21403 extern __attribute__((visibility("default"))) bool
21404 IsIncrementalBarrierNeeded(JSRuntime *rt);
21405
21406 extern __attribute__((visibility("default"))) bool
21407 IsIncrementalBarrierNeeded(JSContext *cx);
21408
21409 extern __attribute__((visibility("default"))) bool
21410 IsIncrementalBarrierNeededOnObject(JSObject *obj);
21411
21412 extern __attribute__((visibility("default"))) bool
21413 IsIncrementalBarrierNeededOnScript(JSScript *obj);
21414
21415 extern __attribute__((visibility("default"))) void
21416 IncrementalReferenceBarrier(void *ptr);
21417
21418 extern __attribute__((visibility("default"))) void
21419 IncrementalValueBarrier(const Value &v);
21420
21421 extern __attribute__((visibility("default"))) void
21422 PokeGC(JSRuntime *rt);
21423
21424 class ObjectPtr
21425 {
21426 JSObject *value;
21427
21428 public:
21429 ObjectPtr() : value(__null) {}
21430
21431 ObjectPtr(JSObject *obj) : value(obj) {}
21432
21433
21434 ~ObjectPtr() { do { } while(0); }
21435
21436 void finalize(JSRuntime *rt) {
21437 if (IsIncrementalBarrierNeeded(rt))
21438 IncrementalReferenceBarrier(value);
21439 value = __null;
21440 }
21441
21442 void init(JSObject *obj) { value = obj; }
21443
21444 JSObject *get() const { return value; }
21445
21446 void writeBarrierPre(JSRuntime *rt) {
21447 IncrementalReferenceBarrier(value);
21448 }
21449
21450 ObjectPtr &operator=(JSObject *obj) {
21451 IncrementalReferenceBarrier(value);
21452 value = obj;
21453 return *this;
21454 }
21455
21456 JSObject &operator*() const { return *value; }
21457 JSObject *operator->() const { return value; }
21458 operator JSObject *() const { return value; }
21459 };
21460
21461 extern __attribute__((visibility("default"))) JSObject *
21462 GetTestingFunctions(JSContext *cx);
21463
21464
21465
21466
21467
21468
21469 inline JSFreeOp *
21470 CastToJSFreeOp(FreeOp *fop)
21471 {
21472 return reinterpret_cast<JSFreeOp *>(fop);
21473 }
21474
21475
21476
21477
21478
21479
21480
21481 extern __attribute__((visibility("default"))) const jschar*
21482 GetErrorTypeNameFromNumber(JSContext* cx, const unsigned errorNumber);
21483
21484
21485 typedef enum NukedGlobalHandling {
21486 NukeForGlobalObject,
21487 DontNukeForGlobalObject
21488 } NukedGlobalHandling;
21489
21490 extern __attribute__((visibility("default"))) JSBool
21491 NukeChromeCrossCompartmentWrappersForGlobal(JSContext *cx, JSObject *obj,
21492 NukedGlobalHandling nukeGlobal);
21493
21494 }
21495 # 804 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsfriendapi.h"
21496 extern __attribute__((visibility("default"))) JSBool
21497 js_DateIsValid(JSContext *cx, JSObject* obj);
21498
21499 extern __attribute__((visibility("default"))) double
21500 js_DateGetMsecSinceEpoch(JSContext *cx, JSObject *obj);
21501
21502
21503
21504
21505
21506
21507
21508 typedef enum JSErrNum {
21509 #define MSG_DEF(name,number,count,exception,format) name = number,
21510
21511 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/js.msg" 1
21512 # 53 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/js.msg"
21513 JSMSG_NOT_AN_ERROR = 0,
21514 JSMSG_NOT_DEFINED = 1,
21515 JSMSG_INACTIVE = 2,
21516 JSMSG_MORE_ARGS_NEEDED = 3,
21517 JSMSG_BAD_CHAR = 4,
21518 JSMSG_BAD_TYPE = 5,
21519 JSMSG_ALLOC_OVERFLOW = 6,
21520 JSMSG_MISSING_HEXDIGITS = 7,
21521 JSMSG_INCOMPATIBLE_PROTO = 8,
21522 JSMSG_NO_CONSTRUCTOR = 9,
21523 JSMSG_CANT_ALIAS = 10,
21524 JSMSG_NOT_SCRIPTED_FUNCTION = 11,
21525 JSMSG_BAD_SORT_ARG = 12,
21526 JSMSG_BAD_ATOMIC_NUMBER = 13,
21527 JSMSG_TOO_MANY_LITERALS = 14,
21528 JSMSG_CANT_WATCH = 15,
21529 JSMSG_STACK_UNDERFLOW = 16,
21530 JSMSG_NEED_DIET = 17,
21531 JSMSG_TOO_MANY_LOCAL_ROOTS = 18,
21532 JSMSG_READ_ONLY = 19,
21533 JSMSG_BAD_FORMAL = 20,
21534 JSMSG_CANT_DELETE = 21,
21535 JSMSG_NOT_FUNCTION = 22,
21536 JSMSG_NOT_CONSTRUCTOR = 23,
21537 JSMSG_INVALID_DATE = 24,
21538 JSMSG_TOO_DEEP = 25,
21539 JSMSG_OVER_RECURSED = 26,
21540 JSMSG_IN_NOT_OBJECT = 27,
21541 JSMSG_BAD_NEW_RESULT = 28,
21542 JSMSG_BAD_SHARP_DEF = 29,
21543 JSMSG_BAD_SHARP_USE = 30,
21544 JSMSG_BAD_INSTANCEOF_RHS = 31,
21545 JSMSG_BAD_BYTECODE = 32,
21546 JSMSG_BAD_RADIX = 33,
21547 JSMSG_PAREN_BEFORE_LET = 34,
21548 JSMSG_CANT_CONVERT = 35,
21549 JSMSG_CYCLIC_VALUE = 36,
21550 JSMSG_COMPILE_EXECED_SCRIPT = 37,
21551 JSMSG_CANT_CONVERT_TO = 38,
21552 JSMSG_NO_PROPERTIES = 39,
21553 JSMSG_CANT_FIND_CLASS = 40,
21554 JSMSG_DEAD_OBJECT = 41,
21555 JSMSG_BYTECODE_TOO_BIG = 42,
21556 JSMSG_UNKNOWN_FORMAT = 43,
21557 JSMSG_TOO_MANY_CON_ARGS = 44,
21558 JSMSG_TOO_MANY_FUN_ARGS = 45,
21559 JSMSG_BAD_QUANTIFIER = 46,
21560 JSMSG_MIN_TOO_BIG = 47,
21561 JSMSG_MAX_TOO_BIG = 48,
21562 JSMSG_OUT_OF_ORDER = 49,
21563 JSMSG_BAD_DESTRUCT_DECL = 50,
21564 JSMSG_BAD_DESTRUCT_ASS = 51,
21565 JSMSG_PAREN_AFTER_LET = 52,
21566 JSMSG_CURLY_AFTER_LET = 53,
21567 JSMSG_MISSING_PAREN = 54,
21568 JSMSG_UNTERM_CLASS = 55,
21569 JSMSG_TRAILING_SLASH = 56,
21570 JSMSG_BAD_CLASS_RANGE = 57,
21571 JSMSG_BAD_REGEXP_FLAG = 58,
21572 JSMSG_NO_INPUT = 59,
21573 JSMSG_CANT_OPEN = 60,
21574 JSMSG_TOO_MANY_FUN_APPLY_ARGS = 61,
21575 JSMSG_UNMATCHED_RIGHT_PAREN = 62,
21576 JSMSG_TOO_BIG_TO_ENCODE = 63,
21577 JSMSG_ARG_INDEX_OUT_OF_RANGE = 64,
21578 JSMSG_UNUSED65 = 65,
21579 JSMSG_UNUSED66 = 66,
21580 JSMSG_UNUSED67 = 67,
21581 JSMSG_BAD_SCRIPT_MAGIC = 68,
21582 JSMSG_PAREN_BEFORE_FORMAL = 69,
21583 JSMSG_MISSING_FORMAL = 70,
21584 JSMSG_PAREN_AFTER_FORMAL = 71,
21585 JSMSG_CURLY_BEFORE_BODY = 72,
21586 JSMSG_CURLY_AFTER_BODY = 73,
21587 JSMSG_PAREN_BEFORE_COND = 74,
21588 JSMSG_PAREN_AFTER_COND = 75,
21589 JSMSG_DESTRUCT_DUP_ARG = 76,
21590 JSMSG_NAME_AFTER_DOT = 77,
21591 JSMSG_BRACKET_IN_INDEX = 78,
21592 JSMSG_XML_WHOLE_PROGRAM = 79,
21593 JSMSG_PAREN_BEFORE_SWITCH = 80,
21594 JSMSG_PAREN_AFTER_SWITCH = 81,
21595 JSMSG_CURLY_BEFORE_SWITCH = 82,
21596 JSMSG_COLON_AFTER_CASE = 83,
21597 JSMSG_WHILE_AFTER_DO = 84,
21598 JSMSG_PAREN_AFTER_FOR = 85,
21599 JSMSG_SEMI_AFTER_FOR_INIT = 86,
21600 JSMSG_SEMI_AFTER_FOR_COND = 87,
21601 JSMSG_PAREN_AFTER_FOR_CTRL = 88,
21602 JSMSG_CURLY_BEFORE_TRY = 89,
21603 JSMSG_CURLY_AFTER_TRY = 90,
21604 JSMSG_PAREN_BEFORE_CATCH = 91,
21605 JSMSG_CATCH_IDENTIFIER = 92,
21606 JSMSG_PAREN_AFTER_CATCH = 93,
21607 JSMSG_CURLY_BEFORE_CATCH = 94,
21608 JSMSG_CURLY_AFTER_CATCH = 95,
21609 JSMSG_CURLY_BEFORE_FINALLY = 96,
21610 JSMSG_CURLY_AFTER_FINALLY = 97,
21611 JSMSG_CATCH_OR_FINALLY = 98,
21612 JSMSG_PAREN_BEFORE_WITH = 99,
21613 JSMSG_PAREN_AFTER_WITH = 100,
21614 JSMSG_CURLY_IN_COMPOUND = 101,
21615 JSMSG_NO_VARIABLE_NAME = 102,
21616 JSMSG_COLON_IN_COND = 103,
21617 JSMSG_PAREN_AFTER_ARGS = 104,
21618 JSMSG_BRACKET_AFTER_LIST = 105,
21619 JSMSG_COLON_AFTER_ID = 106,
21620 JSMSG_CURLY_AFTER_LIST = 107,
21621 JSMSG_PAREN_IN_PAREN = 108,
21622 JSMSG_SEMI_BEFORE_STMNT = 109,
21623 JSMSG_NO_RETURN_VALUE = 110,
21624 JSMSG_DUPLICATE_FORMAL = 111,
21625 JSMSG_EQUAL_AS_ASSIGN = 112,
21626 JSMSG_OPTIMIZED_CLOSURE_LEAK = 113,
21627 JSMSG_TOO_MANY_DEFAULTS = 114,
21628 JSMSG_TOO_MANY_CASES = 115,
21629 JSMSG_BAD_SWITCH = 116,
21630 JSMSG_BAD_FOR_LEFTSIDE = 117,
21631 JSMSG_CATCH_AFTER_GENERAL = 118,
21632 JSMSG_CATCH_WITHOUT_TRY = 119,
21633 JSMSG_FINALLY_WITHOUT_TRY = 120,
21634 JSMSG_LABEL_NOT_FOUND = 121,
21635 JSMSG_TOUGH_BREAK = 122,
21636 JSMSG_BAD_CONTINUE = 123,
21637 JSMSG_BAD_RETURN_OR_YIELD = 124,
21638 JSMSG_BAD_LABEL = 125,
21639 JSMSG_DUPLICATE_LABEL = 126,
21640 JSMSG_VAR_HIDES_ARG = 127,
21641 JSMSG_BAD_VAR_INIT = 128,
21642 JSMSG_BAD_LEFTSIDE_OF_ASS = 129,
21643 JSMSG_BAD_OPERAND = 130,
21644 JSMSG_BAD_PROP_ID = 131,
21645 JSMSG_RESERVED_ID = 132,
21646 JSMSG_SYNTAX_ERROR = 133,
21647 JSMSG_BAD_SHARP_VAR_DEF = 134,
21648 JSMSG_BAD_PROTOTYPE = 135,
21649 JSMSG_MISSING_EXPONENT = 136,
21650 JSMSG_OUT_OF_MEMORY = 137,
21651 JSMSG_UNTERMINATED_STRING = 138,
21652 JSMSG_TOO_MANY_PARENS = 139,
21653 JSMSG_UNTERMINATED_COMMENT = 140,
21654 JSMSG_UNTERMINATED_REGEXP = 141,
21655 JSMSG_BAD_CLONE_FUNOBJ_SCOPE = 142,
21656 JSMSG_SHARPVAR_TOO_BIG = 143,
21657 JSMSG_ILLEGAL_CHARACTER = 144,
21658 JSMSG_BAD_OCTAL = 145,
21659 JSMSG_BAD_INDIRECT_CALL = 146,
21660 JSMSG_UNCAUGHT_EXCEPTION = 147,
21661 JSMSG_INVALID_BACKREF = 148,
21662 JSMSG_BAD_BACKREF = 149,
21663 JSMSG_PRECISION_RANGE = 150,
21664 JSMSG_BAD_GETTER_OR_SETTER = 151,
21665 JSMSG_BAD_ARRAY_LENGTH = 152,
21666 JSMSG_CANT_DESCRIBE_PROPS = 153,
21667 JSMSG_BAD_APPLY_ARGS = 154,
21668 JSMSG_REDECLARED_VAR = 155,
21669 JSMSG_UNDECLARED_VAR = 156,
21670 JSMSG_ANON_NO_RETURN_VALUE = 157,
21671 JSMSG_DEPRECATED_USAGE = 158,
21672 JSMSG_BAD_URI = 159,
21673 JSMSG_GETTER_ONLY = 160,
21674 JSMSG_IDSTART_AFTER_NUMBER = 161,
21675 JSMSG_UNDEFINED_PROP = 162,
21676 JSMSG_USELESS_EXPR = 163,
21677 JSMSG_REDECLARED_PARAM = 164,
21678 JSMSG_NEWREGEXP_FLAGGED = 165,
21679 JSMSG_RESERVED_SLOT_RANGE = 166,
21680 JSMSG_CANT_DECODE_PRINCIPALS = 167,
21681 JSMSG_CANT_SEAL_OBJECT = 168,
21682 JSMSG_TOO_MANY_CATCH_VARS = 169,
21683 JSMSG_BAD_XML_MARKUP = 170,
21684 JSMSG_BAD_XML_CHARACTER = 171,
21685 JSMSG_BAD_DEFAULT_XML_NAMESPACE = 172,
21686 JSMSG_BAD_XML_NAME_SYNTAX = 173,
21687 JSMSG_BRACKET_AFTER_ATTR_EXPR = 174,
21688 JSMSG_NESTING_GENERATOR = 175,
21689 JSMSG_CURLY_IN_XML_EXPR = 176,
21690 JSMSG_BAD_XML_NAMESPACE = 177,
21691 JSMSG_BAD_XML_ATTR_NAME = 178,
21692 JSMSG_BAD_XML_NAME = 179,
21693 JSMSG_BAD_XML_CONVERSION = 180,
21694 JSMSG_BAD_XMLLIST_CONVERSION = 181,
21695 JSMSG_BAD_GENERATOR_SEND = 182,
21696 JSMSG_NO_ASSIGN_IN_XML_ATTR = 183,
21697 JSMSG_BAD_XML_ATTR_VALUE = 184,
21698 JSMSG_XML_TAG_NAME_MISMATCH = 185,
21699 JSMSG_BAD_XML_TAG_SYNTAX = 186,
21700 JSMSG_BAD_XML_LIST_SYNTAX = 187,
21701 JSMSG_INCOMPATIBLE_METHOD = 188,
21702 JSMSG_CANT_SET_XML_ATTRS = 189,
21703 JSMSG_END_OF_XML_SOURCE = 190,
21704 JSMSG_END_OF_XML_ENTITY = 191,
21705 JSMSG_BAD_XML_QNAME = 192,
21706 JSMSG_BAD_FOR_EACH_LOOP = 193,
21707 JSMSG_BAD_XMLLIST_PUT = 194,
21708 JSMSG_UNKNOWN_XML_ENTITY = 195,
21709 JSMSG_BAD_XML_NCR = 196,
21710 JSMSG_UNDEFINED_XML_NAME = 197,
21711 JSMSG_DUPLICATE_XML_ATTR = 198,
21712 JSMSG_TOO_MANY_LOCALS = 199,
21713 JSMSG_ARRAY_INIT_TOO_BIG = 200,
21714 JSMSG_REGEXP_TOO_COMPLEX = 201,
21715 JSMSG_BUFFER_TOO_SMALL = 202,
21716 JSMSG_BAD_SURROGATE_CHAR = 203,
21717 JSMSG_UTF8_CHAR_TOO_LARGE = 204,
21718 JSMSG_MALFORMED_UTF8_CHAR = 205,
21719 JSMSG_USER_DEFINED_ERROR = 206,
21720 JSMSG_WRONG_CONSTRUCTOR = 207,
21721 JSMSG_BAD_GENERATOR_RETURN = 208,
21722 JSMSG_BAD_ANON_GENERATOR_RETURN = 209,
21723 JSMSG_NAME_AFTER_FOR_PAREN = 210,
21724 JSMSG_IN_AFTER_FOR_NAME = 211,
21725 JSMSG_BAD_TRAP_RETURN_VALUE = 212,
21726 JSMSG_KEYWORD_NOT_NS = 213,
21727 JSMSG_BAD_GENERATOR_YIELD = 214,
21728 JSMSG_BAD_GENERATOR_SYNTAX = 215,
21729 JSMSG_ARRAY_COMP_LEFTSIDE = 216,
21730 JSMSG_NON_XML_FILTER = 217,
21731 JSMSG_EMPTY_ARRAY_REDUCE = 218,
21732 JSMSG_NON_LIST_XML_METHOD = 219,
21733 JSMSG_BAD_DELETE_OPERAND = 220,
21734 JSMSG_BAD_INCOP_OPERAND = 221,
21735 JSMSG_UNEXPECTED_TYPE = 222,
21736 JSMSG_LET_DECL_NOT_IN_BLOCK = 223,
21737 JSMSG_BAD_OBJECT_INIT = 224,
21738 JSMSG_CANT_SET_ARRAY_ATTRS = 225,
21739 JSMSG_EVAL_ARITY = 226,
21740 JSMSG_MISSING_FUN_ARG = 227,
21741 JSMSG_JSON_BAD_PARSE = 228,
21742 JSMSG_JSON_BAD_STRINGIFY = 229,
21743 JSMSG_NOT_CALLABLE_OR_UNDEFINED = 230,
21744 JSMSG_NOT_NONNULL_OBJECT = 231,
21745 JSMSG_DEPRECATED_OCTAL = 232,
21746 JSMSG_STRICT_CODE_WITH = 233,
21747 JSMSG_DUPLICATE_PROPERTY = 234,
21748 JSMSG_DEPRECATED_DELETE_OPERAND = 235,
21749 JSMSG_DEPRECATED_ASSIGN = 236,
21750 JSMSG_BAD_BINDING = 237,
21751 JSMSG_INVALID_DESCRIPTOR = 238,
21752 JSMSG_OBJECT_NOT_EXTENSIBLE = 239,
21753 JSMSG_CANT_REDEFINE_PROP = 240,
21754 JSMSG_CANT_APPEND_TO_ARRAY = 241,
21755 JSMSG_CANT_DEFINE_ARRAY_LENGTH = 242,
21756 JSMSG_CANT_DEFINE_ARRAY_INDEX = 243,
21757 JSMSG_TYPED_ARRAY_BAD_INDEX = 244,
21758 JSMSG_TYPED_ARRAY_NEGATIVE_ARG = 245,
21759 JSMSG_TYPED_ARRAY_BAD_ARGS = 246,
21760 JSMSG_CSP_BLOCKED_FUNCTION = 247,
21761 JSMSG_BAD_GET_SET_FIELD = 248,
21762 JSMSG_BAD_PROXY_FIX = 249,
21763 JSMSG_INVALID_EVAL_SCOPE_ARG = 250,
21764 JSMSG_ACCESSOR_WRONG_ARGS = 251,
21765 JSMSG_THROW_TYPE_ERROR = 252,
21766 JSMSG_BAD_TOISOSTRING_PROP = 253,
21767 JSMSG_BAD_PARSE_NODE = 254,
21768 JSMSG_NOT_EXPECTED_TYPE = 255,
21769 JSMSG_CALLER_IS_STRICT = 256,
21770 JSMSG_NEED_DEBUG_MODE = 257,
21771 JSMSG_STRICT_CODE_LET_EXPR_STMT = 258,
21772 JSMSG_CANT_CHANGE_EXTENSIBILITY = 259,
21773 JSMSG_SC_BAD_SERIALIZED_DATA = 260,
21774 JSMSG_SC_UNSUPPORTED_TYPE = 261,
21775 JSMSG_SC_RECURSION = 262,
21776 JSMSG_CANT_WRAP_XML_OBJECT = 263,
21777 JSMSG_BAD_CLONE_VERSION = 264,
21778 JSMSG_CANT_CLONE_OBJECT = 265,
21779 JSMSG_NON_NATIVE_SCOPE = 266,
21780 JSMSG_STRICT_FUNCTION_STATEMENT = 267,
21781 JSMSG_INVALID_FOR_IN_INIT = 268,
21782 JSMSG_CLEARED_SCOPE = 269,
21783 JSMSG_MALFORMED_ESCAPE = 270,
21784 JSMSG_BAD_GENEXP_BODY = 271,
21785 JSMSG_XML_PROTO_FORBIDDEN = 272,
21786 JSMSG_UNNAMED_FUNCTION_STMT = 273,
21787 JSMSG_CCW_REQUIRED = 274,
21788 JSMSG_DEBUG_BAD_RESUMPTION = 275,
21789 JSMSG_ASSIGN_FUNCTION_OR_NULL = 276,
21790 JSMSG_DEBUG_NOT_LIVE = 277,
21791 JSMSG_DEBUG_OBJECT_WRONG_OWNER = 278,
21792 JSMSG_DEBUG_OBJECT_PROTO = 279,
21793 JSMSG_DEBUG_LOOP = 280,
21794 JSMSG_DEBUG_NOT_IDLE = 281,
21795 JSMSG_DEBUG_BAD_OFFSET = 282,
21796 JSMSG_DEBUG_BAD_LINE = 283,
21797 JSMSG_DEBUG_NOT_DEBUGGING = 284,
21798 JSMSG_DEBUG_COMPARTMENT_MISMATCH = 285,
21799 JSMSG_DEBUG_NOT_SCRIPT_FRAME = 286,
21800 JSMSG_CANT_WATCH_PROP = 287,
21801 JSMSG_CSP_BLOCKED_EVAL = 288,
21802 JSMSG_DEBUG_NO_SCOPE_OBJECT = 289,
21803 JSMSG_EMPTY_CONSEQUENT = 290,
21804 JSMSG_NOT_ITERABLE = 291,
21805 JSMSG_QUERY_LINE_WITHOUT_URL = 292,
21806 JSMSG_QUERY_INNERMOST_WITHOUT_LINE_URL = 293,
21807 JSMSG_DEBUG_VARIABLE_NOT_FOUND = 294,
21808 JSMSG_PARAMETER_AFTER_REST = 295,
21809 JSMSG_NO_REST_NAME = 296,
21810 JSMSG_ARGUMENTS_AND_REST = 297,
21811 JSMSG_FUNCTION_ARGUMENTS_AND_REST = 298,
21812 JSMSG_REST_WITH_DEFAULT = 299,
21813 JSMSG_NONDEFAULT_FORMAL_AFTER_DEFAULT = 300,
21814 JSMSG_YIELD_IN_DEFAULT = 301,
21815 # 820 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsfriendapi.h" 2
21816 #undef MSG_DEF
21817 JSErr_Limit
21818 } JSErrNum;
21819
21820 extern __attribute__((visibility("default"))) const JSErrorFormatString *
21821 js_GetErrorMessage(void *userRef, const char *locale, const unsigned errorNumber);
21822
21823
21824
21825 extern __attribute__((visibility("default"))) uint64_t
21826 js_GetSCOffset(JSStructuredCloneWriter* writer);
21827
21828
21829
21830
21831
21832 namespace js {
21833 namespace ArrayBufferView {
21834
21835 enum ViewType {
21836 TYPE_INT8 = 0,
21837 TYPE_UINT8,
21838 TYPE_INT16,
21839 TYPE_UINT16,
21840 TYPE_INT32,
21841 TYPE_UINT32,
21842 TYPE_FLOAT32,
21843 TYPE_FLOAT64,
21844
21845
21846
21847
21848
21849 TYPE_UINT8_CLAMPED,
21850
21851 TYPE_MAX
21852 };
21853
21854 }
21855 }
21856
21857 typedef js::ArrayBufferView::ViewType JSArrayBufferViewType;
21858 # 870 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsfriendapi.h"
21859 extern __attribute__((visibility("default"))) JSObject *
21860 JS_NewInt8Array(JSContext *cx, uint32_t nelements);
21861 extern __attribute__((visibility("default"))) JSObject *
21862 JS_NewUint8Array(JSContext *cx, uint32_t nelements);
21863 extern __attribute__((visibility("default"))) JSObject *
21864 JS_NewUint8ClampedArray(JSContext *cx, uint32_t nelements);
21865
21866 extern __attribute__((visibility("default"))) JSObject *
21867 JS_NewInt16Array(JSContext *cx, uint32_t nelements);
21868 extern __attribute__((visibility("default"))) JSObject *
21869 JS_NewUint16Array(JSContext *cx, uint32_t nelements);
21870 extern __attribute__((visibility("default"))) JSObject *
21871 JS_NewInt32Array(JSContext *cx, uint32_t nelements);
21872 extern __attribute__((visibility("default"))) JSObject *
21873 JS_NewUint32Array(JSContext *cx, uint32_t nelements);
21874 extern __attribute__((visibility("default"))) JSObject *
21875 JS_NewFloat32Array(JSContext *cx, uint32_t nelements);
21876 extern __attribute__((visibility("default"))) JSObject *
21877 JS_NewFloat64Array(JSContext *cx, uint32_t nelements);
21878 # 898 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsfriendapi.h"
21879 extern __attribute__((visibility("default"))) JSObject *
21880 JS_NewInt8ArrayFromArray(JSContext *cx, JSObject *array);
21881 extern __attribute__((visibility("default"))) JSObject *
21882 JS_NewUint8ArrayFromArray(JSContext *cx, JSObject *array);
21883 extern __attribute__((visibility("default"))) JSObject *
21884 JS_NewUint8ClampedArrayFromArray(JSContext *cx, JSObject *array);
21885 extern __attribute__((visibility("default"))) JSObject *
21886 JS_NewInt16ArrayFromArray(JSContext *cx, JSObject *array);
21887 extern __attribute__((visibility("default"))) JSObject *
21888 JS_NewUint16ArrayFromArray(JSContext *cx, JSObject *array);
21889 extern __attribute__((visibility("default"))) JSObject *
21890 JS_NewInt32ArrayFromArray(JSContext *cx, JSObject *array);
21891 extern __attribute__((visibility("default"))) JSObject *
21892 JS_NewUint32ArrayFromArray(JSContext *cx, JSObject *array);
21893 extern __attribute__((visibility("default"))) JSObject *
21894 JS_NewFloat32ArrayFromArray(JSContext *cx, JSObject *array);
21895 extern __attribute__((visibility("default"))) JSObject *
21896 JS_NewFloat64ArrayFromArray(JSContext *cx, JSObject *array);
21897 # 924 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsfriendapi.h"
21898 extern __attribute__((visibility("default"))) JSObject *
21899 JS_NewInt8ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,
21900 uint32_t byteOffset, int32_t length);
21901 extern __attribute__((visibility("default"))) JSObject *
21902 JS_NewUint8ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,
21903 uint32_t byteOffset, int32_t length);
21904 extern __attribute__((visibility("default"))) JSObject *
21905 JS_NewUint8ClampedArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,
21906 uint32_t byteOffset, int32_t length);
21907 extern __attribute__((visibility("default"))) JSObject *
21908 JS_NewInt16ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,
21909 uint32_t byteOffset, int32_t length);
21910 extern __attribute__((visibility("default"))) JSObject *
21911 JS_NewUint16ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,
21912 uint32_t byteOffset, int32_t length);
21913 extern __attribute__((visibility("default"))) JSObject *
21914 JS_NewInt32ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,
21915 uint32_t byteOffset, int32_t length);
21916 extern __attribute__((visibility("default"))) JSObject *
21917 JS_NewUint32ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,
21918 uint32_t byteOffset, int32_t length);
21919 extern __attribute__((visibility("default"))) JSObject *
21920 JS_NewFloat32ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,
21921 uint32_t byteOffset, int32_t length);
21922 extern __attribute__((visibility("default"))) JSObject *
21923 JS_NewFloat64ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,
21924 uint32_t byteOffset, int32_t length);
21925
21926
21927
21928
21929 extern __attribute__((visibility("default"))) JSObject *
21930 JS_NewArrayBuffer(JSContext *cx, uint32_t nbytes);
21931
21932
21933
21934
21935
21936
21937
21938 extern __attribute__((visibility("default"))) JSBool
21939 JS_IsTypedArrayObject(JSObject *obj, JSContext *cx);
21940 # 974 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsfriendapi.h"
21941 extern __attribute__((visibility("default"))) JSBool
21942 JS_IsArrayBufferViewObject(JSObject *obj, JSContext *cx);
21943
21944
21945
21946
21947
21948 extern __attribute__((visibility("default"))) JSBool
21949 JS_IsInt8Array(JSObject *obj, JSContext *cx);
21950 extern __attribute__((visibility("default"))) JSBool
21951 JS_IsUint8Array(JSObject *obj, JSContext *cx);
21952 extern __attribute__((visibility("default"))) JSBool
21953 JS_IsUint8ClampedArray(JSObject *obj, JSContext *cx);
21954 extern __attribute__((visibility("default"))) JSBool
21955 JS_IsInt16Array(JSObject *obj, JSContext *cx);
21956 extern __attribute__((visibility("default"))) JSBool
21957 JS_IsUint16Array(JSObject *obj, JSContext *cx);
21958 extern __attribute__((visibility("default"))) JSBool
21959 JS_IsInt32Array(JSObject *obj, JSContext *cx);
21960 extern __attribute__((visibility("default"))) JSBool
21961 JS_IsUint32Array(JSObject *obj, JSContext *cx);
21962 extern __attribute__((visibility("default"))) JSBool
21963 JS_IsFloat32Array(JSObject *obj, JSContext *cx);
21964 extern __attribute__((visibility("default"))) JSBool
21965 JS_IsFloat64Array(JSObject *obj, JSContext *cx);
21966 # 1008 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsfriendapi.h"
21967 extern __attribute__((visibility("default"))) JSArrayBufferViewType
21968 JS_GetTypedArrayType(JSObject *obj, JSContext *cx);
21969
21970
21971
21972
21973
21974
21975
21976 extern __attribute__((visibility("default"))) JSBool
21977 JS_IsArrayBufferObject(JSObject *obj, JSContext *cx);
21978 # 1028 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsfriendapi.h"
21979 extern __attribute__((visibility("default"))) uint32_t
21980 JS_GetArrayBufferByteLength(JSObject *obj, JSContext *cx);
21981 # 1040 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsfriendapi.h"
21982 extern __attribute__((visibility("default"))) uint8_t *
21983 JS_GetArrayBufferData(JSObject *obj, JSContext *cx);
21984 # 1051 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsfriendapi.h"
21985 extern __attribute__((visibility("default"))) uint32_t
21986 JS_GetTypedArrayLength(JSObject *obj, JSContext *cx);
21987 # 1063 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsfriendapi.h"
21988 extern __attribute__((visibility("default"))) uint32_t
21989 JS_GetTypedArrayByteOffset(JSObject *obj, JSContext *cx);
21990 # 1074 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsfriendapi.h"
21991 extern __attribute__((visibility("default"))) uint32_t
21992 JS_GetTypedArrayByteLength(JSObject *obj, JSContext *cx);
21993
21994
21995
21996
21997
21998
21999 extern __attribute__((visibility("default"))) JSBool
22000 JS_IsArrayBufferViewObject(JSObject *obj, JSContext *cx);
22001
22002
22003
22004
22005 extern __attribute__((visibility("default"))) uint32_t
22006 JS_GetArrayBufferViewByteLength(JSObject *obj, JSContext *cx);
22007 # 1102 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsfriendapi.h"
22008 extern __attribute__((visibility("default"))) int8_t *
22009 JS_GetInt8ArrayData(JSObject *obj, JSContext *cx);
22010 extern __attribute__((visibility("default"))) uint8_t *
22011 JS_GetUint8ArrayData(JSObject *obj, JSContext *cx);
22012 extern __attribute__((visibility("default"))) uint8_t *
22013 JS_GetUint8ClampedArrayData(JSObject *obj, JSContext *cx);
22014 extern __attribute__((visibility("default"))) int16_t *
22015 JS_GetInt16ArrayData(JSObject *obj, JSContext *cx);
22016 extern __attribute__((visibility("default"))) uint16_t *
22017 JS_GetUint16ArrayData(JSObject *obj, JSContext *cx);
22018 extern __attribute__((visibility("default"))) int32_t *
22019 JS_GetInt32ArrayData(JSObject *obj, JSContext *cx);
22020 extern __attribute__((visibility("default"))) uint32_t *
22021 JS_GetUint32ArrayData(JSObject *obj, JSContext *cx);
22022 extern __attribute__((visibility("default"))) float *
22023 JS_GetFloat32ArrayData(JSObject *obj, JSContext *cx);
22024 extern __attribute__((visibility("default"))) double *
22025 JS_GetFloat64ArrayData(JSObject *obj, JSContext *cx);
22026
22027
22028
22029
22030
22031 extern __attribute__((visibility("default"))) void *
22032 JS_GetArrayBufferViewData(JSObject *obj, JSContext *cx);
22033
22034
22035
22036
22037
22038
22039 __attribute__((visibility("default"))) JSBool
22040 JS_IsDataViewObject(JSContext *cx, JSObject *obj, JSBool *isDataView);
22041 # 1145 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsfriendapi.h"
22042 __attribute__((visibility("default"))) uint32_t
22043 JS_GetDataViewByteOffset(JSObject *obj, JSContext *cx);
22044 # 1156 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsfriendapi.h"
22045 __attribute__((visibility("default"))) uint32_t
22046 JS_GetDataViewByteLength(JSObject *obj, JSContext *cx);
22047 # 1167 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsfriendapi.h"
22048 __attribute__((visibility("default"))) void *
22049 JS_GetDataViewData(JSObject *obj, JSContext *cx);
22050 # 23 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobj.h" 2
22051 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinfer.h" 1
22052 # 10 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinfer.h"
22053 #define jsinfer_h___
22054
22055
22056
22057
22058
22059 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/ds/LifoAlloc.h" 1
22060 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/ds/LifoAlloc.h"
22061 #define LifoAlloc_h__
22062 # 24 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/ds/LifoAlloc.h"
22063 namespace js {
22064
22065 namespace detail {
22066
22067 static const size_t LIFO_ALLOC_ALIGN = 8;
22068
22069 __attribute__((always_inline)) inline
22070 char *
22071 AlignPtr(void *orig)
22072 {
22073 typedef tl::StaticAssert<
22074 tl::FloorLog2<LIFO_ALLOC_ALIGN>::result == tl::CeilingLog2<LIFO_ALLOC_ALIGN>::result
22075 >::result _;
22076
22077 char *result = (char *) ((uintptr_t(orig) + (LIFO_ALLOC_ALIGN - 1)) & (~LIFO_ALLOC_ALIGN + 1));
22078 do { } while(0);
22079 return result;
22080 }
22081
22082
22083 class BumpChunk
22084 {
22085 char *bump;
22086 char *limit;
22087 BumpChunk *next_;
22088 size_t bumpSpaceSize;
22089
22090 char *headerBase() { return reinterpret_cast<char *>(this); }
22091 char *bumpBase() const { return limit - bumpSpaceSize; }
22092
22093 BumpChunk *thisDuringConstruction() { return this; }
22094
22095 explicit BumpChunk(size_t bumpSpaceSize)
22096 : bump(reinterpret_cast<char *>(thisDuringConstruction()) + sizeof(BumpChunk)),
22097 limit(bump + bumpSpaceSize),
22098 next_(__null), bumpSpaceSize(bumpSpaceSize)
22099 {
22100 do { } while(0);
22101 }
22102
22103 void setBump(void *ptr) {
22104 do { } while(0);
22105 do { } while(0);
22106 DebugOnly<char *> prevBump = bump;
22107 bump = static_cast<char *>(ptr);
22108
22109
22110
22111
22112
22113
22114
22115 }
22116
22117 public:
22118 BumpChunk *next() const { return next_; }
22119 void setNext(BumpChunk *succ) { next_ = succ; }
22120
22121 size_t used() const { return bump - bumpBase(); }
22122 size_t sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf) {
22123 return mallocSizeOf(this);
22124 }
22125
22126 void resetBump() {
22127 setBump(headerBase() + sizeof(BumpChunk));
22128 }
22129
22130 void *mark() const { return bump; }
22131
22132 void release(void *mark) {
22133 do { } while(0);
22134 do { } while(0);
22135 setBump(mark);
22136 }
22137
22138 bool contains(void *mark) const {
22139 return bumpBase() <= mark && mark <= limit;
22140 }
22141
22142 bool canAlloc(size_t n);
22143
22144
22145 __attribute__((always_inline)) inline
22146 void *tryAlloc(size_t n) {
22147 char *aligned = AlignPtr(bump);
22148 char *newBump = aligned + n;
22149
22150 if (newBump > limit)
22151 return __null;
22152
22153
22154 if ((__builtin_expect((newBump < bump), 0)))
22155 return __null;
22156
22157 do { } while(0);
22158 setBump(newBump);
22159 return aligned;
22160 }
22161
22162 void *allocInfallible(size_t n) {
22163 void *result = tryAlloc(n);
22164 do { } while(0);
22165 return result;
22166 }
22167
22168 static BumpChunk *new_(size_t chunkSize);
22169 static void delete_(BumpChunk *chunk);
22170 };
22171
22172 }
22173
22174
22175
22176
22177
22178
22179
22180 class LifoAlloc
22181 {
22182 typedef detail::BumpChunk BumpChunk;
22183
22184 BumpChunk *first;
22185 BumpChunk *latest;
22186 size_t markCount;
22187 size_t defaultChunkSize_;
22188
22189 void operator=(const LifoAlloc &) ;
22190 LifoAlloc(const LifoAlloc &) ;
22191 # 160 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/ds/LifoAlloc.h"
22192 BumpChunk *getOrCreateChunk(size_t n);
22193
22194 void reset(size_t defaultChunkSize) {
22195 do { } while(0);
22196 first = latest = __null;
22197 defaultChunkSize_ = defaultChunkSize;
22198 markCount = 0;
22199 }
22200
22201 public:
22202 explicit LifoAlloc(size_t defaultChunkSize) { reset(defaultChunkSize); }
22203
22204
22205 void steal(LifoAlloc *other) {
22206 do { } while(0);
22207 PodCopy((char *) this, (char *) other, sizeof(*this));
22208 other->reset(defaultChunkSize_);
22209 }
22210
22211 ~LifoAlloc() { freeAll(); }
22212
22213 size_t defaultChunkSize() const { return defaultChunkSize_; }
22214
22215
22216 void freeAll();
22217
22218
22219 void freeUnused();
22220
22221 __attribute__((always_inline)) inline
22222 void *alloc(size_t n) {
22223 do {} while(0);
22224
22225 void *result;
22226 if (latest && (result = latest->tryAlloc(n)))
22227 return result;
22228
22229 if (!getOrCreateChunk(n))
22230 return __null;
22231
22232 return latest->allocInfallible(n);
22233 }
22234
22235 template <typename T>
22236 T *newArray(size_t count) {
22237 void *mem = alloc(sizeof(T) * count);
22238 if (!mem)
22239 return __null;
22240 typedef int moz_static_assert45[(tl::IsPodType<T>::result) ? 1 : -1];
22241 return (T *) mem;
22242 }
22243
22244
22245
22246
22247
22248 template <typename T>
22249 T *newArrayUninitialized(size_t count) {
22250 return static_cast<T *>(alloc(sizeof(T) * count));
22251 }
22252
22253 void *mark() {
22254 markCount++;
22255
22256 return latest ? latest->mark() : __null;
22257 }
22258
22259 void release(void *mark) {
22260 markCount--;
22261
22262 if (!mark) {
22263 latest = first;
22264 if (latest)
22265 latest->resetBump();
22266 return;
22267 }
22268
22269
22270
22271
22272
22273
22274 BumpChunk *container = first;
22275 while (true) {
22276 if (container->contains(mark))
22277 break;
22278 do { } while(0);
22279 container = container->next();
22280 }
22281 latest = container;
22282 latest->release(mark);
22283 }
22284
22285
22286 size_t used() const {
22287 size_t accum = 0;
22288 BumpChunk *it = first;
22289 while (it) {
22290 accum += it->used();
22291 it = it->next();
22292 }
22293 return accum;
22294 }
22295
22296
22297 size_t sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf) const {
22298 size_t accum = 0;
22299 BumpChunk *it = first;
22300 while (it) {
22301 accum += it->sizeOfIncludingThis(mallocSizeOf);
22302 it = it->next();
22303 }
22304 return accum;
22305 }
22306
22307
22308 size_t sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf) const {
22309 return mallocSizeOf(this) + sizeOfExcludingThis(mallocSizeOf);
22310 }
22311
22312
22313 template <typename T>
22314 __attribute__((always_inline)) inline
22315 T *newPod() {
22316 return static_cast<T *>(alloc(sizeof(T)));
22317 }
22318
22319 template <class T> __attribute__((always_inline)) inline T *new_() { void *memory = alloc(sizeof(T)); return memory ? new(memory) T () : __null; } template <class T, class P1> __attribute__((always_inline)) inline T *new_(P1 p1) { void *memory = alloc(sizeof(T)); return memory ? new(memory) T (p1) : __null; } template <class T, class P1, class P2> __attribute__((always_inline)) inline T *new_(P1 p1, P2 p2) { void *memory = alloc(sizeof(T)); return memory ? new(memory) T (p1, p2) : __null; } template <class T, class P1, class P2, class P3> __attribute__((always_inline)) inline T *new_(P1 p1, P2 p2, P3 p3) { void *memory = alloc(sizeof(T)); return memory ? new(memory) T (p1, p2, p3) : __null; } template <class T, class P1, class P2, class P3, class P4> __attribute__((always_inline)) inline T *new_(P1 p1, P2 p2, P3 p3, P4 p4) { void *memory = alloc(sizeof(T)); return memory ? new(memory) T (p1, p2, p3, p4) : __null; } template <class T, class P1, class P2, class P3, class P4, class P5> __attribute__((always_inline)) inline T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) { void *memory = alloc(sizeof(T)); return memory ? new(memory) T (p1, p2, p3, p4, p5) : __null; } template <class T, class P1, class P2, class P3, class P4, class P5, class P6> __attribute__((always_inline)) inline T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6) { void *memory = alloc(sizeof(T)); return memory ? new(memory) T (p1, p2, p3, p4, p5, p6) : __null; } template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7> __attribute__((always_inline)) inline T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7) { void *memory = alloc(sizeof(T)); return memory ? new(memory) T (p1, p2, p3, p4, p5, p6, p7) : __null; } template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8> __attribute__((always_inline)) inline T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8) { void *memory = alloc(sizeof(T)); return memory ? new(memory) T (p1, p2, p3, p4, p5, p6, p7, p8) : __null; } template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9> __attribute__((always_inline)) inline T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9) { void *memory = alloc(sizeof(T)); return memory ? new(memory) T (p1, p2, p3, p4, p5, p6, p7, p8, p9) : __null; } template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10> __attribute__((always_inline)) inline T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10) { void *memory = alloc(sizeof(T)); return memory ? new(memory) T (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10) : __null; } template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class P11> __attribute__((always_inline)) inline T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11) { void *memory = alloc(sizeof(T)); return memory ? new(memory) T (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11) : __null; } template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class P11, class P12> __attribute__((always_inline)) inline T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11, P12 p12) { void *memory = alloc(sizeof(T)); return memory ? new(memory) T (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12) : __null; } static const int JSMinAlignment = 8; template <class T> __attribute__((always_inline)) inline T *array_new(size_t n) { uint64_t numBytes64 = uint64_t(JSMinAlignment) + uint64_t(sizeof(T)) * uint64_t(n); size_t numBytes = size_t(numBytes64); if (numBytes64 != numBytes) { do { } while(0); return __null; } void *memory = alloc(numBytes); if (!memory) return __null; *(size_t *)memory = n; memory = (void*)(uintptr_t(memory) + JSMinAlignment); return new(memory) T[n]; }
22320 };
22321
22322 class LifoAllocScope
22323 {
22324 LifoAlloc *lifoAlloc;
22325 void *mark;
22326 bool shouldRelease;
22327
22328
22329 public:
22330 explicit LifoAllocScope(LifoAlloc *lifoAlloc
22331 )
22332 : lifoAlloc(lifoAlloc), shouldRelease(true) {
22333 do { } while (0);
22334 mark = lifoAlloc->mark();
22335 }
22336
22337 ~LifoAllocScope() {
22338 if (shouldRelease)
22339 lifoAlloc->release(mark);
22340 }
22341
22342 LifoAlloc &alloc() {
22343 return *lifoAlloc;
22344 }
22345
22346 void releaseEarly() {
22347 do { } while(0);
22348 lifoAlloc->release(mark);
22349 shouldRelease = false;
22350 }
22351 };
22352
22353 }
22354 # 17 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinfer.h" 2
22355
22356 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Heap.h" 1
22357 # 19 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinfer.h" 2
22358
22359
22360 namespace JS {
22361 struct TypeInferenceSizes;
22362 }
22363
22364 namespace js {
22365 namespace types {
22366
22367
22368 struct TypeObjectKey {
22369 static intptr_t keyBits(TypeObjectKey *obj) { return (intptr_t) obj; }
22370 static TypeObjectKey *getKey(TypeObjectKey *obj) { return obj; }
22371 };
22372
22373
22374
22375
22376
22377
22378 class Type
22379 {
22380 uintptr_t data;
22381 Type(uintptr_t data) : data(data) {}
22382
22383 public:
22384
22385 uintptr_t raw() const { return data; }
22386
22387 bool isPrimitive() const {
22388 return data < JSVAL_TYPE_OBJECT;
22389 }
22390
22391 bool isPrimitive(JSValueType type) const {
22392 do { } while(0);
22393 return (uintptr_t) type == data;
22394 }
22395
22396 JSValueType primitive() const {
22397 do { } while(0);
22398 return (JSValueType) data;
22399 }
22400
22401 bool isAnyObject() const {
22402 return data == JSVAL_TYPE_OBJECT;
22403 }
22404
22405 bool isUnknown() const {
22406 return data == JSVAL_TYPE_UNKNOWN;
22407 }
22408
22409
22410
22411 bool isObject() const {
22412 do { } while(0);
22413 return data > JSVAL_TYPE_UNKNOWN;
22414 }
22415
22416 inline TypeObjectKey *objectKey() const;
22417
22418
22419
22420 bool isSingleObject() const {
22421 return isObject() && !!(data & 1);
22422 }
22423
22424 inline JSObject *singleObject() const;
22425
22426
22427
22428 bool isTypeObject() const {
22429 return isObject() && !(data & 1);
22430 }
22431
22432 inline TypeObject *typeObject() const;
22433
22434 bool operator == (Type o) const { return data == o.data; }
22435 bool operator != (Type o) const { return data != o.data; }
22436
22437 static inline Type UndefinedType() { return Type(JSVAL_TYPE_UNDEFINED); }
22438 static inline Type NullType() { return Type(JSVAL_TYPE_NULL); }
22439 static inline Type BooleanType() { return Type(JSVAL_TYPE_BOOLEAN); }
22440 static inline Type Int32Type() { return Type(JSVAL_TYPE_INT32); }
22441 static inline Type DoubleType() { return Type(JSVAL_TYPE_DOUBLE); }
22442 static inline Type StringType() { return Type(JSVAL_TYPE_STRING); }
22443 static inline Type MagicArgType() { return Type(JSVAL_TYPE_MAGIC); }
22444 static inline Type AnyObjectType() { return Type(JSVAL_TYPE_OBJECT); }
22445 static inline Type UnknownType() { return Type(JSVAL_TYPE_UNKNOWN); }
22446
22447 static inline Type PrimitiveType(JSValueType type) {
22448 do { } while(0);
22449 return Type(type);
22450 }
22451
22452 static inline Type ObjectType(JSObject *obj);
22453 static inline Type ObjectType(TypeObject *obj);
22454 static inline Type ObjectType(TypeObjectKey *obj);
22455 };
22456
22457
22458 inline Type GetValueType(JSContext *cx, const Value &val);
22459 # 144 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinfer.h"
22460 class TypeConstraint
22461 {
22462 public:
22463
22464
22465
22466
22467 const char *kind() const { return __null; }
22468
22469
22470
22471 TypeConstraint *next;
22472
22473 TypeConstraint(const char *kind)
22474 : next(__null)
22475 {
22476
22477
22478
22479 }
22480
22481
22482 virtual void newType(JSContext *cx, TypeSet *source, Type type) = 0;
22483
22484
22485
22486
22487
22488 virtual void newPropertyState(JSContext *cx, TypeSet *source) {}
22489
22490
22491
22492
22493
22494
22495 virtual void newObjectState(JSContext *cx, TypeObject *object, bool force) {}
22496 };
22497
22498
22499 enum {
22500 TYPE_FLAG_UNDEFINED = 0x1,
22501 TYPE_FLAG_NULL = 0x2,
22502 TYPE_FLAG_BOOLEAN = 0x4,
22503 TYPE_FLAG_INT32 = 0x8,
22504 TYPE_FLAG_DOUBLE = 0x10,
22505 TYPE_FLAG_STRING = 0x20,
22506 TYPE_FLAG_LAZYARGS = 0x40,
22507 TYPE_FLAG_ANYOBJECT = 0x80,
22508
22509
22510 TYPE_FLAG_OBJECT_COUNT_MASK = 0xff00,
22511 TYPE_FLAG_OBJECT_COUNT_SHIFT = 8,
22512 TYPE_FLAG_OBJECT_COUNT_LIMIT =
22513 TYPE_FLAG_OBJECT_COUNT_MASK >> TYPE_FLAG_OBJECT_COUNT_SHIFT,
22514
22515
22516 TYPE_FLAG_UNKNOWN = 0x00010000,
22517
22518
22519 TYPE_FLAG_BASE_MASK = 0x000100ff,
22520
22521
22522
22523
22524
22525
22526
22527 TYPE_FLAG_PROPAGATED_PROPERTY = 0x00020000,
22528
22529
22530 TYPE_FLAG_OWN_PROPERTY = 0x00040000,
22531
22532
22533
22534
22535
22536
22537 TYPE_FLAG_CONFIGURED_PROPERTY = 0x00080000,
22538
22539
22540
22541
22542
22543
22544 TYPE_FLAG_DEFINITE_PROPERTY = 0x00100000,
22545
22546
22547 TYPE_FLAG_DEFINITE_MASK = 0x0f000000,
22548 TYPE_FLAG_DEFINITE_SHIFT = 24
22549 };
22550 typedef uint32_t TypeFlags;
22551
22552
22553 enum {
22554
22555 OBJECT_FLAG_FUNCTION = 0x1,
22556
22557
22558 OBJECT_FLAG_NEW_SCRIPT_CLEARED = 0x2,
22559
22560
22561
22562
22563
22564
22565 OBJECT_FLAG_NEW_SCRIPT_REGENERATE = 0x4,
22566
22567
22568
22569
22570
22571 OBJECT_FLAG_SETS_MARKED_UNKNOWN = 0x8,
22572
22573
22574 OBJECT_FLAG_PROPERTY_COUNT_MASK = 0xfff0,
22575 OBJECT_FLAG_PROPERTY_COUNT_SHIFT = 4,
22576 OBJECT_FLAG_PROPERTY_COUNT_LIMIT =
22577 OBJECT_FLAG_PROPERTY_COUNT_MASK >> OBJECT_FLAG_PROPERTY_COUNT_SHIFT,
22578
22579
22580
22581
22582
22583 OBJECT_FLAG_NON_DENSE_ARRAY = 0x00010000,
22584
22585
22586 OBJECT_FLAG_NON_PACKED_ARRAY = 0x00020000,
22587
22588
22589 OBJECT_FLAG_NON_TYPED_ARRAY = 0x00040000,
22590
22591
22592 OBJECT_FLAG_UNINLINEABLE = 0x00080000,
22593
22594
22595 OBJECT_FLAG_SPECIAL_EQUALITY = 0x00100000,
22596
22597
22598 OBJECT_FLAG_ITERATED = 0x00200000,
22599
22600
22601 OBJECT_FLAG_REENTRANT_FUNCTION = 0x00400000,
22602
22603
22604 OBJECT_FLAG_REGEXP_FLAGS_SET = 0x00800000,
22605
22606
22607 OBJECT_FLAG_DYNAMIC_MASK = 0x00ff0000,
22608
22609
22610
22611
22612
22613 OBJECT_FLAG_UNKNOWN_PROPERTIES = 0x80000000,
22614
22615
22616 OBJECT_FLAG_UNKNOWN_MASK =
22617 OBJECT_FLAG_DYNAMIC_MASK
22618 | OBJECT_FLAG_UNKNOWN_PROPERTIES
22619 | OBJECT_FLAG_SETS_MARKED_UNKNOWN
22620 };
22621 typedef uint32_t TypeObjectFlags;
22622
22623
22624 class TypeSet
22625 {
22626
22627 TypeFlags flags;
22628
22629
22630 TypeObjectKey **objectSet;
22631
22632 public:
22633
22634
22635 TypeConstraint *constraintList;
22636
22637 TypeSet()
22638 : flags(0), objectSet(__null), constraintList(__null)
22639 {}
22640
22641 void print(JSContext *cx);
22642
22643 inline void sweep(JSCompartment *compartment);
22644 inline size_t computedSizeOfExcludingThis();
22645
22646
22647 inline bool hasType(Type type);
22648
22649 TypeFlags baseFlags() const { return flags & TYPE_FLAG_BASE_MASK; }
22650 bool unknown() const { return !!(flags & TYPE_FLAG_UNKNOWN); }
22651 bool unknownObject() const { return !!(flags & (TYPE_FLAG_UNKNOWN | TYPE_FLAG_ANYOBJECT)); }
22652
22653 bool empty() const { return !baseFlags() && !baseObjectCount(); }
22654
22655 bool hasAnyFlag(TypeFlags flags) const {
22656 do { } while(0);
22657 return !!(baseFlags() & flags);
22658 }
22659
22660 bool isOwnProperty(bool configurable) const {
22661 return flags & (configurable ? TYPE_FLAG_CONFIGURED_PROPERTY : TYPE_FLAG_OWN_PROPERTY);
22662 }
22663 bool isDefiniteProperty() const { return flags & TYPE_FLAG_DEFINITE_PROPERTY; }
22664 unsigned definiteSlot() const {
22665 do { } while(0);
22666 return flags >> TYPE_FLAG_DEFINITE_SHIFT;
22667 }
22668
22669
22670
22671
22672
22673 inline void addType(JSContext *cx, Type type);
22674
22675
22676 inline void setOwnProperty(JSContext *cx, bool configured);
22677
22678
22679
22680
22681
22682
22683 inline unsigned getObjectCount();
22684 inline TypeObjectKey *getObject(unsigned i);
22685 inline JSObject *getSingleObject(unsigned i);
22686 inline TypeObject *getTypeObject(unsigned i);
22687
22688 void setOwnProperty(bool configurable) {
22689 flags |= TYPE_FLAG_OWN_PROPERTY;
22690 if (configurable)
22691 flags |= TYPE_FLAG_CONFIGURED_PROPERTY;
22692 }
22693 void setDefinite(unsigned slot) {
22694 do { } while(0);
22695 flags |= TYPE_FLAG_DEFINITE_PROPERTY | (slot << TYPE_FLAG_DEFINITE_SHIFT);
22696 }
22697
22698 bool hasPropagatedProperty() { return !!(flags & TYPE_FLAG_PROPAGATED_PROPERTY); }
22699 void setPropagatedProperty() { flags |= TYPE_FLAG_PROPAGATED_PROPERTY; }
22700
22701 enum FilterKind {
22702 FILTER_ALL_PRIMITIVES,
22703 FILTER_NULL_VOID,
22704 FILTER_VOID
22705 };
22706
22707
22708 inline void add(JSContext *cx, TypeConstraint *constraint, bool callExisting = true);
22709 void addSubset(JSContext *cx, TypeSet *target);
22710 void addGetProperty(JSContext *cx, JSScript *script, jsbytecode *pc,
22711 TypeSet *target, jsid id);
22712 void addSetProperty(JSContext *cx, JSScript *script, jsbytecode *pc,
22713 TypeSet *target, jsid id);
22714 void addCallProperty(JSContext *cx, JSScript *script, jsbytecode *pc, jsid id);
22715 void addSetElement(JSContext *cx, JSScript *script, jsbytecode *pc,
22716 TypeSet *objectTypes, TypeSet *valueTypes);
22717 void addCall(JSContext *cx, TypeCallsite *site);
22718 void addArith(JSContext *cx, JSScript *script, jsbytecode *pc,
22719 TypeSet *target, TypeSet *other = __null);
22720 void addTransformThis(JSContext *cx, JSScript *script, TypeSet *target);
22721 void addPropagateThis(JSContext *cx, JSScript *script, jsbytecode *pc,
22722 Type type, TypeSet *types = __null);
22723 void addFilterPrimitives(JSContext *cx, TypeSet *target, FilterKind filter);
22724 void addSubsetBarrier(JSContext *cx, JSScript *script, jsbytecode *pc, TypeSet *target);
22725
22726
22727
22728
22729
22730 static TypeSet *make(JSContext *cx, const char *name);
22731 # 424 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinfer.h"
22732 void addFreeze(JSContext *cx);
22733
22734
22735 JSValueType getKnownTypeTag(JSContext *cx);
22736
22737 bool isMagicArguments(JSContext *cx) { return getKnownTypeTag(cx) == JSVAL_TYPE_MAGIC; }
22738
22739
22740 bool hasObjectFlags(JSContext *cx, TypeObjectFlags flags);
22741 static bool HasObjectFlags(JSContext *cx, TypeObject *object, TypeObjectFlags flags);
22742
22743
22744
22745
22746
22747
22748 static void WatchObjectStateChange(JSContext *cx, TypeObject *object);
22749 # 449 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinfer.h"
22750 bool isOwnProperty(JSContext *cx, TypeObject *object, bool configurable);
22751
22752
22753 bool knownNonEmpty(JSContext *cx);
22754
22755
22756 bool knownSubset(JSContext *cx, TypeSet *other);
22757
22758
22759
22760
22761
22762 int getTypedArrayType(JSContext *cx);
22763
22764
22765 JSObject *getSingleton(JSContext *cx, bool freeze = true);
22766
22767
22768 bool hasGlobalObject(JSContext *cx, JSObject *global);
22769
22770 inline void clearObjects();
22771
22772
22773
22774
22775
22776 bool needsBarrier(JSContext *cx);
22777
22778
22779 bool propertyNeedsBarrier(JSContext *cx, jsid id);
22780
22781 private:
22782 uint32_t baseObjectCount() const {
22783 return (flags & TYPE_FLAG_OBJECT_COUNT_MASK) >> TYPE_FLAG_OBJECT_COUNT_SHIFT;
22784 }
22785 inline void setBaseObjectCount(uint32_t count);
22786 };
22787
22788
22789
22790
22791
22792
22793
22794 struct TypeResult
22795 {
22796 uint32_t offset;
22797 Type type;
22798 TypeResult *next;
22799
22800 TypeResult(uint32_t offset, Type type)
22801 : offset(offset), type(type), next(__null)
22802 {}
22803 };
22804 # 562 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinfer.h"
22805 struct TypeBarrier
22806 {
22807
22808 TypeBarrier *next;
22809
22810
22811 TypeSet *target;
22812
22813
22814
22815
22816
22817 Type type;
22818
22819
22820
22821
22822
22823 JSObject *singleton;
22824 jsid singletonId;
22825
22826 TypeBarrier(TypeSet *target, Type type, JSObject *singleton, jsid singletonId)
22827 : next(__null), target(target), type(type),
22828 singleton(singleton), singletonId(singletonId)
22829 {}
22830 };
22831
22832
22833 struct Property
22834 {
22835
22836 HeapId id;
22837
22838
22839 TypeSet types;
22840
22841 inline Property(jsid id);
22842 inline Property(const Property &o);
22843
22844 static uint32_t keyBits(jsid id) { return uint32_t((id)); }
22845 static jsid getKey(Property *p) { return p->id; }
22846 };
22847 # 615 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinfer.h"
22848 struct TypeNewScript
22849 {
22850 HeapPtrFunction fun;
22851
22852
22853 gc::AllocKind allocKind;
22854
22855
22856
22857
22858
22859 HeapPtrShape shape;
22860 # 636 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinfer.h"
22861 struct Initializer {
22862 enum Kind {
22863 SETPROP,
22864 FRAME_PUSH,
22865 FRAME_POP,
22866 DONE
22867 } kind;
22868 uint32_t offset;
22869 Initializer(Kind kind, uint32_t offset)
22870 : kind(kind), offset(offset)
22871 {}
22872 };
22873 Initializer *initializerList;
22874
22875 static inline void writeBarrierPre(TypeNewScript *newScript);
22876 static inline void writeBarrierPost(TypeNewScript *newScript, void *addr);
22877 };
22878 # 681 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinfer.h"
22879 struct TypeObject : gc::Cell
22880 {
22881
22882 HeapPtrObject proto;
22883
22884
22885
22886
22887
22888
22889 HeapPtrObject singleton;
22890
22891
22892
22893
22894
22895 static const size_t LAZY_SINGLETON = 1;
22896 bool lazy() const { return singleton == (JSObject *) LAZY_SINGLETON; }
22897
22898
22899 TypeObjectFlags flags;
22900 # 714 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinfer.h"
22901 uint32_t contribution;
22902 static const uint32_t CONTRIBUTION_LIMIT = 2000;
22903
22904
22905
22906
22907
22908
22909 HeapPtr<TypeNewScript> newScript;
22910 # 754 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinfer.h"
22911 Property **propertySet;
22912
22913
22914 HeapPtrFunction interpretedFunction;
22915
22916
22917 void *padding;
22918
22919
22920 inline TypeObject(JSObject *proto, bool isFunction, bool unknown);
22921
22922 bool isFunction() { return !!(flags & OBJECT_FLAG_FUNCTION); }
22923
22924 bool hasAnyFlags(TypeObjectFlags flags) {
22925 do { } while(0);
22926 return !!(this->flags & flags);
22927 }
22928 bool hasAllFlags(TypeObjectFlags flags) {
22929 do { } while(0);
22930 return (this->flags & flags) == flags;
22931 }
22932
22933 bool unknownProperties() {
22934 do { } while (0)
22935 ;
22936 return !!(flags & OBJECT_FLAG_UNKNOWN_PROPERTIES);
22937 }
22938
22939
22940
22941
22942
22943
22944
22945 inline TypeSet *getProperty(JSContext *cx, jsid id, bool assign);
22946
22947
22948 inline TypeSet *maybeGetProperty(JSContext *cx, jsid id);
22949
22950 inline unsigned getPropertyCount();
22951 inline Property *getProperty(unsigned i);
22952
22953
22954 inline void setFlagsFromKey(JSContext *cx, JSProtoKey kind);
22955
22956
22957
22958
22959
22960 inline JSObject *getGlobal();
22961
22962
22963
22964 bool addProperty(JSContext *cx, jsid id, Property **pprop);
22965 bool addDefiniteProperties(JSContext *cx, JSObject *obj);
22966 bool matchDefiniteProperties(JSObject *obj);
22967 void addPrototype(JSContext *cx, TypeObject *proto);
22968 void addPropertyType(JSContext *cx, jsid id, Type type);
22969 void addPropertyType(JSContext *cx, jsid id, const Value &value);
22970 void addPropertyType(JSContext *cx, const char *name, Type type);
22971 void addPropertyType(JSContext *cx, const char *name, const Value &value);
22972 void markPropertyConfigured(JSContext *cx, jsid id);
22973 void markStateChange(JSContext *cx);
22974 void setFlags(JSContext *cx, TypeObjectFlags flags);
22975 void markUnknown(JSContext *cx);
22976 void clearNewScript(JSContext *cx);
22977 void getFromPrototypes(JSContext *cx, jsid id, TypeSet *types, bool force = false);
22978
22979 void print(JSContext *cx);
22980
22981 inline void clearProperties();
22982 inline void sweep(FreeOp *fop);
22983
22984 inline size_t computedSizeOfExcludingThis();
22985
22986 void sizeOfExcludingThis(TypeInferenceSizes *sizes, JSMallocSizeOfFun mallocSizeOf);
22987
22988
22989
22990
22991
22992
22993 void finalize(FreeOp *fop) {}
22994
22995 static inline void writeBarrierPre(TypeObject *type);
22996 static inline void writeBarrierPost(TypeObject *type, void *addr);
22997 static inline void readBarrier(TypeObject *type);
22998
22999 static inline ThingRootKind rootKind() { return THING_ROOT_TYPE_OBJECT; }
23000
23001 private:
23002 inline uint32_t basePropertyCount() const;
23003 inline void setBasePropertyCount(uint32_t count);
23004
23005 static void staticAsserts() {
23006 typedef int moz_static_assert46[(__builtin_offsetof (TypeObject, proto) == __builtin_offsetof (js::shadow::TypeObject, proto)) ? 1 : -1];
23007 }
23008 };
23009
23010
23011
23012
23013
23014 struct TypeObjectEntry
23015 {
23016 typedef JSObject *Lookup;
23017
23018 static inline HashNumber hash(JSObject *base);
23019 static inline bool match(TypeObject *key, JSObject *lookup);
23020 };
23021 typedef HashSet<ReadBarriered<TypeObject>, TypeObjectEntry, SystemAllocPolicy> TypeObjectSet;
23022
23023
23024 bool
23025 UseNewType(JSContext *cx, JSScript *script, jsbytecode *pc);
23026
23027
23028 bool
23029 UseNewTypeForInitializer(JSContext *cx, JSScript *script, jsbytecode *pc);
23030
23031
23032
23033
23034
23035 bool
23036 ArrayPrototypeHasIndexedProperty(JSContext *cx, JSScript *script);
23037
23038
23039
23040
23041
23042
23043 struct TypeCallsite
23044 {
23045 JSScript *script;
23046 jsbytecode *pc;
23047
23048
23049 bool isNew;
23050
23051
23052 unsigned argumentCount;
23053 TypeSet **argumentTypes;
23054
23055
23056 TypeSet *thisTypes;
23057
23058
23059 TypeSet *returnTypes;
23060
23061 inline TypeCallsite(JSContext *cx, JSScript *script, jsbytecode *pc,
23062 bool isNew, unsigned argumentCount);
23063 };
23064 # 945 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinfer.h"
23065 struct TypeScriptNesting
23066 {
23067 # 955 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinfer.h"
23068 JSScript *parent;
23069
23070
23071 JSScript *children;
23072
23073
23074 JSScript *next;
23075
23076
23077 JSObject *activeCall;
23078 # 974 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinfer.h"
23079 const Value *argArray;
23080 const Value *varArray;
23081
23082
23083 uint32_t activeFrames;
23084
23085 TypeScriptNesting() { PodZero(this); }
23086 ~TypeScriptNesting();
23087 };
23088
23089
23090 bool CheckScriptNesting(JSContext *cx, JSScript *script);
23091
23092
23093 void NestingPrologue(JSContext *cx, StackFrame *fp);
23094 void NestingEpilogue(StackFrame *fp);
23095
23096
23097 class TypeScript
23098 {
23099 friend struct ::JSScript;
23100
23101
23102 analyze::ScriptAnalysis *analysis;
23103
23104
23105
23106
23107
23108
23109 static const size_t GLOBAL_MISSING_SCOPE = 0x1;
23110
23111
23112 HeapPtr<GlobalObject> global;
23113
23114 public:
23115
23116
23117 TypeScriptNesting *nesting;
23118
23119
23120 TypeResult *dynamicList;
23121
23122 inline TypeScript();
23123
23124 bool hasScope() { return size_t(global.get()) != GLOBAL_MISSING_SCOPE; }
23125
23126
23127 TypeSet *typeArray() { return (TypeSet *) (uintptr_t(this) + sizeof(TypeScript)); }
23128
23129 static inline unsigned NumTypeSets(JSScript *script);
23130
23131 static bool SetScope(JSContext *cx, JSScript *script, JSObject *scope);
23132
23133 static inline TypeSet *ReturnTypes(JSScript *script);
23134 static inline TypeSet *ThisTypes(JSScript *script);
23135 static inline TypeSet *ArgTypes(JSScript *script, unsigned i);
23136 static inline TypeSet *LocalTypes(JSScript *script, unsigned i);
23137
23138
23139 static inline TypeSet *SlotTypes(JSScript *script, unsigned slot);
23140
23141
23142
23143
23144
23145
23146
23147 static inline TypeObject *StandardType(JSContext *cx, JSScript *script, JSProtoKey kind);
23148
23149
23150 static inline TypeObject *InitObject(JSContext *cx, JSScript *script, jsbytecode *pc, JSProtoKey kind);
23151
23152
23153
23154
23155
23156 static inline void MonitorOverflow(JSContext *cx, JSScript *script, jsbytecode *pc);
23157 static inline void MonitorString(JSContext *cx, JSScript *script, jsbytecode *pc);
23158 static inline void MonitorUnknown(JSContext *cx, JSScript *script, jsbytecode *pc);
23159
23160 static inline void GetPcScript(JSContext *cx, JSScript **script, jsbytecode **pc);
23161 static inline void MonitorOverflow(JSContext *cx);
23162 static inline void MonitorString(JSContext *cx);
23163 static inline void MonitorUnknown(JSContext *cx);
23164 # 1067 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinfer.h"
23165 static inline void Monitor(JSContext *cx, JSScript *script, jsbytecode *pc,
23166 const js::Value &val);
23167 static inline void Monitor(JSContext *cx, const js::Value &rval);
23168
23169
23170 static inline void MonitorAssign(JSContext *cx, JSObject *obj, jsid id);
23171
23172
23173 static inline void SetThis(JSContext *cx, JSScript *script, Type type);
23174 static inline void SetThis(JSContext *cx, JSScript *script, const js::Value &value);
23175 static inline void SetLocal(JSContext *cx, JSScript *script, unsigned local, Type type);
23176 static inline void SetLocal(JSContext *cx, JSScript *script, unsigned local, const js::Value &value);
23177 static inline void SetArgument(JSContext *cx, JSScript *script, unsigned arg, Type type);
23178 static inline void SetArgument(JSContext *cx, JSScript *script, unsigned arg, const js::Value &value);
23179
23180 static void Sweep(FreeOp *fop, JSScript *script);
23181 inline void trace(JSTracer *trc);
23182 void destroy();
23183 };
23184
23185 struct ArrayTableKey;
23186 typedef HashMap<ArrayTableKey,ReadBarriered<TypeObject>,ArrayTableKey,SystemAllocPolicy> ArrayTypeTable;
23187
23188 struct ObjectTableKey;
23189 struct ObjectTableEntry;
23190 typedef HashMap<ObjectTableKey,ObjectTableEntry,ObjectTableKey,SystemAllocPolicy> ObjectTypeTable;
23191
23192 struct AllocationSiteKey;
23193 typedef HashMap<AllocationSiteKey,ReadBarriered<TypeObject>,AllocationSiteKey,SystemAllocPolicy> AllocationSiteTable;
23194
23195 struct RecompileInfo
23196 {
23197 JSScript *script;
23198 bool constructing : 1;
23199 bool barriers : 1;
23200 uint32_t chunkIndex:30;
23201
23202 bool operator == (const RecompileInfo &o) const {
23203 return script == o.script
23204 && constructing == o.constructing
23205 && barriers == o.barriers
23206 && chunkIndex == o.chunkIndex;
23207 }
23208 };
23209
23210
23211 struct TypeCompartment
23212 {
23213
23214
23215
23216
23217
23218
23219 struct PendingWork
23220 {
23221 TypeConstraint *constraint;
23222 TypeSet *source;
23223 Type type;
23224 };
23225 PendingWork *pendingArray;
23226 unsigned pendingCount;
23227 unsigned pendingCapacity;
23228
23229
23230 bool resolving;
23231
23232
23233 bool inferenceEnabled;
23234
23235
23236
23237
23238
23239 bool pendingNukeTypes;
23240
23241
23242 unsigned scriptCount;
23243
23244
23245 Vector<RecompileInfo> *pendingRecompiles;
23246
23247
23248
23249
23250
23251
23252 unsigned recompilations;
23253 unsigned frameExpansions;
23254
23255
23256
23257
23258
23259
23260 RecompileInfo compiledInfo;
23261
23262
23263 AllocationSiteTable *allocationSiteTable;
23264
23265
23266
23267 ArrayTypeTable *arrayTypeTable;
23268 ObjectTypeTable *objectTypeTable;
23269
23270 void fixArrayType(JSContext *cx, JSObject *obj);
23271 void fixObjectType(JSContext *cx, JSObject *obj);
23272
23273
23274
23275
23276 static const unsigned TYPE_COUNT_LIMIT = 4;
23277 unsigned typeCounts[TYPE_COUNT_LIMIT];
23278 unsigned typeCountOver;
23279
23280 void init(JSContext *cx);
23281 ~TypeCompartment();
23282
23283 inline JSCompartment *compartment();
23284
23285
23286 inline void addPending(JSContext *cx, TypeConstraint *constraint, TypeSet *source, Type type);
23287 bool growPendingArray(JSContext *cx);
23288
23289
23290 inline void resolvePending(JSContext *cx);
23291
23292
23293 void print(JSContext *cx, bool force);
23294
23295
23296
23297
23298
23299
23300
23301 TypeObject *newTypeObject(JSContext *cx, JSScript *script,
23302 JSProtoKey kind, JSObject *proto, bool unknown = false);
23303
23304
23305 TypeObject *newAllocationSiteTypeObject(JSContext *cx, const AllocationSiteKey &key);
23306
23307 void nukeTypes(FreeOp *fop);
23308 void processPendingRecompiles(FreeOp *fop);
23309
23310
23311 void setPendingNukeTypes(JSContext *cx);
23312 void setPendingNukeTypesNoReport();
23313
23314
23315 void addPendingRecompile(JSContext *cx, const RecompileInfo &info);
23316 void addPendingRecompile(JSContext *cx, JSScript *script, jsbytecode *pc);
23317
23318
23319 void monitorBytecode(JSContext *cx, JSScript *script, uint32_t offset,
23320 bool returnOnly = false);
23321
23322
23323 void markSetsUnknown(JSContext *cx, TypeObject *obj);
23324
23325 void sweep(FreeOp *fop);
23326 void finalizeObjects();
23327 };
23328
23329 enum SpewChannel {
23330 ISpewOps,
23331 ISpewResult,
23332 SPEW_COUNT
23333 };
23334 # 1252 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinfer.h"
23335 inline const char * InferSpewColorReset() { return __null; }
23336 inline const char * InferSpewColor(TypeConstraint *constraint) { return __null; }
23337 inline const char * InferSpewColor(TypeSet *types) { return __null; }
23338 inline void InferSpew(SpewChannel which, const char *fmt, ...) {}
23339 inline const char * TypeString(Type type) { return __null; }
23340 inline const char * TypeObjectString(TypeObject *type) { return __null; }
23341
23342
23343
23344
23345 void TypeFailure(JSContext *cx, const char *fmt, ...);
23346
23347 }
23348 }
23349
23350 namespace JS {
23351 template<> class AnchorPermitted<js::types::TypeObject *> { };
23352 }
23353 # 24 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobj.h" 2
23354 # 32 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobj.h"
23355 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl.h" 1
23356 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl.h"
23357 #define ObjectImpl_h___
23358
23359
23360
23361
23362 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsfriendapi.h" 1
23363 # 15 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl.h" 2
23364 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinfer.h" 1
23365 # 16 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl.h" 2
23366 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsval.h" 1
23367 # 17 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl.h" 2
23368
23369 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Barrier.h" 1
23370 # 19 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl.h" 2
23371 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/NumericConversions.h" 1
23372 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/NumericConversions.h"
23373 #define NumericConversions_h___
23374
23375
23376
23377 # 1 "/usr/include/math.h" 1 3 4
23378 # 26 "/usr/include/math.h" 3 4
23379 #define _MATH_H 1
23380
23381
23382
23383 extern "C" {
23384
23385
23386
23387 # 1 "/usr/include/bits/huge_val.h" 1 3 4
23388 # 29 "/usr/include/bits/huge_val.h" 3 4
23389 #define HUGE_VAL (__builtin_huge_val())
23390 # 35 "/usr/include/math.h" 2 3 4
23391
23392 # 1 "/usr/include/bits/huge_valf.h" 1 3 4
23393 # 29 "/usr/include/bits/huge_valf.h" 3 4
23394 #define HUGE_VALF (__builtin_huge_valf())
23395 # 37 "/usr/include/math.h" 2 3 4
23396 # 1 "/usr/include/bits/huge_vall.h" 1 3 4
23397 # 26 "/usr/include/bits/huge_vall.h" 3 4
23398 #define HUGE_VALL (__builtin_huge_vall())
23399 # 38 "/usr/include/math.h" 2 3 4
23400
23401
23402 # 1 "/usr/include/bits/inf.h" 1 3 4
23403 # 27 "/usr/include/bits/inf.h" 3 4
23404 #define INFINITY (__builtin_inff())
23405 # 41 "/usr/include/math.h" 2 3 4
23406
23407
23408 # 1 "/usr/include/bits/nan.h" 1 3 4
23409 # 29 "/usr/include/bits/nan.h" 3 4
23410 #define NAN (__builtin_nanf (""))
23411 # 44 "/usr/include/math.h" 2 3 4
23412
23413
23414
23415 # 1 "/usr/include/bits/mathdef.h" 1 3 4
23416 # 25 "/usr/include/bits/mathdef.h" 3 4
23417 #define _MATH_H_MATHDEF 1
23418
23419
23420 typedef float float_t;
23421
23422 typedef double double_t;
23423
23424
23425
23426 #define FP_ILOGB0 (-2147483647)
23427 #define FP_ILOGBNAN (2147483647)
23428 # 56 "/usr/include/bits/mathdef.h" 3 4
23429 #define __NO_LONG_DOUBLE_MATH 1
23430 # 48 "/usr/include/math.h" 2 3 4
23431
23432
23433
23434
23435
23436
23437 #define __MATHCALL(function,suffix,args) __MATHDECL (_Mdouble_,function,suffix, args)
23438
23439 #define __MATHDECL(type,function,suffix,args) __MATHDECL_1(type, function,suffix, args); __MATHDECL_1(type, __CONCAT(__,function),suffix, args)
23440
23441
23442 #define __MATHCALLX(function,suffix,args,attrib) __MATHDECLX (_Mdouble_,function,suffix, args, attrib)
23443
23444 #define __MATHDECLX(type,function,suffix,args,attrib) __MATHDECL_1(type, function,suffix, args) __attribute__ (attrib); __MATHDECL_1(type, __CONCAT(__,function),suffix, args) __attribute__ (attrib)
23445
23446
23447 #define __MATHDECL_1(type,function,suffix,args) extern type __MATH_PRECNAME(function,suffix) args __THROW
23448
23449
23450 #define _Mdouble_ double
23451 #define __MATH_PRECNAME(name,r) __CONCAT(name,r)
23452 #define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_STD
23453 #define _Mdouble_END_NAMESPACE __END_NAMESPACE_STD
23454 # 1 "/usr/include/bits/mathcalls.h" 1 3 4
23455 # 53 "/usr/include/bits/mathcalls.h" 3 4
23456
23457
23458 extern double acos (double __x) throw (); extern double __acos (double __x) throw ();
23459
23460 extern double asin (double __x) throw (); extern double __asin (double __x) throw ();
23461
23462 extern double atan (double __x) throw (); extern double __atan (double __x) throw ();
23463
23464 extern double atan2 (double __y, double __x) throw (); extern double __atan2 (double __y, double __x) throw ();
23465
23466
23467 extern double cos (double __x) throw (); extern double __cos (double __x) throw ();
23468
23469 extern double sin (double __x) throw (); extern double __sin (double __x) throw ();
23470
23471 extern double tan (double __x) throw (); extern double __tan (double __x) throw ();
23472
23473
23474
23475
23476 extern double cosh (double __x) throw (); extern double __cosh (double __x) throw ();
23477
23478 extern double sinh (double __x) throw (); extern double __sinh (double __x) throw ();
23479
23480 extern double tanh (double __x) throw (); extern double __tanh (double __x) throw ();
23481
23482
23483
23484
23485 extern void sincos (double __x, double *__sinx, double *__cosx) throw (); extern void __sincos (double __x, double *__sinx, double *__cosx) throw ()
23486 ;
23487
23488
23489
23490
23491
23492 extern double acosh (double __x) throw (); extern double __acosh (double __x) throw ();
23493
23494 extern double asinh (double __x) throw (); extern double __asinh (double __x) throw ();
23495
23496 extern double atanh (double __x) throw (); extern double __atanh (double __x) throw ();
23497
23498
23499
23500
23501
23502
23503
23504 extern double exp (double __x) throw (); extern double __exp (double __x) throw ();
23505
23506
23507 extern double frexp (double __x, int *__exponent) throw (); extern double __frexp (double __x, int *__exponent) throw ();
23508
23509
23510 extern double ldexp (double __x, int __exponent) throw (); extern double __ldexp (double __x, int __exponent) throw ();
23511
23512
23513 extern double log (double __x) throw (); extern double __log (double __x) throw ();
23514
23515
23516 extern double log10 (double __x) throw (); extern double __log10 (double __x) throw ();
23517
23518
23519 extern double modf (double __x, double *__iptr) throw (); extern double __modf (double __x, double *__iptr) throw ()
23520 __attribute__ ((__nonnull__ (2)));
23521
23522
23523
23524
23525 extern double exp10 (double __x) throw (); extern double __exp10 (double __x) throw ();
23526
23527 extern double pow10 (double __x) throw (); extern double __pow10 (double __x) throw ();
23528
23529
23530
23531
23532
23533 extern double expm1 (double __x) throw (); extern double __expm1 (double __x) throw ();
23534
23535
23536 extern double log1p (double __x) throw (); extern double __log1p (double __x) throw ();
23537
23538
23539 extern double logb (double __x) throw (); extern double __logb (double __x) throw ();
23540
23541
23542
23543
23544
23545
23546 extern double exp2 (double __x) throw (); extern double __exp2 (double __x) throw ();
23547
23548
23549 extern double log2 (double __x) throw (); extern double __log2 (double __x) throw ();
23550
23551
23552
23553
23554
23555
23556
23557
23558 extern double pow (double __x, double __y) throw (); extern double __pow (double __x, double __y) throw ();
23559
23560
23561 extern double sqrt (double __x) throw (); extern double __sqrt (double __x) throw ();
23562
23563
23564
23565
23566
23567 extern double hypot (double __x, double __y) throw (); extern double __hypot (double __x, double __y) throw ();
23568
23569
23570
23571
23572
23573
23574 extern double cbrt (double __x) throw (); extern double __cbrt (double __x) throw ();
23575
23576
23577
23578
23579
23580
23581
23582
23583 extern double ceil (double __x) throw () __attribute__ ((__const__)); extern double __ceil (double __x) throw () __attribute__ ((__const__));
23584
23585
23586 extern double fabs (double __x) throw () __attribute__ ((__const__)); extern double __fabs (double __x) throw () __attribute__ ((__const__));
23587
23588
23589 extern double floor (double __x) throw () __attribute__ ((__const__)); extern double __floor (double __x) throw () __attribute__ ((__const__));
23590
23591
23592 extern double fmod (double __x, double __y) throw (); extern double __fmod (double __x, double __y) throw ();
23593
23594
23595
23596
23597 extern int __isinf (double __value) throw () __attribute__ ((__const__));
23598
23599
23600 extern int __finite (double __value) throw () __attribute__ ((__const__));
23601
23602
23603
23604
23605
23606 extern int isinf (double __value) throw () __attribute__ ((__const__));
23607
23608
23609 extern int finite (double __value) throw () __attribute__ ((__const__));
23610
23611
23612 extern double drem (double __x, double __y) throw (); extern double __drem (double __x, double __y) throw ();
23613
23614
23615
23616 extern double significand (double __x) throw (); extern double __significand (double __x) throw ();
23617
23618
23619
23620
23621
23622 extern double copysign (double __x, double __y) throw () __attribute__ ((__const__)); extern double __copysign (double __x, double __y) throw () __attribute__ ((__const__));
23623
23624
23625
23626
23627
23628
23629 extern double nan (__const char *__tagb) throw () __attribute__ ((__const__)); extern double __nan (__const char *__tagb) throw () __attribute__ ((__const__));
23630
23631
23632
23633
23634
23635 extern int __isnan (double __value) throw () __attribute__ ((__const__));
23636
23637
23638
23639 extern int isnan (double __value) throw () __attribute__ ((__const__));
23640
23641
23642 extern double j0 (double) throw (); extern double __j0 (double) throw ();
23643 extern double j1 (double) throw (); extern double __j1 (double) throw ();
23644 extern double jn (int, double) throw (); extern double __jn (int, double) throw ();
23645 extern double y0 (double) throw (); extern double __y0 (double) throw ();
23646 extern double y1 (double) throw (); extern double __y1 (double) throw ();
23647 extern double yn (int, double) throw (); extern double __yn (int, double) throw ();
23648
23649
23650
23651
23652
23653
23654 extern double erf (double) throw (); extern double __erf (double) throw ();
23655 extern double erfc (double) throw (); extern double __erfc (double) throw ();
23656 extern double lgamma (double) throw (); extern double __lgamma (double) throw ();
23657
23658
23659
23660
23661
23662
23663 extern double tgamma (double) throw (); extern double __tgamma (double) throw ();
23664
23665
23666
23667
23668
23669 extern double gamma (double) throw (); extern double __gamma (double) throw ();
23670
23671
23672
23673
23674
23675
23676 extern double lgamma_r (double, int *__signgamp) throw (); extern double __lgamma_r (double, int *__signgamp) throw ();
23677
23678
23679
23680
23681
23682
23683
23684 extern double rint (double __x) throw (); extern double __rint (double __x) throw ();
23685
23686
23687 extern double nextafter (double __x, double __y) throw () __attribute__ ((__const__)); extern double __nextafter (double __x, double __y) throw () __attribute__ ((__const__));
23688
23689 extern double nexttoward (double __x, long double __y) throw () __attribute__ ((__const__)); extern double __nexttoward (double __x, long double __y) throw () __attribute__ ((__const__));
23690
23691
23692
23693 extern double remainder (double __x, double __y) throw (); extern double __remainder (double __x, double __y) throw ();
23694
23695
23696
23697 extern double scalbn (double __x, int __n) throw (); extern double __scalbn (double __x, int __n) throw ();
23698
23699
23700
23701 extern int ilogb (double __x) throw (); extern int __ilogb (double __x) throw ();
23702
23703
23704
23705
23706 extern double scalbln (double __x, long int __n) throw (); extern double __scalbln (double __x, long int __n) throw ();
23707
23708
23709
23710 extern double nearbyint (double __x) throw (); extern double __nearbyint (double __x) throw ();
23711
23712
23713
23714 extern double round (double __x) throw () __attribute__ ((__const__)); extern double __round (double __x) throw () __attribute__ ((__const__));
23715
23716
23717
23718 extern double trunc (double __x) throw () __attribute__ ((__const__)); extern double __trunc (double __x) throw () __attribute__ ((__const__));
23719
23720
23721
23722
23723 extern double remquo (double __x, double __y, int *__quo) throw (); extern double __remquo (double __x, double __y, int *__quo) throw ();
23724
23725
23726
23727
23728
23729
23730 extern long int lrint (double __x) throw (); extern long int __lrint (double __x) throw ();
23731 extern long long int llrint (double __x) throw (); extern long long int __llrint (double __x) throw ();
23732
23733
23734
23735 extern long int lround (double __x) throw (); extern long int __lround (double __x) throw ();
23736 extern long long int llround (double __x) throw (); extern long long int __llround (double __x) throw ();
23737
23738
23739
23740 extern double fdim (double __x, double __y) throw (); extern double __fdim (double __x, double __y) throw ();
23741
23742
23743 extern double fmax (double __x, double __y) throw (); extern double __fmax (double __x, double __y) throw ();
23744
23745
23746 extern double fmin (double __x, double __y) throw (); extern double __fmin (double __x, double __y) throw ();
23747
23748
23749
23750 extern int __fpclassify (double __value) throw ()
23751 __attribute__ ((__const__));
23752
23753
23754 extern int __signbit (double __value) throw ()
23755 __attribute__ ((__const__));
23756
23757
23758
23759 extern double fma (double __x, double __y, double __z) throw (); extern double __fma (double __x, double __y, double __z) throw ();
23760
23761
23762
23763
23764
23765
23766
23767
23768 extern double scalb (double __x, double __n) throw (); extern double __scalb (double __x, double __n) throw ();
23769 # 72 "/usr/include/math.h" 2 3 4
23770 #undef _Mdouble_
23771 #undef _Mdouble_BEGIN_NAMESPACE
23772 #undef _Mdouble_END_NAMESPACE
23773 #undef __MATH_PRECNAME
23774 # 84 "/usr/include/math.h" 3 4
23775 #define _Mfloat_ float
23776
23777 #define _Mdouble_ _Mfloat_
23778
23779 #define __MATH_PRECNAME(name,r) name ##f ##r
23780
23781
23782
23783 #define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_C99
23784 #define _Mdouble_END_NAMESPACE __END_NAMESPACE_C99
23785 # 1 "/usr/include/bits/mathcalls.h" 1 3 4
23786 # 53 "/usr/include/bits/mathcalls.h" 3 4
23787
23788
23789 extern float acosf (float __x) throw (); extern float __acosf (float __x) throw ();
23790
23791 extern float asinf (float __x) throw (); extern float __asinf (float __x) throw ();
23792
23793 extern float atanf (float __x) throw (); extern float __atanf (float __x) throw ();
23794
23795 extern float atan2f (float __y, float __x) throw (); extern float __atan2f (float __y, float __x) throw ();
23796
23797
23798 extern float cosf (float __x) throw (); extern float __cosf (float __x) throw ();
23799
23800 extern float sinf (float __x) throw (); extern float __sinf (float __x) throw ();
23801
23802 extern float tanf (float __x) throw (); extern float __tanf (float __x) throw ();
23803
23804
23805
23806
23807 extern float coshf (float __x) throw (); extern float __coshf (float __x) throw ();
23808
23809 extern float sinhf (float __x) throw (); extern float __sinhf (float __x) throw ();
23810
23811 extern float tanhf (float __x) throw (); extern float __tanhf (float __x) throw ();
23812
23813
23814
23815
23816 extern void
23817 sincosf
23818 # 82 "/usr/include/bits/mathcalls.h" 3 4
23819 (float __x, float *__sinx, float *__cosx) throw (); extern void
23820 __sincosf
23821 # 82 "/usr/include/bits/mathcalls.h" 3 4
23822 (float __x, float *__sinx, float *__cosx) throw ()
23823 ;
23824
23825
23826
23827
23828
23829 extern float acoshf (float __x) throw (); extern float __acoshf (float __x) throw ();
23830
23831 extern float asinhf (float __x) throw (); extern float __asinhf (float __x) throw ();
23832
23833 extern float atanhf (float __x) throw (); extern float __atanhf (float __x) throw ();
23834
23835
23836
23837
23838
23839
23840
23841 extern float expf (float __x) throw (); extern float __expf (float __x) throw ();
23842
23843
23844 extern float frexpf (float __x, int *__exponent) throw (); extern float __frexpf (float __x, int *__exponent) throw ();
23845
23846
23847 extern float ldexpf (float __x, int __exponent) throw (); extern float __ldexpf (float __x, int __exponent) throw ();
23848
23849
23850 extern float logf (float __x) throw (); extern float __logf (float __x) throw ();
23851
23852
23853 extern float log10f (float __x) throw (); extern float __log10f (float __x) throw ();
23854
23855
23856 extern float modff (float __x, float *__iptr) throw (); extern float __modff (float __x, float *__iptr) throw ()
23857 __attribute__ ((__nonnull__ (2)));
23858
23859
23860
23861
23862 extern float exp10f (float __x) throw (); extern float __exp10f (float __x) throw ();
23863
23864 extern float pow10f (float __x) throw (); extern float __pow10f (float __x) throw ();
23865
23866
23867
23868
23869
23870 extern float expm1f (float __x) throw (); extern float __expm1f (float __x) throw ();
23871
23872
23873 extern float log1pf (float __x) throw (); extern float __log1pf (float __x) throw ();
23874
23875
23876 extern float logbf (float __x) throw (); extern float __logbf (float __x) throw ();
23877
23878
23879
23880
23881
23882
23883 extern float exp2f (float __x) throw (); extern float __exp2f (float __x) throw ();
23884
23885
23886 extern float log2f (float __x) throw (); extern float __log2f (float __x) throw ();
23887
23888
23889
23890
23891
23892
23893
23894
23895 extern float powf (float __x, float __y) throw (); extern float __powf (float __x, float __y) throw ();
23896
23897
23898 extern float sqrtf (float __x) throw (); extern float __sqrtf (float __x) throw ();
23899
23900
23901
23902
23903
23904 extern float hypotf (float __x, float __y) throw (); extern float __hypotf (float __x, float __y) throw ();
23905
23906
23907
23908
23909
23910
23911 extern float cbrtf (float __x) throw (); extern float __cbrtf (float __x) throw ();
23912
23913
23914
23915
23916
23917
23918
23919
23920 extern float ceilf (float __x) throw () __attribute__ ((__const__)); extern float __ceilf (float __x) throw () __attribute__ ((__const__));
23921
23922
23923 extern float fabsf (float __x) throw () __attribute__ ((__const__)); extern float __fabsf (float __x) throw () __attribute__ ((__const__));
23924
23925
23926 extern float floorf (float __x) throw () __attribute__ ((__const__)); extern float __floorf (float __x) throw () __attribute__ ((__const__));
23927
23928
23929 extern float fmodf (float __x, float __y) throw (); extern float __fmodf (float __x, float __y) throw ();
23930
23931
23932
23933
23934 extern int __isinff (float __value) throw () __attribute__ ((__const__));
23935
23936
23937 extern int __finitef (float __value) throw () __attribute__ ((__const__));
23938
23939
23940
23941
23942
23943 extern int isinff (float __value) throw () __attribute__ ((__const__));
23944
23945
23946 extern int finitef (float __value) throw () __attribute__ ((__const__));
23947
23948
23949 extern float dremf (float __x, float __y) throw (); extern float __dremf (float __x, float __y) throw ();
23950
23951
23952
23953 extern float significandf (float __x) throw (); extern float __significandf (float __x) throw ();
23954
23955
23956
23957
23958
23959 extern float copysignf (float __x, float __y) throw () __attribute__ ((__const__)); extern float __copysignf (float __x, float __y) throw () __attribute__ ((__const__));
23960
23961
23962
23963
23964
23965
23966 extern float nanf (__const char *__tagb) throw () __attribute__ ((__const__)); extern float __nanf (__const char *__tagb) throw () __attribute__ ((__const__));
23967
23968
23969
23970
23971
23972 extern int __isnanf (float __value) throw () __attribute__ ((__const__));
23973
23974
23975
23976 extern int isnanf (float __value) throw () __attribute__ ((__const__));
23977
23978
23979 extern float j0f (float) throw (); extern float __j0f (float) throw ();
23980 extern float j1f (float) throw (); extern float __j1f (float) throw ();
23981 extern float jnf (int, float) throw (); extern float __jnf (int, float) throw ();
23982 extern float y0f (float) throw (); extern float __y0f (float) throw ();
23983 extern float y1f (float) throw (); extern float __y1f (float) throw ();
23984 extern float ynf (int, float) throw (); extern float __ynf (int, float) throw ();
23985
23986
23987
23988
23989
23990
23991 extern float erff (float) throw (); extern float __erff (float) throw ();
23992 extern float erfcf (float) throw (); extern float __erfcf (float) throw ();
23993 extern float lgammaf (float) throw (); extern float __lgammaf (float) throw ();
23994
23995
23996
23997
23998
23999
24000 extern float tgammaf (float) throw (); extern float __tgammaf (float) throw ();
24001
24002
24003
24004
24005
24006 extern float gammaf (float) throw (); extern float __gammaf (float) throw ();
24007
24008
24009
24010
24011
24012
24013 extern float lgammaf_r (float, int *__signgamp) throw (); extern float __lgammaf_r (float, int *__signgamp) throw ();
24014
24015
24016
24017
24018
24019
24020
24021 extern float rintf (float __x) throw (); extern float __rintf (float __x) throw ();
24022
24023
24024 extern float nextafterf (float __x, float __y) throw () __attribute__ ((__const__)); extern float __nextafterf (float __x, float __y) throw () __attribute__ ((__const__));
24025
24026 extern float nexttowardf (float __x, long double __y) throw () __attribute__ ((__const__)); extern float __nexttowardf (float __x, long double __y) throw () __attribute__ ((__const__));
24027
24028
24029
24030 extern float remainderf (float __x, float __y) throw (); extern float __remainderf (float __x, float __y) throw ();
24031
24032
24033
24034 extern float scalbnf (float __x, int __n) throw (); extern float __scalbnf (float __x, int __n) throw ();
24035
24036
24037
24038 extern int ilogbf (float __x) throw (); extern int __ilogbf (float __x) throw ();
24039
24040
24041
24042
24043 extern float scalblnf (float __x, long int __n) throw (); extern float __scalblnf (float __x, long int __n) throw ();
24044
24045
24046
24047 extern float nearbyintf (float __x) throw (); extern float __nearbyintf (float __x) throw ();
24048
24049
24050
24051 extern float roundf (float __x) throw () __attribute__ ((__const__)); extern float __roundf (float __x) throw () __attribute__ ((__const__));
24052
24053
24054
24055 extern float truncf (float __x) throw () __attribute__ ((__const__)); extern float __truncf (float __x) throw () __attribute__ ((__const__));
24056
24057
24058
24059
24060 extern float remquof (float __x, float __y, int *__quo) throw (); extern float __remquof (float __x, float __y, int *__quo) throw ();
24061
24062
24063
24064
24065
24066
24067 extern long int lrintf (float __x) throw (); extern long int __lrintf (float __x) throw ();
24068 extern long long int llrintf (float __x) throw (); extern long long int __llrintf (float __x) throw ();
24069
24070
24071
24072 extern long int lroundf (float __x) throw (); extern long int __lroundf (float __x) throw ();
24073 extern long long int llroundf (float __x) throw (); extern long long int __llroundf (float __x) throw ();
24074
24075
24076
24077 extern float fdimf (float __x, float __y) throw (); extern float __fdimf (float __x, float __y) throw ();
24078
24079
24080 extern float fmaxf (float __x, float __y) throw (); extern float __fmaxf (float __x, float __y) throw ();
24081
24082
24083 extern float fminf (float __x, float __y) throw (); extern float __fminf (float __x, float __y) throw ();
24084
24085
24086
24087 extern int __fpclassifyf (float __value) throw ()
24088 __attribute__ ((__const__));
24089
24090
24091 extern int __signbitf (float __value) throw ()
24092 __attribute__ ((__const__));
24093
24094
24095
24096 extern float fmaf (float __x, float __y, float __z) throw (); extern float __fmaf (float __x, float __y, float __z) throw ();
24097
24098
24099
24100
24101
24102
24103
24104
24105 extern float scalbf (float __x, float __n) throw (); extern float __scalbf (float __x, float __n) throw ();
24106 # 95 "/usr/include/math.h" 2 3 4
24107 #undef _Mdouble_
24108 #undef _Mdouble_BEGIN_NAMESPACE
24109 #undef _Mdouble_END_NAMESPACE
24110 #undef __MATH_PRECNAME
24111 # 132 "/usr/include/math.h" 3 4
24112 #define _Mlong_double_ long double
24113
24114 #define _Mdouble_ _Mlong_double_
24115
24116 #define __MATH_PRECNAME(name,r) name ##l ##r
24117
24118
24119
24120 #define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_C99
24121 #define _Mdouble_END_NAMESPACE __END_NAMESPACE_C99
24122 #define __MATH_DECLARE_LDOUBLE 1
24123 # 1 "/usr/include/bits/mathcalls.h" 1 3 4
24124 # 53 "/usr/include/bits/mathcalls.h" 3 4
24125
24126
24127 extern long double acosl (long double __x) throw (); extern long double __acosl (long double __x) throw ();
24128
24129 extern long double asinl (long double __x) throw (); extern long double __asinl (long double __x) throw ();
24130
24131 extern long double atanl (long double __x) throw (); extern long double __atanl (long double __x) throw ();
24132
24133 extern long double atan2l (long double __y, long double __x) throw (); extern long double __atan2l (long double __y, long double __x) throw ();
24134
24135
24136 extern long double cosl (long double __x) throw (); extern long double __cosl (long double __x) throw ();
24137
24138 extern long double sinl (long double __x) throw (); extern long double __sinl (long double __x) throw ();
24139
24140 extern long double tanl (long double __x) throw (); extern long double __tanl (long double __x) throw ();
24141
24142
24143
24144
24145 extern long double coshl (long double __x) throw (); extern long double __coshl (long double __x) throw ();
24146
24147 extern long double sinhl (long double __x) throw (); extern long double __sinhl (long double __x) throw ();
24148
24149 extern long double tanhl (long double __x) throw (); extern long double __tanhl (long double __x) throw ();
24150
24151
24152
24153
24154 extern void
24155 sincosl
24156 # 82 "/usr/include/bits/mathcalls.h" 3 4
24157 (long double __x, long double *__sinx, long double *__cosx) throw (); extern void
24158 __sincosl
24159 # 82 "/usr/include/bits/mathcalls.h" 3 4
24160 (long double __x, long double *__sinx, long double *__cosx) throw ()
24161 ;
24162
24163
24164
24165
24166
24167 extern long double acoshl (long double __x) throw (); extern long double __acoshl (long double __x) throw ();
24168
24169 extern long double asinhl (long double __x) throw (); extern long double __asinhl (long double __x) throw ();
24170
24171 extern long double atanhl (long double __x) throw (); extern long double __atanhl (long double __x) throw ();
24172
24173
24174
24175
24176
24177
24178
24179 extern long double expl (long double __x) throw (); extern long double __expl (long double __x) throw ();
24180
24181
24182 extern long double frexpl (long double __x, int *__exponent) throw (); extern long double __frexpl (long double __x, int *__exponent) throw ();
24183
24184
24185 extern long double ldexpl (long double __x, int __exponent) throw (); extern long double __ldexpl (long double __x, int __exponent) throw ();
24186
24187
24188 extern long double logl (long double __x) throw (); extern long double __logl (long double __x) throw ();
24189
24190
24191 extern long double log10l (long double __x) throw (); extern long double __log10l (long double __x) throw ();
24192
24193
24194 extern long double modfl (long double __x, long double *__iptr) throw (); extern long double __modfl (long double __x, long double *__iptr) throw ()
24195 __attribute__ ((__nonnull__ (2)));
24196
24197
24198
24199
24200 extern long double exp10l (long double __x) throw (); extern long double __exp10l (long double __x) throw ();
24201
24202 extern long double pow10l (long double __x) throw (); extern long double __pow10l (long double __x) throw ();
24203
24204
24205
24206
24207
24208 extern long double expm1l (long double __x) throw (); extern long double __expm1l (long double __x) throw ();
24209
24210
24211 extern long double log1pl (long double __x) throw (); extern long double __log1pl (long double __x) throw ();
24212
24213
24214 extern long double logbl (long double __x) throw (); extern long double __logbl (long double __x) throw ();
24215
24216
24217
24218
24219
24220
24221 extern long double exp2l (long double __x) throw (); extern long double __exp2l (long double __x) throw ();
24222
24223
24224 extern long double log2l (long double __x) throw (); extern long double __log2l (long double __x) throw ();
24225
24226
24227
24228
24229
24230
24231
24232
24233 extern long double powl (long double __x, long double __y) throw (); extern long double __powl (long double __x, long double __y) throw ();
24234
24235
24236 extern long double sqrtl (long double __x) throw (); extern long double __sqrtl (long double __x) throw ();
24237
24238
24239
24240
24241
24242 extern long double hypotl (long double __x, long double __y) throw (); extern long double __hypotl (long double __x, long double __y) throw ();
24243
24244
24245
24246
24247
24248
24249 extern long double cbrtl (long double __x) throw (); extern long double __cbrtl (long double __x) throw ();
24250
24251
24252
24253
24254
24255
24256
24257
24258 extern long double ceill (long double __x) throw () __attribute__ ((__const__)); extern long double __ceill (long double __x) throw () __attribute__ ((__const__));
24259
24260
24261 extern long double fabsl (long double __x) throw () __attribute__ ((__const__)); extern long double __fabsl (long double __x) throw () __attribute__ ((__const__));
24262
24263
24264 extern long double floorl (long double __x) throw () __attribute__ ((__const__)); extern long double __floorl (long double __x) throw () __attribute__ ((__const__));
24265
24266
24267 extern long double fmodl (long double __x, long double __y) throw (); extern long double __fmodl (long double __x, long double __y) throw ();
24268
24269
24270
24271
24272 extern int __isinfl (long double __value) throw () __attribute__ ((__const__));
24273
24274
24275 extern int __finitel (long double __value) throw () __attribute__ ((__const__));
24276
24277
24278
24279
24280
24281 extern int isinfl (long double __value) throw () __attribute__ ((__const__));
24282
24283
24284 extern int finitel (long double __value) throw () __attribute__ ((__const__));
24285
24286
24287 extern long double dreml (long double __x, long double __y) throw (); extern long double __dreml (long double __x, long double __y) throw ();
24288
24289
24290
24291 extern long double significandl (long double __x) throw (); extern long double __significandl (long double __x) throw ();
24292
24293
24294
24295
24296
24297 extern long double copysignl (long double __x, long double __y) throw () __attribute__ ((__const__)); extern long double __copysignl (long double __x, long double __y) throw () __attribute__ ((__const__));
24298
24299
24300
24301
24302
24303
24304 extern long double nanl (__const char *__tagb) throw () __attribute__ ((__const__)); extern long double __nanl (__const char *__tagb) throw () __attribute__ ((__const__));
24305
24306
24307
24308
24309
24310 extern int __isnanl (long double __value) throw () __attribute__ ((__const__));
24311
24312
24313
24314 extern int isnanl (long double __value) throw () __attribute__ ((__const__));
24315
24316
24317 extern long double j0l (long double) throw (); extern long double __j0l (long double) throw ();
24318 extern long double j1l (long double) throw (); extern long double __j1l (long double) throw ();
24319 extern long double jnl (int, long double) throw (); extern long double __jnl (int, long double) throw ();
24320 extern long double y0l (long double) throw (); extern long double __y0l (long double) throw ();
24321 extern long double y1l (long double) throw (); extern long double __y1l (long double) throw ();
24322 extern long double ynl (int, long double) throw (); extern long double __ynl (int, long double) throw ();
24323
24324
24325
24326
24327
24328
24329 extern long double erfl (long double) throw (); extern long double __erfl (long double) throw ();
24330 extern long double erfcl (long double) throw (); extern long double __erfcl (long double) throw ();
24331 extern long double lgammal (long double) throw (); extern long double __lgammal (long double) throw ();
24332
24333
24334
24335
24336
24337
24338 extern long double tgammal (long double) throw (); extern long double __tgammal (long double) throw ();
24339
24340
24341
24342
24343
24344 extern long double gammal (long double) throw (); extern long double __gammal (long double) throw ();
24345
24346
24347
24348
24349
24350
24351 extern long double lgammal_r (long double, int *__signgamp) throw (); extern long double __lgammal_r (long double, int *__signgamp) throw ();
24352
24353
24354
24355
24356
24357
24358
24359 extern long double rintl (long double __x) throw (); extern long double __rintl (long double __x) throw ();
24360
24361
24362 extern long double nextafterl (long double __x, long double __y) throw () __attribute__ ((__const__)); extern long double __nextafterl (long double __x, long double __y) throw () __attribute__ ((__const__));
24363
24364 extern long double nexttowardl (long double __x, long double __y) throw () __attribute__ ((__const__)); extern long double __nexttowardl (long double __x, long double __y) throw () __attribute__ ((__const__));
24365
24366
24367
24368 extern long double remainderl (long double __x, long double __y) throw (); extern long double __remainderl (long double __x, long double __y) throw ();
24369
24370
24371
24372 extern long double scalbnl (long double __x, int __n) throw (); extern long double __scalbnl (long double __x, int __n) throw ();
24373
24374
24375
24376 extern int ilogbl (long double __x) throw (); extern int __ilogbl (long double __x) throw ();
24377
24378
24379
24380
24381 extern long double scalblnl (long double __x, long int __n) throw (); extern long double __scalblnl (long double __x, long int __n) throw ();
24382
24383
24384
24385 extern long double nearbyintl (long double __x) throw (); extern long double __nearbyintl (long double __x) throw ();
24386
24387
24388
24389 extern long double roundl (long double __x) throw () __attribute__ ((__const__)); extern long double __roundl (long double __x) throw () __attribute__ ((__const__));
24390
24391
24392
24393 extern long double truncl (long double __x) throw () __attribute__ ((__const__)); extern long double __truncl (long double __x) throw () __attribute__ ((__const__));
24394
24395
24396
24397
24398 extern long double remquol (long double __x, long double __y, int *__quo) throw (); extern long double __remquol (long double __x, long double __y, int *__quo) throw ();
24399
24400
24401
24402
24403
24404
24405 extern long int lrintl (long double __x) throw (); extern long int __lrintl (long double __x) throw ();
24406 extern long long int llrintl (long double __x) throw (); extern long long int __llrintl (long double __x) throw ();
24407
24408
24409
24410 extern long int lroundl (long double __x) throw (); extern long int __lroundl (long double __x) throw ();
24411 extern long long int llroundl (long double __x) throw (); extern long long int __llroundl (long double __x) throw ();
24412
24413
24414
24415 extern long double fdiml (long double __x, long double __y) throw (); extern long double __fdiml (long double __x, long double __y) throw ();
24416
24417
24418 extern long double fmaxl (long double __x, long double __y) throw (); extern long double __fmaxl (long double __x, long double __y) throw ();
24419
24420
24421 extern long double fminl (long double __x, long double __y) throw (); extern long double __fminl (long double __x, long double __y) throw ();
24422
24423
24424
24425 extern int __fpclassifyl (long double __value) throw ()
24426 __attribute__ ((__const__));
24427
24428
24429 extern int __signbitl (long double __value) throw ()
24430 __attribute__ ((__const__));
24431
24432
24433
24434 extern long double fmal (long double __x, long double __y, long double __z) throw (); extern long double __fmal (long double __x, long double __y, long double __z) throw ();
24435
24436
24437
24438
24439
24440
24441
24442
24443 extern long double scalbl (long double __x, long double __n) throw (); extern long double __scalbl (long double __x, long double __n) throw ();
24444 # 144 "/usr/include/math.h" 2 3 4
24445 #undef _Mdouble_
24446 #undef _Mdouble_BEGIN_NAMESPACE
24447 #undef _Mdouble_END_NAMESPACE
24448 #undef __MATH_PRECNAME
24449
24450
24451
24452
24453 #undef __MATHDECL_1
24454 #undef __MATHDECL
24455 #undef __MATHCALL
24456
24457
24458
24459
24460 extern int signgam;
24461 # 200 "/usr/include/math.h" 3 4
24462 enum
24463 {
24464 FP_NAN,
24465 #define FP_NAN FP_NAN
24466 FP_INFINITE,
24467 #define FP_INFINITE FP_INFINITE
24468 FP_ZERO,
24469 #define FP_ZERO FP_ZERO
24470 FP_SUBNORMAL,
24471 #define FP_SUBNORMAL FP_SUBNORMAL
24472 FP_NORMAL
24473 #define FP_NORMAL FP_NORMAL
24474 };
24475
24476
24477
24478 #define fpclassify(x) (sizeof (x) == sizeof (float) ? __fpclassifyf (x) : __fpclassify (x))
24479 # 228 "/usr/include/math.h" 3 4
24480 #define signbit(x) (sizeof (x) == sizeof (float) ? __signbitf (x) : __signbit (x))
24481 # 240 "/usr/include/math.h" 3 4
24482 #define isfinite(x) (sizeof (x) == sizeof (float) ? __finitef (x) : __finite (x))
24483 # 251 "/usr/include/math.h" 3 4
24484 #define isnormal(x) (fpclassify (x) == FP_NORMAL)
24485
24486
24487
24488
24489 #define isnan(x) (sizeof (x) == sizeof (float) ? __isnanf (x) : __isnan (x))
24490 # 268 "/usr/include/math.h" 3 4
24491 #define isinf(x) (sizeof (x) == sizeof (float) ? __isinff (x) : __isinf (x))
24492 # 279 "/usr/include/math.h" 3 4
24493 #define MATH_ERRNO 1
24494 #define MATH_ERREXCEPT 2
24495
24496
24497
24498
24499
24500 #define math_errhandling (MATH_ERRNO | MATH_ERREXCEPT)
24501
24502
24503
24504
24505
24506
24507 typedef enum
24508 {
24509 _IEEE_ = -1,
24510 _SVID_,
24511 _XOPEN_,
24512 _POSIX_,
24513 _ISOC_
24514 } _LIB_VERSION_TYPE;
24515
24516
24517
24518
24519 extern _LIB_VERSION_TYPE _LIB_VERSION;
24520 # 316 "/usr/include/math.h" 3 4
24521 struct __exception
24522
24523
24524
24525 {
24526 int type;
24527 char *name;
24528 double arg1;
24529 double arg2;
24530 double retval;
24531 };
24532
24533
24534 extern int matherr (struct __exception *__exc) throw ();
24535
24536
24537
24538
24539 #define X_TLOSS 1.41484755040568800000e+16
24540
24541
24542 #define DOMAIN 1
24543 #define SING 2
24544 #define OVERFLOW 3
24545 #define UNDERFLOW 4
24546 #define TLOSS 5
24547 #define PLOSS 6
24548
24549
24550 #define HUGE 3.40282347e+38F
24551 # 359 "/usr/include/math.h" 3 4
24552 #define M_E 2.7182818284590452354
24553 #define M_LOG2E 1.4426950408889634074
24554 #define M_LOG10E 0.43429448190325182765
24555 #define M_LN2 0.69314718055994530942
24556 #define M_LN10 2.30258509299404568402
24557 #define M_PI 3.14159265358979323846
24558 #define M_PI_2 1.57079632679489661923
24559 #define M_PI_4 0.78539816339744830962
24560 #define M_1_PI 0.31830988618379067154
24561 #define M_2_PI 0.63661977236758134308
24562 #define M_2_SQRTPI 1.12837916709551257390
24563 #define M_SQRT2 1.41421356237309504880
24564 #define M_SQRT1_2 0.70710678118654752440
24565
24566
24567
24568
24569
24570
24571 #define M_El 2.7182818284590452353602874713526625L
24572 #define M_LOG2El 1.4426950408889634073599246810018921L
24573 #define M_LOG10El 0.4342944819032518276511289189166051L
24574 #define M_LN2l 0.6931471805599453094172321214581766L
24575 #define M_LN10l 2.3025850929940456840179914546843642L
24576 #define M_PIl 3.1415926535897932384626433832795029L
24577 #define M_PI_2l 1.5707963267948966192313216916397514L
24578 #define M_PI_4l 0.7853981633974483096156608458198757L
24579 #define M_1_PIl 0.3183098861837906715377675267450287L
24580 #define M_2_PIl 0.6366197723675813430755350534900574L
24581 #define M_2_SQRTPIl 1.1283791670955125738961589031215452L
24582 #define M_SQRT2l 1.4142135623730950488016887242096981L
24583 #define M_SQRT1_2l 0.7071067811865475244008443621048490L
24584 # 408 "/usr/include/math.h" 3 4
24585 #define isgreater(x,y) __builtin_isgreater(x, y)
24586 #define isgreaterequal(x,y) __builtin_isgreaterequal(x, y)
24587 #define isless(x,y) __builtin_isless(x, y)
24588 #define islessequal(x,y) __builtin_islessequal(x, y)
24589 #define islessgreater(x,y) __builtin_islessgreater(x, y)
24590 #define isunordered(u,v) __builtin_isunordered(u, v)
24591
24592
24593
24594
24595 # 1 "/usr/include/bits/mathinline.h" 1 3 4
24596 # 419 "/usr/include/math.h" 2 3 4
24597 # 480 "/usr/include/math.h" 3 4
24598 }
24599 # 14 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/NumericConversions.h" 2
24600
24601
24602 extern double js_NaN;
24603
24604 namespace js {
24605
24606 namespace detail {
24607
24608 union DoublePun {
24609 struct {
24610
24611 uint32_t lo, hi;
24612
24613
24614
24615 } s;
24616 uint64_t u64;
24617 double d;
24618 };
24619
24620 }
24621
24622
24623 inline int32_t
24624 ToInt32(double d)
24625 {
24626 # 114 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/NumericConversions.h"
24627 int32_t i;
24628 uint32_t tmp0;
24629 uint32_t tmp1;
24630 uint32_t tmp2;
24631 asm (
24632 # 131 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/NumericConversions.h"
24633 " mov %1, %R4, LSR #20\n"
24634 " bic %1, %1, #(1 << 11)\n"
24635
24636
24637
24638 " orr %R4, %R4, #(1 << 20)\n"
24639 # 153 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/NumericConversions.h"
24640 " sub %1, %1, #0xff\n"
24641 " subs %1, %1, #0x300\n"
24642 " bmi 8f\n"
24643
24644
24645
24646
24647
24648 " subs %3, %1, #52\n"
24649 " bmi 1f\n"
24650
24651
24652
24653
24654
24655
24656
24657 " bic %2, %3, #0xff\n"
24658 " orr %3, %3, %2, LSR #3\n"
24659
24660
24661 " mov %Q4, %Q4, LSL %3\n"
24662 " b 2f\n"
24663 "1:\n"
24664
24665
24666 " rsb %3, %1, #52\n"
24667 " mov %Q4, %Q4, LSR %3\n"
24668
24669
24670
24671
24672
24673 "2:\n"
24674
24675
24676
24677
24678
24679
24680
24681 " subs %3, %1, #31\n"
24682 " mov %1, %R4, LSL #11\n"
24683 " bmi 3f\n"
24684
24685
24686
24687 " bic %2, %3, #0xff\n"
24688 " orr %3, %3, %2, LSR #3\n"
24689
24690 " mov %2, %1, LSL %3\n"
24691 " b 4f\n"
24692 "3:\n"
24693
24694
24695 " rsb %3, %3, #0\n"
24696 " mov %2, %1, LSR %3\n"
24697
24698
24699
24700
24701
24702 "4:\n"
24703
24704 " orr %Q4, %Q4, %2\n"
24705
24706
24707
24708 " eor %Q4, %Q4, %R4, ASR #31\n"
24709 " add %0, %Q4, %R4, LSR #31\n"
24710 " b 9f\n"
24711 "8:\n"
24712
24713
24714 " mov %0, #0\n"
24715 "9:\n"
24716 : "=r" (i), "=&r" (tmp0), "=&r" (tmp1), "=&r" (tmp2), "=&r" (d)
24717 : "4" (d)
24718 : "cc"
24719 );
24720 return i;
24721 # 252 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/NumericConversions.h"
24722 }
24723
24724
24725 inline uint32_t
24726 ToUint32(double d)
24727 {
24728 return uint32_t(ToInt32(d));
24729 }
24730
24731
24732 inline double
24733 ToInteger(double d)
24734 {
24735 if (d == 0)
24736 return d;
24737
24738 if (!MOZ_DOUBLE_IS_FINITE(d)) {
24739 if (MOZ_DOUBLE_IS_NaN(d))
24740 return 0;
24741 return d;
24742 }
24743
24744 bool neg = (d < 0);
24745 d = floor(neg ? -d : d);
24746 return neg ? -d : d;
24747 }
24748
24749 }
24750 # 20 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl.h" 2
24751
24752 namespace js {
24753
24754 class Debugger;
24755 class ObjectImpl;
24756
24757 class AutoPropDescArrayRooter;
24758
24759 static inline PropertyOp
24760 CastAsPropertyOp(JSObject *object)
24761 {
24762 return (__extension__ (PropertyOp) (size_t) (object));
24763 }
24764
24765 static inline StrictPropertyOp
24766 CastAsStrictPropertyOp(JSObject *object)
24767 {
24768 return (__extension__ (StrictPropertyOp) (size_t) (object));
24769 }
24770
24771
24772
24773
24774
24775 struct PropDesc {
24776 private:
24777
24778
24779
24780
24781 Value pd_;
24782
24783 Value value_, get_, set_;
24784
24785
24786 uint8_t attrs;
24787
24788
24789 bool hasGet_ : 1;
24790 bool hasSet_ : 1;
24791 bool hasValue_ : 1;
24792 bool hasWritable_ : 1;
24793 bool hasEnumerable_ : 1;
24794 bool hasConfigurable_ : 1;
24795
24796
24797 bool isUndefined_ : 1;
24798
24799 PropDesc(const Value &v)
24800 : pd_(UndefinedValue()),
24801 value_(v),
24802 get_(UndefinedValue()), set_(UndefinedValue()),
24803 attrs(0),
24804 hasGet_(false), hasSet_(false),
24805 hasValue_(true), hasWritable_(false), hasEnumerable_(false), hasConfigurable_(false),
24806 isUndefined_(false)
24807 {
24808 }
24809
24810 public:
24811 friend class AutoPropDescArrayRooter;
24812 friend void JS::AutoGCRooter::trace(JSTracer *trc);
24813
24814 enum Enumerability { Enumerable = true, NonEnumerable = false };
24815 enum Configurability { Configurable = true, NonConfigurable = false };
24816 enum Writability { Writable = true, NonWritable = false };
24817
24818 PropDesc();
24819
24820 static PropDesc undefined() { return PropDesc(); }
24821 static PropDesc valueOnly(const Value &v) { return PropDesc(v); }
24822
24823 PropDesc(const Value &v, Writability writable,
24824 Enumerability enumerable, Configurability configurable)
24825 : pd_(UndefinedValue()),
24826 value_(v),
24827 get_(UndefinedValue()), set_(UndefinedValue()),
24828 attrs((writable ? 0 : 0x02) |
24829 (enumerable ? 0x01 : 0) |
24830 (configurable ? 0 : 0x04)),
24831 hasGet_(false), hasSet_(false),
24832 hasValue_(true), hasWritable_(true), hasEnumerable_(true), hasConfigurable_(true),
24833 isUndefined_(false)
24834 {}
24835 # 115 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl.h"
24836 bool initialize(JSContext* cx, const Value &v, bool checkAccessors = true);
24837 # 126 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl.h"
24838 void initFromPropertyDescriptor(const PropertyDescriptor &desc);
24839 bool makeObject(JSContext *cx);
24840
24841 void setUndefined() { isUndefined_ = true; }
24842
24843 bool isUndefined() const { return isUndefined_; }
24844
24845 bool hasGet() const { do { } while(0); return hasGet_; }
24846 bool hasSet() const { do { } while(0); return hasSet_; }
24847 bool hasValue() const { do { } while(0); return hasValue_; }
24848 bool hasWritable() const { do { } while(0); return hasWritable_; }
24849 bool hasEnumerable() const { do { } while(0); return hasEnumerable_; }
24850 bool hasConfigurable() const { do { } while(0); return hasConfigurable_; }
24851
24852 Value pd() const { do { } while(0); return pd_; }
24853 void clearPd() { pd_ = UndefinedValue(); }
24854
24855 uint8_t attributes() const { do { } while(0); return attrs; }
24856
24857
24858 bool isAccessorDescriptor() const {
24859 return !isUndefined() && (hasGet() || hasSet());
24860 }
24861
24862
24863 bool isDataDescriptor() const {
24864 return !isUndefined() && (hasValue() || hasWritable());
24865 }
24866
24867
24868 bool isGenericDescriptor() const {
24869 return !isUndefined() && !isAccessorDescriptor() && !isDataDescriptor();
24870 }
24871
24872 bool configurable() const {
24873 do { } while(0);
24874 do { } while(0);
24875 return (attrs & 0x04) == 0;
24876 }
24877
24878 bool enumerable() const {
24879 do { } while(0);
24880 do { } while(0);
24881 return (attrs & 0x01) != 0;
24882 }
24883
24884 bool writable() const {
24885 do { } while(0);
24886 do { } while(0);
24887 return (attrs & 0x02) == 0;
24888 }
24889
24890 const Value & value() const {
24891 do { } while(0);
24892 return value_;
24893 }
24894
24895 JSObject * getterObject() const {
24896 do { } while(0);
24897 do { } while(0);
24898 return get_.isUndefined() ? __null : &get_.toObject();
24899 }
24900 JSObject * setterObject() const {
24901 do { } while(0);
24902 do { } while(0);
24903 return set_.isUndefined() ? __null : &set_.toObject();
24904 }
24905
24906 const Value & getterValue() const {
24907 do { } while(0);
24908 do { } while(0);
24909 return get_;
24910 }
24911 const Value & setterValue() const {
24912 do { } while(0);
24913 do { } while(0);
24914 return set_;
24915 }
24916
24917
24918
24919
24920
24921 PropertyOp getter() const {
24922 return CastAsPropertyOp(get_.isUndefined() ? __null : &get_.toObject());
24923 }
24924 StrictPropertyOp setter() const {
24925 return CastAsStrictPropertyOp(set_.isUndefined() ? __null : &set_.toObject());
24926 }
24927
24928
24929
24930
24931
24932
24933 bool checkGetter(JSContext *cx);
24934 bool checkSetter(JSContext *cx);
24935
24936 bool unwrapDebuggerObjectsInto(JSContext *cx, Debugger *dbg, JSObject *obj,
24937 PropDesc *unwrapped) const;
24938
24939 bool wrapInto(JSContext *cx, JSObject *obj, const jsid &id, jsid *wrappedId,
24940 PropDesc *wrappedDesc) const;
24941
24942 class AutoRooter : private AutoGCRooter
24943 {
24944 public:
24945 explicit AutoRooter(JSContext *cx, PropDesc *pd_
24946 )
24947 : AutoGCRooter(cx, PROPDESC), pd(pd_), skip(cx, pd_)
24948 {
24949 do { } while (0);
24950 }
24951
24952 friend void AutoGCRooter::trace(JSTracer *trc);
24953
24954 private:
24955 PropDesc *pd;
24956 SkipRoot skip;
24957
24958 };
24959 };
24960
24961 class DenseElementsHeader;
24962 class SparseElementsHeader;
24963 class Uint8ElementsHeader;
24964 class Int8ElementsHeader;
24965 class Uint16ElementsHeader;
24966 class Int16ElementsHeader;
24967 class Uint32ElementsHeader;
24968 class Int32ElementsHeader;
24969 class Uint8ClampedElementsHeader;
24970 class Float32ElementsHeader;
24971 class Float64ElementsHeader;
24972 class Uint8ClampedElementsHeader;
24973 class ArrayBufferElementsHeader;
24974
24975 enum ElementsKind {
24976 DenseElements,
24977 SparseElements,
24978
24979 ArrayBufferElements,
24980
24981
24982 Uint8Elements,
24983 Int8Elements,
24984 Uint16Elements,
24985 Int16Elements,
24986 Uint32Elements,
24987 Int32Elements,
24988 Uint8ClampedElements,
24989 Float32Elements,
24990 Float64Elements
24991 };
24992
24993 class ElementsHeader
24994 {
24995 protected:
24996 uint32_t type;
24997 uint32_t length;
24998
24999 union {
25000 class {
25001 friend class DenseElementsHeader;
25002 uint32_t initializedLength;
25003 uint32_t capacity;
25004 } dense;
25005 class {
25006 friend class SparseElementsHeader;
25007 Shape * shape;
25008 } sparse;
25009 };
25010
25011 void staticAsserts() {
25012 typedef int
25013 moz_static_assert47
25014 # 300 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl.h"
25015 [(sizeof(ElementsHeader) == ValuesPerHeader * sizeof(Value)) ? 1 : -1]
25016 ;
25017 }
25018
25019 public:
25020 ElementsKind kind() const {
25021 do { } while(0);
25022 return ElementsKind(type);
25023 }
25024
25025 inline bool isDenseElements() const { return kind() == DenseElements; }
25026 inline bool isSparseElements() const { return kind() == SparseElements; }
25027 inline bool isArrayBufferElements() const { return kind() == ArrayBufferElements; }
25028 inline bool isUint8Elements() const { return kind() == Uint8Elements; }
25029 inline bool isInt8Elements() const { return kind() == Int8Elements; }
25030 inline bool isUint16Elements() const { return kind() == Uint16Elements; }
25031 inline bool isInt16Elements() const { return kind() == Int16Elements; }
25032 inline bool isUint32Elements() const { return kind() == Uint32Elements; }
25033 inline bool isInt32Elements() const { return kind() == Int32Elements; }
25034 inline bool isUint8ClampedElements() const { return kind() == Uint8ClampedElements; }
25035 inline bool isFloat32Elements() const { return kind() == Float32Elements; }
25036 inline bool isFloat64Elements() const { return kind() == Float64Elements; }
25037
25038 inline DenseElementsHeader & asDenseElements();
25039 inline SparseElementsHeader & asSparseElements();
25040 inline ArrayBufferElementsHeader & asArrayBufferElements();
25041 inline Uint8ElementsHeader & asUint8Elements();
25042 inline Int8ElementsHeader & asInt8Elements();
25043 inline Uint16ElementsHeader & asUint16Elements();
25044 inline Int16ElementsHeader & asInt16Elements();
25045 inline Uint32ElementsHeader & asUint32Elements();
25046 inline Int32ElementsHeader & asInt32Elements();
25047 inline Uint8ClampedElementsHeader & asUint8ClampedElements();
25048 inline Float32ElementsHeader & asFloat32Elements();
25049 inline Float64ElementsHeader & asFloat64Elements();
25050
25051 static ElementsHeader * fromElements(HeapSlot *elems) {
25052 return reinterpret_cast<ElementsHeader *>(uintptr_t(elems) - sizeof(ElementsHeader));
25053 }
25054
25055 static const size_t ValuesPerHeader = 2;
25056 };
25057
25058 class DenseElementsHeader : public ElementsHeader
25059 {
25060 public:
25061 uint32_t capacity() const {
25062 do { } while(0);
25063 return dense.capacity;
25064 }
25065
25066 uint32_t initializedLength() const {
25067 do { } while(0);
25068 return dense.initializedLength;
25069 }
25070
25071 uint32_t length() const {
25072 do { } while(0);
25073 return ElementsHeader::length;
25074 }
25075
25076 bool getOwnElement(JSContext *cx, ObjectImpl *obj, uint32_t index, PropDesc *desc);
25077
25078 bool defineElement(JSContext *cx, ObjectImpl *obj, uint32_t index, const PropDesc &desc,
25079 bool shouldThrow, bool *succeeded);
25080
25081 bool setElement(JSContext *cx, ObjectImpl *obj, ObjectImpl *receiver, uint32_t index,
25082 const Value &v, bool *succeeded);
25083
25084 private:
25085 inline bool isDenseElements() const ;
25086 inline DenseElementsHeader & asDenseElements() ;
25087
25088 DenseElementsHeader(const DenseElementsHeader &other) ;
25089 void operator=(const DenseElementsHeader &other) ;
25090 };
25091
25092 class SparseElementsHeader : public ElementsHeader
25093 {
25094 public:
25095 Shape * shape() {
25096 do { } while(0);
25097 return sparse.shape;
25098 }
25099
25100 uint32_t length() const {
25101 do { } while(0);
25102 return ElementsHeader::length;
25103 }
25104
25105 bool getOwnElement(JSContext *cx, ObjectImpl *obj, uint32_t index, PropDesc *desc);
25106
25107 bool defineElement(JSContext *cx, ObjectImpl *obj, uint32_t index, const PropDesc &desc,
25108 bool shouldThrow, bool *succeeded);
25109
25110 bool setElement(JSContext *cx, ObjectImpl *obj, ObjectImpl *receiver, uint32_t index,
25111 const Value &v, bool *succeeded);
25112
25113 private:
25114 inline bool isSparseElements() const ;
25115 inline SparseElementsHeader & asSparseElements() ;
25116
25117 SparseElementsHeader(const SparseElementsHeader &other) ;
25118 void operator=(const SparseElementsHeader &other) ;
25119 };
25120
25121 extern uint32_t
25122 ClampDoubleToUint8(const double x);
25123
25124 struct uint8_clamped {
25125 uint8_t val;
25126
25127 uint8_clamped() { }
25128 uint8_clamped(const uint8_clamped& other) : val(other.val) { }
25129
25130
25131 uint8_clamped(uint8_t x) { *this = x; }
25132 uint8_clamped(uint16_t x) { *this = x; }
25133 uint8_clamped(uint32_t x) { *this = x; }
25134 uint8_clamped(int8_t x) { *this = x; }
25135 uint8_clamped(int16_t x) { *this = x; }
25136 uint8_clamped(int32_t x) { *this = x; }
25137 uint8_clamped(double x) { *this = x; }
25138
25139 uint8_clamped& operator=(const uint8_clamped& x) {
25140 val = x.val;
25141 return *this;
25142 }
25143
25144 uint8_clamped& operator=(uint8_t x) {
25145 val = x;
25146 return *this;
25147 }
25148
25149 uint8_clamped& operator=(uint16_t x) {
25150 val = (x > 255) ? 255 : uint8_t(x);
25151 return *this;
25152 }
25153
25154 uint8_clamped& operator=(uint32_t x) {
25155 val = (x > 255) ? 255 : uint8_t(x);
25156 return *this;
25157 }
25158
25159 uint8_clamped& operator=(int8_t x) {
25160 val = (x >= 0) ? uint8_t(x) : 0;
25161 return *this;
25162 }
25163
25164 uint8_clamped& operator=(int16_t x) {
25165 val = (x >= 0)
25166 ? ((x < 255)
25167 ? uint8_t(x)
25168 : 255)
25169 : 0;
25170 return *this;
25171 }
25172
25173 uint8_clamped& operator=(int32_t x) {
25174 val = (x >= 0)
25175 ? ((x < 255)
25176 ? uint8_t(x)
25177 : 255)
25178 : 0;
25179 return *this;
25180 }
25181
25182 uint8_clamped& operator=(const double x) {
25183 val = uint8_t(ClampDoubleToUint8(x));
25184 return *this;
25185 }
25186
25187 operator uint8_t() const {
25188 return val;
25189 }
25190
25191 void staticAsserts() {
25192 typedef int
25193 moz_static_assert48
25194 # 477 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl.h"
25195 [(sizeof(uint8_clamped) == 1) ? 1 : -1]
25196 ;
25197 }
25198 };
25199
25200
25201 template<typename T> static inline const bool TypeIsFloatingPoint() { return false; }
25202 template<> inline const bool TypeIsFloatingPoint<float>() { return true; }
25203 template<> inline const bool TypeIsFloatingPoint<double>() { return true; }
25204
25205 template<typename T> static inline const bool TypeIsUnsigned() { return false; }
25206 template<> inline const bool TypeIsUnsigned<uint8_t>() { return true; }
25207 template<> inline const bool TypeIsUnsigned<uint16_t>() { return true; }
25208 template<> inline const bool TypeIsUnsigned<uint32_t>() { return true; }
25209
25210 template <typename T>
25211 class TypedElementsHeader : public ElementsHeader
25212 {
25213 T getElement(uint32_t index) {
25214 do { } while(0);
25215 return reinterpret_cast<T *>(this + 1)[index];
25216 }
25217
25218 inline void assign(uint32_t index, double d);
25219
25220 void setElement(uint32_t index, T value) {
25221 do { } while(0);
25222 reinterpret_cast<T *>(this + 1)[index] = value;
25223 }
25224
25225 public:
25226 uint32_t length() const {
25227 do { } while(0);
25228 do { } while(0);
25229 return ElementsHeader::length;
25230 }
25231
25232 bool getOwnElement(JSContext *cx, ObjectImpl *obj, uint32_t index, PropDesc *desc);
25233
25234 bool defineElement(JSContext *cx, ObjectImpl *obj, uint32_t index, const PropDesc &desc,
25235 bool shouldThrow, bool *succeeded);
25236
25237 bool setElement(JSContext *cx, ObjectImpl *obj, ObjectImpl *receiver, uint32_t index,
25238 const Value &v, bool *succeeded);
25239
25240 private:
25241 TypedElementsHeader(const TypedElementsHeader &other) ;
25242 void operator=(const TypedElementsHeader &other) ;
25243 };
25244
25245 template<typename T> inline void
25246 TypedElementsHeader<T>::assign(uint32_t index, double d)
25247 {
25248 __builtin_unreachable();
25249 }
25250
25251 template<> inline void
25252 TypedElementsHeader<uint8_clamped>::assign(uint32_t index, double d)
25253 {
25254 double i = ToInteger(d);
25255 uint8_t u = (i <= 0)
25256 ? 0
25257 : (i >= 255)
25258 ? 255
25259 : uint8_t(i);
25260 setElement(index, uint8_clamped(u));
25261 }
25262
25263 template<> inline void
25264 TypedElementsHeader<uint8_t>::assign(uint32_t index, double d)
25265 {
25266 setElement(index, uint8_t(ToUint32(d)));
25267 }
25268
25269 template<> inline void
25270 TypedElementsHeader<int8_t>::assign(uint32_t index, double d)
25271 {
25272
25273 setElement(index, int8_t(ToInt32(d)));
25274 }
25275
25276 template<> inline void
25277 TypedElementsHeader<uint16_t>::assign(uint32_t index, double d)
25278 {
25279 setElement(index, uint16_t(ToUint32(d)));
25280 }
25281
25282 template<> inline void
25283 TypedElementsHeader<int16_t>::assign(uint32_t index, double d)
25284 {
25285
25286 setElement(index, int16_t(ToInt32(d)));
25287 }
25288
25289 template<> inline void
25290 TypedElementsHeader<uint32_t>::assign(uint32_t index, double d)
25291 {
25292 setElement(index, ToUint32(d));
25293 }
25294
25295 template<> inline void
25296 TypedElementsHeader<int32_t>::assign(uint32_t index, double d)
25297 {
25298
25299 setElement(index, int32_t(ToInt32(d)));
25300 }
25301
25302 template<> inline void
25303 TypedElementsHeader<float>::assign(uint32_t index, double d)
25304 {
25305 setElement(index, float(d));
25306 }
25307
25308 template<> inline void
25309 TypedElementsHeader<double>::assign(uint32_t index, double d)
25310 {
25311 setElement(index, d);
25312 }
25313
25314 class Uint8ElementsHeader : public TypedElementsHeader<uint8_t>
25315 {
25316 private:
25317 inline bool isUint8Elements() const ;
25318 inline Uint8ElementsHeader & asUint8Elements() ;
25319 Uint8ElementsHeader(const Uint8ElementsHeader &other) ;
25320 void operator=(const Uint8ElementsHeader &other) ;
25321 };
25322 class Int8ElementsHeader : public TypedElementsHeader<int8_t>
25323 {
25324 private:
25325 bool isInt8Elements() const ;
25326 Int8ElementsHeader & asInt8Elements() ;
25327 Int8ElementsHeader(const Int8ElementsHeader &other) ;
25328 void operator=(const Int8ElementsHeader &other) ;
25329 };
25330 class Uint16ElementsHeader : public TypedElementsHeader<uint16_t>
25331 {
25332 private:
25333 bool isUint16Elements() const ;
25334 Uint16ElementsHeader & asUint16Elements() ;
25335 Uint16ElementsHeader(const Uint16ElementsHeader &other) ;
25336 void operator=(const Uint16ElementsHeader &other) ;
25337 };
25338 class Int16ElementsHeader : public TypedElementsHeader<int16_t>
25339 {
25340 private:
25341 bool isInt16Elements() const ;
25342 Int16ElementsHeader & asInt16Elements() ;
25343 Int16ElementsHeader(const Int16ElementsHeader &other) ;
25344 void operator=(const Int16ElementsHeader &other) ;
25345 };
25346 class Uint32ElementsHeader : public TypedElementsHeader<uint32_t>
25347 {
25348 private:
25349 bool isUint32Elements() const ;
25350 Uint32ElementsHeader & asUint32Elements() ;
25351 Uint32ElementsHeader(const Uint32ElementsHeader &other) ;
25352 void operator=(const Uint32ElementsHeader &other) ;
25353 };
25354 class Int32ElementsHeader : public TypedElementsHeader<int32_t>
25355 {
25356 private:
25357 bool isInt32Elements() const ;
25358 Int32ElementsHeader & asInt32Elements() ;
25359 Int32ElementsHeader(const Int32ElementsHeader &other) ;
25360 void operator=(const Int32ElementsHeader &other) ;
25361 };
25362 class Float32ElementsHeader : public TypedElementsHeader<float>
25363 {
25364 private:
25365 bool isFloat32Elements() const ;
25366 Float32ElementsHeader & asFloat32Elements() ;
25367 Float32ElementsHeader(const Float32ElementsHeader &other) ;
25368 void operator=(const Float32ElementsHeader &other) ;
25369 };
25370 class Float64ElementsHeader : public TypedElementsHeader<double>
25371 {
25372 private:
25373 bool isFloat64Elements() const ;
25374 Float64ElementsHeader & asFloat64Elements() ;
25375 Float64ElementsHeader(const Float64ElementsHeader &other) ;
25376 void operator=(const Float64ElementsHeader &other) ;
25377 };
25378
25379 class Uint8ClampedElementsHeader : public TypedElementsHeader<uint8_clamped>
25380 {
25381 private:
25382 inline bool isUint8Clamped() const ;
25383 inline Uint8ClampedElementsHeader & asUint8ClampedElements() ;
25384 Uint8ClampedElementsHeader(const Uint8ClampedElementsHeader &other) ;
25385 void operator=(const Uint8ClampedElementsHeader &other) ;
25386 };
25387
25388 class ArrayBufferElementsHeader : public ElementsHeader
25389 {
25390 public:
25391 bool getOwnElement(JSContext *cx, ObjectImpl *obj, uint32_t index, PropDesc *desc);
25392
25393 bool defineElement(JSContext *cx, ObjectImpl *obj, uint32_t index, const PropDesc &desc,
25394 bool shouldThrow, bool *succeeded);
25395
25396 bool setElement(JSContext *cx, ObjectImpl *obj, ObjectImpl *receiver, uint32_t index,
25397 const Value &v, bool *succeeded);
25398
25399 private:
25400 inline bool isArrayBufferElements() const ;
25401 inline ArrayBufferElementsHeader & asArrayBufferElements() ;
25402
25403 ArrayBufferElementsHeader(const ArrayBufferElementsHeader &other) ;
25404 void operator=(const ArrayBufferElementsHeader &other) ;
25405 };
25406
25407 inline DenseElementsHeader &
25408 ElementsHeader::asDenseElements()
25409 {
25410 do { } while(0);
25411 return *static_cast<DenseElementsHeader *>(this);
25412 }
25413
25414 inline SparseElementsHeader &
25415 ElementsHeader::asSparseElements()
25416 {
25417 do { } while(0);
25418 return *static_cast<SparseElementsHeader *>(this);
25419 }
25420
25421 inline Uint8ElementsHeader &
25422 ElementsHeader::asUint8Elements()
25423 {
25424 do { } while(0);
25425 return *static_cast<Uint8ElementsHeader *>(this);
25426 }
25427
25428 inline Int8ElementsHeader &
25429 ElementsHeader::asInt8Elements()
25430 {
25431 do { } while(0);
25432 return *static_cast<Int8ElementsHeader *>(this);
25433 }
25434
25435 inline Uint16ElementsHeader &
25436 ElementsHeader::asUint16Elements()
25437 {
25438 do { } while(0);
25439 return *static_cast<Uint16ElementsHeader *>(this);
25440 }
25441
25442 inline Int16ElementsHeader &
25443 ElementsHeader::asInt16Elements()
25444 {
25445 do { } while(0);
25446 return *static_cast<Int16ElementsHeader *>(this);
25447 }
25448
25449 inline Uint32ElementsHeader &
25450 ElementsHeader::asUint32Elements()
25451 {
25452 do { } while(0);
25453 return *static_cast<Uint32ElementsHeader *>(this);
25454 }
25455
25456 inline Int32ElementsHeader &
25457 ElementsHeader::asInt32Elements()
25458 {
25459 do { } while(0);
25460 return *static_cast<Int32ElementsHeader *>(this);
25461 }
25462
25463 inline Uint8ClampedElementsHeader &
25464 ElementsHeader::asUint8ClampedElements()
25465 {
25466 do { } while(0);
25467 return *static_cast<Uint8ClampedElementsHeader *>(this);
25468 }
25469
25470 inline Float32ElementsHeader &
25471 ElementsHeader::asFloat32Elements()
25472 {
25473 do { } while(0);
25474 return *static_cast<Float32ElementsHeader *>(this);
25475 }
25476
25477 inline Float64ElementsHeader &
25478 ElementsHeader::asFloat64Elements()
25479 {
25480 do { } while(0);
25481 return *static_cast<Float64ElementsHeader *>(this);
25482 }
25483
25484 inline ArrayBufferElementsHeader &
25485 ElementsHeader::asArrayBufferElements()
25486 {
25487 do { } while(0);
25488 return *static_cast<ArrayBufferElementsHeader *>(this);
25489 }
25490
25491
25492
25493
25494
25495
25496
25497 class ArrayBufferObject;
25498 class ObjectElements
25499 {
25500 friend struct ::JSObject;
25501 friend class ObjectImpl;
25502 friend class ArrayBufferObject;
25503
25504
25505 uint32_t capacity;
25506
25507
25508
25509
25510
25511
25512
25513 uint32_t initializedLength;
25514
25515
25516 uint32_t length;
25517
25518
25519 uint32_t unused;
25520
25521 void staticAsserts() {
25522 typedef int
25523 moz_static_assert49
25524 # 804 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl.h"
25525 [(sizeof(ObjectElements) == VALUES_PER_HEADER * sizeof(Value)) ? 1 : -1]
25526 ;
25527 }
25528
25529 public:
25530
25531 ObjectElements(uint32_t capacity, uint32_t length)
25532 : capacity(capacity), initializedLength(0), length(length)
25533 {}
25534
25535 HeapSlot *elements() { return (HeapSlot *)(uintptr_t(this) + sizeof(ObjectElements)); }
25536 static ObjectElements * fromElements(HeapSlot *elems) {
25537 return (ObjectElements *)(uintptr_t(elems) - sizeof(ObjectElements));
25538 }
25539
25540 static int offsetOfCapacity() {
25541 return (int)__builtin_offsetof (ObjectElements, capacity) - (int)sizeof(ObjectElements);
25542 }
25543 static int offsetOfInitializedLength() {
25544 return (int)__builtin_offsetof (ObjectElements, initializedLength) - (int)sizeof(ObjectElements);
25545 }
25546 static int offsetOfLength() {
25547 return (int)__builtin_offsetof (ObjectElements, length) - (int)sizeof(ObjectElements);
25548 }
25549
25550 static const size_t VALUES_PER_HEADER = 2;
25551 };
25552
25553
25554 extern HeapSlot *emptyObjectElements;
25555
25556 struct Class;
25557 struct GCMarker;
25558 struct ObjectOps;
25559 struct Shape;
25560
25561 class NewObjectCache;
25562
25563 inline Value
25564 ObjectValue(ObjectImpl &obj);
25565 # 893 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl.h"
25566 class ObjectImpl : public gc::Cell
25567 {
25568 protected:
25569
25570
25571
25572
25573 HeapPtrShape shape_;
25574
25575
25576
25577
25578
25579
25580 HeapPtrTypeObject type_;
25581
25582 HeapSlot *slots;
25583 HeapSlot *elements;
25584
25585 private:
25586 static void staticAsserts() {
25587 typedef int
25588 moz_static_assert50
25589 # 914 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl.h"
25590 [(sizeof(ObjectImpl) == sizeof(shadow::Object)) ? 1 : -1]
25591 ;
25592 typedef int
25593 moz_static_assert51
25594 # 916 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl.h"
25595 [(sizeof(ObjectImpl) % sizeof(Value) == 0) ? 1 : -1]
25596 ;
25597
25598 typedef int
25599 moz_static_assert52
25600 # 919 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl.h"
25601 [(__builtin_offsetof (ObjectImpl, shape_) == __builtin_offsetof (shadow::Object, shape)) ? 1 : -1]
25602 ;
25603 typedef int
25604 moz_static_assert53
25605 # 921 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl.h"
25606 [(__builtin_offsetof (ObjectImpl, type_) == __builtin_offsetof (shadow::Object, type)) ? 1 : -1]
25607 ;
25608 typedef int
25609 moz_static_assert54
25610 # 923 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl.h"
25611 [(__builtin_offsetof (ObjectImpl, slots) == __builtin_offsetof (shadow::Object, slots)) ? 1 : -1]
25612 ;
25613 typedef int
25614 moz_static_assert55
25615 # 925 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl.h"
25616 [(__builtin_offsetof (ObjectImpl, elements) == __builtin_offsetof (shadow::Object, _1)) ? 1 : -1]
25617 ;
25618 }
25619
25620 JSObject * asObjectPtr() { return reinterpret_cast<JSObject *>(this); }
25621
25622 friend inline Value ObjectValue(ObjectImpl &obj);
25623
25624
25625
25626 public:
25627 JSObject * getProto() const {
25628 return type_->proto;
25629 }
25630
25631 inline bool isExtensible() const;
25632
25633
25634
25635
25636
25637 inline bool isDenseArray() const;
25638 inline bool isSlowArray() const;
25639 inline bool isArray() const;
25640
25641 inline HeapSlotArray getDenseArrayElements();
25642 inline const Value & getDenseArrayElement(uint32_t idx);
25643 inline uint32_t getDenseArrayInitializedLength();
25644
25645 bool makeElementsSparse(JSContext *cx) {
25646 __builtin_unreachable();
25647
25648 __builtin_unreachable();
25649 return false;
25650 }
25651
25652 protected:
25653
25654
25655
25656 void checkShapeConsistency() { }
25657
25658
25659 private:
25660
25661
25662
25663
25664 inline void getSlotRangeUnchecked(uint32_t start, uint32_t length,
25665 HeapSlot **fixedStart, HeapSlot **fixedEnd,
25666 HeapSlot **slotsStart, HeapSlot **slotsEnd);
25667 inline void getSlotRange(uint32_t start, uint32_t length,
25668 HeapSlot **fixedStart, HeapSlot **fixedEnd,
25669 HeapSlot **slotsStart, HeapSlot **slotsEnd);
25670
25671 protected:
25672 friend struct GCMarker;
25673 friend struct Shape;
25674 friend class NewObjectCache;
25675
25676 inline bool hasContiguousSlots(uint32_t start, uint32_t count) const;
25677
25678 inline void invalidateSlotRange(uint32_t start, uint32_t count);
25679 inline void initializeSlotRange(uint32_t start, uint32_t count);
25680
25681
25682
25683
25684
25685 void initSlotRange(uint32_t start, const Value *vector, uint32_t length);
25686
25687
25688
25689
25690
25691 void copySlotRange(uint32_t start, const Value *vector, uint32_t length);
25692 # 1016 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl.h"
25693 static const uint32_t SLOT_CAPACITY_MIN = 8;
25694
25695 HeapSlot *fixedSlots() const {
25696 return reinterpret_cast<HeapSlot *>(uintptr_t(this) + sizeof(ObjectImpl));
25697 }
25698
25699 friend class ElementsHeader;
25700 friend class DenseElementsHeader;
25701 friend class SparseElementsHeader;
25702
25703 enum DenseElementsResult {
25704 Failure,
25705 ConvertToSparse,
25706 Succeeded
25707 };
25708
25709 DenseElementsResult ensureDenseElementsInitialized(JSContext *cx, uint32_t index,
25710 uint32_t extra)
25711 {
25712 __builtin_unreachable();
25713
25714 __builtin_unreachable();
25715 return Failure;
25716 }
25717
25718
25719
25720
25721
25722
25723 public:
25724 Shape * lastProperty() const {
25725 do { } while(0);
25726 return shape_;
25727 }
25728
25729 inline bool isNative() const;
25730
25731 types::TypeObject *type() const {
25732 do { } while(0);
25733 return type_;
25734 }
25735
25736 uint32_t numFixedSlots() const {
25737 return reinterpret_cast<const shadow::Object *>(this)->numFixedSlots();
25738 }
25739
25740
25741
25742
25743
25744 bool hasSingletonType() const { return !!type_->singleton; }
25745
25746
25747
25748
25749
25750 bool hasLazyType() const { return type_->lazy(); }
25751
25752 inline uint32_t slotSpan() const;
25753
25754
25755 inline uint32_t numDynamicSlots() const;
25756
25757 const Shape * nativeLookup(JSContext *cx, jsid id);
25758
25759
25760
25761
25762
25763 inline Class *getClass() const;
25764 inline JSClass *getJSClass() const;
25765 inline bool hasClass(const Class *c) const;
25766 inline const ObjectOps *getOps() const;
25767 # 1100 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl.h"
25768 inline bool isDelegate() const;
25769
25770
25771
25772
25773
25774
25775 inline bool inDictionaryMode() const;
25776
25777 const Value &getSlot(uint32_t slot) const {
25778 do { } while(0);
25779 uint32_t fixed = numFixedSlots();
25780 if (slot < fixed)
25781 return fixedSlots()[slot];
25782 return slots[slot - fixed];
25783 }
25784
25785 HeapSlot *getSlotAddressUnchecked(uint32_t slot) {
25786 uint32_t fixed = numFixedSlots();
25787 if (slot < fixed)
25788 return fixedSlots() + slot;
25789 return slots + (slot - fixed);
25790 }
25791
25792 HeapSlot *getSlotAddress(uint32_t slot) {
25793
25794
25795
25796
25797
25798 do { } while(0);
25799 return getSlotAddressUnchecked(slot);
25800 }
25801
25802 HeapSlot &getSlotRef(uint32_t slot) {
25803 do { } while(0);
25804 return *getSlotAddress(slot);
25805 }
25806
25807 inline HeapSlot &nativeGetSlotRef(uint32_t slot);
25808 inline const Value &nativeGetSlot(uint32_t slot) const;
25809
25810 inline void setSlot(uint32_t slot, const Value &value);
25811 inline void initSlot(uint32_t slot, const Value &value);
25812 inline void initSlotUnchecked(uint32_t slot, const Value &value);
25813
25814
25815
25816 HeapSlot &getFixedSlotRef(uint32_t slot) {
25817 do { } while(0);
25818 return fixedSlots()[slot];
25819 }
25820
25821 const Value &getFixedSlot(uint32_t slot) const {
25822 do { } while(0);
25823 return fixedSlots()[slot];
25824 }
25825
25826 inline void setFixedSlot(uint32_t slot, const Value &value);
25827 inline void initFixedSlot(uint32_t slot, const Value &value);
25828
25829
25830
25831
25832
25833
25834
25835 static inline uint32_t dynamicSlotsCount(uint32_t nfixed, uint32_t span);
25836
25837
25838 inline size_t sizeOfThis() const;
25839
25840
25841
25842 ObjectElements * getElementsHeader() const {
25843 return ObjectElements::fromElements(elements);
25844 }
25845
25846 ElementsHeader & elementsHeader() const {
25847 __builtin_unreachable();
25848 return *ElementsHeader::fromElements(elements);
25849 }
25850
25851 inline HeapSlot *fixedElements() const {
25852 typedef int
25853
25854 moz_static_assert56
25855 # 1184 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl.h"
25856 [(2 * sizeof(Value) == sizeof(ObjectElements)) ? 1 : -1]
25857
25858 ;
25859 return &fixedSlots()[2];
25860 }
25861
25862 void setFixedElements() { this->elements = fixedElements(); }
25863
25864 inline bool hasDynamicElements() const {
25865
25866
25867
25868
25869
25870
25871
25872 return elements != emptyObjectElements && elements != fixedElements();
25873 }
25874
25875
25876 static inline void readBarrier(ObjectImpl *obj);
25877 static inline void writeBarrierPre(ObjectImpl *obj);
25878 static inline void writeBarrierPost(ObjectImpl *obj, void *addr);
25879 inline void privateWriteBarrierPre(void **oldval);
25880 inline void privateWriteBarrierPost(void **oldval);
25881 void markChildren(JSTracer *trc);
25882
25883
25884
25885 inline void *&privateRef(uint32_t nfixed) const;
25886
25887 inline bool hasPrivate() const;
25888 inline void *getPrivate() const;
25889 inline void setPrivate(void *data);
25890 inline void setPrivateUnbarriered(void *data);
25891 inline void initPrivate(void *data);
25892
25893
25894 inline void *getPrivate(uint32_t nfixed) const;
25895
25896
25897 static size_t offsetOfShape() { return __builtin_offsetof (ObjectImpl, shape_); }
25898 HeapPtrShape *addressOfShape() { return &shape_; }
25899
25900 static size_t offsetOfType() { return __builtin_offsetof (ObjectImpl, type_); }
25901 HeapPtrTypeObject *addressOfType() { return &type_; }
25902
25903 static size_t offsetOfElements() { return __builtin_offsetof (ObjectImpl, elements); }
25904 static size_t offsetOfFixedElements() {
25905 return sizeof(ObjectImpl) + sizeof(ObjectElements);
25906 }
25907
25908 static size_t getFixedSlotOffset(size_t slot) {
25909 return sizeof(ObjectImpl) + slot * sizeof(Value);
25910 }
25911 static size_t getPrivateDataOffset(size_t nfixed) { return getFixedSlotOffset(nfixed); }
25912 static size_t offsetOfSlots() { return __builtin_offsetof (ObjectImpl, slots); }
25913 };
25914
25915 inline Value
25916 ObjectValue(ObjectImpl &obj)
25917 {
25918 Value v;
25919 v.setObject(*obj.asObjectPtr());
25920 return v;
25921 }
25922
25923 bool
25924 GetOwnElement(JSContext *cx, ObjectImpl *obj, uint32_t index, PropDesc *desc);
25925
25926
25927 extern bool
25928 GetElement(JSContext *cx, ObjectImpl *obj, ObjectImpl *receiver, uint32_t index, Value *vp);
25929
25930 extern bool
25931 DefineElement(JSContext *cx, ObjectImpl *obj, uint32_t index, const PropDesc &desc,
25932 bool shouldThrow, bool *succeeded);
25933
25934
25935 extern bool
25936 SetElement(JSContext *cx, ObjectImpl *obj, ObjectImpl *receiver, uint32_t index, const Value &v,
25937 bool *succeeded);
25938
25939 extern bool
25940 HasElement(JSContext *cx, ObjectImpl *obj, uint32_t index, bool *found);
25941
25942 }
25943 # 33 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobj.h" 2
25944 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/String.h" 1
25945 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/String.h"
25946 #define String_h_
25947
25948
25949
25950
25951 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsatom.h" 1
25952 # 15 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/String.h" 2
25953
25954 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsstr.h" 1
25955
25956
25957
25958
25959
25960
25961
25962 #define jsstr_h___
25963
25964 # 1 "/usr/include/ctype.h" 1 3 4
25965 # 25 "/usr/include/ctype.h" 3 4
25966 #define _CTYPE_H 1
25967
25968
25969
25970
25971 extern "C" {
25972 # 45 "/usr/include/ctype.h" 3 4
25973 #define _ISbit(bit) ((bit) < 8 ? ((1 << (bit)) << 8) : ((1 << (bit)) >> 8))
25974
25975
25976 enum
25977 {
25978 _ISupper = ((0) < 8 ? ((1 << (0)) << 8) : ((1 << (0)) >> 8)),
25979 _ISlower = ((1) < 8 ? ((1 << (1)) << 8) : ((1 << (1)) >> 8)),
25980 _ISalpha = ((2) < 8 ? ((1 << (2)) << 8) : ((1 << (2)) >> 8)),
25981 _ISdigit = ((3) < 8 ? ((1 << (3)) << 8) : ((1 << (3)) >> 8)),
25982 _ISxdigit = ((4) < 8 ? ((1 << (4)) << 8) : ((1 << (4)) >> 8)),
25983 _ISspace = ((5) < 8 ? ((1 << (5)) << 8) : ((1 << (5)) >> 8)),
25984 _ISprint = ((6) < 8 ? ((1 << (6)) << 8) : ((1 << (6)) >> 8)),
25985 _ISgraph = ((7) < 8 ? ((1 << (7)) << 8) : ((1 << (7)) >> 8)),
25986 _ISblank = ((8) < 8 ? ((1 << (8)) << 8) : ((1 << (8)) >> 8)),
25987 _IScntrl = ((9) < 8 ? ((1 << (9)) << 8) : ((1 << (9)) >> 8)),
25988 _ISpunct = ((10) < 8 ? ((1 << (10)) << 8) : ((1 << (10)) >> 8)),
25989 _ISalnum = ((11) < 8 ? ((1 << (11)) << 8) : ((1 << (11)) >> 8))
25990 };
25991 # 81 "/usr/include/ctype.h" 3 4
25992 extern __const unsigned short int **__ctype_b_loc (void)
25993 throw () __attribute__ ((__const));
25994 extern __const __int32_t **__ctype_tolower_loc (void)
25995 throw () __attribute__ ((__const));
25996 extern __const __int32_t **__ctype_toupper_loc (void)
25997 throw () __attribute__ ((__const));
25998
25999
26000
26001
26002
26003
26004 #define __isctype_f(type) __extern_inline int is ##type (int __c) __THROW { return (*__ctype_b_loc ())[(int) (__c)] & (unsigned short int) _IS ##type; }
26005
26006
26007
26008
26009
26010
26011
26012 #define __isascii(c) (((c) & ~0x7f) == 0)
26013 #define __toascii(c) ((c) & 0x7f)
26014
26015 #define __exctype(name) extern int name (int) __THROW
26016
26017
26018
26019
26020
26021
26022
26023 extern int isalnum (int) throw ();
26024 extern int isalpha (int) throw ();
26025 extern int iscntrl (int) throw ();
26026 extern int isdigit (int) throw ();
26027 extern int islower (int) throw ();
26028 extern int isgraph (int) throw ();
26029 extern int isprint (int) throw ();
26030 extern int ispunct (int) throw ();
26031 extern int isspace (int) throw ();
26032 extern int isupper (int) throw ();
26033 extern int isxdigit (int) throw ();
26034
26035
26036
26037 extern int tolower (int __c) throw ();
26038
26039
26040 extern int toupper (int __c) throw ();
26041
26042
26043
26044
26045
26046
26047
26048
26049 extern int isblank (int) throw ();
26050
26051
26052
26053
26054
26055
26056 extern int isctype (int __c, int __mask) throw ();
26057
26058
26059
26060
26061
26062
26063 extern int isascii (int __c) throw ();
26064
26065
26066
26067 extern int toascii (int __c) throw ();
26068
26069
26070
26071 extern int _toupper (int) throw ();
26072 extern int _tolower (int) throw ();
26073
26074
26075
26076 #define __tobody(c,f,a,args) (__extension__ ({ int __res; if (sizeof (c) > 1) { if (__builtin_constant_p (c)) { int __c = (c); __res = __c < -128 || __c > 255 ? __c : (a)[__c]; } else __res = f args; } else __res = (a)[(int) (c)]; __res; }))
26077 # 263 "/usr/include/ctype.h" 3 4
26078 #define __isctype_l(c,type,locale) ((locale)->__ctype_b[(int) (c)] & (unsigned short int) type)
26079
26080
26081 #define __exctype_l(name) extern int name (int, __locale_t) __THROW
26082
26083
26084
26085
26086
26087
26088 extern int isalnum_l (int, __locale_t) throw ();
26089 extern int isalpha_l (int, __locale_t) throw ();
26090 extern int iscntrl_l (int, __locale_t) throw ();
26091 extern int isdigit_l (int, __locale_t) throw ();
26092 extern int islower_l (int, __locale_t) throw ();
26093 extern int isgraph_l (int, __locale_t) throw ();
26094 extern int isprint_l (int, __locale_t) throw ();
26095 extern int ispunct_l (int, __locale_t) throw ();
26096 extern int isspace_l (int, __locale_t) throw ();
26097 extern int isupper_l (int, __locale_t) throw ();
26098 extern int isxdigit_l (int, __locale_t) throw ();
26099
26100 extern int isblank_l (int, __locale_t) throw ();
26101
26102
26103
26104 extern int __tolower_l (int __c, __locale_t __l) throw ();
26105 extern int tolower_l (int __c, __locale_t __l) throw ();
26106
26107
26108 extern int __toupper_l (int __c, __locale_t __l) throw ();
26109 extern int toupper_l (int __c, __locale_t __l) throw ();
26110 # 349 "/usr/include/ctype.h" 3 4
26111 }
26112 # 11 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsstr.h" 2
26113
26114
26115
26116
26117
26118
26119
26120 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Unicode.h" 1
26121
26122
26123
26124
26125
26126 #define Unicode_h__
26127 # 16 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Unicode.h"
26128 extern const bool js_isidstart[];
26129 extern const bool js_isident[];
26130 extern const bool js_isspace[];
26131
26132 namespace js {
26133 namespace unicode {
26134 # 68 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Unicode.h"
26135 struct CharFlag {
26136 enum temp {
26137 SPACE = 1 << 0,
26138 LETTER = 1 << 1,
26139 IDENTIFIER_PART = 1 << 2,
26140 NO_DELTA = 1 << 3,
26141 ENCLOSING_MARK = 1 << 4,
26142 COMBINING_SPACING_MARK = 1 << 5
26143 };
26144 };
26145
26146 const jschar BYTE_ORDER_MARK2 = 0xFFFE;
26147 const jschar NO_BREAK_SPACE = 0x00A0;
26148
26149 class CharacterInfo {
26150 # 103 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Unicode.h"
26151 public:
26152 uint16_t upperCase;
26153 uint16_t lowerCase;
26154 uint8_t flags;
26155
26156 inline bool isSpace() const {
26157 return flags & CharFlag::SPACE;
26158 }
26159
26160 inline bool isLetter() const {
26161 return flags & CharFlag::LETTER;
26162 }
26163
26164 inline bool isIdentifierPart() const {
26165 return flags & (CharFlag::IDENTIFIER_PART | CharFlag::LETTER);
26166 }
26167
26168 inline bool isEnclosingMark() const {
26169 return flags & CharFlag::ENCLOSING_MARK;
26170 }
26171
26172 inline bool isCombiningSpacingMark() const {
26173 return flags & CharFlag::COMBINING_SPACING_MARK;
26174 }
26175 };
26176
26177 extern const uint8_t index1[];
26178 extern const uint8_t index2[];
26179 extern const CharacterInfo js_charinfo[];
26180
26181 inline const CharacterInfo&
26182 CharInfo(jschar code)
26183 {
26184 size_t index = index1[code >> 6];
26185 index = index2[(index << 6) + (code & 0x3f)];
26186
26187 return js_charinfo[index];
26188 }
26189
26190 inline bool
26191 IsIdentifierStart(jschar ch)
26192 {
26193 # 154 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Unicode.h"
26194 if (ch < 128)
26195 return js_isidstart[ch];
26196
26197 return CharInfo(ch).isLetter();
26198 }
26199
26200 inline bool
26201 IsIdentifierPart(jschar ch)
26202 {
26203
26204
26205 if (ch < 128)
26206 return js_isident[ch];
26207
26208 return CharInfo(ch).isIdentifierPart();
26209 }
26210
26211 inline bool
26212 IsLetter(jschar ch)
26213 {
26214 return CharInfo(ch).isLetter();
26215 }
26216
26217 inline bool
26218 IsSpace(jschar ch)
26219 {
26220 # 192 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Unicode.h"
26221 if (ch < 128)
26222 return js_isspace[ch];
26223
26224 if (ch == NO_BREAK_SPACE)
26225 return true;
26226
26227 return CharInfo(ch).isSpace();
26228 }
26229
26230 inline bool
26231 IsSpaceOrBOM2(jschar ch)
26232 {
26233 if (ch < 128)
26234 return js_isspace[ch];
26235
26236
26237 if (ch == NO_BREAK_SPACE || ch == BYTE_ORDER_MARK2)
26238 return true;
26239
26240 return CharInfo(ch).isSpace();
26241 }
26242
26243 inline jschar
26244 ToUpperCase(jschar ch)
26245 {
26246 const CharacterInfo &info = CharInfo(ch);
26247
26248
26249
26250
26251
26252 if (info.flags & CharFlag::NO_DELTA)
26253 return info.upperCase;
26254
26255 return uint16_t(ch) + info.upperCase;
26256 }
26257
26258 inline jschar
26259 ToLowerCase(jschar ch)
26260 {
26261 const CharacterInfo &info = CharInfo(ch);
26262
26263 if (info.flags & CharFlag::NO_DELTA)
26264 return info.lowerCase;
26265
26266 return uint16_t(ch) + info.lowerCase;
26267 }
26268
26269
26270
26271 inline bool
26272 IsXMLSpace(jschar ch)
26273 {
26274 return ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n';
26275 }
26276
26277 inline bool
26278 IsXMLNamespaceStart(jschar ch)
26279 {
26280 if (ch == '_')
26281 return true;
26282
26283 return CharInfo(ch).isCombiningSpacingMark() || IsIdentifierStart(ch);
26284 }
26285
26286 inline bool
26287 IsXMLNamespacePart(jschar ch)
26288 {
26289 if (ch == '.' || ch == '-' || ch == '_')
26290 return true;
26291
26292 return CharInfo(ch).isEnclosingMark() || IsIdentifierPart(ch);
26293 }
26294
26295 inline bool
26296 IsXMLNameStart(jschar ch)
26297 {
26298 if (ch == '_' || ch == ':')
26299 return true;
26300
26301 return CharInfo(ch).isCombiningSpacingMark() || IsIdentifierStart(ch);
26302 }
26303
26304 inline bool
26305 IsXMLNamePart(jschar ch)
26306 {
26307 if (ch == '.' || ch == '-' || ch == '_' || ch == ':')
26308 return true;
26309
26310 return CharInfo(ch).isEnclosingMark() || IsIdentifierPart(ch);
26311 }
26312
26313
26314 }
26315 }
26316 # 19 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsstr.h" 2
26317
26318 namespace js {
26319
26320
26321 class StringBuffer;
26322 # 32 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsstr.h"
26323 class StringSegmentRange;
26324 class MutatingRopeSegmentRange;
26325
26326
26327
26328
26329 class RopeBuilder;
26330
26331 }
26332
26333 extern JSString *
26334 js_ConcatStrings(JSContext *cx, js::HandleString s1, js::HandleString s2);
26335
26336 extern JSString *
26337 js_toLowerCase(JSContext *cx, JSString *str);
26338
26339 extern JSString *
26340 js_toUpperCase(JSContext *cx, JSString *str);
26341
26342 struct JSSubString {
26343 size_t length;
26344 const jschar *chars;
26345 };
26346
26347 extern jschar js_empty_ucstr[];
26348 extern JSSubString js_EmptySubString;
26349
26350
26351
26352
26353
26354 #define JS7_ISDEC(c) ((((unsigned)(c)) - '0') <= 9)
26355 #define JS7_UNDEC(c) ((c) - '0')
26356 #define JS7_ISHEX(c) ((c) < 128 && isxdigit(c))
26357 #define JS7_UNHEX(c) (unsigned)(JS7_ISDEC(c) ? (c) - '0' : 10 + tolower(c) - 'a')
26358 #define JS7_ISLET(c) ((c) < 128 && isalpha(c))
26359
26360
26361 extern JSObject *
26362 js_InitStringClass(JSContext *cx, JSObject *obj);
26363
26364 extern const char js_escape_str[];
26365 extern const char js_unescape_str[];
26366 extern const char js_uneval_str[];
26367 extern const char js_decodeURI_str[];
26368 extern const char js_encodeURI_str[];
26369 extern const char js_decodeURIComponent_str[];
26370 extern const char js_encodeURIComponent_str[];
26371
26372
26373 extern JSFixedString *
26374 js_NewString(JSContext *cx, jschar *chars, size_t length);
26375
26376 extern JSLinearString *
26377 js_NewDependentString(JSContext *cx, JSString *base, size_t start, size_t length);
26378
26379
26380 extern JSFixedString *
26381 js_NewStringCopyN(JSContext *cx, const jschar *s, size_t n);
26382
26383 extern JSFixedString *
26384 js_NewStringCopyN(JSContext *cx, const char *s, size_t n);
26385
26386
26387 extern JSFixedString *
26388 js_NewStringCopyZ(JSContext *cx, const jschar *s);
26389
26390 extern JSFixedString *
26391 js_NewStringCopyZ(JSContext *cx, const char *s);
26392
26393
26394
26395
26396 extern const char *
26397 js_ValueToPrintable(JSContext *cx, const js::Value &,
26398 JSAutoByteString *bytes, bool asSource = false);
26399
26400 namespace js {
26401
26402
26403
26404
26405
26406 extern JSString *
26407 ToStringSlow(JSContext *cx, const Value &v);
26408
26409
26410
26411
26412
26413
26414 static __attribute__((always_inline)) inline JSString *
26415 ToString(JSContext *cx, const js::Value &v)
26416 {
26417 if (v.isString())
26418 return v.toString();
26419 return ToStringSlow(cx, v);
26420 }
26421
26422
26423
26424
26425
26426
26427 inline bool
26428 ValueToStringBuffer(JSContext *cx, const Value &v, StringBuffer &sb);
26429
26430 }
26431
26432
26433
26434
26435
26436 extern __attribute__((visibility("default"))) JSString *
26437 js_ValueToSource(JSContext *cx, const js::Value &v);
26438
26439 namespace js {
26440
26441
26442
26443
26444
26445 extern bool
26446 EqualStrings(JSContext *cx, JSString *str1, JSString *str2, bool *result);
26447
26448
26449 extern bool
26450 EqualStrings(JSContext *cx, JSLinearString *str1, JSLinearString *str2, bool *result) ;
26451
26452
26453 extern bool
26454 EqualStrings(JSLinearString *str1, JSLinearString *str2);
26455
26456
26457
26458
26459
26460 extern bool
26461 CompareStrings(JSContext *cx, JSString *str1, JSString *str2, int32_t *result);
26462
26463
26464
26465
26466 extern bool
26467 StringEqualsAscii(JSLinearString *str, const char *asciiBytes);
26468
26469 }
26470
26471 extern size_t
26472 js_strlen(const jschar *s);
26473
26474 extern jschar *
26475 js_strchr(const jschar *s, jschar c);
26476
26477 extern jschar *
26478 js_strchr_limit(const jschar *s, jschar c, const jschar *limit);
26479
26480 static __attribute__((always_inline)) inline void
26481 js_strncpy(jschar *dst, const jschar *src, size_t nelem)
26482 {
26483 return js::PodCopy(dst, src, nelem);
26484 }
26485
26486 namespace js {
26487
26488
26489
26490
26491
26492
26493 extern jschar *
26494 InflateString(JSContext *cx, const char *bytes, size_t *length,
26495 FlationCoding fc = NormalEncoding);
26496
26497 extern char *
26498 DeflateString(JSContext *cx, const jschar *chars, size_t length);
26499 # 216 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsstr.h"
26500 extern bool
26501 InflateStringToBuffer(JSContext *cx, const char *bytes, size_t length,
26502 jschar *chars, size_t *charsLength);
26503
26504 extern bool
26505 InflateUTF8StringToBuffer(JSContext *cx, const char *bytes, size_t length,
26506 jschar *chars, size_t *charsLength,
26507 FlationCoding fc = NormalEncoding);
26508
26509
26510 extern size_t
26511 GetDeflatedStringLength(JSContext *cx, const jschar *chars, size_t charsLength);
26512
26513
26514 extern size_t
26515 GetDeflatedUTF8StringLength(JSContext *cx, const jschar *chars,
26516 size_t charsLength,
26517 FlationCoding fc = NormalEncoding);
26518
26519
26520
26521
26522
26523
26524
26525 extern bool
26526 DeflateStringToBuffer(JSContext *cx, const jschar *chars,
26527 size_t charsLength, char *bytes, size_t *length);
26528
26529
26530
26531
26532 extern bool
26533 DeflateStringToUTF8Buffer(JSContext *cx, const jschar *chars,
26534 size_t charsLength, char *bytes, size_t *length,
26535 FlationCoding fc = NormalEncoding);
26536
26537
26538
26539
26540
26541 extern JSBool
26542 str_replace(JSContext *cx, unsigned argc, js::Value *vp);
26543
26544 extern JSBool
26545 str_fromCharCode(JSContext *cx, unsigned argc, Value *vp);
26546
26547 }
26548
26549 extern JSBool
26550 js_str_toString(JSContext *cx, unsigned argc, js::Value *vp);
26551
26552 extern JSBool
26553 js_str_charAt(JSContext *cx, unsigned argc, js::Value *vp);
26554
26555 extern JSBool
26556 js_str_charCodeAt(JSContext *cx, unsigned argc, js::Value *vp);
26557
26558
26559
26560
26561
26562 extern int
26563 js_OneUcs4ToUtf8Char(uint8_t *utf8Buffer, uint32_t ucs4Char);
26564
26565 namespace js {
26566
26567 extern size_t
26568 PutEscapedStringImpl(char *buffer, size_t size, FILE *fp, JSLinearString *str, uint32_t quote);
26569 # 295 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsstr.h"
26570 inline size_t
26571 PutEscapedString(char *buffer, size_t size, JSLinearString *str, uint32_t quote)
26572 {
26573 size_t n = PutEscapedStringImpl(buffer, size, __null, str, quote);
26574
26575
26576 do { } while(0);
26577 return n;
26578 }
26579
26580
26581
26582
26583
26584
26585 inline bool
26586 FileEscapedString(FILE *fp, JSLinearString *str, uint32_t quote)
26587 {
26588 return PutEscapedStringImpl(__null, 0, fp, str, quote) != size_t(-1);
26589 }
26590
26591 JSBool
26592 str_match(JSContext *cx, unsigned argc, Value *vp);
26593
26594 JSBool
26595 str_search(JSContext *cx, unsigned argc, Value *vp);
26596
26597 JSBool
26598 str_split(JSContext *cx, unsigned argc, Value *vp);
26599
26600 }
26601
26602 extern JSBool
26603 js_String(JSContext *cx, unsigned argc, js::Value *vp);
26604 # 17 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/String.h" 2
26605
26606
26607
26608
26609 class JSString;
26610 class JSDependentString;
26611 class JSUndependedString;
26612 class JSExtensibleString;
26613 class JSExternalString;
26614 class JSLinearString;
26615 class JSFixedString;
26616 class JSRope;
26617 class JSAtom;
26618
26619 namespace js {
26620
26621 class StaticStrings;
26622 class PropertyName;
26623
26624
26625 static const size_t UINT32_CHAR_BUFFER_LENGTH = sizeof("4294967295") - 1;
26626
26627 }
26628 # 131 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/String.h"
26629 class JSString : public js::gc::Cell
26630 {
26631 protected:
26632 static const size_t NUM_INLINE_CHARS = 2 * sizeof(void *) / sizeof(jschar);
26633
26634
26635 struct Data
26636 {
26637 size_t lengthAndFlags;
26638 union {
26639 const jschar *chars;
26640 JSString *left;
26641 } u1;
26642 union {
26643 jschar inlineStorage[NUM_INLINE_CHARS];
26644 struct {
26645 union {
26646 JSLinearString *base;
26647 JSString *right;
26648 size_t capacity;
26649 const JSStringFinalizer *externalFinalizer;
26650 } u2;
26651 union {
26652 JSString *parent;
26653 size_t reserved;
26654 } u3;
26655 } s;
26656 };
26657 } d;
26658
26659 public:
26660 # 200 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/String.h"
26661 static const size_t LENGTH_SHIFT = 4;
26662 static const size_t FLAGS_MASK = (((uint32_t)1 << (LENGTH_SHIFT)) - 1);
26663
26664 static const size_t ROPE_BIT = ((uint32_t)1 << (0));
26665
26666 static const size_t DEPENDENT_FLAGS = ((uint32_t)1 << (1));
26667 static const size_t EXTENSIBLE_FLAGS = ((uint32_t)1 << (2));
26668 static const size_t FIXED_FLAGS = ((uint32_t)1 << (1)) | ((uint32_t)1 << (2));
26669 static const size_t UNDEPENDED_FLAGS = ((uint32_t)1 << (1)) | ((uint32_t)1 << (3));
26670
26671 static const size_t ATOM_MASK = (((uint32_t)1 << (3)) - 1);
26672 static const size_t NON_STATIC_ATOM_FLAGS = ((uint32_t)1 << (3));
26673
26674 static const size_t MAX_LENGTH = ((uint32_t)1 << (32 - LENGTH_SHIFT)) - 1;
26675
26676 size_t buildLengthAndFlags(size_t length, size_t flags) {
26677 do { } while(0);
26678 do { } while(0);
26679 return (length << LENGTH_SHIFT) | flags;
26680 }
26681
26682
26683
26684
26685
26686
26687 static inline bool validateLength(JSContext *cx, size_t length);
26688
26689 static void staticAsserts() {
26690 typedef int moz_static_assert57[((8 * 4) >= 32) ? 1 : -1];
26691 typedef int
26692 moz_static_assert58
26693 # 230 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/String.h"
26694 [(((JSString::MAX_LENGTH << JSString::LENGTH_SHIFT) >> JSString::LENGTH_SHIFT) == JSString::MAX_LENGTH) ? 1 : -1]
26695 ;
26696 typedef int
26697 moz_static_assert59
26698 # 232 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/String.h"
26699 [(sizeof(JSString) == __builtin_offsetof (JSString, d.inlineStorage) + NUM_INLINE_CHARS * sizeof(jschar)) ? 1 : -1]
26700 ;
26701 typedef int
26702 moz_static_assert60
26703 # 234 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/String.h"
26704 [(__builtin_offsetof (JSString, d.u1.chars) == __builtin_offsetof (js::shadow::Atom, chars)) ? 1 : -1]
26705 ;
26706 }
26707
26708
26709 friend class JSRope;
26710
26711 public:
26712
26713
26714 __attribute__((always_inline)) inline
26715 size_t length() const {
26716 return d.lengthAndFlags >> LENGTH_SHIFT;
26717 }
26718
26719 __attribute__((always_inline)) inline
26720 bool empty() const {
26721 return d.lengthAndFlags <= FLAGS_MASK;
26722 }
26723
26724
26725
26726
26727
26728
26729 inline const jschar *getChars(JSContext *cx);
26730 inline const jschar *getCharsZ(JSContext *cx);
26731
26732
26733
26734 inline JSLinearString *ensureLinear(JSContext *cx);
26735 inline JSFlatString *ensureFlat(JSContext *cx);
26736 inline JSFixedString *ensureFixed(JSContext *cx);
26737
26738
26739
26740 __attribute__((always_inline)) inline
26741 bool isRope() const {
26742 bool rope = d.lengthAndFlags & ROPE_BIT;
26743 do { } while (0);
26744 return rope;
26745 }
26746
26747 __attribute__((always_inline)) inline
26748 JSRope &asRope() const {
26749 do { } while(0);
26750 return *(JSRope *)this;
26751 }
26752
26753 __attribute__((always_inline)) inline
26754 bool isLinear() const {
26755 return !(d.lengthAndFlags & ROPE_BIT);
26756 }
26757
26758 __attribute__((always_inline)) inline
26759 JSLinearString &asLinear() const {
26760 do { } while(0);
26761 return *(JSLinearString *)this;
26762 }
26763
26764 __attribute__((always_inline)) inline
26765 bool isDependent() const {
26766 return (d.lengthAndFlags & FLAGS_MASK) == DEPENDENT_FLAGS;
26767 }
26768
26769 __attribute__((always_inline)) inline
26770 JSDependentString &asDependent() const {
26771 do { } while(0);
26772 return *(JSDependentString *)this;
26773 }
26774
26775 __attribute__((always_inline)) inline
26776 bool isFlat() const {
26777 return isLinear() && !isDependent();
26778 }
26779
26780 __attribute__((always_inline)) inline
26781 JSFlatString &asFlat() const {
26782 do { } while(0);
26783 return *(JSFlatString *)this;
26784 }
26785
26786 __attribute__((always_inline)) inline
26787 bool isExtensible() const {
26788 return (d.lengthAndFlags & FLAGS_MASK) == EXTENSIBLE_FLAGS;
26789 }
26790
26791 __attribute__((always_inline)) inline
26792 JSExtensibleString &asExtensible() const {
26793 do { } while(0);
26794 return *(JSExtensibleString *)this;
26795 }
26796
26797
26798 bool isShort() const;
26799 bool isFixed() const;
26800 bool isInline() const;
26801
26802 __attribute__((always_inline)) inline
26803 JSFixedString &asFixed() const {
26804 do { } while(0);
26805 return *(JSFixedString *)this;
26806 }
26807
26808 bool isExternal() const;
26809
26810 __attribute__((always_inline)) inline
26811 JSExternalString &asExternal() const {
26812 do { } while(0);
26813 return *(JSExternalString *)this;
26814 }
26815
26816 __attribute__((always_inline)) inline
26817 bool isUndepended() const {
26818 return (d.lengthAndFlags & FLAGS_MASK) == UNDEPENDED_FLAGS;
26819 }
26820
26821 __attribute__((always_inline)) inline
26822 bool isAtom() const {
26823 return !(d.lengthAndFlags & ATOM_MASK);
26824 }
26825
26826 __attribute__((always_inline)) inline
26827 JSAtom &asAtom() const {
26828 do { } while(0);
26829 return *(JSAtom *)this;
26830 }
26831
26832
26833
26834 inline bool hasBase() const {
26835 typedef int moz_static_assert61[((DEPENDENT_FLAGS | ((uint32_t)1 << (3))) == UNDEPENDED_FLAGS) ? 1 : -1];
26836 return (d.lengthAndFlags & (((uint32_t)1 << (3)) - 1)) == DEPENDENT_FLAGS;
26837 }
26838
26839 inline JSLinearString *base() const {
26840 do { } while(0);
26841 return d.s.u2.base;
26842 }
26843
26844 inline void markBase(JSTracer *trc);
26845
26846
26847
26848 inline void finalize(js::FreeOp *fop);
26849
26850
26851
26852 size_t sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf);
26853
26854
26855
26856 static size_t offsetOfLengthAndFlags() {
26857 return __builtin_offsetof (JSString, d.lengthAndFlags);
26858 }
26859
26860 static size_t offsetOfChars() {
26861 return __builtin_offsetof (JSString, d.u1.chars);
26862 }
26863
26864 static inline void writeBarrierPre(JSString *str);
26865 static inline void writeBarrierPost(JSString *str, void *addr);
26866 static inline bool needWriteBarrierPre(JSCompartment *comp);
26867 static inline void readBarrier(JSString *str);
26868
26869 static inline js::ThingRootKind rootKind() { return js::THING_ROOT_STRING; }
26870
26871
26872
26873
26874
26875
26876 private:
26877 JSString() ;
26878 JSString(const JSString &other) ;
26879 void operator=(const JSString &other) ;
26880 };
26881
26882 class JSRope : public JSString
26883 {
26884 enum UsingBarrier { WithIncrementalBarrier, NoBarrier };
26885 template<UsingBarrier b>
26886 JSFlatString *flattenInternal(JSContext *cx);
26887
26888 friend class JSString;
26889 JSFlatString *flatten(JSContext *cx);
26890
26891 void init(JSString *left, JSString *right, size_t length);
26892
26893 public:
26894 static inline JSRope *new_(JSContext *cx, js::HandleString left,
26895 js::HandleString right, size_t length);
26896
26897 inline JSString *leftChild() const {
26898 do { } while(0);
26899 return d.u1.left;
26900 }
26901
26902 inline JSString *rightChild() const {
26903 do { } while(0);
26904 return d.s.u2.right;
26905 }
26906
26907 inline void markChildren(JSTracer *trc);
26908 };
26909
26910 typedef int moz_static_assert62[(sizeof(JSRope) == sizeof(JSString)) ? 1 : -1];
26911
26912 class JSLinearString : public JSString
26913 {
26914 friend class JSString;
26915
26916
26917 JSLinearString *ensureLinear(JSContext *cx) ;
26918 bool isLinear() const ;
26919 JSLinearString &asLinear() const ;
26920
26921 public:
26922 __attribute__((always_inline)) inline
26923 const jschar *chars() const {
26924 do { } while(0);
26925 return d.u1.chars;
26926 }
26927 };
26928
26929 typedef int moz_static_assert63[(sizeof(JSLinearString) == sizeof(JSString)) ? 1 : -1];
26930
26931 class JSDependentString : public JSLinearString
26932 {
26933 friend class JSString;
26934 JSFixedString *undepend(JSContext *cx);
26935
26936 void init(JSLinearString *base, const jschar *chars, size_t length);
26937
26938
26939 bool isDependent() const ;
26940 JSDependentString &asDependent() const ;
26941
26942 public:
26943 static inline JSDependentString *new_(JSContext *cx, JSLinearString *base,
26944 const jschar *chars, size_t length);
26945 };
26946
26947 typedef int moz_static_assert64[(sizeof(JSDependentString) == sizeof(JSString)) ? 1 : -1];
26948
26949 class JSFlatString : public JSLinearString
26950 {
26951
26952 JSFlatString *ensureFlat(JSContext *cx) ;
26953 bool isFlat() const ;
26954 JSFlatString &asFlat() const ;
26955
26956 bool isIndexSlow(uint32_t *indexp) const;
26957
26958 public:
26959 __attribute__((always_inline)) inline
26960 const jschar *charsZ() const {
26961 do { } while(0);
26962 return chars();
26963 }
26964
26965
26966
26967
26968
26969
26970
26971 inline bool isIndex(uint32_t *indexp) const {
26972 const jschar *s = chars();
26973 return ((((unsigned)(*s)) - '0') <= 9) && isIndexSlow(indexp);
26974 }
26975
26976
26977
26978
26979
26980
26981 inline js::PropertyName *toPropertyName(JSContext *cx);
26982
26983 inline void finalize(js::FreeOp *fop);
26984 };
26985
26986 typedef int moz_static_assert65[(sizeof(JSFlatString) == sizeof(JSString)) ? 1 : -1];
26987
26988 class JSExtensibleString : public JSFlatString
26989 {
26990
26991 bool isExtensible() const ;
26992 JSExtensibleString &asExtensible() const ;
26993
26994 public:
26995 __attribute__((always_inline)) inline
26996 size_t capacity() const {
26997 do { } while(0);
26998 return d.s.u2.capacity;
26999 }
27000 };
27001
27002 typedef int moz_static_assert66[(sizeof(JSExtensibleString) == sizeof(JSString)) ? 1 : -1];
27003
27004 class JSFixedString : public JSFlatString
27005 {
27006 void init(const jschar *chars, size_t length);
27007
27008
27009 JSFlatString *ensureFixed(JSContext *cx) ;
27010 bool isFixed() const ;
27011 JSFixedString &asFixed() const ;
27012
27013 public:
27014 static inline JSFixedString *new_(JSContext *cx, const jschar *chars, size_t length);
27015
27016
27017
27018
27019
27020
27021 inline JSAtom *morphAtomizedStringIntoAtom();
27022 };
27023
27024 typedef int moz_static_assert67[(sizeof(JSFixedString) == sizeof(JSString)) ? 1 : -1];
27025
27026 class JSInlineString : public JSFixedString
27027 {
27028 static const size_t MAX_INLINE_LENGTH = NUM_INLINE_CHARS - 1;
27029
27030 public:
27031 static inline JSInlineString *new_(JSContext *cx);
27032
27033 inline jschar *init(size_t length);
27034
27035 inline void resetLength(size_t length);
27036
27037 static bool lengthFits(size_t length) {
27038 return length <= MAX_INLINE_LENGTH;
27039 }
27040
27041 };
27042
27043 typedef int moz_static_assert68[(sizeof(JSInlineString) == sizeof(JSString)) ? 1 : -1];
27044
27045 class JSShortString : public JSInlineString
27046 {
27047
27048 static const size_t INLINE_EXTENSION_CHARS = sizeof(JSString::Data) / sizeof(jschar);
27049
27050 static void staticAsserts() {
27051 typedef int moz_static_assert69[(INLINE_EXTENSION_CHARS % js::gc::Cell::CellSize == 0) ? 1 : -1];
27052 typedef int
27053
27054 moz_static_assert70
27055 # 582 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/String.h"
27056 [(MAX_SHORT_LENGTH + 1 == (sizeof(JSShortString) - __builtin_offsetof (JSShortString, d.inlineStorage)) / sizeof(jschar)) ? 1 : -1]
27057
27058 ;
27059 }
27060
27061 jschar inlineStorageExtension[INLINE_EXTENSION_CHARS];
27062
27063 public:
27064 static inline JSShortString *new_(JSContext *cx);
27065
27066 jschar *inlineStorageBeforeInit() {
27067 return d.inlineStorage;
27068 }
27069
27070 inline void initAtOffsetInBuffer(const jschar *chars, size_t length);
27071
27072 static const size_t MAX_SHORT_LENGTH = JSString::NUM_INLINE_CHARS +
27073 INLINE_EXTENSION_CHARS
27074 -1 ;
27075
27076 static bool lengthFits(size_t length) {
27077 return length <= MAX_SHORT_LENGTH;
27078 }
27079
27080
27081
27082 __attribute__((always_inline)) inline void finalize(js::FreeOp *fop);
27083 };
27084
27085 typedef int moz_static_assert71[(sizeof(JSShortString) == 2 * sizeof(JSString)) ? 1 : -1];
27086
27087 class JSExternalString : public JSFixedString
27088 {
27089 void init(const jschar *chars, size_t length, const JSStringFinalizer *fin);
27090
27091
27092 bool isExternal() const ;
27093 JSExternalString &asExternal() const ;
27094
27095 public:
27096 static inline JSExternalString *new_(JSContext *cx, const jschar *chars, size_t length,
27097 const JSStringFinalizer *fin);
27098
27099 const JSStringFinalizer *externalFinalizer() const {
27100 do { } while(0);
27101 return d.s.u2.externalFinalizer;
27102 }
27103
27104
27105
27106 inline void finalize(js::FreeOp *fop);
27107 };
27108
27109 typedef int moz_static_assert72[(sizeof(JSExternalString) == sizeof(JSString)) ? 1 : -1];
27110
27111 class JSUndependedString : public JSFixedString
27112 {
27113
27114
27115
27116
27117
27118 };
27119
27120 typedef int moz_static_assert73[(sizeof(JSUndependedString) == sizeof(JSString)) ? 1 : -1];
27121
27122 class JSAtom : public JSFixedString
27123 {
27124
27125 bool isAtom() const ;
27126 JSAtom &asAtom() const ;
27127
27128 public:
27129
27130 inline js::PropertyName *asPropertyName();
27131
27132 inline void finalize(js::FreeOp *fop);
27133
27134
27135
27136
27137 };
27138
27139 typedef int moz_static_assert74[(sizeof(JSAtom) == sizeof(JSString)) ? 1 : -1];
27140
27141 class JSInlineAtom : public JSInlineString
27142 {
27143
27144
27145
27146
27147 };
27148
27149 typedef int moz_static_assert75[(sizeof(JSInlineAtom) == sizeof(JSInlineString)) ? 1 : -1];
27150
27151 class JSShortAtom : public JSShortString
27152 {
27153
27154
27155
27156
27157 };
27158
27159 typedef int moz_static_assert76[(sizeof(JSShortAtom) == sizeof(JSShortString)) ? 1 : -1];
27160
27161 namespace js {
27162
27163 class StaticStrings
27164 {
27165 private:
27166
27167 static const size_t SMALL_CHAR_LIMIT = 128U;
27168 static const size_t NUM_SMALL_CHARS = 64U;
27169
27170 static const size_t INT_STATIC_LIMIT = 256U;
27171
27172 JSAtom *length2StaticTable[NUM_SMALL_CHARS * NUM_SMALL_CHARS];
27173 JSAtom *intStaticTable[INT_STATIC_LIMIT];
27174
27175 public:
27176
27177 static const size_t UNIT_STATIC_LIMIT = 256U;
27178 JSAtom *unitStaticTable[UNIT_STATIC_LIMIT];
27179
27180 StaticStrings() {
27181 PodArrayZero(unitStaticTable);
27182 PodArrayZero(length2StaticTable);
27183 PodArrayZero(intStaticTable);
27184 }
27185
27186 bool init(JSContext *cx);
27187 void trace(JSTracer *trc);
27188
27189 static inline bool hasUint(uint32_t u);
27190 inline JSAtom *getUint(uint32_t u);
27191
27192 static inline bool hasInt(int32_t i);
27193 inline JSAtom *getInt(int32_t i);
27194
27195 static inline bool hasUnit(jschar c);
27196 JSAtom *getUnit(jschar c);
27197
27198
27199 inline JSLinearString *getUnitStringForElement(JSContext *cx, JSString *str, size_t index);
27200
27201 static bool isStatic(JSAtom *atom);
27202
27203
27204 inline JSAtom *lookup(const jschar *chars, size_t length);
27205
27206 private:
27207 typedef uint8_t SmallChar;
27208 static const SmallChar INVALID_SMALL_CHAR = -1;
27209
27210 static inline bool fitsInSmallChar(jschar c);
27211
27212 static const SmallChar toSmallChar[];
27213
27214 JSAtom *getLength2(jschar c1, jschar c2);
27215 JSAtom *getLength2(uint32_t u);
27216 };
27217 # 759 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/String.h"
27218 class PropertyName : public JSAtom
27219 {};
27220
27221 typedef int moz_static_assert77[(sizeof(PropertyName) == sizeof(JSString)) ? 1 : -1];
27222
27223 static __attribute__((always_inline)) inline jsid
27224 NameToId(PropertyName *name)
27225 {
27226 return NON_INTEGER_ATOM_TO_JSID(name);
27227 }
27228
27229 typedef HeapPtr<JSAtom> HeapPtrAtom;
27230
27231 }
27232
27233
27234
27235 __attribute__((always_inline)) inline const jschar *
27236 JSString::getChars(JSContext *cx)
27237 {
27238 if (JSLinearString *str = ensureLinear(cx))
27239 return str->chars();
27240 return __null;
27241 }
27242
27243 __attribute__((always_inline)) inline const jschar *
27244 JSString::getCharsZ(JSContext *cx)
27245 {
27246 if (JSFlatString *str = ensureFlat(cx))
27247 return str->chars();
27248 return __null;
27249 }
27250
27251 __attribute__((always_inline)) inline JSLinearString *
27252 JSString::ensureLinear(JSContext *cx)
27253 {
27254 return isLinear()
27255 ? &asLinear()
27256 : asRope().flatten(cx);
27257 }
27258
27259 __attribute__((always_inline)) inline JSFlatString *
27260 JSString::ensureFlat(JSContext *cx)
27261 {
27262 return isFlat()
27263 ? &asFlat()
27264 : isDependent()
27265 ? asDependent().undepend(cx)
27266 : asRope().flatten(cx);
27267 }
27268
27269 __attribute__((always_inline)) inline JSFixedString *
27270 JSString::ensureFixed(JSContext *cx)
27271 {
27272 if (!ensureFlat(cx))
27273 return __null;
27274 if (isExtensible())
27275 d.lengthAndFlags = buildLengthAndFlags(length(), FIXED_FLAGS);
27276 return &asFixed();
27277 }
27278
27279 inline js::PropertyName *
27280 JSAtom::asPropertyName()
27281 {
27282
27283
27284
27285
27286 return static_cast<js::PropertyName *>(this);
27287 }
27288 # 34 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobj.h" 2
27289
27290 namespace js {
27291
27292 class AutoPropDescArrayRooter;
27293 class BaseProxyHandler;
27294 class CallObject;
27295 struct GCMarker;
27296 struct NativeIterator;
27297
27298 namespace mjit { class Compiler; }
27299
27300 inline JSObject *
27301 CastAsObject(PropertyOp op)
27302 {
27303 return (__extension__ (JSObject *) (size_t) (op));
27304 }
27305
27306 inline JSObject *
27307 CastAsObject(StrictPropertyOp op)
27308 {
27309 return (__extension__ (JSObject *) (size_t) (op));
27310 }
27311
27312 inline Value
27313 CastAsObjectJsval(PropertyOp op)
27314 {
27315 return ObjectOrNullValue(CastAsObject(op));
27316 }
27317
27318 inline Value
27319 CastAsObjectJsval(StrictPropertyOp op)
27320 {
27321 return ObjectOrNullValue(CastAsObject(op));
27322 }
27323
27324
27325
27326
27327
27328
27329
27330 #define JS_PSG(name,getter,flags) {name, 0, (flags) | JSPROP_SHARED | JSPROP_NATIVE_ACCESSORS, (JSPropertyOp)getter, NULL}
27331
27332
27333 #define JS_PSGS(name,getter,setter,flags) {name, 0, (flags) | JSPROP_SHARED | JSPROP_NATIVE_ACCESSORS, (JSPropertyOp)getter, (JSStrictPropertyOp)setter}
27334
27335
27336 #define JS_PS_END {0, 0, 0, 0, 0}
27337
27338
27339
27340 typedef Vector<PropDesc, 1> PropDescArray;
27341
27342
27343
27344
27345
27346
27347
27348 namespace baseops {
27349
27350
27351
27352
27353
27354
27355 extern __attribute__((visibility("default"))) JSBool
27356 LookupProperty(JSContext *cx, HandleObject obj, HandleId id, JSObject **objp,
27357 JSProperty **propp);
27358
27359 inline bool
27360 LookupProperty(JSContext *cx, HandleObject obj, PropertyName *name,
27361 JSObject **objp, JSProperty **propp)
27362 {
27363 return LookupProperty(cx, obj, RootedId(cx, NameToId(name)), objp, propp);
27364 }
27365
27366 extern __attribute__((visibility("default"))) JSBool
27367 LookupElement(JSContext *cx, HandleObject obj, uint32_t index,
27368 JSObject **objp, JSProperty **propp);
27369
27370 extern JSBool
27371 DefineProperty(JSContext *cx, HandleObject obj, HandleId id, const js::Value *value,
27372 JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs);
27373
27374 extern JSBool
27375 DefineElement(JSContext *cx, HandleObject obj, uint32_t index, const js::Value *value,
27376 JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs);
27377
27378 extern JSBool
27379 GetProperty(JSContext *cx, HandleObject obj, HandleObject receiver, HandleId id, js::Value *vp);
27380
27381 extern JSBool
27382 GetElement(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_t index, js::Value *vp);
27383
27384 inline JSBool
27385 GetProperty(JSContext *cx, HandleObject obj, HandleId id, js::Value *vp)
27386 {
27387 return GetProperty(cx, obj, obj, id, vp);
27388 }
27389
27390 inline JSBool
27391 GetElement(JSContext *cx, HandleObject obj, uint32_t index, js::Value *vp)
27392 {
27393 return GetElement(cx, obj, obj, index, vp);
27394 }
27395
27396 extern JSBool
27397 GetPropertyDefault(JSContext *cx, HandleObject obj, HandleId id, const Value &def, Value *vp);
27398
27399 extern JSBool
27400 SetPropertyHelper(JSContext *cx, HandleObject obj, HandleId id, unsigned defineHow,
27401 Value *vp, JSBool strict);
27402
27403 inline bool
27404 SetPropertyHelper(JSContext *cx, HandleObject obj, PropertyName *name, unsigned defineHow,
27405 Value *vp, JSBool strict)
27406 {
27407 return SetPropertyHelper(cx, obj, RootedId(cx, NameToId(name)), defineHow, vp, strict);
27408 }
27409
27410 extern JSBool
27411 SetElementHelper(JSContext *cx, HandleObject obj, uint32_t index, unsigned defineHow,
27412 Value *vp, JSBool strict);
27413
27414 extern JSType
27415 TypeOf(JSContext *cx, HandleObject obj);
27416
27417 extern JSBool
27418 GetAttributes(JSContext *cx, HandleObject obj, HandleId id, unsigned *attrsp);
27419
27420 extern JSBool
27421 SetAttributes(JSContext *cx, HandleObject obj, HandleId id, unsigned *attrsp);
27422
27423 extern JSBool
27424 GetElementAttributes(JSContext *cx, HandleObject obj, uint32_t index, unsigned *attrsp);
27425
27426 extern JSBool
27427 SetElementAttributes(JSContext *cx, HandleObject obj, uint32_t index, unsigned *attrsp);
27428
27429 extern JSBool
27430 DeleteProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, Value *rval, JSBool strict);
27431
27432 extern JSBool
27433 DeleteElement(JSContext *cx, HandleObject obj, uint32_t index, Value *rval, JSBool strict);
27434
27435 extern JSBool
27436 DeleteSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, Value *rval, JSBool strict);
27437
27438 extern JSBool
27439 DeleteGeneric(JSContext *cx, HandleObject obj, HandleId id, Value *rval, JSBool strict);
27440
27441 }
27442
27443
27444 extern JSBool
27445 DefaultValue(JSContext *cx, HandleObject obj, JSType hint, Value *vp);
27446
27447 extern Class ArrayClass;
27448 extern Class ArrayBufferClass;
27449 extern Class BlockClass;
27450 extern Class BooleanClass;
27451 extern Class CallableObjectClass;
27452 extern Class DataViewClass;
27453 extern Class DateClass;
27454 extern Class ErrorClass;
27455 extern Class ElementIteratorClass;
27456 extern Class GeneratorClass;
27457 extern Class IteratorClass;
27458 extern Class JSONClass;
27459 extern Class MathClass;
27460 extern Class NumberClass;
27461 extern Class NormalArgumentsObjectClass;
27462 extern Class ObjectClass;
27463 extern Class ProxyClass;
27464 extern Class RegExpClass;
27465 extern Class RegExpStaticsClass;
27466 extern Class SlowArrayClass;
27467 extern Class StopIterationClass;
27468 extern Class StringClass;
27469 extern Class StrictArgumentsObjectClass;
27470 extern Class WeakMapClass;
27471 extern Class WithClass;
27472 extern Class XMLFilterClass;
27473
27474 class ArgumentsObject;
27475 class ArrayBufferObject;
27476 class BlockObject;
27477 class BooleanObject;
27478 class ClonedBlockObject;
27479 class DataViewObject;
27480 class DebugScopeObject;
27481 class DeclEnvObject;
27482 class ElementIteratorObject;
27483 class GlobalObject;
27484 class NestedScopeObject;
27485 class NewObjectCache;
27486 class NormalArgumentsObject;
27487 class NumberObject;
27488 class ScopeObject;
27489 class StaticBlockObject;
27490 class StrictArgumentsObject;
27491 class StringObject;
27492 class RegExpObject;
27493 class WithObject;
27494
27495 }
27496 # 252 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobj.h"
27497 struct JSObject : public js::ObjectImpl
27498 {
27499 private:
27500 friend struct js::Shape;
27501 friend struct js::GCMarker;
27502 friend class js::NewObjectCache;
27503
27504
27505 void makeLazyType(JSContext *cx);
27506
27507 public:
27508
27509
27510
27511
27512 bool setLastProperty(JSContext *cx, const js::Shape *shape);
27513
27514
27515 inline void setLastPropertyInfallible(const js::Shape *shape);
27516
27517
27518 static inline JSObject *create(JSContext *cx,
27519 js::gc::AllocKind kind,
27520 js::HandleShape shape,
27521 js::HandleTypeObject type,
27522 js::HeapSlot *slots);
27523
27524
27525 static inline JSObject *createDenseArray(JSContext *cx,
27526 js::gc::AllocKind kind,
27527 js::HandleShape shape,
27528 js::HandleTypeObject type,
27529 uint32_t length);
27530
27531
27532
27533
27534
27535
27536 inline void removeLastProperty(JSContext *cx);
27537 inline bool canRemoveLastProperty();
27538
27539
27540
27541
27542
27543 bool setSlotSpan(JSContext *cx, uint32_t span);
27544
27545 inline bool nativeContains(JSContext *cx, jsid id);
27546 inline bool nativeContains(JSContext *cx, const js::Shape &shape);
27547
27548
27549 static const uint32_t NELEMENTS_LIMIT = ((uint32_t)1 << (28));
27550
27551 public:
27552 inline bool setDelegate(JSContext *cx);
27553
27554 inline bool isBoundFunction() const;
27555
27556
27557
27558
27559
27560
27561 inline bool isSystem() const;
27562 inline bool setSystem(JSContext *cx);
27563
27564 inline bool hasSpecialEquality() const;
27565
27566 inline bool watched() const;
27567 inline bool setWatched(JSContext *cx);
27568
27569
27570 inline bool isVarObj();
27571 inline bool setVarObj(JSContext *cx);
27572
27573
27574
27575
27576
27577
27578
27579 inline bool hasUncacheableProto() const;
27580 inline bool setUncacheableProto(JSContext *cx);
27581
27582 bool generateOwnShape(JSContext *cx, js::Shape *newShape = __null) {
27583 return replaceWithNewEquivalentShape(cx, lastProperty(), newShape);
27584 }
27585
27586 private:
27587 js::Shape *replaceWithNewEquivalentShape(JSContext *cx, js::Shape *existingShape,
27588 js::Shape *newShape = __null);
27589
27590 enum GenerateShape {
27591 GENERATE_NONE,
27592 GENERATE_SHAPE
27593 };
27594
27595 bool setFlag(JSContext *cx, uint32_t flag,
27596 GenerateShape generateShape = GENERATE_NONE);
27597
27598 public:
27599 inline bool nativeEmpty() const;
27600
27601 bool shadowingShapeChange(JSContext *cx, const js::Shape &shape);
27602
27603
27604 inline bool isIndexed() const;
27605
27606 inline uint32_t propertyCount() const;
27607
27608 inline bool hasShapeTable() const;
27609
27610 inline size_t computedSizeOfThisSlotsElements() const;
27611
27612 inline void sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf,
27613 size_t *slotsSize, size_t *elementsSize,
27614 size_t *miscSize) const;
27615
27616 static const uint32_t MAX_FIXED_SLOTS = 16;
27617
27618 public:
27619
27620
27621
27622
27623 inline bool isFixedSlot(size_t slot);
27624
27625
27626 inline size_t dynamicSlotIndex(size_t slot);
27627
27628
27629 inline const js::HeapSlot *getRawSlots();
27630
27631
27632
27633
27634
27635
27636 bool growSlots(JSContext *cx, uint32_t oldCount, uint32_t newCount);
27637 void shrinkSlots(JSContext *cx, uint32_t oldCount, uint32_t newCount);
27638
27639 bool hasDynamicSlots() const { return slots != __null; }
27640
27641 protected:
27642 inline bool updateSlotsForSpan(JSContext *cx, size_t oldSpan, size_t newSpan);
27643
27644 public:
27645
27646
27647
27648
27649 inline void prepareSlotRangeForOverwrite(size_t start, size_t end);
27650 inline void prepareElementRangeForOverwrite(size_t start, size_t end);
27651
27652 void rollbackProperties(JSContext *cx, uint32_t slotSpan);
27653
27654 inline void nativeSetSlot(unsigned slot, const js::Value &value);
27655 inline void nativeSetSlotWithType(JSContext *cx, const js::Shape *shape, const js::Value &value);
27656
27657 inline const js::Value &getReservedSlot(unsigned index) const;
27658 inline js::HeapSlot &getReservedSlotRef(unsigned index);
27659 inline void initReservedSlot(unsigned index, const js::Value &v);
27660 inline void setReservedSlot(unsigned index, const js::Value &v);
27661
27662
27663
27664
27665
27666 inline bool setSingletonType(JSContext *cx);
27667
27668 inline js::types::TypeObject *getType(JSContext *cx);
27669
27670 const js::HeapPtr<js::types::TypeObject> &typeFromGC() const {
27671
27672 return type_;
27673 }
27674
27675 inline void setType(js::types::TypeObject *newType);
27676
27677 js::types::TypeObject *getNewType(JSContext *cx, JSFunction *fun = __null);
27678 # 443 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobj.h"
27679 inline bool setIteratedSingleton(JSContext *cx);
27680
27681
27682
27683
27684
27685 bool setNewTypeUnknown(JSContext *cx);
27686
27687
27688 bool splicePrototype(JSContext *cx, JSObject *proto);
27689
27690
27691
27692
27693
27694 bool shouldSplicePrototype(JSContext *cx);
27695 # 487 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobj.h"
27696 inline JSObject *getParent() const;
27697 static bool setParent(JSContext *cx, js::HandleObject obj, js::HandleObject newParent);
27698
27699
27700
27701
27702
27703
27704 inline JSObject *enclosingScope();
27705
27706 inline js::GlobalObject &global() const;
27707
27708
27709 inline JSPrincipals *principals(JSContext *cx);
27710
27711
27712 inline bool clearType(JSContext *cx);
27713 bool clearParent(JSContext *cx);
27714
27715
27716
27717
27718
27719 private:
27720 enum ImmutabilityType { SEAL, FREEZE };
27721
27722
27723
27724
27725
27726
27727
27728 bool sealOrFreeze(JSContext *cx, ImmutabilityType it);
27729
27730 bool isSealedOrFrozen(JSContext *cx, ImmutabilityType it, bool *resultp);
27731
27732 static inline unsigned getSealedOrFrozenAttributes(unsigned attrs, ImmutabilityType it);
27733
27734 public:
27735 bool preventExtensions(JSContext *cx);
27736
27737
27738 inline bool seal(JSContext *cx) { return sealOrFreeze(cx, SEAL); }
27739
27740 bool freeze(JSContext *cx) { return sealOrFreeze(cx, FREEZE); }
27741
27742 bool isSealed(JSContext *cx, bool *resultp) { return isSealedOrFrozen(cx, SEAL, resultp); }
27743 bool isFrozen(JSContext *cx, bool *resultp) { return isSealedOrFrozen(cx, FREEZE, resultp); }
27744
27745
27746
27747 inline bool ensureElements(JSContext *cx, unsigned cap);
27748 bool growElements(JSContext *cx, unsigned cap);
27749 void shrinkElements(JSContext *cx, unsigned cap);
27750
27751 inline js::ElementIteratorObject *asElementIterator();
27752
27753
27754
27755
27756
27757 bool allocateSlowArrayElements(JSContext *cx);
27758
27759 inline uint32_t getArrayLength() const;
27760 inline void setArrayLength(JSContext *cx, uint32_t length);
27761
27762 inline uint32_t getDenseArrayCapacity();
27763 inline void setDenseArrayLength(uint32_t length);
27764 inline void setDenseArrayInitializedLength(uint32_t length);
27765 inline void ensureDenseArrayInitializedLength(JSContext *cx, unsigned index, unsigned extra);
27766 inline void setDenseArrayElement(unsigned idx, const js::Value &val);
27767 inline void initDenseArrayElement(unsigned idx, const js::Value &val);
27768 inline void setDenseArrayElementWithType(JSContext *cx, unsigned idx, const js::Value &val);
27769 inline void initDenseArrayElementWithType(JSContext *cx, unsigned idx, const js::Value &val);
27770 inline void copyDenseArrayElements(unsigned dstStart, const js::Value *src, unsigned count);
27771 inline void initDenseArrayElements(unsigned dstStart, const js::Value *src, unsigned count);
27772 inline void moveDenseArrayElements(unsigned dstStart, unsigned srcStart, unsigned count);
27773 inline void moveDenseArrayElementsUnbarriered(unsigned dstStart, unsigned srcStart, unsigned count);
27774 inline bool denseArrayHasInlineSlots() const;
27775
27776
27777 inline void markDenseArrayNotPacked(JSContext *cx);
27778 # 577 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobj.h"
27779 enum EnsureDenseResult { ED_OK, ED_FAILED, ED_SPARSE };
27780 inline EnsureDenseResult ensureDenseArrayElements(JSContext *cx, unsigned index, unsigned extra);
27781
27782
27783
27784
27785
27786 bool willBeSparseDenseArray(unsigned requiredCapacity, unsigned newElementsHint);
27787
27788 static bool makeDenseArraySlow(JSContext *cx, js::HandleObject obj);
27789
27790
27791
27792
27793
27794
27795 bool arrayGetOwnDataElement(JSContext *cx, size_t i, js::Value *vp);
27796
27797 public:
27798
27799
27800
27801
27802 static const uint32_t JSSLOT_DATE_UTC_TIME = 0;
27803
27804
27805
27806
27807
27808
27809 static const uint32_t JSSLOT_DATE_COMPONENTS_START = 1;
27810
27811 static const uint32_t JSSLOT_DATE_LOCAL_TIME = 1;
27812 static const uint32_t JSSLOT_DATE_LOCAL_YEAR = 2;
27813 static const uint32_t JSSLOT_DATE_LOCAL_MONTH = 3;
27814 static const uint32_t JSSLOT_DATE_LOCAL_DATE = 4;
27815 static const uint32_t JSSLOT_DATE_LOCAL_DAY = 5;
27816 static const uint32_t JSSLOT_DATE_LOCAL_HOURS = 6;
27817 static const uint32_t JSSLOT_DATE_LOCAL_MINUTES = 7;
27818 static const uint32_t JSSLOT_DATE_LOCAL_SECONDS = 8;
27819
27820 static const uint32_t DATE_CLASS_RESERVED_SLOTS = 9;
27821
27822 inline const js::Value &getDateUTCTime() const;
27823 inline void setDateUTCTime(const js::Value &pthis);
27824
27825
27826
27827
27828
27829 friend struct JSFunction;
27830
27831 inline JSFunction *toFunction();
27832 inline const JSFunction *toFunction() const;
27833
27834 public:
27835
27836
27837
27838
27839 static const uint32_t ITER_CLASS_NFIXED_SLOTS = 1;
27840
27841 inline js::NativeIterator *getNativeIterator() const;
27842 inline void setNativeIterator(js::NativeIterator *);
27843 # 653 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobj.h"
27844 private:
27845 static const uint32_t JSSLOT_NAME_PREFIX = 0;
27846 static const uint32_t JSSLOT_NAME_URI = 1;
27847
27848 static const uint32_t JSSLOT_NAMESPACE_DECLARED = 2;
27849
27850 static const uint32_t JSSLOT_QNAME_LOCAL_NAME = 2;
27851
27852 public:
27853 static const uint32_t NAMESPACE_CLASS_RESERVED_SLOTS = 3;
27854 static const uint32_t QNAME_CLASS_RESERVED_SLOTS = 3;
27855
27856 inline JSLinearString *getNamePrefix() const;
27857 inline jsval getNamePrefixVal() const;
27858 inline void setNamePrefix(JSLinearString *prefix);
27859 inline void clearNamePrefix();
27860
27861 inline JSLinearString *getNameURI() const;
27862 inline jsval getNameURIVal() const;
27863 inline void setNameURI(JSLinearString *uri);
27864
27865 inline jsval getNamespaceDeclared() const;
27866 inline void setNamespaceDeclared(jsval decl);
27867
27868 inline JSAtom *getQNameLocalName() const;
27869 inline jsval getQNameLocalNameVal() const;
27870 inline void setQNameLocalName(JSAtom *name);
27871
27872
27873
27874
27875 inline bool isCallable();
27876
27877 inline void finish(js::FreeOp *fop);
27878 __attribute__((always_inline)) inline void finalize(js::FreeOp *fop);
27879
27880 inline bool hasProperty(JSContext *cx, js::HandleId id, bool *foundp, unsigned flags = 0);
27881 # 698 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobj.h"
27882 bool allocSlot(JSContext *cx, uint32_t *slotp);
27883 void freeSlot(JSContext *cx, uint32_t slot);
27884
27885 public:
27886 static bool reportReadOnly(JSContext *cx, jsid id, unsigned report = 0x0);
27887 bool reportNotConfigurable(JSContext* cx, jsid id, unsigned report = 0x0);
27888 bool reportNotExtensible(JSContext *cx, unsigned report = 0x0);
27889
27890
27891
27892
27893
27894
27895
27896 bool callMethod(JSContext *cx, js::HandleId id, unsigned argc, js::Value *argv, js::Value *vp);
27897
27898 private:
27899 js::Shape *getChildProperty(JSContext *cx, js::Shape *parent, js::StackShape &child);
27900
27901 protected:
27902
27903
27904
27905
27906
27907
27908
27909 js::Shape *addPropertyInternal(JSContext *cx, jsid id,
27910 JSPropertyOp getter, JSStrictPropertyOp setter,
27911 uint32_t slot, unsigned attrs,
27912 unsigned flags, int shortid, js::Shape **spp,
27913 bool allowDictionary);
27914
27915 private:
27916 bool toDictionaryMode(JSContext *cx);
27917
27918 struct TradeGutsReserved;
27919 static bool ReserveForTradeGuts(JSContext *cx, JSObject *a, JSObject *b,
27920 TradeGutsReserved &reserved);
27921
27922 static void TradeGuts(JSContext *cx, JSObject *a, JSObject *b,
27923 TradeGutsReserved &reserved);
27924
27925 public:
27926
27927 js::Shape *addProperty(JSContext *cx, jsid id,
27928 JSPropertyOp getter, JSStrictPropertyOp setter,
27929 uint32_t slot, unsigned attrs,
27930 unsigned flags, int shortid, bool allowDictionary = true);
27931
27932
27933 js::Shape *addDataProperty(JSContext *cx, jsid id, uint32_t slot, unsigned attrs) {
27934 do { } while(0);
27935 return addProperty(cx, id, __null, __null, slot, attrs, 0, 0);
27936 }
27937
27938
27939 js::Shape *putProperty(JSContext *cx, jsid id,
27940 JSPropertyOp getter, JSStrictPropertyOp setter,
27941 uint32_t slot, unsigned attrs,
27942 unsigned flags, int shortid);
27943 inline js::Shape *
27944 putProperty(JSContext *cx, js::PropertyName *name,
27945 JSPropertyOp getter, JSStrictPropertyOp setter,
27946 uint32_t slot, unsigned attrs, unsigned flags, int shortid) {
27947 return putProperty(cx, js::NameToId(name), getter, setter, slot, attrs, flags, shortid);
27948 }
27949
27950
27951 js::Shape *changeProperty(JSContext *cx, js::Shape *shape, unsigned attrs, unsigned mask,
27952 JSPropertyOp getter, JSStrictPropertyOp setter);
27953
27954 inline bool changePropertyAttributes(JSContext *cx, js::Shape *shape, unsigned attrs);
27955
27956
27957 bool removeProperty(JSContext *cx, jsid id);
27958
27959
27960 void clear(JSContext *cx);
27961
27962 inline JSBool lookupGeneric(JSContext *cx, js::HandleId id, JSObject **objp, JSProperty **propp);
27963 inline JSBool lookupProperty(JSContext *cx, js::PropertyName *name, JSObject **objp, JSProperty **propp);
27964 inline JSBool lookupElement(JSContext *cx, uint32_t index,
27965 JSObject **objp, JSProperty **propp);
27966 inline JSBool lookupSpecial(JSContext *cx, js::SpecialId sid,
27967 JSObject **objp, JSProperty **propp);
27968
27969 inline JSBool defineGeneric(JSContext *cx, js::HandleId id, const js::Value &value,
27970 JSPropertyOp getter = JS_PropertyStub,
27971 JSStrictPropertyOp setter = JS_StrictPropertyStub,
27972 unsigned attrs = 0x01);
27973 inline JSBool defineProperty(JSContext *cx, js::PropertyName *name, const js::Value &value,
27974 JSPropertyOp getter = JS_PropertyStub,
27975 JSStrictPropertyOp setter = JS_StrictPropertyStub,
27976 unsigned attrs = 0x01);
27977
27978 inline JSBool defineElement(JSContext *cx, uint32_t index, const js::Value &value,
27979 JSPropertyOp getter = JS_PropertyStub,
27980 JSStrictPropertyOp setter = JS_StrictPropertyStub,
27981 unsigned attrs = 0x01);
27982 inline JSBool defineSpecial(JSContext *cx, js::SpecialId sid, const js::Value &value,
27983 JSPropertyOp getter = JS_PropertyStub,
27984 JSStrictPropertyOp setter = JS_StrictPropertyStub,
27985 unsigned attrs = 0x01);
27986
27987 inline JSBool getGeneric(JSContext *cx, js::HandleObject receiver, js::HandleId id, js::Value *vp);
27988 inline JSBool getProperty(JSContext *cx, js::HandleObject receiver, js::PropertyName *name,
27989 js::Value *vp);
27990 inline JSBool getElement(JSContext *cx, js::HandleObject receiver, uint32_t index, js::Value *vp);
27991
27992
27993 inline JSBool getElementIfPresent(JSContext *cx, js::HandleObject receiver, uint32_t index,
27994 js::Value *vp, bool *present);
27995 inline JSBool getSpecial(JSContext *cx, js::HandleObject receiver, js::SpecialId sid, js::Value *vp);
27996
27997 inline JSBool getGeneric(JSContext *cx, js::HandleId id, js::Value *vp);
27998 inline JSBool getProperty(JSContext *cx, js::PropertyName *name, js::Value *vp);
27999 inline JSBool getElement(JSContext *cx, uint32_t index, js::Value *vp);
28000 inline JSBool getSpecial(JSContext *cx, js::SpecialId sid, js::Value *vp);
28001
28002 inline JSBool setGeneric(JSContext *cx, js::HandleId id, js::Value *vp, JSBool strict);
28003 inline JSBool setProperty(JSContext *cx, js::PropertyName *name, js::Value *vp, JSBool strict);
28004 inline JSBool setElement(JSContext *cx, uint32_t index, js::Value *vp, JSBool strict);
28005 inline JSBool setSpecial(JSContext *cx, js::SpecialId sid, js::Value *vp, JSBool strict);
28006
28007 JSBool nonNativeSetProperty(JSContext *cx, js::HandleId id, js::Value *vp, JSBool strict);
28008 JSBool nonNativeSetElement(JSContext *cx, uint32_t index, js::Value *vp, JSBool strict);
28009
28010 inline JSBool getGenericAttributes(JSContext *cx, js::HandleId id, unsigned *attrsp);
28011 inline JSBool getPropertyAttributes(JSContext *cx, js::PropertyName *name, unsigned *attrsp);
28012 inline JSBool getElementAttributes(JSContext *cx, uint32_t index, unsigned *attrsp);
28013 inline JSBool getSpecialAttributes(JSContext *cx, js::SpecialId sid, unsigned *attrsp);
28014
28015 inline JSBool setGenericAttributes(JSContext *cx, js::HandleId id, unsigned *attrsp);
28016 inline JSBool setPropertyAttributes(JSContext *cx, js::PropertyName *name, unsigned *attrsp);
28017 inline JSBool setElementAttributes(JSContext *cx, uint32_t index, unsigned *attrsp);
28018 inline JSBool setSpecialAttributes(JSContext *cx, js::SpecialId sid, unsigned *attrsp);
28019
28020 inline bool deleteProperty(JSContext *cx, js::HandlePropertyName name, js::Value *rval, bool strict);
28021 inline bool deleteElement(JSContext *cx, uint32_t index, js::Value *rval, bool strict);
28022 inline bool deleteSpecial(JSContext *cx, js::HandleSpecialId sid, js::Value *rval, bool strict);
28023 bool deleteByValue(JSContext *cx, const js::Value &property, js::Value *rval, bool strict);
28024
28025 inline bool enumerate(JSContext *cx, JSIterateOp iterop, js::Value *statep, jsid *idp);
28026 inline bool defaultValue(JSContext *cx, JSType hint, js::Value *vp);
28027 inline JSType typeOf(JSContext *cx);
28028 inline JSObject *thisObject(JSContext *cx);
28029
28030 static bool thisObject(JSContext *cx, const js::Value &v, js::Value *vp);
28031
28032 bool swap(JSContext *cx, JSObject *other);
28033
28034 inline void initArrayClass();
28035 # 881 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobj.h"
28036 inline bool isArguments() const;
28037 inline bool isArrayBuffer() const;
28038 inline bool isDataView() const;
28039 inline bool isDate() const;
28040 inline bool isElementIterator() const;
28041 inline bool isError() const;
28042 inline bool isFunction() const;
28043 inline bool isGenerator() const;
28044 inline bool isGlobal() const;
28045 inline bool isIterator() const;
28046 inline bool isObject() const;
28047 inline bool isPrimitive() const;
28048 inline bool isProxy() const;
28049 inline bool isRegExp() const;
28050 inline bool isRegExpStatics() const;
28051 inline bool isScope() const;
28052 inline bool isScript() const;
28053 inline bool isStopIteration() const;
28054 inline bool isTypedArray() const;
28055 inline bool isWeakMap() const;
28056
28057 inline bool isNamespace() const;
28058 inline bool isQName() const;
28059 inline bool isXML() const;
28060 inline bool isXMLId() const;
28061
28062
28063
28064 inline bool isBlock() const;
28065 inline bool isCall() const;
28066 inline bool isDeclEnv() const;
28067 inline bool isNestedScope() const;
28068 inline bool isWith() const;
28069 inline bool isClonedBlock() const;
28070 inline bool isStaticBlock() const;
28071
28072
28073 inline bool isBoolean() const;
28074 inline bool isNumber() const;
28075 inline bool isString() const;
28076
28077
28078 inline bool isNormalArguments() const;
28079 inline bool isStrictArguments() const;
28080
28081
28082 inline bool isDebugScope() const;
28083 inline bool isWrapper() const;
28084 inline bool isFunctionProxy() const;
28085 inline bool isCrossCompartmentWrapper() const;
28086
28087 inline js::ArgumentsObject &asArguments();
28088 inline js::ArrayBufferObject &asArrayBuffer();
28089 inline const js::ArgumentsObject &asArguments() const;
28090 inline js::BlockObject &asBlock();
28091 inline js::BooleanObject &asBoolean();
28092 inline js::CallObject &asCall();
28093 inline js::ClonedBlockObject &asClonedBlock();
28094 inline js::DataViewObject &asDataView();
28095 inline js::DeclEnvObject &asDeclEnv();
28096 inline js::DebugScopeObject &asDebugScope();
28097 inline js::GlobalObject &asGlobal();
28098 inline js::NestedScopeObject &asNestedScope();
28099 inline js::NormalArgumentsObject &asNormalArguments();
28100 inline js::NumberObject &asNumber();
28101 inline js::RegExpObject &asRegExp();
28102 inline js::ScopeObject &asScope();
28103 inline js::StrictArgumentsObject &asStrictArguments();
28104 inline js::StaticBlockObject &asStaticBlock();
28105 inline js::StringObject &asString();
28106 inline js::WithObject &asWith();
28107
28108 static inline js::ThingRootKind rootKind() { return js::THING_ROOT_OBJECT; }
28109
28110
28111
28112
28113
28114 private:
28115 static void staticAsserts() {
28116 typedef int
28117 moz_static_assert78
28118 # 961 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobj.h"
28119 [(sizeof(JSObject) == sizeof(js::shadow::Object)) ? 1 : -1]
28120 ;
28121 typedef int
28122 moz_static_assert79
28123 # 963 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobj.h"
28124 [(sizeof(JSObject) == sizeof(js::ObjectImpl)) ? 1 : -1]
28125 ;
28126 typedef int
28127 moz_static_assert80
28128 # 965 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobj.h"
28129 [(sizeof(JSObject) % sizeof(js::Value) == 0) ? 1 : -1]
28130 ;
28131 }
28132
28133 JSObject() ;
28134 JSObject(const JSObject &other) ;
28135 void operator=(const JSObject &other) ;
28136 };
28137
28138
28139
28140
28141
28142
28143 static __attribute__((always_inline)) inline bool
28144 operator==(const JSObject &lhs, const JSObject &rhs)
28145 {
28146 return &lhs == &rhs;
28147 }
28148
28149 static __attribute__((always_inline)) inline bool
28150 operator!=(const JSObject &lhs, const JSObject &rhs)
28151 {
28152 return &lhs != &rhs;
28153 }
28154
28155 struct JSObject_Slots2 : JSObject { js::Value fslots[2]; };
28156 struct JSObject_Slots4 : JSObject { js::Value fslots[4]; };
28157 struct JSObject_Slots8 : JSObject { js::Value fslots[8]; };
28158 struct JSObject_Slots12 : JSObject { js::Value fslots[12]; };
28159 struct JSObject_Slots16 : JSObject { js::Value fslots[16]; };
28160
28161 #define JSSLOT_FREE(clasp) JSCLASS_RESERVED_SLOTS(clasp)
28162
28163 class JSValueArray {
28164 public:
28165 jsval *array;
28166 size_t length;
28167
28168 JSValueArray(jsval *v, size_t c) : array(v), length(c) {}
28169 };
28170
28171 class ValueArray {
28172 public:
28173 js::Value *array;
28174 size_t length;
28175
28176 ValueArray(js::Value *v, size_t c) : array(v), length(c) {}
28177 };
28178
28179
28180 extern bool
28181 js_EnterSharpObject(JSContext *cx, js::HandleObject obj, JSIdArray **idap, bool *alreadySeen, bool *isSharp);
28182
28183 extern void
28184 js_LeaveSharpObject(JSContext *cx, JSIdArray **idap);
28185
28186
28187
28188
28189
28190 extern void
28191 js_TraceSharpMap(JSTracer *trc, JSSharpObjectMap *map);
28192
28193 extern JSBool
28194 js_HasOwnPropertyHelper(JSContext *cx, js::LookupGenericOp lookup, unsigned argc,
28195 js::Value *vp);
28196
28197 extern JSBool
28198 js_HasOwnProperty(JSContext *cx, js::LookupGenericOp lookup, js::HandleObject obj, js::HandleId id,
28199 JSObject **objp, JSProperty **propp);
28200
28201 extern JSBool
28202 js_PropertyIsEnumerable(JSContext *cx, js::HandleObject obj, js::HandleId id, js::Value *vp);
28203
28204
28205 extern JSPropertySpec object_props[];
28206
28207
28208
28209
28210 extern JSFunctionSpec object_methods[];
28211 extern JSFunctionSpec object_static_methods[];
28212
28213 namespace js {
28214
28215 bool
28216 IsStandardClassResolved(JSObject *obj, js::Class *clasp);
28217
28218 void
28219 MarkStandardClassInitializedNoProto(JSObject *obj, js::Class *clasp);
28220
28221 }
28222
28223
28224
28225
28226 extern const char js_watch_str[];
28227 extern const char js_unwatch_str[];
28228 extern const char js_hasOwnProperty_str[];
28229 extern const char js_isPrototypeOf_str[];
28230 extern const char js_propertyIsEnumerable_str[];
28231
28232
28233 extern const char js_defineGetter_str[];
28234 extern const char js_defineSetter_str[];
28235 extern const char js_lookupGetter_str[];
28236 extern const char js_lookupSetter_str[];
28237
28238
28239 extern JSBool
28240 js_PopulateObject(JSContext *cx, js::HandleObject newborn, JSObject *props);
28241
28242
28243
28244
28245 extern JSBool
28246 js_GetClassObject(JSContext *cx, JSObject *obj, JSProtoKey key,
28247 JSObject **objp);
28248
28249
28250
28251
28252
28253 extern JSProtoKey
28254 js_IdentifyClassPrototype(JSObject *obj);
28255
28256
28257
28258
28259
28260 extern JSBool
28261 js_FindClassObject(JSContext *cx, JSObject *start, JSProtoKey key,
28262 js::Value *vp, js::Class *clasp = __null);
28263
28264
28265
28266 extern JSObject *
28267 js_CreateThisForFunctionWithProto(JSContext *cx, js::HandleObject callee, JSObject *proto);
28268
28269
28270 extern JSObject *
28271 js_CreateThisForFunction(JSContext *cx, js::HandleObject callee, bool newType);
28272
28273
28274 extern JSObject *
28275 js_CreateThis(JSContext *cx, js::Class *clasp, JSObject *callee);
28276
28277
28278
28279
28280
28281 extern js::Shape *
28282 js_AddNativeProperty(JSContext *cx, js::HandleObject obj, jsid id,
28283 JSPropertyOp getter, JSStrictPropertyOp setter, uint32_t slot,
28284 unsigned attrs, unsigned flags, int shortid);
28285
28286 extern JSBool
28287 js_DefineOwnProperty(JSContext *cx, js::HandleObject obj, js::HandleId id,
28288 const js::Value &descriptor, JSBool *bp);
28289
28290 namespace js {
28291
28292
28293
28294
28295 const unsigned DNP_CACHE_RESULT = 1;
28296 const unsigned DNP_DONT_PURGE = 2;
28297 const unsigned DNP_UNQUALIFIED = 4;
28298
28299
28300 const unsigned DNP_SKIP_TYPE = 8;
28301
28302
28303
28304
28305 extern const Shape *
28306 DefineNativeProperty(JSContext *cx, HandleObject obj, HandleId id, const Value &value,
28307 PropertyOp getter, StrictPropertyOp setter, unsigned attrs,
28308 unsigned flags, int shortid, unsigned defineHow = 0);
28309
28310 inline const Shape *
28311 DefineNativeProperty(JSContext *cx, HandleObject obj, PropertyName *name, const Value &value,
28312 PropertyOp getter, StrictPropertyOp setter, unsigned attrs,
28313 unsigned flags, int shortid, unsigned defineHow = 0)
28314 {
28315 return DefineNativeProperty(cx, obj, RootedId(cx, NameToId(name)),
28316 value, getter, setter, attrs, flags,
28317 shortid, defineHow);
28318 }
28319
28320
28321
28322
28323 extern bool
28324 LookupPropertyWithFlags(JSContext *cx, HandleObject obj, HandleId id, unsigned flags,
28325 JSObject **objp, JSProperty **propp);
28326
28327 inline bool
28328 LookupPropertyWithFlags(JSContext *cx, HandleObject obj, PropertyName *name, unsigned flags,
28329 JSObject **objp, JSProperty **propp)
28330 {
28331 return LookupPropertyWithFlags(cx, obj, RootedId(cx, NameToId(name)), flags, objp, propp);
28332 }
28333 # 1178 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobj.h"
28334 extern bool
28335 DefineProperty(JSContext *cx, js::HandleObject obj,
28336 js::HandleId id, const PropDesc &desc, bool throwError,
28337 bool *rval);
28338
28339
28340
28341
28342
28343 extern bool
28344 ReadPropertyDescriptors(JSContext *cx, JSObject *props, bool checkAccessors,
28345 AutoIdVector *ids, AutoPropDescArrayRooter *descs);
28346
28347
28348
28349
28350
28351 static const unsigned RESOLVE_INFER = 0xffff;
28352
28353
28354
28355
28356 extern bool
28357 FindPropertyHelper(JSContext *cx, HandlePropertyName name,
28358 bool cacheResult, HandleObject scopeChain,
28359 JSObject **objp, JSObject **pobjp, JSProperty **propp);
28360
28361
28362
28363
28364
28365 extern bool
28366 FindProperty(JSContext *cx, HandlePropertyName name, HandleObject scopeChain,
28367 JSObject **objp, JSObject **pobjp, JSProperty **propp);
28368
28369 extern JSObject *
28370 FindIdentifierBase(JSContext *cx, HandleObject scopeChain, HandlePropertyName name);
28371
28372 }
28373
28374 extern JSObject *
28375 js_FindVariableScope(JSContext *cx, JSFunction **funp);
28376
28377
28378 const unsigned JSGET_CACHE_RESULT = 1;
28379
28380
28381
28382
28383
28384
28385
28386 extern JSBool
28387 js_NativeGet(JSContext *cx, JSObject *obj, JSObject *pobj, const js::Shape *shape, unsigned getHow,
28388 js::Value *vp);
28389
28390 extern JSBool
28391 js_NativeSet(JSContext *cx, JSObject *obj, const js::Shape *shape, bool added,
28392 bool strict, js::Value *vp);
28393
28394 namespace js {
28395
28396 bool
28397 GetPropertyHelper(JSContext *cx, HandleObject obj, jsid id, uint32_t getHow, Value *vp);
28398
28399 inline bool
28400 GetPropertyHelper(JSContext *cx, HandleObject obj, PropertyName *name, uint32_t getHow, Value *vp)
28401 {
28402 return GetPropertyHelper(cx, obj, NameToId(name), getHow, vp);
28403 }
28404
28405 bool
28406 GetOwnPropertyDescriptor(JSContext *cx, HandleObject obj, HandleId id, PropertyDescriptor *desc);
28407
28408 bool
28409 GetOwnPropertyDescriptor(JSContext *cx, HandleObject obj, HandleId id, Value *vp);
28410
28411 bool
28412 NewPropertyDescriptorObject(JSContext *cx, const PropertyDescriptor *desc, Value *vp);
28413
28414 extern JSBool
28415 GetMethod(JSContext *cx, HandleObject obj, HandleId id, unsigned getHow, Value *vp);
28416
28417 inline bool
28418 GetMethod(JSContext *cx, HandleObject obj, PropertyName *name, unsigned getHow, Value *vp)
28419 {
28420 return GetMethod(cx, obj, RootedId(cx, NameToId(name)), getHow, vp);
28421 }
28422
28423
28424
28425
28426
28427 extern bool
28428 HasDataProperty(JSContext *cx, HandleObject obj, jsid id, Value *vp);
28429
28430 inline bool
28431 HasDataProperty(JSContext *cx, HandleObject obj, PropertyName *name, Value *vp)
28432 {
28433 return HasDataProperty(cx, obj, NameToId(name), vp);
28434 }
28435
28436 extern JSBool
28437 CheckAccess(JSContext *cx, JSObject *obj, HandleId id, JSAccessMode mode,
28438 js::Value *vp, unsigned *attrsp);
28439
28440 }
28441
28442 extern bool
28443 js_IsDelegate(JSContext *cx, JSObject *obj, const js::Value &v);
28444
28445
28446
28447
28448
28449 extern JSBool
28450 js_PrimitiveToObject(JSContext *cx, js::Value *vp);
28451
28452 extern JSBool
28453 js_ValueToObjectOrNull(JSContext *cx, const js::Value &v, JSObject **objp);
28454
28455
28456 extern JSObject *
28457 js_ValueToNonNullObject(JSContext *cx, const js::Value &v);
28458
28459 namespace js {
28460
28461
28462
28463
28464
28465 extern JSObject *
28466 ToObjectSlow(JSContext *cx, Value *vp);
28467
28468 __attribute__((always_inline)) inline JSObject *
28469 ToObject(JSContext *cx, Value *vp)
28470 {
28471 if (vp->isObject())
28472 return &vp->toObject();
28473 return ToObjectSlow(cx, vp);
28474 }
28475
28476
28477 inline JSObject *
28478 ValueToObject(JSContext *cx, const Value &v)
28479 {
28480 if (v.isObject())
28481 return &v.toObject();
28482 return js_ValueToNonNullObject(cx, v);
28483 }
28484
28485 }
28486
28487 extern void
28488 js_GetObjectSlotName(JSTracer *trc, char *buf, size_t bufsize);
28489
28490 extern bool
28491 js_ClearNative(JSContext *cx, JSObject *obj);
28492
28493 extern JSBool
28494 js_ReportGetterOnlyAssignment(JSContext *cx);
28495
28496 extern unsigned
28497 js_InferFlags(JSContext *cx, unsigned defaultFlags);
28498
28499
28500 JSBool
28501 js_Object(JSContext *cx, unsigned argc, js::Value *vp);
28502 # 1354 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobj.h"
28503 extern __attribute__((visibility("default"))) JSBool
28504 js_GetClassPrototype(JSContext *cx, JSObject *scope, JSProtoKey protoKey,
28505 JSObject **protop, js::Class *clasp = __null);
28506
28507 namespace js {
28508
28509 extern bool
28510 SetProto(JSContext *cx, HandleObject obj, HandleObject proto, bool checkForCycles);
28511
28512 extern JSString *
28513 obj_toStringHelper(JSContext *cx, JSObject *obj);
28514
28515 extern JSBool
28516 eval(JSContext *cx, unsigned argc, Value *vp);
28517
28518
28519
28520
28521
28522
28523 extern bool
28524 DirectEval(JSContext *cx, const CallArgs &args);
28525
28526
28527
28528
28529
28530 extern bool
28531 IsBuiltinEvalForScope(JSObject *scopeChain, const js::Value &v);
28532
28533
28534 extern bool
28535 IsAnyBuiltinEval(JSFunction *fun);
28536
28537
28538 extern JSPrincipals *
28539 PrincipalsForCompiledCode(const CallReceiver &call, JSContext *cx);
28540
28541 extern JSObject *
28542 NonNullObject(JSContext *cx, const Value &v);
28543
28544 extern const char *
28545 InformalValueTypeName(const Value &v);
28546
28547 inline void
28548 DestroyIdArray(FreeOp *fop, JSIdArray *ida);
28549
28550 extern bool
28551 GetFirstArgumentAsObject(JSContext *cx, unsigned argc, Value *vp, const char *method, JSObject **objp);
28552
28553
28554 extern bool
28555 Throw(JSContext *cx, jsid id, unsigned errorNumber);
28556
28557 extern bool
28558 Throw(JSContext *cx, JSObject *obj, unsigned errorNumber);
28559 # 1424 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobj.h"
28560 extern bool
28561 CheckDefineProperty(JSContext *cx, HandleObject obj, HandleId id, HandleValue value,
28562 PropertyOp getter, StrictPropertyOp setter, unsigned attrs);
28563
28564 }
28565 # 19 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscope.h" 2
28566 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jspropertytree.h" 1
28567
28568
28569
28570
28571
28572
28573
28574 #define jspropertytree_h___
28575
28576
28577
28578
28579
28580 namespace js {
28581
28582 struct ShapeHasher {
28583 typedef js::Shape *Key;
28584 typedef js::StackShape Lookup;
28585
28586 static inline HashNumber hash(const Lookup &l);
28587 static inline bool match(Key k, const Lookup &l);
28588 };
28589
28590 typedef HashSet<js::Shape *, ShapeHasher, SystemAllocPolicy> KidsHash;
28591
28592 class KidsPointer {
28593 private:
28594 enum {
28595 SHAPE = 0,
28596 HASH = 1,
28597 TAG = 1
28598 };
28599
28600 uintptr_t w;
28601
28602 public:
28603 bool isNull() const { return !w; }
28604 void setNull() { w = 0; }
28605
28606 bool isShape() const { return (w & TAG) == SHAPE && !isNull(); }
28607 js::Shape *toShape() const {
28608 do { } while(0);
28609 return reinterpret_cast<js::Shape *>(w & ~uintptr_t(TAG));
28610 }
28611 void setShape(js::Shape *shape) {
28612 do { } while(0);
28613 do { } while(0);
28614 w = reinterpret_cast<uintptr_t>(shape) | SHAPE;
28615 }
28616
28617 bool isHash() const { return (w & TAG) == HASH; }
28618 KidsHash *toHash() const {
28619 do { } while(0);
28620 return reinterpret_cast<KidsHash *>(w & ~uintptr_t(TAG));
28621 }
28622 void setHash(KidsHash *hash) {
28623 do { } while(0);
28624 do { } while(0);
28625 w = reinterpret_cast<uintptr_t>(hash) | HASH;
28626 }
28627
28628
28629
28630
28631 };
28632
28633 class PropertyTree
28634 {
28635 friend struct ::JSFunction;
28636
28637 JSCompartment *compartment;
28638
28639 bool insertChild(JSContext *cx, js::Shape *parent, js::Shape *child);
28640
28641 PropertyTree();
28642
28643 public:
28644 enum { MAX_HEIGHT = 128 };
28645
28646 PropertyTree(JSCompartment *comp)
28647 : compartment(comp)
28648 {
28649 }
28650
28651 js::Shape *newShape(JSContext *cx);
28652 js::Shape *getChild(JSContext *cx, Shape *parent, uint32_t nfixed, const StackShape &child);
28653
28654
28655
28656
28657
28658 };
28659
28660 }
28661 # 20 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscope.h" 2
28662 # 98 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscope.h"
28663 namespace js {
28664
28665
28666 static const uint32_t SHAPE_INVALID_SLOT = ((uint32_t)1 << (24)) - 1;
28667 static const uint32_t SHAPE_MAXIMUM_SLOT = ((uint32_t)1 << (24)) - 2;
28668
28669
28670
28671
28672
28673 struct ShapeTable {
28674 static const uint32_t HASH_BITS = tl::BitSize<HashNumber>::result;
28675 static const uint32_t MIN_ENTRIES = 7;
28676 static const uint32_t MIN_SIZE_LOG2 = 4;
28677 static const uint32_t MIN_SIZE = ((uint32_t)1 << (MIN_SIZE_LOG2));
28678
28679 int hashShift;
28680
28681 uint32_t entryCount;
28682 uint32_t removedCount;
28683 uint32_t freelist;
28684
28685
28686 js::Shape **entries;
28687
28688 ShapeTable(uint32_t nentries)
28689 : hashShift(HASH_BITS - MIN_SIZE_LOG2),
28690 entryCount(nentries),
28691 removedCount(0),
28692 freelist(SHAPE_INVALID_SLOT)
28693 {
28694
28695 }
28696
28697 ~ShapeTable() {
28698 js::UnwantedForeground::free_(entries);
28699 }
28700
28701
28702 uint32_t capacity() const { return ((uint32_t)1 << (HASH_BITS - hashShift)); }
28703
28704
28705 static size_t sizeOfEntries(size_t cap) { return cap * sizeof(Shape *); }
28706
28707
28708
28709
28710
28711 size_t sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf) const {
28712 return mallocSizeOf(this) + mallocSizeOf(entries);
28713 }
28714
28715
28716 bool needsToGrow() const {
28717 uint32_t size = capacity();
28718 return entryCount + removedCount >= size - (size >> 2);
28719 }
28720
28721
28722
28723
28724
28725
28726 bool grow(JSContext *cx);
28727
28728
28729
28730
28731
28732
28733 bool init(JSRuntime *rt, js::Shape *lastProp);
28734 bool change(int log2Delta, JSContext *cx);
28735 js::Shape **search(jsid id, bool adding);
28736 };
28737
28738 }
28739
28740 struct JSObject;
28741
28742 namespace js {
28743
28744 class PropertyTree;
28745
28746
28747
28748
28749 #define JSPROP_SHADOWABLE JSPROP_INDEX
28750 # 234 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscope.h"
28751 class UnownedBaseShape;
28752
28753 class BaseShape : public js::gc::Cell
28754 {
28755 public:
28756 friend struct Shape;
28757 friend struct StackBaseShape;
28758 friend struct StackShape;
28759
28760 enum Flag {
28761
28762 OWNED_SHAPE = 0x1,
28763
28764
28765 HAS_GETTER_OBJECT = 0x2,
28766 HAS_SETTER_OBJECT = 0x4,
28767
28768
28769
28770
28771
28772
28773
28774 EXTENSIBLE_PARENTS = 0x8,
28775 DELEGATE = 0x10,
28776 SYSTEM = 0x20,
28777 NOT_EXTENSIBLE = 0x40,
28778 INDEXED = 0x80,
28779 BOUND_FUNCTION = 0x100,
28780 VAROBJ = 0x200,
28781 WATCHED = 0x400,
28782 ITERATED_SINGLETON = 0x800,
28783 NEW_TYPE_UNKNOWN = 0x1000,
28784 UNCACHEABLE_PROTO = 0x2000,
28785
28786 OBJECT_FLAG_MASK = 0x3ff8
28787 };
28788
28789 private:
28790 Class *clasp;
28791 HeapPtrObject parent;
28792 uint32_t flags;
28793 uint32_t slotSpan_;
28794
28795
28796 union {
28797 js::PropertyOp rawGetter;
28798 JSObject *getterObj;
28799
28800 };
28801
28802 union {
28803 js::StrictPropertyOp rawSetter;
28804 JSObject *setterObj;
28805
28806 };
28807
28808
28809 HeapPtr<UnownedBaseShape> unowned_;
28810
28811
28812 ShapeTable *table_;
28813
28814 BaseShape(const BaseShape &base) ;
28815
28816 public:
28817 void finalize(FreeOp *fop);
28818
28819 inline BaseShape(Class *clasp, JSObject *parent, uint32_t objectFlags);
28820 inline BaseShape(Class *clasp, JSObject *parent, uint32_t objectFlags,
28821 uint8_t attrs, PropertyOp rawGetter, StrictPropertyOp rawSetter);
28822 inline BaseShape(const StackBaseShape &base);
28823
28824
28825 ~BaseShape();
28826
28827 inline BaseShape &operator=(const BaseShape &other);
28828
28829 bool isOwned() const { return !!(flags & OWNED_SHAPE); }
28830
28831 inline bool matchesGetterSetter(PropertyOp rawGetter,
28832 StrictPropertyOp rawSetter) const;
28833
28834 inline void adoptUnowned(UnownedBaseShape *other);
28835 inline void setOwned(UnownedBaseShape *unowned);
28836
28837 JSObject *getObjectParent() const { return parent; }
28838 uint32_t getObjectFlags() const { return flags & OBJECT_FLAG_MASK; }
28839
28840 bool hasGetterObject() const { return !!(flags & HAS_GETTER_OBJECT); }
28841 JSObject *getterObject() const { do { } while(0); return getterObj; }
28842
28843 bool hasSetterObject() const { return !!(flags & HAS_SETTER_OBJECT); }
28844 JSObject *setterObject() const { do { } while(0); return setterObj; }
28845
28846 bool hasTable() const { do { } while (0); return table_ != __null; }
28847 ShapeTable &table() const { do { } while(0); return *table_; }
28848 void setTable(ShapeTable *table) { do { } while(0); table_ = table; }
28849
28850 uint32_t slotSpan() const { do { } while(0); return slotSpan_; }
28851 void setSlotSpan(uint32_t slotSpan) { do { } while(0); slotSpan_ = slotSpan; }
28852
28853
28854 static UnownedBaseShape *getUnowned(JSContext *cx, const StackBaseShape &base);
28855
28856
28857 inline UnownedBaseShape *unowned();
28858
28859
28860 inline UnownedBaseShape *baseUnowned();
28861
28862
28863 inline UnownedBaseShape *toUnowned();
28864
28865
28866 inline void assertConsistency();
28867
28868
28869 static inline size_t offsetOfClass() { return __builtin_offsetof (BaseShape, clasp); }
28870 static inline size_t offsetOfParent() { return __builtin_offsetof (BaseShape, parent); }
28871 static inline size_t offsetOfFlags() { return __builtin_offsetof (BaseShape, flags); }
28872
28873 static inline void writeBarrierPre(BaseShape *shape);
28874 static inline void writeBarrierPost(BaseShape *shape, void *addr);
28875 static inline void readBarrier(BaseShape *shape);
28876
28877 static inline ThingRootKind rootKind() { return THING_ROOT_BASE_SHAPE; }
28878
28879 inline void markChildren(JSTracer *trc);
28880
28881 private:
28882 static void staticAsserts() {
28883 typedef int moz_static_assert81[(__builtin_offsetof (BaseShape, clasp) == __builtin_offsetof (js::shadow::BaseShape, clasp)) ? 1 : -1];
28884 }
28885 };
28886
28887 class UnownedBaseShape : public BaseShape {};
28888
28889 UnownedBaseShape *
28890 BaseShape::unowned()
28891 {
28892 return isOwned() ? baseUnowned() : toUnowned();
28893 }
28894
28895 UnownedBaseShape *
28896 BaseShape::toUnowned()
28897 {
28898 do { } while(0); return static_cast<UnownedBaseShape *>(this);
28899 }
28900
28901 UnownedBaseShape *
28902 BaseShape::baseUnowned()
28903 {
28904 do { } while(0); return unowned_;
28905 }
28906
28907
28908 struct StackBaseShape
28909 {
28910 typedef const StackBaseShape *Lookup;
28911
28912 uint32_t flags;
28913 Class *clasp;
28914 JSObject *parent;
28915 PropertyOp rawGetter;
28916 StrictPropertyOp rawSetter;
28917
28918 StackBaseShape(BaseShape *base)
28919 : flags(base->flags & BaseShape::OBJECT_FLAG_MASK),
28920 clasp(base->clasp),
28921 parent(base->parent),
28922 rawGetter(__null),
28923 rawSetter(__null)
28924 {}
28925
28926 StackBaseShape(Class *clasp, JSObject *parent, uint32_t objectFlags)
28927 : flags(objectFlags),
28928 clasp(clasp),
28929 parent(parent),
28930 rawGetter(__null),
28931 rawSetter(__null)
28932 {}
28933
28934 inline StackBaseShape(Shape *shape);
28935
28936 inline void updateGetterSetter(uint8_t attrs,
28937 PropertyOp rawGetter,
28938 StrictPropertyOp rawSetter);
28939
28940 static inline HashNumber hash(const StackBaseShape *lookup);
28941 static inline bool match(UnownedBaseShape *key, const StackBaseShape *lookup);
28942
28943 class AutoRooter : private AutoGCRooter
28944 {
28945 public:
28946 explicit AutoRooter(JSContext *cx, const StackBaseShape *base_
28947 )
28948 : AutoGCRooter(cx, STACKBASESHAPE), base(base_), skip(cx, base_)
28949 {
28950 do { } while (0);
28951 }
28952
28953 friend void AutoGCRooter::trace(JSTracer *trc);
28954
28955 private:
28956 const StackBaseShape *base;
28957 SkipRoot skip;
28958
28959 };
28960 };
28961
28962 typedef HashSet<ReadBarriered<UnownedBaseShape>,
28963 StackBaseShape,
28964 SystemAllocPolicy> BaseShapeSet;
28965
28966 struct Shape : public js::gc::Cell
28967 {
28968 friend struct ::JSObject;
28969 friend struct ::JSFunction;
28970 friend class js::Bindings;
28971 friend class js::ObjectImpl;
28972 friend class js::PropertyTree;
28973 friend class js::StaticBlockObject;
28974 friend struct js::StackShape;
28975 friend struct js::StackBaseShape;
28976
28977 protected:
28978 HeapPtrBaseShape base_;
28979 HeapId propid_;
28980
28981 enum SlotInfo
28982 {
28983
28984 FIXED_SLOTS_MAX = 0x1f,
28985 FIXED_SLOTS_SHIFT = 27,
28986 FIXED_SLOTS_MASK = uint32_t(FIXED_SLOTS_MAX << FIXED_SLOTS_SHIFT),
28987
28988
28989
28990
28991
28992
28993
28994 LINEAR_SEARCHES_MAX = 0x7,
28995 LINEAR_SEARCHES_SHIFT = 24,
28996 LINEAR_SEARCHES_MASK = LINEAR_SEARCHES_MAX << LINEAR_SEARCHES_SHIFT,
28997
28998
28999
29000
29001
29002
29003
29004 SLOT_MASK = ((uint32_t)1 << (24)) - 1
29005 } __attribute__((packed));
29006
29007 uint32_t slotInfo;
29008 uint8_t attrs;
29009 uint8_t flags;
29010 int16_t shortid_;
29011
29012 HeapPtrShape parent;
29013
29014 union {
29015 KidsPointer kids;
29016
29017 HeapPtrShape *listp;
29018
29019
29020
29021 };
29022
29023 static inline Shape *search(JSContext *cx, Shape *start, jsid id,
29024 Shape ***pspp, bool adding = false);
29025
29026
29027
29028
29029
29030 inline void removeFromDictionary(JSObject *obj);
29031 inline void insertIntoDictionary(HeapPtrShape *dictp);
29032
29033 inline void initDictionaryShape(const StackShape &child, uint32_t nfixed,
29034 HeapPtrShape *dictp);
29035
29036 Shape *getChildBinding(JSContext *cx, const StackShape &child);
29037
29038
29039 static Shape *replaceLastProperty(JSContext *cx, const StackBaseShape &base,
29040 JSObject *proto, Shape *shape);
29041
29042 bool hashify(JSContext *cx);
29043 void handoffTableTo(Shape *newShape);
29044
29045 inline void setParent(js::Shape *p);
29046
29047 bool ensureOwnBaseShape(JSContext *cx) {
29048 if (base()->isOwned())
29049 return true;
29050 return makeOwnBaseShape(cx);
29051 }
29052
29053 bool makeOwnBaseShape(JSContext *cx);
29054
29055 public:
29056 bool hasTable() const { return base()->hasTable(); }
29057 js::ShapeTable &table() const { return base()->table(); }
29058
29059 void sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf,
29060 size_t *propTableSize, size_t *kidsSize) const {
29061 *propTableSize = hasTable() ? table().sizeOfIncludingThis(mallocSizeOf) : 0;
29062 *kidsSize = !inDictionary() && kids.isHash()
29063 ? kids.toHash()->sizeOfIncludingThis(mallocSizeOf)
29064 : 0;
29065 }
29066
29067 bool isNative() const {
29068 do { } while(0);
29069 return !(flags & NON_NATIVE);
29070 }
29071
29072 const HeapPtrShape &previous() const {
29073 return parent;
29074 }
29075
29076 class Range {
29077 protected:
29078 friend struct Shape;
29079 const Shape *cursor;
29080
29081 public:
29082 Range(const Shape *shape) : cursor(shape) { }
29083
29084 bool empty() const {
29085 return cursor->isEmptyShape();
29086 }
29087
29088 const Shape &front() const {
29089 do { } while(0);
29090 return *cursor;
29091 }
29092
29093 void popFront() {
29094 do { } while(0);
29095 cursor = cursor->parent;
29096 }
29097
29098 class AutoRooter : private AutoGCRooter
29099 {
29100 public:
29101 explicit AutoRooter(JSContext *cx, Range *r_
29102 )
29103 : AutoGCRooter(cx, SHAPERANGE), r(r_), skip(cx, r_)
29104 {
29105 do { } while (0);
29106 }
29107
29108 friend void AutoGCRooter::trace(JSTracer *trc);
29109 void trace(JSTracer *trc);
29110
29111 private:
29112 Range *r;
29113 SkipRoot skip;
29114
29115 };
29116 };
29117
29118 Range all() const {
29119 return Range(this);
29120 }
29121
29122 Class *getObjectClass() const { return base()->clasp; }
29123 JSObject *getObjectParent() const { return base()->parent; }
29124
29125 static Shape *setObjectParent(JSContext *cx, JSObject *obj, JSObject *proto, Shape *last);
29126 static Shape *setObjectFlag(JSContext *cx, BaseShape::Flag flag, JSObject *proto, Shape *last);
29127
29128 uint32_t getObjectFlags() const { return base()->getObjectFlags(); }
29129 bool hasObjectFlag(BaseShape::Flag flag) const {
29130 do { } while(0);
29131 return !!(base()->flags & flag);
29132 }
29133
29134 protected:
29135
29136
29137
29138
29139
29140 enum {
29141
29142 NON_NATIVE = 0x01,
29143
29144
29145 IN_DICTIONARY = 0x02,
29146
29147 UNUSED_BITS = 0x3C
29148 };
29149
29150
29151 Shape(const StackShape &other, uint32_t nfixed);
29152
29153
29154 Shape(UnownedBaseShape *base, uint32_t nfixed);
29155
29156
29157 Shape(const Shape &other) ;
29158
29159
29160
29161
29162
29163
29164
29165 bool hasMissingSlot() const { return maybeSlot() == SHAPE_INVALID_SLOT; }
29166
29167 public:
29168
29169 enum {
29170 HAS_SHORTID = 0x40,
29171 PUBLIC_FLAGS = HAS_SHORTID
29172 };
29173
29174 bool inDictionary() const { return (flags & IN_DICTIONARY) != 0; }
29175 unsigned getFlags() const { return flags & PUBLIC_FLAGS; }
29176 bool hasShortID() const { return (flags & HAS_SHORTID) != 0; }
29177
29178 PropertyOp getter() const { return base()->rawGetter; }
29179 bool hasDefaultGetter() const { return !base()->rawGetter; }
29180 PropertyOp getterOp() const { do { } while(0); return base()->rawGetter; }
29181 JSObject *getterObject() const { do { } while(0); return base()->getterObj; }
29182
29183
29184 Value getterValue() const {
29185 do { } while(0);
29186 return base()->getterObj ? js::ObjectValue(*base()->getterObj) : js::UndefinedValue();
29187 }
29188
29189 Value getterOrUndefined() const {
29190 return (hasGetterValue() && base()->getterObj)
29191 ? ObjectValue(*base()->getterObj)
29192 : UndefinedValue();
29193 }
29194
29195 StrictPropertyOp setter() const { return base()->rawSetter; }
29196 bool hasDefaultSetter() const { return !base()->rawSetter; }
29197 StrictPropertyOp setterOp() const { do { } while(0); return base()->rawSetter; }
29198 JSObject *setterObject() const { do { } while(0); return base()->setterObj; }
29199
29200
29201 Value setterValue() const {
29202 do { } while(0);
29203 return base()->setterObj ? js::ObjectValue(*base()->setterObj) : js::UndefinedValue();
29204 }
29205
29206 Value setterOrUndefined() const {
29207 return (hasSetterValue() && base()->setterObj)
29208 ? ObjectValue(*base()->setterObj)
29209 : UndefinedValue();
29210 }
29211
29212 void update(js::PropertyOp getter, js::StrictPropertyOp setter, uint8_t attrs);
29213
29214 inline bool matches(const Shape *other) const;
29215 inline bool matches(const StackShape &other) const;
29216 inline bool matchesParamsAfterId(BaseShape *base,
29217 uint32_t aslot, unsigned aattrs, unsigned aflags,
29218 int ashortid) const;
29219
29220 bool get(JSContext* cx, HandleObject receiver, JSObject *obj, JSObject *pobj, js::Value* vp) const;
29221 bool set(JSContext* cx, HandleObject obj, bool strict, js::Value* vp) const;
29222
29223 BaseShape *base() const { return base_; }
29224
29225 bool hasSlot() const { return (attrs & 0x40) == 0; }
29226 uint32_t slot() const { do { } while(0); return maybeSlot(); }
29227 uint32_t maybeSlot() const { return slotInfo & SLOT_MASK; }
29228
29229 bool isEmptyShape() const {
29230 do { } while (0);
29231 return JSID_IS_EMPTY(propid_);
29232 }
29233
29234 uint32_t slotSpan() const {
29235 do { } while(0);
29236 uint32_t free = (((getObjectClass())->flags >> 8) & (((uint32_t)1 << (8)) - 1));
29237 return hasMissingSlot() ? free : Max(free, maybeSlot() + 1);
29238 }
29239
29240 void setSlot(uint32_t slot) {
29241 do { } while(0);
29242 slotInfo = slotInfo & ~Shape::SLOT_MASK;
29243 slotInfo = slotInfo | slot;
29244 }
29245
29246 uint32_t numFixedSlots() const {
29247 return (slotInfo >> FIXED_SLOTS_SHIFT);
29248 }
29249
29250 void setNumFixedSlots(uint32_t nfixed) {
29251 do { } while(0);
29252 slotInfo = slotInfo & ~FIXED_SLOTS_MASK;
29253 slotInfo = slotInfo | (nfixed << FIXED_SLOTS_SHIFT);
29254 }
29255
29256 uint32_t numLinearSearches() const {
29257 return (slotInfo & LINEAR_SEARCHES_MASK) >> LINEAR_SEARCHES_SHIFT;
29258 }
29259
29260 void incrementNumLinearSearches() {
29261 uint32_t count = numLinearSearches();
29262 do { } while(0);
29263 slotInfo = slotInfo & ~LINEAR_SEARCHES_MASK;
29264 slotInfo = slotInfo | ((count + 1) << LINEAR_SEARCHES_SHIFT);
29265 }
29266
29267 const HeapId &propid() const {
29268 do { } while(0);
29269 do { } while(0);
29270 return propid_;
29271 }
29272 HeapId &propidRef() { do { } while(0); return propid_; }
29273
29274 int16_t shortid() const { do { } while(0); return maybeShortid(); }
29275 int16_t maybeShortid() const { return shortid_; }
29276
29277
29278
29279
29280
29281 inline bool getUserId(JSContext *cx, jsid *idp) const;
29282
29283 uint8_t attributes() const { return attrs; }
29284 bool configurable() const { return (attrs & 0x04) == 0; }
29285 bool enumerable() const { return (attrs & 0x01) != 0; }
29286 bool writable() const {
29287
29288 return (attrs & 0x02) == 0;
29289 }
29290 bool hasGetterValue() const { return attrs & 0x10; }
29291 bool hasSetterValue() const { return attrs & 0x20; }
29292
29293 bool isDataDescriptor() const {
29294 return (attrs & (0x20 | 0x10)) == 0;
29295 }
29296 bool isAccessorDescriptor() const {
29297 return (attrs & (0x20 | 0x10)) != 0;
29298 }
29299
29300
29301
29302
29303
29304
29305
29306 bool shadowable() const {
29307 do { } while (0);
29308 return hasSlot() || (attrs & 0x80);
29309 }
29310 # 837 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscope.h"
29311 static Shape *setExtensibleParents(JSContext *cx, Shape *shape);
29312 bool extensibleParents() const { return !!(base()->flags & BaseShape::EXTENSIBLE_PARENTS); }
29313
29314 uint32_t entryCount() const {
29315 if (hasTable())
29316 return table().entryCount;
29317
29318 const js::Shape *shape = this;
29319 uint32_t count = 0;
29320 for (js::Shape::Range r = shape->all(); !r.empty(); r.popFront())
29321 ++count;
29322 return count;
29323 }
29324
29325 bool isBigEnoughForAShapeTable() const {
29326 do { } while(0);
29327 const js::Shape *shape = this;
29328 uint32_t count = 0;
29329 for (js::Shape::Range r = shape->all(); !r.empty(); r.popFront()) {
29330 ++count;
29331 if (count >= ShapeTable::MIN_ENTRIES)
29332 return true;
29333 }
29334 return false;
29335 }
29336
29337
29338
29339
29340
29341
29342 void finalize(FreeOp *fop);
29343 void removeChild(js::Shape *child);
29344
29345 static inline void writeBarrierPre(const Shape *shape);
29346 static inline void writeBarrierPost(const Shape *shape, void *addr);
29347
29348
29349
29350
29351
29352
29353 static inline void readBarrier(const Shape *shape);
29354
29355 static inline ThingRootKind rootKind() { return THING_ROOT_SHAPE; }
29356
29357 inline void markChildren(JSTracer *trc);
29358
29359
29360 static inline size_t offsetOfBase() { return __builtin_offsetof (Shape, base_); }
29361
29362 private:
29363 static void staticAsserts() {
29364 typedef int moz_static_assert82[(__builtin_offsetof (Shape, base_) == __builtin_offsetof (js::shadow::Shape, base)) ? 1 : -1];
29365 typedef int moz_static_assert83[(__builtin_offsetof (Shape, slotInfo) == __builtin_offsetof (js::shadow::Shape, slotInfo)) ? 1 : -1];
29366 typedef int moz_static_assert84[(FIXED_SLOTS_SHIFT == js::shadow::Shape::FIXED_SLOTS_SHIFT) ? 1 : -1];
29367 }
29368 };
29369
29370 class AutoRooterGetterSetter
29371 {
29372 class Inner : private AutoGCRooter
29373 {
29374 public:
29375 Inner(JSContext *cx, uint8_t attrs,
29376 PropertyOp *pgetter_, StrictPropertyOp *psetter_)
29377 : AutoGCRooter(cx, GETTERSETTER), attrs(attrs),
29378 pgetter(pgetter_), psetter(psetter_),
29379 getterRoot(cx, pgetter_), setterRoot(cx, psetter_)
29380 {}
29381
29382 friend void AutoGCRooter::trace(JSTracer *trc);
29383
29384 private:
29385 uint8_t attrs;
29386 PropertyOp *pgetter;
29387 StrictPropertyOp *psetter;
29388 SkipRoot getterRoot, setterRoot;
29389 };
29390
29391 public:
29392 explicit AutoRooterGetterSetter(JSContext *cx, uint8_t attrs,
29393 PropertyOp *pgetter, StrictPropertyOp *psetter
29394 )
29395 {
29396 if (attrs & (0x10 | 0x20))
29397 inner.construct(cx, attrs, pgetter, psetter);
29398 do { } while (0);
29399 }
29400
29401 friend void AutoGCRooter::trace(JSTracer *trc);
29402
29403 private:
29404 Maybe<Inner> inner;
29405
29406 };
29407
29408 struct EmptyShape : public js::Shape
29409 {
29410 EmptyShape(UnownedBaseShape *base, uint32_t nfixed);
29411
29412
29413
29414
29415
29416 static Shape *getInitialShape(JSContext *cx, Class *clasp, JSObject *proto,
29417 JSObject *parent, gc::AllocKind kind, uint32_t objectFlags = 0);
29418
29419
29420
29421
29422
29423
29424 static void insertInitialShape(JSContext *cx, Shape *shape, JSObject *proto);
29425 };
29426
29427
29428
29429
29430
29431 struct InitialShapeEntry
29432 {
29433
29434
29435
29436
29437
29438 ReadBarriered<Shape> shape;
29439
29440
29441
29442
29443
29444 JSObject *proto;
29445
29446
29447 struct Lookup {
29448 Class *clasp;
29449 JSObject *proto;
29450 JSObject *parent;
29451 uint32_t nfixed;
29452 uint32_t baseFlags;
29453 Lookup(Class *clasp, JSObject *proto, JSObject *parent, uint32_t nfixed,
29454 uint32_t baseFlags)
29455 : clasp(clasp), proto(proto), parent(parent),
29456 nfixed(nfixed), baseFlags(baseFlags)
29457 {}
29458 };
29459
29460 inline InitialShapeEntry();
29461 inline InitialShapeEntry(const ReadBarriered<Shape> &shape, JSObject *proto);
29462
29463 inline Lookup getLookup();
29464
29465 static inline HashNumber hash(const Lookup &lookup);
29466 static inline bool match(const InitialShapeEntry &key, const Lookup &lookup);
29467 };
29468
29469 typedef HashSet<InitialShapeEntry, InitialShapeEntry, SystemAllocPolicy> InitialShapeSet;
29470
29471 struct StackShape
29472 {
29473 UnownedBaseShape *base;
29474 jsid propid;
29475 uint32_t slot_;
29476 uint8_t attrs;
29477 uint8_t flags;
29478 int16_t shortid;
29479
29480 StackShape(UnownedBaseShape *base, jsid propid, uint32_t slot,
29481 uint32_t nfixed, unsigned attrs, unsigned flags, int shortid)
29482 : base(base),
29483 propid(propid),
29484 slot_(slot),
29485 attrs(uint8_t(attrs)),
29486 flags(uint8_t(flags)),
29487 shortid(int16_t(shortid))
29488 {
29489 do { } while(0);
29490 do { } while(0);
29491 do { } while(0);
29492 }
29493
29494 StackShape(const Shape *shape)
29495 : base(shape->base()->unowned()),
29496 propid(const_cast<Shape *>(shape)->propidRef()),
29497 slot_(shape->slotInfo & Shape::SLOT_MASK),
29498 attrs(shape->attrs),
29499 flags(shape->flags),
29500 shortid(shape->shortid_)
29501 {}
29502
29503 bool hasSlot() const { return (attrs & 0x40) == 0; }
29504 bool hasMissingSlot() const { return maybeSlot() == SHAPE_INVALID_SLOT; }
29505
29506 uint32_t slot() const { do { } while(0); return slot_; }
29507 uint32_t maybeSlot() const { return slot_; }
29508
29509 uint32_t slotSpan() const {
29510 uint32_t free = (((base->clasp)->flags >> 8) & (((uint32_t)1 << (8)) - 1));
29511 return hasMissingSlot() ? free : (maybeSlot() + 1);
29512 }
29513
29514 void setSlot(uint32_t slot) {
29515 do { } while(0);
29516 slot_ = slot;
29517 }
29518
29519 inline HashNumber hash() const;
29520
29521 class AutoRooter : private AutoGCRooter
29522 {
29523 public:
29524 explicit AutoRooter(JSContext *cx, const StackShape *shape_
29525 )
29526 : AutoGCRooter(cx, STACKSHAPE), shape(shape_), skip(cx, shape_)
29527 {
29528 do { } while (0);
29529 }
29530
29531 friend void AutoGCRooter::trace(JSTracer *trc);
29532
29533 private:
29534 const StackShape *shape;
29535 SkipRoot skip;
29536
29537 };
29538 };
29539
29540 }
29541
29542
29543 #define SHAPE_COLLISION (uintptr_t(1))
29544 #define SHAPE_REMOVED ((js::Shape *) SHAPE_COLLISION)
29545
29546
29547 #define SHAPE_IS_FREE(shape) ((shape) == NULL)
29548 #define SHAPE_IS_REMOVED(shape) ((shape) == SHAPE_REMOVED)
29549 #define SHAPE_IS_LIVE(shape) ((shape) > SHAPE_REMOVED)
29550 #define SHAPE_FLAG_COLLISION(spp,shape) (*(spp) = (js::Shape *) (uintptr_t(shape) | SHAPE_COLLISION))
29551
29552 #define SHAPE_HAD_COLLISION(shape) (uintptr_t(shape) & SHAPE_COLLISION)
29553 #define SHAPE_FETCH(spp) SHAPE_CLEAR_COLLISION(*(spp))
29554
29555 #define SHAPE_CLEAR_COLLISION(shape) ((js::Shape *) (uintptr_t(shape) & ~SHAPE_COLLISION))
29556
29557
29558 #define SHAPE_STORE_PRESERVING_COLLISION(spp,shape) (*(spp) = (js::Shape *) (uintptr_t(shape) | SHAPE_HAD_COLLISION(*(spp))))
29559
29560
29561 namespace js {
29562
29563 inline Shape *
29564 Shape::search(JSContext *cx, Shape *start, jsid id, Shape ***pspp, bool adding)
29565 {
29566 if (start->inDictionary()) {
29567 *pspp = start->table().search(id, adding);
29568 return ((js::Shape *) (uintptr_t(*(*pspp)) & ~(uintptr_t(1))));
29569 }
29570
29571 *pspp = __null;
29572
29573 if (start->hasTable()) {
29574 Shape **spp = start->table().search(id, adding);
29575 return ((js::Shape *) (uintptr_t(*(spp)) & ~(uintptr_t(1))));
29576 }
29577
29578 if (start->numLinearSearches() == LINEAR_SEARCHES_MAX) {
29579 if (start->isBigEnoughForAShapeTable()) {
29580 RootedShape startRoot(cx, start);
29581 RootedId idRoot(cx, id);
29582 if (start->hashify(cx)) {
29583 Shape **spp = start->table().search(id, adding);
29584 return ((js::Shape *) (uintptr_t(*(spp)) & ~(uintptr_t(1))));
29585 }
29586 start = startRoot;
29587 id = idRoot;
29588 }
29589
29590
29591
29592
29593 do { } while(0);
29594 } else {
29595 start->incrementNumLinearSearches();
29596 }
29597
29598 for (Shape *shape = start; shape; shape = shape->parent) {
29599 if (shape->propidRef() == id)
29600 return shape;
29601 }
29602
29603 return __null;
29604 }
29605 # 1150 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscope.h"
29606 }
29607
29608
29609
29610
29611
29612
29613 namespace JS {
29614 template<> class AnchorPermitted<js::Shape *> { };
29615 template<> class AnchorPermitted<const js::Shape *> { };
29616 }
29617 # 12 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl.cpp" 2
29618 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobjinlines.h" 1
29619 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobjinlines.h"
29620 #define jsobjinlines_h___
29621
29622
29623
29624
29625 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsarray.h" 1
29626
29627
29628
29629
29630
29631
29632
29633 #define jsarray_h___
29634
29635
29636
29637 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscntxt.h" 1
29638 # 11 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscntxt.h"
29639 #define jscntxt_h___
29640 # 21 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscntxt.h"
29641 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsclist.h" 1
29642
29643
29644
29645
29646
29647
29648 #define jsclist_h___
29649
29650
29651
29652
29653
29654
29655 typedef struct JSCListStr {
29656 struct JSCListStr *next;
29657 struct JSCListStr *prev;
29658 } JSCList;
29659
29660
29661
29662
29663 #define JS_INSERT_BEFORE(_e,_l) JS_BEGIN_MACRO (_e)->next = (_l); (_e)->prev = (_l)->prev; (_l)->prev->next = (_e); (_l)->prev = (_e); JS_END_MACRO
29664 # 33 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsclist.h"
29665 #define JS_INSERT_AFTER(_e,_l) JS_BEGIN_MACRO (_e)->next = (_l)->next; (_e)->prev = (_l); (_l)->next->prev = (_e); (_l)->next = (_e); JS_END_MACRO
29666 # 44 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsclist.h"
29667 #define JS_NEXT_LINK(_e) ((_e)->next)
29668
29669
29670
29671
29672 #define JS_PREV_LINK(_e) ((_e)->prev)
29673
29674
29675
29676
29677
29678 #define JS_APPEND_LINK(_e,_l) JS_INSERT_BEFORE(_e,_l)
29679
29680
29681
29682
29683 #define JS_INSERT_LINK(_e,_l) JS_INSERT_AFTER(_e,_l)
29684
29685
29686 #define JS_LIST_HEAD(_l) (_l)->next
29687 #define JS_LIST_TAIL(_l) (_l)->prev
29688
29689
29690
29691
29692 #define JS_REMOVE_LINK(_e) JS_BEGIN_MACRO (_e)->prev->next = (_e)->next; (_e)->next->prev = (_e)->prev; JS_END_MACRO
29693 # 79 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsclist.h"
29694 #define JS_REMOVE_AND_INIT_LINK(_e) JS_BEGIN_MACRO (_e)->prev->next = (_e)->next; (_e)->next->prev = (_e)->prev; (_e)->next = (_e); (_e)->prev = (_e); JS_END_MACRO
29695 # 91 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsclist.h"
29696 #define JS_CLIST_IS_EMPTY(_l) ((_l)->next == (_l))
29697
29698
29699
29700
29701
29702 #define JS_INIT_CLIST(_l) JS_BEGIN_MACRO (_l)->next = (_l); (_l)->prev = (_l); JS_END_MACRO
29703
29704
29705
29706
29707
29708 #define JS_INIT_STATIC_CLIST(_l) {(_l), (_l)}
29709 # 22 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscntxt.h" 2
29710 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsgc.h" 1
29711
29712
29713
29714
29715
29716
29717
29718 #define jsgc_h___
29719
29720
29721
29722
29723 # 1 "/usr/include/setjmp.h" 1 3 4
29724 # 24 "/usr/include/setjmp.h" 3 4
29725 #define _SETJMP_H 1
29726
29727
29728
29729 extern "C" {
29730
29731 # 1 "/usr/include/bits/setjmp.h" 1 3 4
29732 # 22 "/usr/include/bits/setjmp.h" 3 4
29733 #define _BITS_SETJMP_H 1
29734 # 35 "/usr/include/bits/setjmp.h" 3 4
29735 typedef int __jmp_buf[64] __attribute__((__aligned__ (8)));
29736 # 31 "/usr/include/setjmp.h" 2 3 4
29737 # 1 "/usr/include/bits/sigset.h" 1 3 4
29738 # 32 "/usr/include/setjmp.h" 2 3 4
29739
29740
29741
29742 struct __jmp_buf_tag
29743 {
29744
29745
29746
29747
29748 __jmp_buf __jmpbuf;
29749 int __mask_was_saved;
29750 __sigset_t __saved_mask;
29751 };
29752
29753
29754
29755
29756 typedef struct __jmp_buf_tag jmp_buf[1];
29757
29758
29759
29760 extern int setjmp (jmp_buf __env) throw ();
29761
29762
29763
29764
29765
29766
29767 extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) throw ();
29768
29769
29770
29771
29772 extern int _setjmp (struct __jmp_buf_tag __env[1]) throw ();
29773
29774
29775
29776 #define setjmp(env) _setjmp (env)
29777 # 78 "/usr/include/setjmp.h" 3 4
29778
29779
29780
29781
29782 extern void longjmp (struct __jmp_buf_tag __env[1], int __val)
29783 throw () __attribute__ ((__noreturn__));
29784
29785
29786
29787
29788
29789
29790
29791 extern void _longjmp (struct __jmp_buf_tag __env[1], int __val)
29792 throw () __attribute__ ((__noreturn__));
29793
29794
29795
29796
29797
29798
29799
29800 typedef struct __jmp_buf_tag sigjmp_buf[1];
29801
29802
29803
29804 #define sigsetjmp(env,savemask) __sigsetjmp (env, savemask)
29805
29806
29807
29808
29809
29810 extern void siglongjmp (sigjmp_buf __env, int __val)
29811 throw () __attribute__ ((__noreturn__));
29812
29813
29814
29815
29816
29817 # 1 "/usr/include/bits/setjmp2.h" 1 3 4
29818 # 26 "/usr/include/bits/setjmp2.h" 3 4
29819 extern void longjmp (struct __jmp_buf_tag __env[1], int __val) throw () __asm__ ("" "__longjmp_chk")
29820
29821 __attribute__ ((__noreturn__));
29822 extern void _longjmp (struct __jmp_buf_tag __env[1], int __val) throw () __asm__ ("" "__longjmp_chk")
29823
29824 __attribute__ ((__noreturn__));
29825 extern void siglongjmp (struct __jmp_buf_tag __env[1], int __val) throw () __asm__ ("" "__longjmp_chk")
29826
29827 __attribute__ ((__noreturn__));
29828 # 118 "/usr/include/setjmp.h" 2 3 4
29829
29830
29831 }
29832 # 14 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsgc.h" 2
29833 # 23 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsgc.h"
29834 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsversion.h" 1
29835 # 42 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsversion.h"
29836 #define JS_VERSION_ECMA_3 148
29837 #define JS_VERSION_ECMA_3_TEST 149
29838 # 124 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsversion.h"
29839 #define JS_HAS_STR_HTML_HELPERS 1
29840 #define JS_HAS_OBJ_PROTO_PROP 1
29841 #define JS_HAS_OBJ_WATCHPOINT 1
29842 #define JS_HAS_TOSOURCE 1
29843 #define JS_HAS_CATCH_GUARD 1
29844 #define JS_HAS_UNEVAL 1
29845 #define JS_HAS_CONST 1
29846 #define JS_HAS_FUN_EXPR_STMT 1
29847 #define JS_HAS_NO_SUCH_METHOD 1
29848 #define JS_HAS_GENERATORS 1
29849 #define JS_HAS_BLOCK_SCOPE 1
29850 #define JS_HAS_DESTRUCTURING 2
29851 #define JS_HAS_GENERATOR_EXPRS 1
29852 #define JS_HAS_EXPR_CLOSURES 1
29853 # 146 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsversion.h"
29854 #define JS_HAS_NEW_GLOBAL_OBJECT 1
29855
29856
29857 #define JS_HAS_MAKE_SYSTEM_OBJECT 1
29858
29859
29860 #define JS_HAS_DESTRUCTURING_SHORTHAND (JS_HAS_DESTRUCTURING == 2)
29861
29862
29863
29864
29865
29866 #define OLD_GETTER_SETTER_METHODS 1
29867
29868
29869 #define USE_NEW_OBJECT_REPRESENTATION 0
29870
29871
29872
29873
29874 #define NEW_OBJECT_REPRESENTATION_ONLY() MOZ_NOT_REACHED("don't call this! to be used in the new object representation")
29875 # 24 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsgc.h" 2
29876
29877 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/ds/BitArray.h" 1
29878 # 26 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsgc.h" 2
29879
29880 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Statistics.h" 1
29881 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Statistics.h"
29882 #define jsgc_statistics_h___
29883
29884
29885
29886
29887
29888
29889
29890 struct JSCompartment;
29891
29892 namespace js {
29893 namespace gcstats {
29894
29895 enum Phase {
29896 PHASE_GC_BEGIN,
29897 PHASE_WAIT_BACKGROUND_THREAD,
29898 PHASE_PURGE,
29899 PHASE_MARK,
29900 PHASE_MARK_DISCARD_CODE,
29901 PHASE_MARK_ROOTS,
29902 PHASE_MARK_TYPES,
29903 PHASE_MARK_DELAYED,
29904 PHASE_MARK_WEAK,
29905 PHASE_MARK_GRAY,
29906 PHASE_MARK_GRAY_WEAK,
29907 PHASE_FINALIZE_START,
29908 PHASE_SWEEP,
29909 PHASE_SWEEP_ATOMS,
29910 PHASE_SWEEP_COMPARTMENTS,
29911 PHASE_SWEEP_TABLES,
29912 PHASE_SWEEP_OBJECT,
29913 PHASE_SWEEP_STRING,
29914 PHASE_SWEEP_SCRIPT,
29915 PHASE_SWEEP_SHAPE,
29916 PHASE_SWEEP_DISCARD_CODE,
29917 PHASE_DISCARD_ANALYSIS,
29918 PHASE_DISCARD_TI,
29919 PHASE_FREE_TI_ARENA,
29920 PHASE_SWEEP_TYPES,
29921 PHASE_CLEAR_SCRIPT_ANALYSIS,
29922 PHASE_FINALIZE_END,
29923 PHASE_DESTROY,
29924 PHASE_GC_END,
29925
29926 PHASE_LIMIT
29927 };
29928
29929 enum Stat {
29930 STAT_NEW_CHUNK,
29931 STAT_DESTROY_CHUNK,
29932
29933 STAT_LIMIT
29934 };
29935
29936 class StatisticsSerializer;
29937
29938 struct Statistics {
29939 Statistics(JSRuntime *rt);
29940 ~Statistics();
29941
29942 void beginPhase(Phase phase);
29943 void endPhase(Phase phase);
29944
29945 void beginSlice(int collectedCount, int compartmentCount, gcreason::Reason reason);
29946 void endSlice();
29947
29948 void reset(const char *reason) { slices.back().resetReason = reason; }
29949 void nonincremental(const char *reason) { nonincrementalReason = reason; }
29950
29951 void count(Stat s) {
29952 do { } while(0);
29953 counts[s]++;
29954 }
29955
29956 jschar *formatMessage();
29957 jschar *formatJSON(uint64_t timestamp);
29958
29959 private:
29960 JSRuntime *runtime;
29961
29962 int64_t startupTime;
29963
29964 FILE *fp;
29965 bool fullFormat;
29966
29967
29968
29969
29970
29971 int gcDepth;
29972
29973 int collectedCount;
29974 int compartmentCount;
29975 const char *nonincrementalReason;
29976
29977 struct SliceData {
29978 SliceData(gcreason::Reason reason, int64_t start, size_t startFaults)
29979 : reason(reason), resetReason(__null), start(start), startFaults(startFaults)
29980 {
29981 PodArrayZero(phaseTimes);
29982 }
29983
29984 gcreason::Reason reason;
29985 const char *resetReason;
29986 int64_t start, end;
29987 size_t startFaults, endFaults;
29988 int64_t phaseTimes[PHASE_LIMIT];
29989
29990 int64_t duration() const { return end - start; }
29991 };
29992
29993 Vector<SliceData, 8, SystemAllocPolicy> slices;
29994
29995
29996 int64_t phaseStartTimes[PHASE_LIMIT];
29997
29998
29999 int64_t phaseTimes[PHASE_LIMIT];
30000
30001
30002 int64_t phaseTotals[PHASE_LIMIT];
30003
30004
30005 unsigned int counts[STAT_LIMIT];
30006
30007
30008 size_t preBytes;
30009
30010 void beginGC();
30011 void endGC();
30012
30013 int64_t gcDuration();
30014 void printStats();
30015 bool formatData(StatisticsSerializer &ss, uint64_t timestamp);
30016
30017 double computeMMU(int64_t resolution);
30018 };
30019
30020 struct AutoGCSlice {
30021 AutoGCSlice(Statistics &stats, int collectedCount, int compartmentCount, gcreason::Reason reason
30022 )
30023 : stats(stats)
30024 {
30025 do { } while (0);
30026 stats.beginSlice(collectedCount, compartmentCount, reason);
30027 }
30028 ~AutoGCSlice() { stats.endSlice(); }
30029
30030 Statistics &stats;
30031
30032 };
30033
30034 struct AutoPhase {
30035 AutoPhase(Statistics &stats, Phase phase )
30036 : stats(stats), phase(phase) { do { } while (0); stats.beginPhase(phase); }
30037 ~AutoPhase() { stats.endPhase(phase); }
30038
30039 Statistics &stats;
30040 Phase phase;
30041
30042 };
30043
30044 }
30045 }
30046 # 28 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsgc.h" 2
30047
30048
30049
30050
30051 struct JSCompartment;
30052
30053
30054
30055
30056 #define JS_CHECK_STACK_SIZE(limit,lval) ((uintptr_t)(lval) > limit)
30057
30058
30059 namespace js {
30060
30061 class GCHelperThread;
30062 struct Shape;
30063
30064 namespace gc {
30065
30066 enum State {
30067 NO_INCREMENTAL,
30068 MARK_ROOTS,
30069 MARK,
30070 INVALID
30071 };
30072
30073 class ChunkPool {
30074 Chunk *emptyChunkListHead;
30075 size_t emptyCount;
30076
30077 public:
30078 ChunkPool()
30079 : emptyChunkListHead(__null),
30080 emptyCount(0) { }
30081
30082 size_t getEmptyCount() const {
30083 return emptyCount;
30084 }
30085
30086 inline bool wantBackgroundAllocation(JSRuntime *rt) const;
30087
30088
30089 inline Chunk *get(JSRuntime *rt);
30090
30091
30092 inline void put(Chunk *chunk);
30093
30094
30095
30096
30097
30098 Chunk *expire(JSRuntime *rt, bool releaseAll);
30099
30100
30101 void expireAndFree(JSRuntime *rt, bool releaseAll);
30102
30103
30104 __attribute__((visibility("default"))) int64_t countCleanDecommittedArenas(JSRuntime *rt);
30105 };
30106
30107 static inline JSGCTraceKind
30108 MapAllocToTraceKind(AllocKind thingKind)
30109 {
30110 static const JSGCTraceKind map[FINALIZE_LIMIT] = {
30111 JSTRACE_OBJECT,
30112 JSTRACE_OBJECT,
30113 JSTRACE_OBJECT,
30114 JSTRACE_OBJECT,
30115 JSTRACE_OBJECT,
30116 JSTRACE_OBJECT,
30117 JSTRACE_OBJECT,
30118 JSTRACE_OBJECT,
30119 JSTRACE_OBJECT,
30120 JSTRACE_OBJECT,
30121 JSTRACE_OBJECT,
30122 JSTRACE_OBJECT,
30123 JSTRACE_SCRIPT,
30124 JSTRACE_SHAPE,
30125 JSTRACE_BASE_SHAPE,
30126 JSTRACE_TYPE_OBJECT,
30127
30128 JSTRACE_XML,
30129
30130 JSTRACE_STRING,
30131 JSTRACE_STRING,
30132 JSTRACE_STRING,
30133 };
30134 return map[thingKind];
30135 }
30136
30137 inline JSGCTraceKind
30138 GetGCThingTraceKind(const void *thing);
30139
30140 struct ArenaLists {
30141 # 134 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsgc.h"
30142 struct ArenaList {
30143 ArenaHeader *head;
30144 ArenaHeader **cursor;
30145
30146 ArenaList() {
30147 clear();
30148 }
30149
30150 void clear() {
30151 head = __null;
30152 cursor = &head;
30153 }
30154 };
30155
30156 private:
30157 # 158 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsgc.h"
30158 FreeSpan freeLists[FINALIZE_LIMIT];
30159
30160 ArenaList arenaLists[FINALIZE_LIMIT];
30161 # 179 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsgc.h"
30162 enum BackgroundFinalizeState {
30163 BFS_DONE,
30164 BFS_RUN,
30165 BFS_JUST_FINISHED
30166 };
30167
30168 volatile uintptr_t backgroundFinalizeState[FINALIZE_LIMIT];
30169
30170
30171 public:
30172 ArenaLists() {
30173 for (size_t i = 0; i != FINALIZE_LIMIT; ++i)
30174 freeLists[i].initAsEmpty();
30175
30176 for (size_t i = 0; i != FINALIZE_LIMIT; ++i)
30177 backgroundFinalizeState[i] = BFS_DONE;
30178
30179 }
30180
30181 ~ArenaLists() {
30182 for (size_t i = 0; i != FINALIZE_LIMIT; ++i) {
30183
30184
30185
30186
30187
30188 do { } while(0);
30189
30190 ArenaHeader **headp = &arenaLists[i].head;
30191 while (ArenaHeader *aheader = *headp) {
30192 *headp = aheader->next;
30193 aheader->chunk()->releaseArena(aheader);
30194 }
30195 }
30196 }
30197
30198 const FreeSpan *getFreeList(AllocKind thingKind) const {
30199 return &freeLists[thingKind];
30200 }
30201
30202 ArenaHeader *getFirstArena(AllocKind thingKind) const {
30203 return arenaLists[thingKind].head;
30204 }
30205
30206 bool arenaListsAreEmpty() const {
30207 for (size_t i = 0; i != FINALIZE_LIMIT; ++i) {
30208
30209
30210
30211
30212
30213 if (backgroundFinalizeState[i] != BFS_DONE)
30214 return false;
30215
30216 if (arenaLists[i].head)
30217 return false;
30218 }
30219 return true;
30220 }
30221 # 257 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsgc.h"
30222 bool doneBackgroundFinalize(AllocKind kind) const {
30223 return backgroundFinalizeState[kind] == BFS_DONE;
30224 }
30225
30226
30227
30228
30229
30230
30231 void purge() {
30232 for (size_t i = 0; i != FINALIZE_LIMIT; ++i) {
30233 FreeSpan *headSpan = &freeLists[i];
30234 if (!headSpan->isEmpty()) {
30235 ArenaHeader *aheader = headSpan->arenaHeader();
30236 aheader->setFirstFreeSpan(headSpan);
30237 headSpan->initAsEmpty();
30238 }
30239 }
30240 }
30241
30242 inline void prepareForIncrementalGC(JSRuntime *rt);
30243
30244
30245
30246
30247
30248
30249 void copyFreeListsToArenas() {
30250 for (size_t i = 0; i != FINALIZE_LIMIT; ++i)
30251 copyFreeListToArena(AllocKind(i));
30252 }
30253
30254 void copyFreeListToArena(AllocKind thingKind) {
30255 FreeSpan *headSpan = &freeLists[thingKind];
30256 if (!headSpan->isEmpty()) {
30257 ArenaHeader *aheader = headSpan->arenaHeader();
30258 do { } while(0);
30259 aheader->setFirstFreeSpan(headSpan);
30260 }
30261 }
30262
30263
30264
30265
30266
30267 void clearFreeListsInArenas() {
30268 for (size_t i = 0; i != FINALIZE_LIMIT; ++i)
30269 clearFreeListInArena(AllocKind(i));
30270 }
30271
30272
30273 void clearFreeListInArena(AllocKind kind) {
30274 FreeSpan *headSpan = &freeLists[kind];
30275 if (!headSpan->isEmpty()) {
30276 ArenaHeader *aheader = headSpan->arenaHeader();
30277 do { } while(0);
30278 aheader->setAsFullyUsed();
30279 }
30280 }
30281
30282
30283
30284
30285
30286 bool isSynchronizedFreeList(AllocKind kind) {
30287 FreeSpan *headSpan = &freeLists[kind];
30288 if (headSpan->isEmpty())
30289 return true;
30290 ArenaHeader *aheader = headSpan->arenaHeader();
30291 if (aheader->hasFreeThings()) {
30292
30293
30294
30295
30296 do { } while(0);
30297 return true;
30298 }
30299 return false;
30300 }
30301
30302 __attribute__((always_inline)) inline void *allocateFromFreeList(AllocKind thingKind, size_t thingSize) {
30303 return freeLists[thingKind].allocate(thingSize);
30304 }
30305
30306 static void *refillFreeList(JSContext *cx, AllocKind thingKind);
30307
30308 void checkEmptyFreeLists() {
30309
30310
30311
30312
30313 }
30314
30315 void checkEmptyFreeList(AllocKind kind) {
30316 do { } while(0);
30317 }
30318
30319 void finalizeObjects(FreeOp *fop);
30320 void finalizeStrings(FreeOp *fop);
30321 void finalizeShapes(FreeOp *fop);
30322 void finalizeScripts(FreeOp *fop);
30323
30324
30325 static void backgroundFinalize(FreeOp *fop, ArenaHeader *listHead);
30326
30327
30328 private:
30329 inline void finalizeNow(FreeOp *fop, AllocKind thingKind);
30330 inline void finalizeLater(FreeOp *fop, AllocKind thingKind);
30331
30332 inline void *allocateFromArena(JSCompartment *comp, AllocKind thingKind);
30333 };
30334
30335
30336
30337
30338
30339
30340 const size_t INITIAL_CHUNK_CAPACITY = 16 * 1024 * 1024 / ChunkSize;
30341
30342
30343 const size_t MAX_EMPTY_CHUNK_AGE = 4;
30344
30345 inline Cell *
30346 AsCell(JSObject *obj)
30347 {
30348 return reinterpret_cast<Cell *>(obj);
30349 }
30350
30351 }
30352
30353 struct GCPtrHasher
30354 {
30355 typedef void *Lookup;
30356
30357 static HashNumber hash(void *key) {
30358 return HashNumber(uintptr_t(key) >> JS_GCTHING_ZEROBITS);
30359 }
30360
30361 static bool match(void *l, void *k) { return l == k; }
30362 };
30363
30364 typedef HashMap<void *, uint32_t, GCPtrHasher, SystemAllocPolicy> GCLocks;
30365
30366 struct RootInfo {
30367 RootInfo() {}
30368 RootInfo(const char *name, JSGCRootType type) : name(name), type(type) {}
30369 const char *name;
30370 JSGCRootType type;
30371 };
30372
30373 typedef js::HashMap<void *,
30374 RootInfo,
30375 js::DefaultHasher<void *>,
30376 js::SystemAllocPolicy> RootedValueMap;
30377
30378 }
30379
30380 extern __attribute__((visibility("default"))) JSGCTraceKind
30381 js_GetGCThingTraceKind(void *thing);
30382
30383 extern JSBool
30384 js_InitGC(JSRuntime *rt, uint32_t maxbytes);
30385
30386 extern void
30387 js_FinishGC(JSRuntime *rt);
30388
30389 extern JSBool
30390 js_AddRoot(JSContext *cx, js::Value *vp, const char *name);
30391
30392 extern JSBool
30393 js_AddGCThingRoot(JSContext *cx, void **rp, const char *name);
30394 # 437 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsgc.h"
30395 extern uint32_t
30396 js_MapGCRoots(JSRuntime *rt, JSGCRootMapFun map, void *data);
30397
30398
30399 typedef struct JSPtrTable {
30400 size_t count;
30401 void **array;
30402 } JSPtrTable;
30403
30404 extern JSBool
30405 js_LockGCThingRT(JSRuntime *rt, void *thing);
30406
30407 extern void
30408 js_UnlockGCThingRT(JSRuntime *rt, void *thing);
30409
30410 extern bool
30411 js_IsAddressableGCThing(JSRuntime *rt, uintptr_t w, js::gc::AllocKind *thingKind, void **thing);
30412
30413 namespace js {
30414
30415 extern void
30416 MarkCompartmentActive(js::StackFrame *fp);
30417
30418 extern void
30419 TraceRuntime(JSTracer *trc);
30420
30421 extern __attribute__((visibility("default"))) void
30422 MarkContext(JSTracer *trc, JSContext *acx);
30423
30424
30425 extern void
30426 TriggerGC(JSRuntime *rt, js::gcreason::Reason reason);
30427
30428
30429 extern void
30430 TriggerCompartmentGC(JSCompartment *comp, js::gcreason::Reason reason);
30431
30432 extern void
30433 MaybeGC(JSContext *cx);
30434
30435 extern void
30436 ShrinkGCBuffers(JSRuntime *rt);
30437
30438 extern __attribute__((visibility("default"))) void
30439 PrepareForFullGC(JSRuntime *rt);
30440
30441
30442
30443
30444 typedef enum JSGCInvocationKind {
30445
30446 GC_NORMAL = 0,
30447
30448
30449 GC_SHRINK = 1
30450 } JSGCInvocationKind;
30451
30452 extern void
30453 GC(JSRuntime *rt, JSGCInvocationKind gckind, js::gcreason::Reason reason);
30454
30455 extern void
30456 GCSlice(JSRuntime *rt, JSGCInvocationKind gckind, js::gcreason::Reason reason);
30457
30458 extern void
30459 GCDebugSlice(JSRuntime *rt, bool limit, int64_t objCount);
30460
30461 extern void
30462 PrepareForDebugGC(JSRuntime *rt);
30463
30464 }
30465
30466 namespace js {
30467
30468 void
30469 InitTracer(JSTracer *trc, JSRuntime *rt, JSTraceCallback callback);
30470
30471
30472
30473 class GCHelperThread {
30474 enum State {
30475 IDLE,
30476 SWEEPING,
30477 ALLOCATING,
30478 CANCEL_ALLOCATION,
30479 SHUTDOWN
30480 };
30481 # 534 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsgc.h"
30482 static const size_t FREE_ARRAY_SIZE = size_t(1) << 16;
30483 static const size_t FREE_ARRAY_LENGTH = FREE_ARRAY_SIZE / sizeof(void *);
30484
30485 JSRuntime *const rt;
30486 PRThread *thread;
30487 PRCondVar *wakeup;
30488 PRCondVar *done;
30489 volatile State state;
30490
30491 bool sweepFlag;
30492 bool shrinkFlag;
30493
30494 Vector<void **, 16, js::SystemAllocPolicy> freeVector;
30495 void **freeCursor;
30496 void **freeCursorEnd;
30497
30498 Vector<js::gc::ArenaHeader *, 64, js::SystemAllocPolicy> finalizeVector;
30499
30500 bool backgroundAllocation;
30501
30502 friend struct js::gc::ArenaLists;
30503
30504 __attribute__((visibility("default"))) void
30505 replenishAndFreeLater(void *ptr);
30506
30507 static void freeElementsAndArray(void **array, void **end) {
30508 do { } while(0);
30509 for (void **p = array; p != end; ++p)
30510 js::Foreground::free_(*p);
30511 js::Foreground::free_(array);
30512 }
30513
30514 static void threadMain(void* arg);
30515 void threadLoop();
30516
30517
30518 void doSweep();
30519
30520 public:
30521 GCHelperThread(JSRuntime *rt)
30522 : rt(rt),
30523 thread(__null),
30524 wakeup(__null),
30525 done(__null),
30526 state(IDLE),
30527 sweepFlag(false),
30528 shrinkFlag(false),
30529 freeCursor(__null),
30530 freeCursorEnd(__null),
30531 backgroundAllocation(true)
30532 { }
30533
30534 bool init();
30535 void finish();
30536
30537
30538 void startBackgroundSweep(bool shouldShrink);
30539
30540
30541 void startBackgroundShrink();
30542
30543
30544 void waitBackgroundSweepEnd();
30545
30546
30547 void waitBackgroundSweepOrAllocEnd();
30548
30549
30550 inline void startBackgroundAllocationIfIdle();
30551
30552 bool canBackgroundAllocate() const {
30553 return backgroundAllocation;
30554 }
30555
30556 void disableBackgroundAllocation() {
30557 backgroundAllocation = false;
30558 }
30559
30560 PRThread *getThread() const {
30561 return thread;
30562 }
30563
30564
30565
30566
30567
30568 bool sweeping() const {
30569 return state == SWEEPING;
30570 }
30571
30572 bool shouldShrink() const {
30573 do { } while(0);
30574 return shrinkFlag;
30575 }
30576
30577 void freeLater(void *ptr) {
30578 do { } while(0);
30579 if (freeCursor != freeCursorEnd)
30580 *freeCursor++ = ptr;
30581 else
30582 replenishAndFreeLater(ptr);
30583 }
30584
30585
30586 bool prepareForBackgroundSweep();
30587 };
30588
30589
30590
30591 struct GCChunkHasher {
30592 typedef gc::Chunk *Lookup;
30593
30594
30595
30596
30597
30598 static HashNumber hash(gc::Chunk *chunk) {
30599 do { } while(0);
30600 return HashNumber(uintptr_t(chunk) >> gc::ChunkShift);
30601 }
30602
30603 static bool match(gc::Chunk *k, gc::Chunk *l) {
30604 do { } while(0);
30605 do { } while(0);
30606 return k == l;
30607 }
30608 };
30609
30610 typedef HashSet<js::gc::Chunk *, GCChunkHasher, SystemAllocPolicy> GCChunkSet;
30611
30612 template<class T>
30613 struct MarkStack {
30614 T *stack;
30615 T *tos;
30616 T *limit;
30617
30618 T *ballast;
30619 T *ballastLimit;
30620
30621 size_t sizeLimit;
30622
30623 MarkStack(size_t sizeLimit)
30624 : stack(__null),
30625 tos(__null),
30626 limit(__null),
30627 ballast(__null),
30628 ballastLimit(__null),
30629 sizeLimit(sizeLimit) { }
30630
30631 ~MarkStack() {
30632 if (stack != ballast)
30633 js_free(stack);
30634 js_free(ballast);
30635 }
30636
30637 bool init(size_t ballastcap) {
30638 do { } while(0);
30639
30640 if (ballastcap == 0)
30641 return true;
30642
30643 ballast = (T *)js_malloc(sizeof(T) * ballastcap);
30644 if (!ballast)
30645 return false;
30646 ballastLimit = ballast + ballastcap;
30647 initFromBallast();
30648 return true;
30649 }
30650
30651 void initFromBallast() {
30652 stack = ballast;
30653 limit = ballastLimit;
30654 if (size_t(limit - stack) > sizeLimit)
30655 limit = stack + sizeLimit;
30656 tos = stack;
30657 }
30658
30659 void setSizeLimit(size_t size) {
30660 do { } while(0);
30661
30662 sizeLimit = size;
30663 reset();
30664 }
30665
30666 bool push(T item) {
30667 if (tos == limit) {
30668 if (!enlarge())
30669 return false;
30670 }
30671 do { } while(0);
30672 *tos++ = item;
30673 return true;
30674 }
30675
30676 bool push(T item1, T item2, T item3) {
30677 T *nextTos = tos + 3;
30678 if (nextTos > limit) {
30679 if (!enlarge())
30680 return false;
30681 nextTos = tos + 3;
30682 }
30683 do { } while(0);
30684 tos[0] = item1;
30685 tos[1] = item2;
30686 tos[2] = item3;
30687 tos = nextTos;
30688 return true;
30689 }
30690
30691 bool isEmpty() const {
30692 return tos == stack;
30693 }
30694
30695 T pop() {
30696 do { } while(0);
30697 return *--tos;
30698 }
30699
30700 ptrdiff_t position() const {
30701 return tos - stack;
30702 }
30703
30704 void reset() {
30705 if (stack != ballast)
30706 js_free(stack);
30707 initFromBallast();
30708 do { } while(0);
30709 }
30710
30711 bool enlarge() {
30712 size_t tosIndex = tos - stack;
30713 size_t cap = limit - stack;
30714 if (cap == sizeLimit)
30715 return false;
30716 size_t newcap = cap * 2;
30717 if (newcap == 0)
30718 newcap = 32;
30719 if (newcap > sizeLimit)
30720 newcap = sizeLimit;
30721
30722 T *newStack;
30723 if (stack == ballast) {
30724 newStack = (T *)js_malloc(sizeof(T) * newcap);
30725 if (!newStack)
30726 return false;
30727 for (T *src = stack, *dst = newStack; src < tos; )
30728 *dst++ = *src++;
30729 } else {
30730 newStack = (T *)js_realloc(stack, sizeof(T) * newcap);
30731 if (!newStack)
30732 return false;
30733 }
30734 stack = newStack;
30735 tos = stack + tosIndex;
30736 limit = newStack + newcap;
30737 return true;
30738 }
30739
30740 size_t sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf) const {
30741 size_t n = 0;
30742 if (stack != ballast)
30743 n += mallocSizeOf(stack);
30744 n += mallocSizeOf(ballast);
30745 return n;
30746 }
30747 };
30748
30749
30750
30751
30752
30753
30754
30755 struct SliceBudget {
30756 int64_t deadline;
30757 intptr_t counter;
30758
30759 static const intptr_t CounterReset = 1000;
30760
30761 static const int64_t Unlimited = 0;
30762 static int64_t TimeBudget(int64_t millis);
30763 static int64_t WorkBudget(int64_t work);
30764
30765
30766 SliceBudget();
30767
30768
30769 SliceBudget(int64_t budget);
30770
30771 void reset() {
30772 deadline = (9223372036854775807LL);
30773 counter = (2147483647);
30774 }
30775
30776 void step(intptr_t amt = 1) {
30777 counter -= amt;
30778 }
30779
30780 bool checkOverBudget();
30781
30782 bool isOverBudget() {
30783 if (counter >= 0)
30784 return false;
30785 return checkOverBudget();
30786 }
30787 };
30788
30789 static const size_t MARK_STACK_LENGTH = 32768;
30790
30791 struct GCMarker : public JSTracer {
30792 private:
30793
30794
30795
30796
30797
30798 enum StackTag {
30799 ValueArrayTag,
30800 ObjectTag,
30801 TypeTag,
30802 XmlTag,
30803 ArenaTag,
30804 SavedValueArrayTag,
30805 LastTag = SavedValueArrayTag
30806 };
30807
30808 static const uintptr_t StackTagMask = 7;
30809
30810 static void staticAsserts() {
30811 typedef int moz_static_assert85[(StackTagMask >= uintptr_t(LastTag)) ? 1 : -1];
30812 typedef int moz_static_assert86[(StackTagMask <= gc::Cell::CellMask) ? 1 : -1];
30813 }
30814
30815 public:
30816 explicit GCMarker();
30817 bool init();
30818
30819 void setSizeLimit(size_t size) { stack.setSizeLimit(size); }
30820 size_t sizeLimit() const { return stack.sizeLimit; }
30821
30822 void start(JSRuntime *rt);
30823 void stop();
30824 void reset();
30825
30826 void pushObject(JSObject *obj) {
30827 pushTaggedPtr(ObjectTag, obj);
30828 }
30829
30830 void pushArenaList(gc::ArenaHeader *firstArena) {
30831 pushTaggedPtr(ArenaTag, firstArena);
30832 }
30833
30834 void pushType(types::TypeObject *type) {
30835 pushTaggedPtr(TypeTag, type);
30836 }
30837
30838
30839 void pushXML(JSXML *xml) {
30840 pushTaggedPtr(XmlTag, xml);
30841 }
30842
30843
30844 uint32_t getMarkColor() const {
30845 return color;
30846 }
30847 # 908 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsgc.h"
30848 void setMarkColorGray() {
30849 do { } while(0);
30850 do { } while(0);
30851 color = gc::GRAY;
30852 }
30853
30854 inline void delayMarkingArena(gc::ArenaHeader *aheader);
30855 void delayMarkingChildren(const void *thing);
30856 void markDelayedChildren(gc::ArenaHeader *aheader);
30857 bool markDelayedChildren(SliceBudget &budget);
30858 bool hasDelayedChildren() const {
30859 return !!unmarkedArenaStackTop;
30860 }
30861
30862 bool isDrained() {
30863 return isMarkStackEmpty() && !unmarkedArenaStackTop;
30864 }
30865
30866 bool drainMarkStack(SliceBudget &budget);
30867 # 936 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsgc.h"
30868 bool hasBufferedGrayRoots() const;
30869 void startBufferingGrayRoots();
30870 void endBufferingGrayRoots();
30871 void markBufferedGrayRoots();
30872
30873 static void GrayCallback(JSTracer *trc, void **thing, JSGCTraceKind kind);
30874
30875 size_t sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf) const;
30876
30877 MarkStack<uintptr_t> stack;
30878
30879 private:
30880
30881
30882
30883 void checkCompartment(void *p) {}
30884
30885
30886 void pushTaggedPtr(StackTag tag, void *ptr) {
30887 checkCompartment(ptr);
30888 uintptr_t addr = reinterpret_cast<uintptr_t>(ptr);
30889 do { } while(0);
30890 if (!stack.push(addr | uintptr_t(tag)))
30891 delayMarkingChildren(ptr);
30892 }
30893
30894 void pushValueArray(JSObject *obj, void *start, void *end) {
30895 checkCompartment(obj);
30896
30897 do { } while(0);
30898 uintptr_t tagged = reinterpret_cast<uintptr_t>(obj) | GCMarker::ValueArrayTag;
30899 uintptr_t startAddr = reinterpret_cast<uintptr_t>(start);
30900 uintptr_t endAddr = reinterpret_cast<uintptr_t>(end);
30901
30902
30903
30904
30905
30906 if (!stack.push(endAddr, startAddr, tagged))
30907 delayMarkingChildren(obj);
30908 }
30909
30910 bool isMarkStackEmpty() {
30911 return stack.isEmpty();
30912 }
30913
30914 bool restoreValueArray(JSObject *obj, void **vpp, void **endp);
30915 void saveValueRanges();
30916 inline void processMarkStackTop(SliceBudget &budget);
30917 void processMarkStackOther(SliceBudget &budget, uintptr_t tag, uintptr_t addr);
30918
30919 void appendGrayRoot(void *thing, JSGCTraceKind kind);
30920
30921
30922 uint32_t color;
30923
30924 DebugOnly<bool> started;
30925
30926
30927 js::gc::ArenaHeader *unmarkedArenaStackTop;
30928
30929 DebugOnly<size_t> markLaterArenas;
30930
30931 struct GrayRoot {
30932 void *thing;
30933 JSGCTraceKind kind;
30934
30935
30936
30937
30938
30939
30940 GrayRoot(void *thing, JSGCTraceKind kind)
30941 : thing(thing), kind(kind) {}
30942 };
30943
30944 bool grayFailed;
30945 Vector<GrayRoot, 0, SystemAllocPolicy> grayRoots;
30946 };
30947
30948 void
30949 SetMarkStackLimit(JSRuntime *rt, size_t limit);
30950
30951 void
30952 MarkStackRangeConservatively(JSTracer *trc, Value *begin, Value *end);
30953
30954 typedef void (*IterateChunkCallback)(JSRuntime *rt, void *data, gc::Chunk *chunk);
30955 typedef void (*IterateArenaCallback)(JSRuntime *rt, void *data, gc::Arena *arena,
30956 JSGCTraceKind traceKind, size_t thingSize);
30957 typedef void (*IterateCellCallback)(JSRuntime *rt, void *data, void *thing,
30958 JSGCTraceKind traceKind, size_t thingSize);
30959
30960
30961
30962
30963
30964
30965 extern __attribute__((visibility("default"))) void
30966 IterateCompartmentsArenasCells(JSRuntime *rt, void *data,
30967 JSIterateCompartmentCallback compartmentCallback,
30968 IterateArenaCallback arenaCallback,
30969 IterateCellCallback cellCallback);
30970
30971
30972
30973
30974 extern __attribute__((visibility("default"))) void
30975 IterateChunks(JSRuntime *rt, void *data, IterateChunkCallback chunkCallback);
30976
30977
30978
30979
30980
30981 extern __attribute__((visibility("default"))) void
30982 IterateCells(JSRuntime *rt, JSCompartment *compartment, gc::AllocKind thingKind,
30983 void *data, IterateCellCallback cellCallback);
30984
30985 }
30986
30987 extern void
30988 js_FinalizeStringRT(JSRuntime *rt, JSString *str);
30989
30990
30991
30992
30993 #define IS_GC_MARKING_TRACER(trc) ((trc)->callback == NULL || (trc)->callback == GCMarker::GrayCallback)
30994
30995
30996 namespace js {
30997 namespace gc {
30998
30999 JSCompartment *
31000 NewCompartment(JSContext *cx, JSPrincipals *principals);
31001
31002
31003 void
31004 RunDebugGC(JSContext *cx);
31005
31006 void
31007 SetDeterministicGC(JSContext *cx, bool enabled);
31008
31009 const int ZealPokeValue = 1;
31010 const int ZealAllocValue = 2;
31011 const int ZealFrameGCValue = 3;
31012 const int ZealVerifierValue = 4;
31013 const int ZealFrameVerifierValue = 5;
31014 # 1094 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsgc.h"
31015 static inline void
31016 VerifyBarriers(JSRuntime *rt)
31017 {
31018 }
31019
31020 static inline void
31021 MaybeVerifyBarriers(JSContext *cx, bool always = false)
31022 {
31023 }
31024
31025
31026
31027 }
31028
31029 static inline JSCompartment *
31030 GetObjectCompartment(JSObject *obj) { return reinterpret_cast<js::gc::Cell *>(obj)->compartment(); }
31031
31032 }
31033 # 23 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscntxt.h" 2
31034 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jspropertycache.h" 1
31035 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jspropertycache.h"
31036 #define jspropertycache_h___
31037
31038
31039
31040
31041
31042
31043
31044 namespace js {
31045
31046
31047
31048
31049
31050
31051 class PropertyCache;
31052
31053 struct PropertyCacheEntry
31054 {
31055 jsbytecode *kpc;
31056 const Shape *kshape;
31057 const Shape *pshape;
31058 const Shape *prop;
31059
31060 friend class PropertyCache;
31061
31062 private:
31063
31064 uint8_t scopeIndex;
31065
31066 uint8_t protoIndex;
31067
31068 public:
31069 static const size_t MaxScopeIndex = 15;
31070 static const size_t MaxProtoIndex = 15;
31071 # 53 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jspropertycache.h"
31072 bool isOwnPropertyHit() const { return scopeIndex == 0 && protoIndex == 0; }
31073 # 63 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jspropertycache.h"
31074 bool isPrototypePropertyHit() const { return scopeIndex == 0 && protoIndex == 1; }
31075
31076 void assign(jsbytecode *kpc, const Shape *kshape, const Shape *pshape,
31077 const Shape *prop, unsigned scopeIndex, unsigned protoIndex) {
31078 do { } while(0);
31079 do { } while(0);
31080
31081 this->kpc = kpc;
31082 this->kshape = kshape;
31083 this->pshape = pshape;
31084 this->prop = prop;
31085 this->scopeIndex = uint8_t(scopeIndex);
31086 this->protoIndex = uint8_t(protoIndex);
31087 }
31088 };
31089
31090
31091
31092
31093
31094 #define JS_NO_PROP_CACHE_FILL ((js::PropertyCacheEntry *) NULL + 1)
31095
31096
31097
31098
31099
31100 class PropertyCache
31101 {
31102 private:
31103 enum {
31104 SIZE_LOG2 = 12,
31105 SIZE = ((uint32_t)1 << (SIZE_LOG2)),
31106 MASK = (((uint32_t)1 << (SIZE_LOG2)) - 1)
31107 };
31108
31109 PropertyCacheEntry table[SIZE];
31110 JSBool empty;
31111
31112 public:
31113 # 136 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jspropertycache.h"
31114 #define PCMETER(x) ((void)0)
31115
31116
31117 PropertyCache() {
31118 PodZero(this);
31119 }
31120
31121 private:
31122 static inline uintptr_t
31123 hash(jsbytecode *pc, const Shape *kshape)
31124 {
31125 return (((uintptr_t(pc) >> SIZE_LOG2) ^ uintptr_t(pc) ^ ((uintptr_t)kshape >> 3)) & MASK);
31126 }
31127
31128 static inline bool matchShape(JSContext *cx, JSObject *obj, uint32_t shape);
31129
31130 PropertyName *
31131 fullTest(JSContext *cx, jsbytecode *pc, JSObject **objp,
31132 JSObject **pobjp, PropertyCacheEntry *entry);
31133
31134
31135
31136
31137 inline void assertEmpty() {}
31138
31139
31140 public:
31141 __attribute__((always_inline)) inline void test(JSContext *cx, jsbytecode *pc,
31142 JSObject *&obj, JSObject *&pobj,
31143 PropertyCacheEntry *&entry, PropertyName *&name);
31144 # 174 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jspropertycache.h"
31145 __attribute__((always_inline)) inline bool testForSet(JSContext *cx, jsbytecode *pc, JSObject *obj,
31146 PropertyCacheEntry **entryp, JSObject **obj2p,
31147 PropertyName **namep);
31148 # 186 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jspropertycache.h"
31149 PropertyCacheEntry *fill(JSContext *cx, JSObject *obj, unsigned scopeIndex,
31150 JSObject *pobj, const js::Shape *shape);
31151
31152 void purge(JSRuntime *rt);
31153
31154
31155 void restore(PropertyCacheEntry *entry);
31156 };
31157
31158 }
31159 # 24 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscntxt.h" 2
31160
31161
31162 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/prmjtime.h" 1
31163
31164
31165
31166
31167
31168
31169
31170 #define prmjtime_h___
31171
31172 # 1 "/usr/include/time.h" 1 3 4
31173 # 27 "/usr/include/time.h" 3 4
31174 #define _TIME_H 1
31175
31176
31177 extern "C" {
31178
31179
31180
31181
31182
31183 #define __need_size_t
31184 #define __need_NULL
31185 # 1 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 1 3 4
31186 # 160 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
31187 #undef __need_ptrdiff_t
31188 # 233 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
31189 #undef __need_size_t
31190 # 342 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
31191 #undef __need_wchar_t
31192 # 395 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
31193 #undef NULL
31194
31195 #define NULL __null
31196 # 406 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 3 4
31197 #undef __need_NULL
31198
31199
31200
31201
31202 #define offsetof(TYPE,MEMBER) __builtin_offsetof (TYPE, MEMBER)
31203 # 39 "/usr/include/time.h" 2 3 4
31204
31205
31206
31207 # 1 "/usr/include/bits/time.h" 1 3 4
31208 # 41 "/usr/include/bits/time.h" 3 4
31209 #define _BITS_TIME_H 1
31210
31211
31212
31213
31214
31215
31216
31217 #define CLOCKS_PER_SEC 1000000l
31218 # 61 "/usr/include/bits/time.h" 3 4
31219 #define CLOCK_REALTIME 0
31220
31221 #define CLOCK_MONOTONIC 1
31222
31223 #define CLOCK_PROCESS_CPUTIME_ID 2
31224
31225 #define CLOCK_THREAD_CPUTIME_ID 3
31226
31227 #define CLOCK_MONOTONIC_RAW 4
31228
31229 #define CLOCK_REALTIME_COARSE 5
31230
31231 #define CLOCK_MONOTONIC_COARSE 6
31232
31233 #define CLOCK_BOOTTIME 7
31234
31235 #define CLOCK_REALTIME_ALARM 8
31236
31237 #define CLOCK_BOOTTIME_ALARM 9
31238
31239
31240 #define TIMER_ABSTIME 1
31241
31242
31243
31244 # 1 "/usr/include/bits/timex.h" 1 3 4
31245 # 20 "/usr/include/bits/timex.h" 3 4
31246 #define _BITS_TIMEX_H 1
31247
31248
31249
31250 struct timex
31251 {
31252 unsigned int modes;
31253 long int offset;
31254 long int freq;
31255 long int maxerror;
31256 long int esterror;
31257 int status;
31258 long int constant;
31259 long int precision;
31260 long int tolerance;
31261 struct timeval time;
31262 long int tick;
31263
31264 long int ppsfreq;
31265 long int jitter;
31266 int shift;
31267 long int stabil;
31268 long int jitcnt;
31269 long int calcnt;
31270 long int errcnt;
31271 long int stbcnt;
31272
31273 int tai;
31274
31275
31276 int :32; int :32; int :32; int :32;
31277 int :32; int :32; int :32; int :32;
31278 int :32; int :32; int :32;
31279 };
31280
31281
31282 #define ADJ_OFFSET 0x0001
31283 #define ADJ_FREQUENCY 0x0002
31284 #define ADJ_MAXERROR 0x0004
31285 #define ADJ_ESTERROR 0x0008
31286 #define ADJ_STATUS 0x0010
31287 #define ADJ_TIMECONST 0x0020
31288 #define ADJ_TAI 0x0080
31289 #define ADJ_MICRO 0x1000
31290 #define ADJ_NANO 0x2000
31291 #define ADJ_TICK 0x4000
31292 #define ADJ_OFFSET_SINGLESHOT 0x8001
31293 #define ADJ_OFFSET_SS_READ 0xa001
31294
31295
31296 #define MOD_OFFSET ADJ_OFFSET
31297 #define MOD_FREQUENCY ADJ_FREQUENCY
31298 #define MOD_MAXERROR ADJ_MAXERROR
31299 #define MOD_ESTERROR ADJ_ESTERROR
31300 #define MOD_STATUS ADJ_STATUS
31301 #define MOD_TIMECONST ADJ_TIMECONST
31302 #define MOD_CLKB ADJ_TICK
31303 #define MOD_CLKA ADJ_OFFSET_SINGLESHOT
31304 #define MOD_TAI ADJ_TAI
31305 #define MOD_MICRO ADJ_MICRO
31306 #define MOD_NANO ADJ_NANO
31307
31308
31309
31310 #define STA_PLL 0x0001
31311 #define STA_PPSFREQ 0x0002
31312 #define STA_PPSTIME 0x0004
31313 #define STA_FLL 0x0008
31314
31315 #define STA_INS 0x0010
31316 #define STA_DEL 0x0020
31317 #define STA_UNSYNC 0x0040
31318 #define STA_FREQHOLD 0x0080
31319
31320 #define STA_PPSSIGNAL 0x0100
31321 #define STA_PPSJITTER 0x0200
31322 #define STA_PPSWANDER 0x0400
31323 #define STA_PPSERROR 0x0800
31324
31325 #define STA_CLOCKERR 0x1000
31326 #define STA_NANO 0x2000
31327 #define STA_MODE 0x4000
31328 #define STA_CLK 0x8000
31329
31330
31331 #define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | STA_PPSERROR | STA_CLOCKERR | STA_NANO | STA_MODE | STA_CLK)
31332 # 87 "/usr/include/bits/time.h" 2 3 4
31333
31334 extern "C" {
31335
31336
31337 extern int clock_adjtime (__clockid_t __clock_id, struct timex *__utx) throw ();
31338
31339 }
31340
31341
31342
31343
31344
31345 #undef __need_timeval
31346 # 43 "/usr/include/time.h" 2 3 4
31347 # 67 "/usr/include/time.h" 3 4
31348 #undef __need_clock_t
31349 # 83 "/usr/include/time.h" 3 4
31350 #undef __need_time_t
31351 # 95 "/usr/include/time.h" 3 4
31352 #undef __clockid_time_t
31353 # 107 "/usr/include/time.h" 3 4
31354 #undef __need_timer_t
31355 # 127 "/usr/include/time.h" 3 4
31356 #undef __need_timespec
31357
31358
31359
31360
31361
31362 struct tm
31363 {
31364 int tm_sec;
31365 int tm_min;
31366 int tm_hour;
31367 int tm_mday;
31368 int tm_mon;
31369 int tm_year;
31370 int tm_wday;
31371 int tm_yday;
31372 int tm_isdst;
31373
31374
31375 long int tm_gmtoff;
31376 __const char *tm_zone;
31377
31378
31379
31380
31381 };
31382
31383
31384
31385
31386
31387
31388
31389
31390 struct itimerspec
31391 {
31392 struct timespec it_interval;
31393 struct timespec it_value;
31394 };
31395
31396
31397 struct sigevent;
31398 # 180 "/usr/include/time.h" 3 4
31399
31400
31401
31402 extern clock_t clock (void) throw ();
31403
31404
31405 extern time_t time (time_t *__timer) throw ();
31406
31407
31408 extern double difftime (time_t __time1, time_t __time0)
31409 throw () __attribute__ ((__const__));
31410
31411
31412 extern time_t mktime (struct tm *__tp) throw ();
31413
31414
31415
31416
31417
31418 extern size_t strftime (char *__restrict __s, size_t __maxsize,
31419 __const char *__restrict __format,
31420 __const struct tm *__restrict __tp) throw ();
31421
31422
31423
31424
31425
31426 extern char *strptime (__const char *__restrict __s,
31427 __const char *__restrict __fmt, struct tm *__tp)
31428 throw ();
31429
31430
31431
31432
31433
31434
31435
31436 extern size_t strftime_l (char *__restrict __s, size_t __maxsize,
31437 __const char *__restrict __format,
31438 __const struct tm *__restrict __tp,
31439 __locale_t __loc) throw ();
31440
31441
31442
31443 extern char *strptime_l (__const char *__restrict __s,
31444 __const char *__restrict __fmt, struct tm *__tp,
31445 __locale_t __loc) throw ();
31446
31447
31448
31449
31450
31451
31452 extern struct tm *gmtime (__const time_t *__timer) throw ();
31453
31454
31455
31456 extern struct tm *localtime (__const time_t *__timer) throw ();
31457
31458
31459
31460
31461
31462 extern struct tm *gmtime_r (__const time_t *__restrict __timer,
31463 struct tm *__restrict __tp) throw ();
31464
31465
31466
31467 extern struct tm *localtime_r (__const time_t *__restrict __timer,
31468 struct tm *__restrict __tp) throw ();
31469
31470
31471
31472
31473
31474 extern char *asctime (__const struct tm *__tp) throw ();
31475
31476
31477 extern char *ctime (__const time_t *__timer) throw ();
31478
31479
31480
31481
31482
31483
31484
31485 extern char *asctime_r (__const struct tm *__restrict __tp,
31486 char *__restrict __buf) throw ();
31487
31488
31489 extern char *ctime_r (__const time_t *__restrict __timer,
31490 char *__restrict __buf) throw ();
31491
31492
31493
31494
31495 extern char *__tzname[2];
31496 extern int __daylight;
31497 extern long int __timezone;
31498
31499
31500
31501
31502 extern char *tzname[2];
31503
31504
31505
31506 extern void tzset (void) throw ();
31507
31508
31509
31510 extern int daylight;
31511 extern long int timezone;
31512
31513
31514
31515
31516
31517 extern int stime (__const time_t *__when) throw ();
31518
31519
31520
31521
31522
31523 #define __isleap(year) ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
31524 # 313 "/usr/include/time.h" 3 4
31525 extern time_t timegm (struct tm *__tp) throw ();
31526
31527
31528 extern time_t timelocal (struct tm *__tp) throw ();
31529
31530
31531 extern int dysize (int __year) throw () __attribute__ ((__const__));
31532 # 328 "/usr/include/time.h" 3 4
31533 extern int nanosleep (__const struct timespec *__requested_time,
31534 struct timespec *__remaining);
31535
31536
31537
31538 extern int clock_getres (clockid_t __clock_id, struct timespec *__res) throw ();
31539
31540
31541 extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) throw ();
31542
31543
31544 extern int clock_settime (clockid_t __clock_id, __const struct timespec *__tp)
31545 throw ();
31546
31547
31548
31549
31550
31551
31552 extern int clock_nanosleep (clockid_t __clock_id, int __flags,
31553 __const struct timespec *__req,
31554 struct timespec *__rem);
31555
31556
31557 extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) throw ();
31558
31559
31560
31561
31562 extern int timer_create (clockid_t __clock_id,
31563 struct sigevent *__restrict __evp,
31564 timer_t *__restrict __timerid) throw ();
31565
31566
31567 extern int timer_delete (timer_t __timerid) throw ();
31568
31569
31570 extern int timer_settime (timer_t __timerid, int __flags,
31571 __const struct itimerspec *__restrict __value,
31572 struct itimerspec *__restrict __ovalue) throw ();
31573
31574
31575 extern int timer_gettime (timer_t __timerid, struct itimerspec *__value)
31576 throw ();
31577
31578
31579 extern int timer_getoverrun (timer_t __timerid) throw ();
31580 # 390 "/usr/include/time.h" 3 4
31581 extern int getdate_err;
31582 # 399 "/usr/include/time.h" 3 4
31583 extern struct tm *getdate (__const char *__string);
31584 # 413 "/usr/include/time.h" 3 4
31585 extern int getdate_r (__const char *__restrict __string,
31586 struct tm *__restrict __resbufp);
31587
31588
31589 }
31590 # 11 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/prmjtime.h" 2
31591
31592 struct JSContext;
31593 # 58 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/prmjtime.h"
31594 class DSTOffsetCache {
31595 public:
31596 inline DSTOffsetCache();
31597 int64_t getDSTOffsetMilliseconds(int64_t localTimeMilliseconds, JSContext *cx);
31598
31599 inline void purge();
31600
31601 private:
31602 int64_t computeDSTOffsetMilliseconds(int64_t localTimeSeconds);
31603
31604 int64_t offsetMilliseconds;
31605 int64_t rangeStartSeconds, rangeEndSeconds;
31606
31607 int64_t oldOffsetMilliseconds;
31608 int64_t oldRangeStartSeconds, oldRangeEndSeconds;
31609
31610 static const int64_t MAX_UNIX_TIMET = 2145859200;
31611 static const int64_t MILLISECONDS_PER_SECOND = 1000;
31612 static const int64_t SECONDS_PER_MINUTE = 60;
31613 static const int64_t SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;
31614 static const int64_t SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR;
31615
31616 static const int64_t RANGE_EXPANSION_AMOUNT = 30 * SECONDS_PER_DAY;
31617
31618 private:
31619 void sanityCheck();
31620 };
31621
31622 extern "C" {
31623
31624 typedef struct PRMJTime PRMJTime;
31625
31626
31627
31628
31629 struct PRMJTime {
31630 int32_t tm_usec;
31631 int8_t tm_sec;
31632 int8_t tm_min;
31633 int8_t tm_hour;
31634 int8_t tm_mday;
31635 int8_t tm_mon;
31636 int8_t tm_wday;
31637 int32_t tm_year;
31638 int16_t tm_yday;
31639 int8_t tm_isdst;
31640 };
31641
31642
31643 #define PRMJ_USEC_PER_SEC 1000000L
31644 #define PRMJ_USEC_PER_MSEC 1000L
31645
31646
31647 extern int64_t
31648 PRMJ_Now(void);
31649
31650
31651
31652
31653
31654
31655 #define PRMJ_NowShutdown()
31656
31657
31658
31659 extern int32_t
31660 PRMJ_LocalGMTDifference(void);
31661
31662
31663 extern size_t
31664 PRMJ_FormatTime(char *buf, int buflen, const char *fmt, PRMJTime *tm);
31665
31666 }
31667 # 27 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscntxt.h" 2
31668
31669
31670
31671
31672
31673 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack.h" 1
31674 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack.h"
31675 #define Stack_h__
31676
31677 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsfun.h" 1
31678
31679
31680
31681
31682
31683
31684
31685 #define jsfun_h___
31686
31687
31688
31689
31690
31691
31692
31693 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscript.h" 1
31694 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscript.h"
31695 #define jsscript_h___
31696
31697
31698
31699
31700
31701 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsdbgapi.h" 1
31702 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsdbgapi.h"
31703 #define jsdbgapi_h___
31704
31705
31706
31707
31708
31709
31710 extern "C" {
31711
31712 extern __attribute__((visibility("default"))) JSCrossCompartmentCall *
31713 JS_EnterCrossCompartmentCallScript(JSContext *cx, JSScript *target);
31714
31715 extern __attribute__((visibility("default"))) JSCrossCompartmentCall *
31716 JS_EnterCrossCompartmentCallStackFrame(JSContext *cx, JSStackFrame *target);
31717
31718
31719 }
31720
31721 namespace JS {
31722
31723 class __attribute__((visibility("default"))) AutoEnterScriptCompartment
31724 {
31725 protected:
31726 JSCrossCompartmentCall *call;
31727
31728 public:
31729 AutoEnterScriptCompartment() : call(__null) {}
31730
31731 bool enter(JSContext *cx, JSScript *target);
31732
31733 bool entered() const { return call != __null; }
31734
31735 ~AutoEnterScriptCompartment() {
31736 if (call && call != reinterpret_cast<JSCrossCompartmentCall*>(1))
31737 JS_LeaveCrossCompartmentCall(call);
31738 }
31739 };
31740
31741 class __attribute__((visibility("default"))) AutoEnterFrameCompartment : public AutoEnterScriptCompartment
31742 {
31743 public:
31744 bool enter(JSContext *cx, JSStackFrame *target);
31745 };
31746
31747 }
31748
31749
31750
31751
31752
31753
31754 __attribute__((visibility("default"))) void js_DumpBacktrace(JSContext *cx);
31755
31756 extern "C" {
31757
31758
31759 extern __attribute__((visibility("default"))) JSString *
31760 JS_DecompileScript(JSContext *cx, JSScript *script, const char *name, unsigned indent);
31761
31762
31763
31764
31765
31766 extern __attribute__((visibility("default"))) void
31767 JS_SetRuntimeDebugMode(JSRuntime *rt, JSBool debug);
31768 # 86 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsdbgapi.h"
31769 extern __attribute__((visibility("default"))) JSBool
31770 JS_GetDebugMode(JSContext *cx);
31771
31772
31773
31774
31775
31776 __attribute__((visibility("default"))) JSBool
31777 JS_SetDebugModeForAllCompartments(JSContext *cx, JSBool debug);
31778
31779
31780
31781
31782
31783
31784 __attribute__((visibility("default"))) JSBool
31785 JS_SetDebugModeForCompartment(JSContext *cx, JSCompartment *comp, JSBool debug);
31786
31787
31788
31789
31790 __attribute__((visibility("default"))) JSBool
31791 JS_SetDebugMode(JSContext *cx, JSBool debug);
31792
31793
31794 extern __attribute__((visibility("default"))) JSBool
31795 JS_SetSingleStepMode(JSContext *cx, JSScript *script, JSBool singleStep);
31796
31797
31798 extern __attribute__((visibility("default"))) JSBool
31799 JS_SetTrap(JSContext *cx, JSScript *script, jsbytecode *pc,
31800 JSTrapHandler handler, jsval closure);
31801
31802 extern __attribute__((visibility("default"))) void
31803 JS_ClearTrap(JSContext *cx, JSScript *script, jsbytecode *pc,
31804 JSTrapHandler *handlerp, jsval *closurep);
31805
31806 extern __attribute__((visibility("default"))) void
31807 JS_ClearScriptTraps(JSContext *cx, JSScript *script);
31808
31809 extern __attribute__((visibility("default"))) void
31810 JS_ClearAllTrapsForCompartment(JSContext *cx);
31811
31812 extern __attribute__((visibility("default"))) JSBool
31813 JS_SetInterrupt(JSRuntime *rt, JSInterruptHook handler, void *closure);
31814
31815 extern __attribute__((visibility("default"))) JSBool
31816 JS_ClearInterrupt(JSRuntime *rt, JSInterruptHook *handlerp, void **closurep);
31817
31818
31819
31820 extern __attribute__((visibility("default"))) JSBool
31821 JS_SetWatchPoint(JSContext *cx, JSObject *obj, jsid id,
31822 JSWatchPointHandler handler, JSObject *closure);
31823
31824 extern __attribute__((visibility("default"))) JSBool
31825 JS_ClearWatchPoint(JSContext *cx, JSObject *obj, jsid id,
31826 JSWatchPointHandler *handlerp, JSObject **closurep);
31827
31828 extern __attribute__((visibility("default"))) JSBool
31829 JS_ClearWatchPointsForObject(JSContext *cx, JSObject *obj);
31830
31831 extern __attribute__((visibility("default"))) JSBool
31832 JS_ClearAllWatchPoints(JSContext *cx);
31833
31834
31835
31836 extern __attribute__((visibility("default"))) unsigned
31837 JS_PCToLineNumber(JSContext *cx, JSScript *script, jsbytecode *pc);
31838
31839 extern __attribute__((visibility("default"))) jsbytecode *
31840 JS_LineNumberToPC(JSContext *cx, JSScript *script, unsigned lineno);
31841
31842 extern __attribute__((visibility("default"))) jsbytecode *
31843 JS_EndPC(JSContext *cx, JSScript *script);
31844
31845 extern __attribute__((visibility("default"))) JSBool
31846 JS_GetLinePCs(JSContext *cx, JSScript *script,
31847 unsigned startLine, unsigned maxLines,
31848 unsigned* count, unsigned** lines, jsbytecode*** pcs);
31849
31850 extern __attribute__((visibility("default"))) unsigned
31851 JS_GetFunctionArgumentCount(JSContext *cx, JSFunction *fun);
31852
31853 extern __attribute__((visibility("default"))) JSBool
31854 JS_FunctionHasLocalNames(JSContext *cx, JSFunction *fun);
31855
31856
31857
31858
31859
31860
31861 extern __attribute__((visibility("default"))) uintptr_t *
31862 JS_GetFunctionLocalNameArray(JSContext *cx, JSFunction *fun, void **markp);
31863
31864 extern __attribute__((visibility("default"))) JSAtom *
31865 JS_LocalNameToAtom(uintptr_t w);
31866
31867 extern __attribute__((visibility("default"))) JSString *
31868 JS_AtomKey(JSAtom *atom);
31869
31870 extern __attribute__((visibility("default"))) void
31871 JS_ReleaseFunctionLocalNameArray(JSContext *cx, void *mark);
31872
31873 extern __attribute__((visibility("default"))) JSScript *
31874 JS_GetFunctionScript(JSContext *cx, JSFunction *fun);
31875
31876 extern __attribute__((visibility("default"))) JSNative
31877 JS_GetFunctionNative(JSContext *cx, JSFunction *fun);
31878
31879 extern __attribute__((visibility("default"))) JSPrincipals *
31880 JS_GetScriptPrincipals(JSScript *script);
31881
31882 extern __attribute__((visibility("default"))) JSPrincipals *
31883 JS_GetScriptOriginPrincipals(JSScript *script);
31884 # 209 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsdbgapi.h"
31885 extern __attribute__((visibility("default"))) JSStackFrame *
31886 JS_FrameIterator(JSContext *cx, JSStackFrame **iteratorp);
31887
31888 extern __attribute__((visibility("default"))) JSScript *
31889 JS_GetFrameScript(JSContext *cx, JSStackFrame *fp);
31890
31891 extern __attribute__((visibility("default"))) jsbytecode *
31892 JS_GetFramePC(JSContext *cx, JSStackFrame *fp);
31893
31894 extern __attribute__((visibility("default"))) void *
31895 JS_GetFrameAnnotation(JSContext *cx, JSStackFrame *fp);
31896
31897 extern __attribute__((visibility("default"))) void
31898 JS_SetFrameAnnotation(JSContext *cx, JSStackFrame *fp, void *annotation);
31899
31900 extern __attribute__((visibility("default"))) JSBool
31901 JS_IsScriptFrame(JSContext *cx, JSStackFrame *fp);
31902
31903 extern __attribute__((visibility("default"))) JSObject *
31904 JS_GetFrameScopeChain(JSContext *cx, JSStackFrame *fp);
31905
31906 extern __attribute__((visibility("default"))) JSObject *
31907 JS_GetFrameCallObject(JSContext *cx, JSStackFrame *fp);
31908
31909 extern __attribute__((visibility("default"))) JSBool
31910 JS_GetFrameThis(JSContext *cx, JSStackFrame *fp, jsval *thisv);
31911
31912 extern __attribute__((visibility("default"))) JSFunction *
31913 JS_GetFrameFunction(JSContext *cx, JSStackFrame *fp);
31914
31915 extern __attribute__((visibility("default"))) JSObject *
31916 JS_GetFrameFunctionObject(JSContext *cx, JSStackFrame *fp);
31917
31918 __attribute__((visibility("default"))) JSFunction *
31919 JS_GetScriptFunction(JSContext *cx, JSScript *script);
31920
31921 extern __attribute__((visibility("default"))) JSObject *
31922 JS_GetParentOrScopeChain(JSContext *cx, JSObject *obj);
31923
31924
31925 #define JS_IsContructorFrame JS_IsConstructorFrame
31926 extern __attribute__((visibility("default"))) JSBool
31927 JS_IsConstructorFrame(JSContext *cx, JSStackFrame *fp);
31928
31929 extern __attribute__((visibility("default"))) JSBool
31930 JS_IsDebuggerFrame(JSContext *cx, JSStackFrame *fp);
31931
31932 extern __attribute__((visibility("default"))) JSBool
31933 JS_IsGlobalFrame(JSContext *cx, JSStackFrame *fp);
31934
31935 extern __attribute__((visibility("default"))) jsval
31936 JS_GetFrameReturnValue(JSContext *cx, JSStackFrame *fp);
31937
31938 extern __attribute__((visibility("default"))) void
31939 JS_SetFrameReturnValue(JSContext *cx, JSStackFrame *fp, jsval rval);
31940
31941
31942
31943
31944
31945
31946 extern __attribute__((visibility("default"))) JSObject *
31947 JS_GetFrameCalleeObject(JSContext *cx, JSStackFrame *fp);
31948 # 281 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsdbgapi.h"
31949 extern __attribute__((visibility("default"))) const char *
31950 JS_GetDebugClassName(JSObject *obj);
31951
31952
31953
31954 extern __attribute__((visibility("default"))) const char *
31955 JS_GetScriptFilename(JSContext *cx, JSScript *script);
31956
31957 extern __attribute__((visibility("default"))) const jschar *
31958 JS_GetScriptSourceMap(JSContext *cx, JSScript *script);
31959
31960 extern __attribute__((visibility("default"))) unsigned
31961 JS_GetScriptBaseLineNumber(JSContext *cx, JSScript *script);
31962
31963 extern __attribute__((visibility("default"))) unsigned
31964 JS_GetScriptLineExtent(JSContext *cx, JSScript *script);
31965
31966 extern __attribute__((visibility("default"))) JSVersion
31967 JS_GetScriptVersion(JSContext *cx, JSScript *script);
31968 # 308 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsdbgapi.h"
31969 #define JS_SetNewScriptHook JS_SetNewScriptHookProc
31970 #define JS_SetDestroyScriptHook JS_SetDestroyScriptHookProc
31971
31972 extern __attribute__((visibility("default"))) void
31973 JS_SetNewScriptHookProc(JSRuntime *rt, JSNewScriptHook hook, void *callerdata);
31974
31975 extern __attribute__((visibility("default"))) void
31976 JS_SetDestroyScriptHookProc(JSRuntime *rt, JSDestroyScriptHook hook,
31977 void *callerdata);
31978
31979
31980
31981 extern __attribute__((visibility("default"))) JSBool
31982 JS_EvaluateUCInStackFrame(JSContext *cx, JSStackFrame *fp,
31983 const jschar *chars, unsigned length,
31984 const char *filename, unsigned lineno,
31985 jsval *rval);
31986
31987 extern __attribute__((visibility("default"))) JSBool
31988 JS_EvaluateInStackFrame(JSContext *cx, JSStackFrame *fp,
31989 const char *bytes, unsigned length,
31990 const char *filename, unsigned lineno,
31991 jsval *rval);
31992
31993
31994
31995 typedef struct JSPropertyDesc {
31996 jsval id;
31997 jsval value;
31998 uint8_t flags;
31999 uint8_t spare;
32000 uint16_t slot;
32001 jsval alias;
32002 } JSPropertyDesc;
32003
32004 #define JSPD_ENUMERATE 0x01
32005 #define JSPD_READONLY 0x02
32006 #define JSPD_PERMANENT 0x04
32007 #define JSPD_ALIAS 0x08
32008 #define JSPD_ARGUMENT 0x10
32009 #define JSPD_VARIABLE 0x20
32010 #define JSPD_EXCEPTION 0x40
32011
32012 #define JSPD_ERROR 0x80
32013
32014
32015 typedef struct JSPropertyDescArray {
32016 uint32_t length;
32017 JSPropertyDesc *array;
32018 } JSPropertyDescArray;
32019
32020 typedef struct JSScopeProperty JSScopeProperty;
32021
32022 extern __attribute__((visibility("default"))) JSBool
32023 JS_GetPropertyDescArray(JSContext *cx, JSObject *obj, JSPropertyDescArray *pda);
32024
32025 extern __attribute__((visibility("default"))) void
32026 JS_PutPropertyDescArray(JSContext *cx, JSPropertyDescArray *pda);
32027
32028
32029
32030 extern __attribute__((visibility("default"))) JSBool
32031 JS_SetDebuggerHandler(JSRuntime *rt, JSDebuggerHandler hook, void *closure);
32032
32033 extern __attribute__((visibility("default"))) JSBool
32034 JS_SetSourceHandler(JSRuntime *rt, JSSourceHandler handler, void *closure);
32035
32036 extern __attribute__((visibility("default"))) JSBool
32037 JS_SetExecuteHook(JSRuntime *rt, JSInterpreterHook hook, void *closure);
32038
32039 extern __attribute__((visibility("default"))) JSBool
32040 JS_SetCallHook(JSRuntime *rt, JSInterpreterHook hook, void *closure);
32041
32042 extern __attribute__((visibility("default"))) JSBool
32043 JS_SetThrowHook(JSRuntime *rt, JSThrowHook hook, void *closure);
32044
32045 extern __attribute__((visibility("default"))) JSBool
32046 JS_SetDebugErrorHook(JSRuntime *rt, JSDebugErrorHook hook, void *closure);
32047
32048
32049
32050 extern __attribute__((visibility("default"))) size_t
32051 JS_GetObjectTotalSize(JSContext *cx, JSObject *obj);
32052
32053 extern __attribute__((visibility("default"))) size_t
32054 JS_GetFunctionTotalSize(JSContext *cx, JSFunction *fun);
32055
32056 extern __attribute__((visibility("default"))) size_t
32057 JS_GetScriptTotalSize(JSContext *cx, JSScript *script);
32058
32059
32060
32061
32062
32063
32064
32065 extern __attribute__((visibility("default"))) JSBool
32066 JS_IsSystemObject(JSContext *cx, JSObject *obj);
32067
32068
32069
32070
32071
32072
32073 extern __attribute__((visibility("default"))) JSBool
32074 JS_MakeSystemObject(JSContext *cx, JSObject *obj);
32075
32076
32077
32078 extern __attribute__((visibility("default"))) void
32079 js_RevertVersion(JSContext *cx);
32080
32081 extern __attribute__((visibility("default"))) const JSDebugHooks *
32082 JS_GetGlobalDebugHooks(JSRuntime *rt);
32083 # 434 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsdbgapi.h"
32084 extern __attribute__((visibility("default"))) JSBool
32085 JS_StartProfiling(const char *profileName);
32086
32087
32088
32089
32090
32091 extern __attribute__((visibility("default"))) JSBool
32092 JS_StopProfiling(const char *profileName);
32093
32094
32095
32096
32097
32098 extern __attribute__((visibility("default"))) JSBool
32099 JS_DumpProfile(const char *outfile, const char *profileName);
32100
32101
32102
32103
32104
32105
32106 extern __attribute__((visibility("default"))) JSBool
32107 JS_PauseProfilers(const char *profileName);
32108
32109
32110
32111
32112 extern __attribute__((visibility("default"))) JSBool
32113 JS_ResumeProfilers(const char *profileName);
32114
32115
32116
32117
32118 extern __attribute__((visibility("default"))) JSBool
32119 JS_DefineProfilingFunctions(JSContext *cx, JSObject *obj);
32120
32121
32122 extern __attribute__((visibility("default"))) JSBool
32123 JS_DefineDebuggerObject(JSContext *cx, JSObject *obj);
32124
32125
32126
32127
32128
32129
32130 __attribute__((visibility("default"))) const char *
32131 JS_UnsafeGetLastProfilingError();
32132 # 514 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsdbgapi.h"
32133 extern __attribute__((visibility("default"))) JSBool
32134 js_StartPerf();
32135
32136 extern __attribute__((visibility("default"))) JSBool
32137 js_StopPerf();
32138
32139
32140
32141 extern __attribute__((visibility("default"))) void
32142 JS_DumpBytecode(JSContext *cx, JSScript *script);
32143
32144 extern __attribute__((visibility("default"))) void
32145 JS_DumpCompartmentBytecode(JSContext *cx);
32146
32147 extern __attribute__((visibility("default"))) void
32148 JS_DumpPCCounts(JSContext *cx, JSScript *script);
32149
32150 extern __attribute__((visibility("default"))) void
32151 JS_DumpCompartmentPCCounts(JSContext *cx);
32152
32153 extern __attribute__((visibility("default"))) JSObject *
32154 JS_UnwrapObject(JSObject *obj);
32155
32156 extern __attribute__((visibility("default"))) JSObject *
32157 JS_UnwrapObjectAndInnerize(JSObject *obj);
32158
32159
32160 extern __attribute__((visibility("default"))) JSBool
32161 js_CallContextDebugHandler(JSContext *cx);
32162
32163 }
32164 # 16 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscript.h" 2
32165
32166
32167 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsopcode.h" 1
32168
32169
32170
32171
32172
32173
32174
32175 #define jsopcode_h___
32176
32177
32178
32179
32180 # 1 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 1 3 4
32181 # 14 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsopcode.h" 2
32182
32183
32184
32185
32186 extern "C" {
32187
32188
32189
32190
32191 typedef enum JSOp {
32192 #define OPDEF(op,val,name,token,length,nuses,ndefs,prec,format) op = val,
32193
32194 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsopcode.tbl" 1
32195 # 80 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsopcode.tbl"
32196 JSOP_NOP = 0,
32197
32198
32199 JSOP_UNDEFINED = 1,
32200 JSOP_POPV = 2,
32201 JSOP_ENTERWITH = 3,
32202 JSOP_LEAVEWITH = 4,
32203 JSOP_RETURN = 5,
32204 JSOP_GOTO = 6,
32205 JSOP_IFEQ = 7,
32206 JSOP_IFNE = 8,
32207
32208
32209 JSOP_ARGUMENTS = 9,
32210
32211 JSOP_SWAP = 10,
32212 JSOP_POPN = 11,
32213
32214
32215 JSOP_DUP = 12,
32216 JSOP_DUP2 = 13,
32217 JSOP_SETCONST = 14,
32218 JSOP_BITOR = 15,
32219 JSOP_BITXOR = 16,
32220 JSOP_BITAND = 17,
32221 JSOP_EQ = 18,
32222 JSOP_NE = 19,
32223 JSOP_LT = 20,
32224 JSOP_LE = 21,
32225 JSOP_GT = 22,
32226 JSOP_GE = 23,
32227 JSOP_LSH = 24,
32228 JSOP_RSH = 25,
32229 JSOP_URSH = 26,
32230 JSOP_ADD = 27,
32231 JSOP_SUB = 28,
32232 JSOP_MUL = 29,
32233 JSOP_DIV = 30,
32234 JSOP_MOD = 31,
32235 JSOP_NOT = 32,
32236 JSOP_BITNOT = 33,
32237 JSOP_NEG = 34,
32238 JSOP_POS = 35,
32239 JSOP_DELNAME = 36,
32240 JSOP_DELPROP = 37,
32241 JSOP_DELELEM = 38,
32242 JSOP_TYPEOF = 39,
32243 JSOP_VOID = 40,
32244
32245 JSOP_INCNAME = 41,
32246 JSOP_INCPROP = 42,
32247 JSOP_INCELEM = 43,
32248 JSOP_DECNAME = 44,
32249 JSOP_DECPROP = 45,
32250 JSOP_DECELEM = 46,
32251 JSOP_NAMEINC = 47,
32252 JSOP_PROPINC = 48,
32253 JSOP_ELEMINC = 49,
32254 JSOP_NAMEDEC = 50,
32255 JSOP_PROPDEC = 51,
32256 JSOP_ELEMDEC = 52,
32257
32258 JSOP_GETPROP = 53,
32259 JSOP_SETPROP = 54,
32260 JSOP_GETELEM = 55,
32261 JSOP_SETELEM = 56,
32262 JSOP_CALLNAME = 57,
32263 JSOP_CALL = 58,
32264 JSOP_NAME = 59,
32265 JSOP_DOUBLE = 60,
32266 JSOP_STRING = 61,
32267 JSOP_ZERO = 62,
32268 JSOP_ONE = 63,
32269 JSOP_NULL = 64,
32270 JSOP_THIS = 65,
32271 JSOP_FALSE = 66,
32272 JSOP_TRUE = 67,
32273 JSOP_OR = 68,
32274 JSOP_AND = 69,
32275
32276
32277 JSOP_TABLESWITCH = 70,
32278 JSOP_LOOKUPSWITCH = 71,
32279
32280
32281 JSOP_STRICTEQ = 72,
32282 JSOP_STRICTNE = 73,
32283
32284
32285
32286
32287
32288 JSOP_SETCALL = 74,
32289 # 186 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsopcode.tbl"
32290 JSOP_ITER = 75,
32291 JSOP_MOREITER = 76,
32292 JSOP_ITERNEXT = 77,
32293 JSOP_ENDITER = 78,
32294
32295 JSOP_FUNAPPLY = 79,
32296
32297
32298 JSOP_OBJECT = 80,
32299
32300
32301 JSOP_POP = 81,
32302
32303
32304 JSOP_NEW = 82,
32305
32306 JSOP_UNUSED0 = 83,
32307
32308
32309 JSOP_GETARG = 84,
32310 JSOP_SETARG = 85,
32311 JSOP_GETLOCAL = 86,
32312 JSOP_SETLOCAL = 87,
32313
32314
32315 JSOP_UINT16 = 88,
32316 # 221 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsopcode.tbl"
32317 JSOP_NEWINIT = 89,
32318 JSOP_NEWARRAY = 90,
32319 JSOP_NEWOBJECT = 91,
32320 JSOP_ENDINIT = 92,
32321 JSOP_INITPROP = 93,
32322 JSOP_INITELEM = 94,
32323 JSOP_UNUSED14 = 95,
32324 JSOP_UNUSED15 = 96,
32325
32326
32327 JSOP_INCARG = 97,
32328 JSOP_DECARG = 98,
32329 JSOP_ARGINC = 99,
32330 JSOP_ARGDEC = 100,
32331
32332 JSOP_INCLOCAL = 101,
32333 JSOP_DECLOCAL = 102,
32334 JSOP_LOCALINC = 103,
32335 JSOP_LOCALDEC = 104,
32336
32337
32338 JSOP_LEAVEFORLETIN = 105,
32339
32340
32341 JSOP_LABEL = 106,
32342 JSOP_UNUSED3 = 107,
32343
32344
32345 JSOP_FUNCALL = 108,
32346
32347
32348 JSOP_LOOPHEAD = 109,
32349
32350
32351 JSOP_BINDNAME = 110,
32352 JSOP_SETNAME = 111,
32353
32354
32355 JSOP_THROW = 112,
32356
32357
32358 JSOP_IN = 113,
32359 JSOP_INSTANCEOF = 114,
32360
32361
32362 JSOP_DEBUGGER = 115,
32363
32364
32365 JSOP_GOSUB = 116,
32366 JSOP_RETSUB = 117,
32367
32368
32369 JSOP_EXCEPTION = 118,
32370
32371
32372 JSOP_LINENO = 119,
32373
32374
32375
32376
32377
32378
32379 JSOP_CONDSWITCH = 120,
32380 JSOP_CASE = 121,
32381 JSOP_DEFAULT = 122,
32382
32383
32384
32385
32386 JSOP_EVAL = 123,
32387
32388
32389
32390
32391 JSOP_ENUMELEM = 124,
32392
32393
32394
32395
32396
32397
32398 JSOP_GETTER = 125,
32399 JSOP_SETTER = 126,
32400
32401
32402
32403
32404 JSOP_DEFFUN = 127,
32405 JSOP_DEFCONST = 128,
32406 JSOP_DEFVAR = 129,
32407
32408
32409 JSOP_LAMBDA = 130,
32410
32411
32412 JSOP_CALLEE = 131,
32413
32414 JSOP_UNUSED31 = 132,
32415
32416
32417 JSOP_PICK = 133,
32418
32419
32420
32421
32422
32423 JSOP_TRY = 134,
32424 JSOP_FINALLY = 135,
32425 # 337 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsopcode.tbl"
32426 JSOP_GETALIASEDVAR = 136,
32427 JSOP_CALLALIASEDVAR = 137,
32428 JSOP_SETALIASEDVAR = 138,
32429 JSOP_INCALIASEDVAR = 139,
32430 JSOP_DECALIASEDVAR = 140,
32431 JSOP_ALIASEDVARINC = 141,
32432 JSOP_ALIASEDVARDEC = 142,
32433
32434
32435 JSOP_UNUSED8 = 143,
32436 JSOP_UNUSED9 = 144,
32437 JSOP_UNUSED10 = 145,
32438 JSOP_UNUSED11 = 146,
32439 JSOP_UNUSED12 = 147,
32440 JSOP_UNUSED13 = 148,
32441
32442
32443 JSOP_BACKPATCH = 149,
32444 JSOP_BACKPATCH_POP = 150,
32445
32446
32447 JSOP_THROWING = 151,
32448
32449
32450 JSOP_SETRVAL = 152,
32451 JSOP_RETRVAL = 153,
32452
32453
32454 JSOP_GETGNAME = 154,
32455 JSOP_SETGNAME = 155,
32456 JSOP_INCGNAME = 156,
32457 JSOP_DECGNAME = 157,
32458 JSOP_GNAMEINC = 158,
32459 JSOP_GNAMEDEC = 159,
32460
32461
32462 JSOP_REGEXP = 160,
32463
32464
32465 JSOP_DEFXMLNS = 161,
32466 JSOP_ANYNAME = 162,
32467 JSOP_QNAMEPART = 163,
32468 JSOP_QNAMECONST = 164,
32469 JSOP_QNAME = 165,
32470 JSOP_TOATTRNAME = 166,
32471 JSOP_TOATTRVAL = 167,
32472 JSOP_ADDATTRNAME = 168,
32473 JSOP_ADDATTRVAL = 169,
32474 JSOP_BINDXMLNAME = 170,
32475 JSOP_SETXMLNAME = 171,
32476 JSOP_XMLNAME = 172,
32477 JSOP_DESCENDANTS = 173,
32478 JSOP_FILTER = 174,
32479 JSOP_ENDFILTER = 175,
32480 JSOP_TOXML = 176,
32481 JSOP_TOXMLLIST = 177,
32482 JSOP_XMLTAGEXPR = 178,
32483 JSOP_XMLELTEXPR = 179,
32484 JSOP_XMLCDATA = 180,
32485 JSOP_XMLCOMMENT = 181,
32486 JSOP_XMLPI = 182,
32487 JSOP_DELDESC = 183,
32488
32489 JSOP_CALLPROP = 184,
32490
32491
32492 JSOP_ENTERLET0 = 185,
32493
32494
32495 JSOP_ENTERLET1 = 186,
32496
32497
32498
32499
32500 JSOP_UINT24 = 187,
32501
32502 JSOP_UNUSED18 = 188,
32503 JSOP_UNUSED19 = 189,
32504 JSOP_UNUSED20 = 190,
32505
32506
32507
32508
32509 JSOP_STARTXML = 191,
32510 JSOP_STARTXMLEXPR = 192,
32511
32512 JSOP_CALLELEM = 193,
32513
32514
32515
32516
32517
32518 JSOP_STOP = 194,
32519
32520
32521
32522
32523
32524 JSOP_GETXPROP = 195,
32525
32526 JSOP_CALLXMLNAME = 196,
32527
32528
32529
32530
32531 JSOP_TYPEOFEXPR = 197,
32532
32533
32534
32535
32536 JSOP_ENTERBLOCK = 198,
32537 JSOP_LEAVEBLOCK = 199,
32538
32539
32540 JSOP_UNUSED1 = 200,
32541 JSOP_UNUSED2 = 201,
32542
32543
32544
32545
32546 JSOP_GENERATOR = 202,
32547 JSOP_YIELD = 203,
32548 JSOP_ARRAYPUSH = 204,
32549
32550
32551
32552
32553 JSOP_GETFUNNS = 205,
32554
32555
32556
32557
32558 JSOP_ENUMCONSTELEM = 206,
32559
32560
32561
32562
32563
32564 JSOP_LEAVEBLOCKEXPR = 207,
32565
32566 JSOP_UNUSED21 = 208,
32567 JSOP_UNUSED22 = 209,
32568 JSOP_UNUSED23 = 210,
32569
32570 JSOP_CALLGNAME = 211,
32571 JSOP_CALLLOCAL = 212,
32572 JSOP_CALLARG = 213,
32573 JSOP_BINDGNAME = 214,
32574
32575
32576
32577
32578 JSOP_INT8 = 215,
32579 JSOP_INT32 = 216,
32580
32581
32582
32583
32584 JSOP_LENGTH = 217,
32585
32586
32587
32588
32589
32590
32591 JSOP_HOLE = 218,
32592
32593 JSOP_UNUSED17 = 219,
32594 JSOP_UNUSED24 = 220,
32595 JSOP_UNUSED25 = 221,
32596 JSOP_UNUSED29 = 222,
32597 JSOP_UNUSED30 = 223,
32598
32599 JSOP_REST = 224,
32600
32601
32602 JSOP_TOID = 225,
32603
32604
32605 JSOP_IMPLICITTHIS = 226,
32606
32607
32608 JSOP_LOOPENTRY = 227,
32609
32610 JSOP_ACTUALSFILLED = 228,
32611 # 27 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsopcode.h" 2
32612 #undef OPDEF
32613 JSOP_LIMIT,
32614
32615
32616
32617
32618
32619
32620 JSOP_GETPROP2 = JSOP_LIMIT,
32621 JSOP_GETELEM2 = JSOP_LIMIT + 1,
32622 JSOP_FORLOCAL = JSOP_LIMIT + 2,
32623 JSOP_FAKE_LIMIT = JSOP_FORLOCAL
32624 } JSOp;
32625
32626
32627
32628
32629 #define JOF_BYTE 0
32630 #define JOF_JUMP 1
32631 #define JOF_ATOM 2
32632 #define JOF_UINT16 3
32633 #define JOF_TABLESWITCH 4
32634 #define JOF_LOOKUPSWITCH 5
32635 #define JOF_QARG 6
32636 #define JOF_LOCAL 7
32637 #define JOF_DOUBLE 8
32638 #define JOF_UINT24 12
32639 #define JOF_UINT8 13
32640
32641 #define JOF_INT32 14
32642 #define JOF_OBJECT 15
32643 #define JOF_SLOTOBJECT 16
32644 #define JOF_REGEXP 17
32645 #define JOF_INT8 18
32646 #define JOF_ATOMOBJECT 19
32647 #define JOF_UINT16PAIR 20
32648 #define JOF_SCOPECOORD 21
32649 #define JOF_TYPEMASK 0x001f
32650
32651 #define JOF_NAME (1U<<5)
32652 #define JOF_PROP (2U<<5)
32653 #define JOF_ELEM (3U<<5)
32654 #define JOF_XMLNAME (4U<<5)
32655 #define JOF_MODEMASK (7U<<5)
32656 #define JOF_SET (1U<<8)
32657 #define JOF_DEL (1U<<9)
32658 #define JOF_DEC (1U<<10)
32659 #define JOF_INC (2U<<10)
32660 #define JOF_INCDEC (3U<<10)
32661 #define JOF_POST (1U<<12)
32662 #define JOF_ASSIGNING JOF_SET
32663
32664 #define JOF_DETECTING (1U<<14)
32665 #define JOF_BACKPATCH (1U<<15)
32666 #define JOF_LEFTASSOC (1U<<16)
32667 #define JOF_DECLARING (1U<<17)
32668
32669 #define JOF_PARENHEAD (1U<<20)
32670
32671 #define JOF_INVOKE (1U<<21)
32672 #define JOF_TMPSLOT (1U<<22)
32673
32674
32675 #define JOF_TMPSLOT2 (2U<<22)
32676
32677 #define JOF_TMPSLOT3 (3U<<22)
32678
32679 #define JOF_TMPSLOT_SHIFT 22
32680 #define JOF_TMPSLOT_MASK (JS_BITMASK(2) << JOF_TMPSLOT_SHIFT)
32681
32682
32683 #define JOF_GNAME (1U<<25)
32684 #define JOF_TYPESET (1U<<26)
32685 #define JOF_DECOMPOSE (1U<<27)
32686
32687 #define JOF_ARITH (1U<<28)
32688
32689
32690 #define JOF_TYPE(fmt) ((fmt) & JOF_TYPEMASK)
32691 #define JOF_OPTYPE(op) JOF_TYPE(js_CodeSpec[op].format)
32692
32693
32694 #define JOF_MODE(fmt) ((fmt) & JOF_MODEMASK)
32695 #define JOF_OPMODE(op) JOF_MODE(js_CodeSpec[op].format)
32696
32697 #define JOF_TYPE_IS_EXTENDED_JUMP(t) ((unsigned)((t) - JOF_JUMP) <= (unsigned)(JOF_LOOKUPSWITCH - JOF_JUMP))
32698
32699
32700
32701
32702
32703
32704 static __attribute__((always_inline)) inline uint8_t
32705 GET_UINT8(jsbytecode *pc)
32706 {
32707 return (uint8_t) pc[1];
32708 }
32709
32710 static __attribute__((always_inline)) inline void
32711 SET_UINT8(jsbytecode *pc, uint8_t u)
32712 {
32713 pc[1] = (jsbytecode) u;
32714 }
32715
32716
32717 #define UINT16_LEN 2
32718 #define UINT16_HI(i) ((jsbytecode)((i) >> 8))
32719 #define UINT16_LO(i) ((jsbytecode)(i))
32720 #define GET_UINT16(pc) ((unsigned)(((pc)[1] << 8) | (pc)[2]))
32721 #define SET_UINT16(pc,i) ((pc)[1] = UINT16_HI(i), (pc)[2] = UINT16_LO(i))
32722 #define UINT16_LIMIT ((unsigned)1 << 16)
32723
32724
32725 #define JUMP_OFFSET_LEN 4
32726 #define JUMP_OFFSET_MIN INT32_MIN
32727 #define JUMP_OFFSET_MAX INT32_MAX
32728
32729 static __attribute__((always_inline)) inline int32_t
32730 GET_JUMP_OFFSET(jsbytecode *pc)
32731 {
32732 return (pc[1] << 24) | (pc[2] << 16) | (pc[3] << 8) | pc[4];
32733 }
32734
32735 static __attribute__((always_inline)) inline void
32736 SET_JUMP_OFFSET(jsbytecode *pc, int32_t off)
32737 {
32738 pc[1] = (jsbytecode)(off >> 24);
32739 pc[2] = (jsbytecode)(off >> 16);
32740 pc[3] = (jsbytecode)(off >> 8);
32741 pc[4] = (jsbytecode)off;
32742 }
32743
32744 #define UINT32_INDEX_LEN 4
32745
32746 static __attribute__((always_inline)) inline uint32_t
32747 GET_UINT32_INDEX(const jsbytecode *pc)
32748 {
32749 return (pc[1] << 24) | (pc[2] << 16) | (pc[3] << 8) | pc[4];
32750 }
32751
32752 static __attribute__((always_inline)) inline void
32753 SET_UINT32_INDEX(jsbytecode *pc, uint32_t index)
32754 {
32755 pc[1] = (jsbytecode)(index >> 24);
32756 pc[2] = (jsbytecode)(index >> 16);
32757 pc[3] = (jsbytecode)(index >> 8);
32758 pc[4] = (jsbytecode)index;
32759 }
32760
32761 #define UINT24_HI(i) ((jsbytecode)((i) >> 16))
32762 #define UINT24_MID(i) ((jsbytecode)((i) >> 8))
32763 #define UINT24_LO(i) ((jsbytecode)(i))
32764 #define GET_UINT24(pc) ((jsatomid)(((pc)[1] << 16) | ((pc)[2] << 8) | (pc)[3]))
32765
32766
32767 #define SET_UINT24(pc,i) ((pc)[1] = UINT24_HI(i), (pc)[2] = UINT24_MID(i), (pc)[3] = UINT24_LO(i))
32768
32769
32770
32771 #define GET_INT8(pc) (int8_t((pc)[1]))
32772
32773 #define GET_INT32(pc) (((uint32_t((pc)[1]) << 24) | (uint32_t((pc)[2]) << 16) | (uint32_t((pc)[3]) << 8) | uint32_t((pc)[4])))
32774
32775
32776
32777 #define SET_INT32(pc,i) ((pc)[1] = (jsbytecode)(uint32_t(i) >> 24), (pc)[2] = (jsbytecode)(uint32_t(i) >> 16), (pc)[3] = (jsbytecode)(uint32_t(i) >> 8), (pc)[4] = (jsbytecode)uint32_t(i))
32778
32779
32780
32781
32782
32783 #define INDEX_LIMIT_LOG2 23
32784 #define INDEX_LIMIT (uint32_t(1) << INDEX_LIMIT_LOG2)
32785
32786
32787 #define ARGC_HI(argc) UINT16_HI(argc)
32788 #define ARGC_LO(argc) UINT16_LO(argc)
32789 #define GET_ARGC(pc) GET_UINT16(pc)
32790 #define ARGC_LIMIT UINT16_LIMIT
32791
32792
32793 #define GET_ARGNO(pc) GET_UINT16(pc)
32794 #define SET_ARGNO(pc,argno) SET_UINT16(pc,argno)
32795 #define ARGNO_LEN 2
32796 #define ARGNO_LIMIT UINT16_LIMIT
32797
32798 #define GET_SLOTNO(pc) GET_UINT16(pc)
32799 #define SET_SLOTNO(pc,varno) SET_UINT16(pc,varno)
32800 #define SLOTNO_LEN 2
32801 #define SLOTNO_LIMIT UINT16_LIMIT
32802
32803 struct JSCodeSpec {
32804 int8_t length;
32805 int8_t nuses;
32806 int8_t ndefs;
32807 uint8_t prec;
32808 uint32_t format;
32809
32810 uint32_t type() const { return ((format) & 0x001f); }
32811 };
32812
32813 extern const JSCodeSpec js_CodeSpec[];
32814 extern unsigned js_NumCodeSpecs;
32815 extern const char *js_CodeName[];
32816 extern const char js_EscapeMap[];
32817 # 244 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsopcode.h"
32818 extern JSString *
32819 js_QuoteString(JSContext *cx, JSString *str, jschar quote);
32820 # 258 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsopcode.h"
32821 extern JSPrinter *
32822 js_NewPrinter(JSContext *cx, const char *name, JSFunction *fun,
32823 unsigned indent, JSBool pretty, JSBool grouped, JSBool strict);
32824
32825 extern void
32826 js_DestroyPrinter(JSPrinter *jp);
32827
32828 extern JSString *
32829 js_GetPrinterOutput(JSPrinter *jp);
32830
32831 extern int
32832 js_printf(JSPrinter *jp, const char *format, ...);
32833
32834 extern JSBool
32835 js_puts(JSPrinter *jp, const char *s);
32836
32837 #define GET_ATOM_FROM_BYTECODE(script,pc,pcoff,atom) JS_BEGIN_MACRO JS_ASSERT(js_CodeSpec[*(pc)].format & JOF_ATOM); (atom) = (script)->getAtom(GET_UINT32_INDEX((pc) + (pcoff))); JS_END_MACRO
32838
32839
32840
32841
32842
32843 #define GET_NAME_FROM_BYTECODE(script,pc,pcoff,name) JS_BEGIN_MACRO JSAtom *atom_; GET_ATOM_FROM_BYTECODE(script, pc, pcoff, atom_); JS_ASSERT(js_CodeSpec[*(pc)].format & (JOF_NAME | JOF_PROP)); (name) = atom_->asPropertyName(); JS_END_MACRO
32844
32845
32846
32847
32848
32849
32850
32851 namespace js {
32852
32853 extern unsigned
32854 StackUses(JSScript *script, jsbytecode *pc);
32855
32856 extern unsigned
32857 StackDefs(JSScript *script, jsbytecode *pc);
32858
32859 }
32860
32861
32862
32863
32864 extern JSBool
32865 js_DecompileScript(JSPrinter *jp, JSScript *script);
32866
32867 extern JSBool
32868 js_DecompileFunctionBody(JSPrinter *jp);
32869
32870 extern JSBool
32871 js_DecompileFunction(JSPrinter *jp);
32872 # 317 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsopcode.h"
32873 typedef JSBool (* JSDecompilerPtr)(JSPrinter *);
32874
32875 extern JSString *
32876 js_DecompileToString(JSContext *cx, const char *name, JSFunction *fun,
32877 unsigned indent, JSBool pretty, JSBool grouped, JSBool strict,
32878 JSDecompilerPtr decompiler);
32879 # 336 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsopcode.h"
32880 extern char *
32881 js_DecompileValueGenerator(JSContext *cx, int spindex, jsval v,
32882 JSString *fallback);
32883
32884
32885
32886
32887
32888 extern unsigned
32889 js_ReconstructStackDepth(JSContext *cx, JSScript *script, jsbytecode *pc);
32890
32891
32892
32893
32894
32895 }
32896
32897 #define JSDVG_IGNORE_STACK 0
32898 #define JSDVG_SEARCH_STACK 1
32899
32900
32901
32902
32903 extern size_t
32904 js_GetVariableBytecodeLength(jsbytecode *pc);
32905
32906 namespace js {
32907
32908 static inline char *
32909 DecompileValueGenerator(JSContext *cx, int spindex, const Value &v,
32910 JSString *fallback)
32911 {
32912 return js_DecompileValueGenerator(cx, spindex, v, fallback);
32913 }
32914
32915
32916
32917
32918 class Sprinter
32919 {
32920 public:
32921 struct InvariantChecker
32922 {
32923 const Sprinter *parent;
32924
32925 explicit InvariantChecker(const Sprinter *p) : parent(p) {
32926 parent->checkInvariants();
32927 }
32928
32929 ~InvariantChecker() {
32930 parent->checkInvariants();
32931 }
32932 };
32933
32934 JSContext *context;
32935
32936 private:
32937 static const size_t DefaultSize;
32938
32939
32940
32941 char *base;
32942 size_t size;
32943 ptrdiff_t offset;
32944
32945 bool realloc_(size_t newSize);
32946
32947 public:
32948 explicit Sprinter(JSContext *cx);
32949 ~Sprinter();
32950
32951
32952 bool init();
32953
32954 void checkInvariants() const;
32955
32956 const char *string() const;
32957 const char *stringEnd() const;
32958
32959 char *stringAt(ptrdiff_t off) const;
32960
32961 char &operator[](size_t off);
32962
32963 bool empty() const;
32964
32965
32966
32967
32968
32969
32970 char *reserve(size_t len);
32971
32972 char *reserveAndClear(size_t len);
32973
32974
32975
32976
32977
32978 ptrdiff_t put(const char *s, size_t len);
32979 ptrdiff_t put(const char *s);
32980 ptrdiff_t putString(JSString *str);
32981
32982
32983 int printf(const char *fmt, ...);
32984
32985
32986 void setOffset(const char *end);
32987 void setOffset(ptrdiff_t off);
32988
32989
32990 ptrdiff_t getOffset() const;
32991 ptrdiff_t getOffsetOf(const char *string) const;
32992 };
32993
32994 extern ptrdiff_t
32995 Sprint(Sprinter *sp, const char *format, ...);
32996
32997 extern bool
32998 CallResultEscapes(jsbytecode *pc);
32999
33000 static inline unsigned
33001 GetDecomposeLength(jsbytecode *pc, size_t len)
33002 {
33003
33004
33005
33006
33007 do { } while(0);
33008 return (unsigned) pc[len - 1];
33009 }
33010
33011 static inline unsigned
33012 GetBytecodeLength(jsbytecode *pc)
33013 {
33014 JSOp op = (JSOp)*pc;
33015 do { } while(0);
33016
33017 if (js_CodeSpec[op].length != -1)
33018 return js_CodeSpec[op].length;
33019 return js_GetVariableBytecodeLength(pc);
33020 }
33021
33022 extern bool
33023 IsValidBytecodeOffset(JSContext *cx, JSScript *script, size_t offset);
33024
33025 inline bool
33026 FlowsIntoNext(JSOp op)
33027 {
33028
33029 return op != JSOP_STOP && op != JSOP_RETURN && op != JSOP_RETRVAL && op != JSOP_THROW &&
33030 op != JSOP_GOTO && op != JSOP_RETSUB;
33031 }
33032
33033
33034
33035
33036
33037
33038 class PCCounts
33039 {
33040 friend struct ::JSScript;
33041 double *counts;
33042
33043
33044
33045
33046 public:
33047
33048 enum BaseCounts {
33049 BASE_INTERP = 0,
33050 BASE_METHODJIT,
33051
33052 BASE_METHODJIT_STUBS,
33053 BASE_METHODJIT_CODE,
33054 BASE_METHODJIT_PICS,
33055
33056 BASE_LIMIT
33057 };
33058
33059 enum AccessCounts {
33060 ACCESS_MONOMORPHIC = BASE_LIMIT,
33061 ACCESS_DIMORPHIC,
33062 ACCESS_POLYMORPHIC,
33063
33064 ACCESS_BARRIER,
33065 ACCESS_NOBARRIER,
33066
33067 ACCESS_UNDEFINED,
33068 ACCESS_NULL,
33069 ACCESS_BOOLEAN,
33070 ACCESS_INT32,
33071 ACCESS_DOUBLE,
33072 ACCESS_STRING,
33073 ACCESS_OBJECT,
33074
33075 ACCESS_LIMIT
33076 };
33077
33078 static bool accessOp(JSOp op) {
33079
33080
33081
33082
33083 if (op == JSOP_SETELEM || op == JSOP_SETPROP)
33084 return true;
33085 int format = js_CodeSpec[op].format;
33086 return !!(format & ((1U<<5) | (1U<<25) | (3U<<5) | (2U<<5)))
33087 && !(format & ((1U<<8) | (3U<<10)));
33088 }
33089
33090 enum ElementCounts {
33091 ELEM_ID_INT = ACCESS_LIMIT,
33092 ELEM_ID_DOUBLE,
33093 ELEM_ID_OTHER,
33094 ELEM_ID_UNKNOWN,
33095
33096 ELEM_OBJECT_TYPED,
33097 ELEM_OBJECT_PACKED,
33098 ELEM_OBJECT_DENSE,
33099 ELEM_OBJECT_OTHER,
33100
33101 ELEM_LIMIT
33102 };
33103
33104 static bool elementOp(JSOp op) {
33105 return accessOp(op) && (((js_CodeSpec[op].format) & (7U<<5)) == (3U<<5));
33106 }
33107
33108 enum PropertyCounts {
33109 PROP_STATIC = ACCESS_LIMIT,
33110 PROP_DEFINITE,
33111 PROP_OTHER,
33112
33113 PROP_LIMIT
33114 };
33115
33116 static bool propertyOp(JSOp op) {
33117 return accessOp(op) && (((js_CodeSpec[op].format) & (7U<<5)) == (2U<<5));
33118 }
33119
33120 enum ArithCounts {
33121 ARITH_INT = BASE_LIMIT,
33122 ARITH_DOUBLE,
33123 ARITH_OTHER,
33124 ARITH_UNKNOWN,
33125
33126 ARITH_LIMIT
33127 };
33128
33129 static bool arithOp(JSOp op) {
33130 return !!(js_CodeSpec[op].format & ((3U<<10) | (1U<<28)));
33131 }
33132
33133 static size_t numCounts(JSOp op)
33134 {
33135 if (accessOp(op)) {
33136 if (elementOp(op))
33137 return ELEM_LIMIT;
33138 if (propertyOp(op))
33139 return PROP_LIMIT;
33140 return ACCESS_LIMIT;
33141 }
33142 if (arithOp(op))
33143 return ARITH_LIMIT;
33144 return BASE_LIMIT;
33145 }
33146
33147 static const char *countName(JSOp op, size_t which);
33148
33149 double *rawCounts() { return counts; }
33150
33151 double& get(size_t which) {
33152 do { } while(0);
33153 return counts[which];
33154 }
33155
33156
33157 operator void*() const {
33158 return counts;
33159 }
33160 };
33161
33162 }
33163 # 19 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscript.h" 2
33164 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscope.h" 1
33165 # 20 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscript.h" 2
33166
33167
33168
33169
33170
33171
33172
33173 typedef enum JSTryNoteKind {
33174 JSTRY_CATCH,
33175 JSTRY_FINALLY,
33176 JSTRY_ITER
33177 } JSTryNoteKind;
33178
33179
33180
33181
33182 struct JSTryNote {
33183 uint8_t kind;
33184 uint8_t padding;
33185 uint16_t stackDepth;
33186 uint32_t start;
33187
33188 uint32_t length;
33189 };
33190
33191 namespace js {
33192
33193 struct ConstArray {
33194 js::HeapValue *vector;
33195 uint32_t length;
33196 };
33197
33198 struct ObjectArray {
33199 js::HeapPtrObject *vector;
33200 uint32_t length;
33201 };
33202
33203 struct TryNoteArray {
33204 JSTryNote *vector;
33205 uint32_t length;
33206 };
33207
33208 struct ClosedSlotArray {
33209 uint32_t *vector;
33210 uint32_t length;
33211 };
33212
33213 struct Shape;
33214
33215 enum BindingKind { NONE, ARGUMENT, VARIABLE, CONSTANT };
33216
33217 struct BindingName {
33218 JSAtom *maybeAtom;
33219 BindingKind kind;
33220 };
33221
33222 typedef Vector<BindingName, 32> BindingNames;
33223
33224
33225
33226
33227
33228
33229
33230 class Bindings
33231 {
33232 HeapPtr<Shape> lastBinding;
33233 uint16_t nargs;
33234 uint16_t nvars;
33235 bool hasDup_:1;
33236
33237 inline Shape *initialShape(JSContext *cx) const;
33238 public:
33239 inline Bindings(JSContext *cx);
33240
33241
33242
33243
33244
33245
33246 inline void transfer(JSContext *cx, Bindings *bindings);
33247
33248
33249
33250
33251
33252
33253 inline void clone(JSContext *cx, Bindings *bindings);
33254
33255 uint16_t numArgs() const { return nargs; }
33256 uint16_t numVars() const { return nvars; }
33257 unsigned count() const { return nargs + nvars; }
33258
33259
33260
33261
33262
33263 bool bindingIsArg(uint16_t i) const { return i < nargs; }
33264 bool bindingIsLocal(uint16_t i) const { return i >= nargs; }
33265 uint16_t argToBinding(uint16_t i) { do { } while(0); return i; }
33266 uint16_t localToBinding(uint16_t i) { return i + nargs; }
33267 uint16_t bindingToArg(uint16_t i) { do { } while(0); return i; }
33268 uint16_t bindingToLocal(uint16_t i) { do { } while(0); return i - nargs; }
33269
33270
33271 inline bool ensureShape(JSContext *cx);
33272
33273
33274 inline Shape *lastShape() const;
33275
33276
33277
33278
33279
33280 Shape *callObjectShape(JSContext *cx) const;
33281
33282
33283 inline bool extensibleParents();
33284 bool setExtensibleParents(JSContext *cx);
33285
33286 bool setParent(JSContext *cx, JSObject *obj);
33287
33288 enum {
33289
33290 BINDING_COUNT_LIMIT = 0xFFFF
33291 };
33292 # 162 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscript.h"
33293 bool add(JSContext *cx, HandleAtom name, BindingKind kind);
33294
33295
33296 bool addVariable(JSContext *cx, HandleAtom name) {
33297 return add(cx, name, VARIABLE);
33298 }
33299 bool addConstant(JSContext *cx, HandleAtom name) {
33300 return add(cx, name, CONSTANT);
33301 }
33302 bool addArgument(JSContext *cx, HandleAtom name, uint16_t *slotp) {
33303 do { } while(0);
33304 *slotp = nargs;
33305 return add(cx, name, ARGUMENT);
33306 }
33307 bool addDestructuring(JSContext *cx, uint16_t *slotp) {
33308 *slotp = nargs;
33309 return add(cx, RootedAtom(cx), ARGUMENT);
33310 }
33311
33312 void noteDup() { hasDup_ = true; }
33313 bool hasDup() const { return hasDup_; }
33314
33315
33316
33317
33318
33319
33320
33321 BindingKind lookup(JSContext *cx, JSAtom *name, unsigned *indexp) const;
33322
33323
33324 bool hasBinding(JSContext *cx, JSAtom *name) const {
33325 return lookup(cx, name, __null) != NONE;
33326 }
33327 # 206 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscript.h"
33328 bool getLocalNameArray(JSContext *cx, BindingNames *namesp);
33329
33330
33331
33332
33333
33334
33335 void makeImmutable();
33336 # 224 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscript.h"
33337 const js::Shape *lastArgument() const;
33338 const js::Shape *lastVariable() const;
33339
33340 void trace(JSTracer *trc);
33341
33342 class AutoRooter : private AutoGCRooter
33343 {
33344 public:
33345 explicit AutoRooter(JSContext *cx, Bindings *bindings_
33346 )
33347 : AutoGCRooter(cx, BINDINGS), bindings(bindings_), skip(cx, bindings_)
33348 {
33349 do { } while (0);
33350 }
33351
33352 friend void AutoGCRooter::trace(JSTracer *trc);
33353 void trace(JSTracer *trc);
33354
33355 private:
33356 Bindings *bindings;
33357 SkipRoot skip;
33358
33359 };
33360 };
33361
33362 }
33363
33364 #define JS_OBJECT_ARRAY_SIZE(length) (offsetof(ObjectArray, vector) + sizeof(JSObject *) * (length))
33365
33366
33367
33368 namespace JSC {
33369 class ExecutablePool;
33370 }
33371
33372 namespace js {
33373 namespace mjit {
33374 struct JITScript;
33375 class CallCompiler;
33376 }
33377 }
33378
33379
33380
33381 namespace js {
33382
33383 namespace analyze { class ScriptAnalysis; }
33384
33385 class ScriptCounts
33386 {
33387 friend struct ::JSScript;
33388 friend struct ScriptAndCounts;
33389
33390
33391
33392
33393
33394 PCCounts *pcCountsVector;
33395
33396 public:
33397 ScriptCounts() : pcCountsVector(__null) { }
33398
33399 inline void destroy(FreeOp *fop);
33400
33401 void set(js::ScriptCounts counts) {
33402 pcCountsVector = counts.pcCountsVector;
33403 }
33404 };
33405
33406 typedef HashMap<JSScript *,
33407 ScriptCounts,
33408 DefaultHasher<JSScript *>,
33409 SystemAllocPolicy> ScriptCountsMap;
33410
33411 typedef HashMap<JSScript *,
33412 jschar *,
33413 DefaultHasher<JSScript *>,
33414 SystemAllocPolicy> SourceMapMap;
33415
33416 class DebugScript
33417 {
33418 friend struct ::JSScript;
33419 # 314 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscript.h"
33420 uint32_t stepMode;
33421
33422
33423 uint32_t numSites;
33424
33425
33426
33427
33428
33429 BreakpointSite *breakpoints[1];
33430 };
33431
33432 typedef HashMap<JSScript *,
33433 DebugScript *,
33434 DefaultHasher<JSScript *>,
33435 SystemAllocPolicy> DebugScriptMap;
33436
33437 }
33438
33439 struct JSScript : public js::gc::Cell
33440 {
33441 private:
33442 static const uint32_t stepFlagMask = 0x80000000U;
33443 static const uint32_t stepCountMask = 0x7fffffffU;
33444
33445 public:
33446
33447
33448
33449
33450
33451 class JITScriptHandle
33452 {
33453
33454
33455 friend class js::mjit::CallCompiler;
33456 # 358 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscript.h"
33457 static const js::mjit::JITScript *UNJITTABLE;
33458 js::mjit::JITScript *value;
33459
33460 public:
33461 JITScriptHandle() { value = __null; }
33462
33463 bool isEmpty() { return value == __null; }
33464 bool isUnjittable() { return value == UNJITTABLE; }
33465 bool isValid() { return value > UNJITTABLE; }
33466
33467 js::mjit::JITScript *getValid() {
33468 do { } while(0);
33469 return value;
33470 }
33471
33472 void setEmpty() { value = __null; }
33473 void setUnjittable() { value = const_cast<js::mjit::JITScript *>(UNJITTABLE); }
33474 void setValid(js::mjit::JITScript *jit) {
33475 value = jit;
33476 do { } while(0);
33477 }
33478
33479 static void staticAsserts();
33480 };
33481
33482
33483 struct JITScriptSet
33484 {
33485 JITScriptHandle jitHandleNormal;
33486 JITScriptHandle jitHandleNormalBarriered;
33487 JITScriptHandle jitHandleCtor;
33488 JITScriptHandle jitHandleCtorBarriered;
33489
33490 static size_t jitHandleOffset(bool constructing, bool barriers) {
33491 return constructing
33492 ? (barriers
33493 ? __builtin_offsetof (JITScriptSet, jitHandleCtorBarriered)
33494 : __builtin_offsetof (JITScriptSet, jitHandleCtor))
33495 : (barriers
33496 ? __builtin_offsetof (JITScriptSet, jitHandleNormalBarriered)
33497 : __builtin_offsetof (JITScriptSet, jitHandleNormal));
33498 }
33499 };
33500 # 411 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscript.h"
33501 public:
33502 js::Bindings bindings;
33503
33504
33505
33506
33507 public:
33508 jsbytecode *code;
33509 uint8_t *data;
33510
33511
33512 const char *filename;
33513 js::HeapPtrAtom *atoms;
33514
33515 JSPrincipals *principals;
33516 JSPrincipals *originPrincipals;
33517 # 439 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscript.h"
33518 js::HeapPtr<js::GlobalObject, JSScript*> globalObject;
33519
33520
33521 js::types::TypeScript *types;
33522
33523 private:
33524
33525 JITScriptSet *jitInfo;
33526
33527
33528 js::HeapPtrFunction function_;
33529
33530
33531
33532 public:
33533 uint32_t length;
33534
33535 uint32_t lineno;
33536
33537 uint32_t mainOffset;
33538
33539
33540 uint32_t natoms;
33541
33542 private:
33543 uint32_t useCount;
33544
33545
33546
33547
33548 uint32_t pad32;
33549 # 482 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscript.h"
33550 private:
33551 uint16_t version;
33552
33553 public:
33554 uint16_t nfixed;
33555
33556
33557 uint16_t nTypeSets;
33558
33559
33560 uint16_t nslots;
33561 uint16_t staticLevel;
33562
33563 private:
33564 uint16_t argsSlot_;
33565
33566
33567
33568 public:
33569
33570 enum ArrayKind {
33571 CONSTS,
33572 OBJECTS,
33573 REGEXPS,
33574 TRYNOTES,
33575 CLOSED_ARGS,
33576 CLOSED_VARS,
33577 LIMIT
33578 };
33579
33580 typedef uint8_t ArrayBitsT;
33581
33582 private:
33583
33584
33585
33586 ArrayBitsT hasArrayBits;
33587
33588
33589
33590 public:
33591 bool noScriptRval:1;
33592
33593 bool savedCallerFun:1;
33594 bool strictModeCode:1;
33595 bool compileAndGo:1;
33596 bool bindingsAccessedDynamically:1;
33597 bool warnedAboutTwoArgumentEval:1;
33598
33599
33600 bool warnedAboutUndefinedProp:1;
33601
33602
33603 bool hasSingletons:1;
33604 bool isOuterFunction:1;
33605 bool isInnerFunction:1;
33606
33607 bool isActiveEval:1;
33608 bool isCachedEval:1;
33609 bool uninlineable:1;
33610 bool reentrantOuterFunction:1;
33611 bool typesPurged:1;
33612
33613 bool debugMode:1;
33614 bool failedBoundsCheck:1;
33615
33616 bool callDestroyHook:1;
33617 bool isGenerator:1;
33618 bool hasScriptCounts:1;
33619
33620 bool hasSourceMap:1;
33621
33622 bool hasDebugScript:1;
33623
33624
33625 private:
33626
33627 bool argsHasLocalBinding_:1;
33628 bool needsArgsAnalysis_:1;
33629 bool needsArgsObj_:1;
33630 # 578 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscript.h"
33631 public:
33632 static JSScript *NewScript(JSContext *cx, uint32_t length, uint32_t nsrcnotes, uint32_t natoms,
33633 uint32_t nobjects, uint32_t nregexps,
33634 uint32_t ntrynotes, uint32_t nconsts,
33635 uint16_t nClosedArgs, uint16_t nClosedVars, uint32_t nTypeSets,
33636 JSVersion version);
33637 static JSScript *NewScriptFromEmitter(JSContext *cx, js::BytecodeEmitter *bce);
33638
33639 void setVersion(JSVersion v) { version = v; }
33640
33641
33642 bool argumentsHasLocalBinding() const { return argsHasLocalBinding_; }
33643 jsbytecode *argumentsBytecode() const { do { } while(0); return code; }
33644 unsigned argumentsLocalSlot() const { do { } while(0); return argsSlot_; }
33645 void setArgumentsHasLocalBinding(uint16_t slot);
33646 # 604 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscript.h"
33647 bool analyzedArgsUsage() const { return !needsArgsAnalysis_; }
33648 bool needsArgsObj() const { do { } while(0); return needsArgsObj_; }
33649 void setNeedsArgsObj(bool needsArgsObj);
33650 static bool applySpeculationFailed(JSContext *cx, JSScript *script);
33651 # 618 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscript.h"
33652 bool argsObjAliasesFormals() const {
33653 return needsArgsObj() && !strictModeCode;
33654 }
33655
33656
33657 JSScript *&evalHashLink() { return *globalObject.unsafeGetUnioned(); }
33658
33659
33660
33661
33662
33663 JSFunction *function() const { return function_; }
33664 void setFunction(JSFunction *fun);
33665
33666
33667
33668
33669 unsigned id() { return 0; }
33670
33671
33672
33673 inline bool ensureHasTypes(JSContext *cx);
33674
33675
33676
33677
33678
33679
33680
33681 inline bool ensureRanAnalysis(JSContext *cx, JSObject *scope);
33682
33683
33684 inline bool ensureRanInference(JSContext *cx);
33685
33686 inline bool hasAnalysis();
33687 inline void clearAnalysis();
33688 inline js::analyze::ScriptAnalysis *analysis();
33689
33690
33691
33692
33693
33694 bool typeSetFunction(JSContext *cx, JSFunction *fun, bool singleton = false);
33695
33696 inline bool hasGlobal() const;
33697 inline bool hasClearedGlobal() const;
33698
33699 inline js::GlobalObject *global() const;
33700 inline js::types::TypeScriptNesting *nesting() const;
33701
33702 inline void clearNesting();
33703
33704
33705 js::GlobalObject *getGlobalObjectOrNull() const {
33706 return (isCachedEval || isActiveEval) ? __null : globalObject.get();
33707 }
33708
33709 private:
33710 bool makeTypes(JSContext *cx);
33711 bool makeAnalysis(JSContext *cx);
33712
33713
33714 private:
33715
33716
33717 friend class js::mjit::CallCompiler;
33718
33719 public:
33720 bool hasJITInfo() {
33721 return jitInfo != __null;
33722 }
33723
33724 static size_t offsetOfJITInfo() { return __builtin_offsetof (JSScript, jitInfo); }
33725
33726 inline bool ensureHasJITInfo(JSContext *cx);
33727 inline void destroyJITInfo(js::FreeOp *fop);
33728
33729 JITScriptHandle *jitHandle(bool constructing, bool barriers) {
33730 do { } while(0);
33731 return constructing
33732 ? (barriers ? &jitInfo->jitHandleCtorBarriered : &jitInfo->jitHandleCtor)
33733 : (barriers ? &jitInfo->jitHandleNormalBarriered : &jitInfo->jitHandleNormal);
33734 }
33735
33736 js::mjit::JITScript *getJIT(bool constructing, bool barriers) {
33737 if (!jitInfo)
33738 return __null;
33739 JITScriptHandle *jith = jitHandle(constructing, barriers);
33740 return jith->isValid() ? jith->getValid() : __null;
33741 }
33742
33743 static void ReleaseCode(js::FreeOp *fop, JITScriptHandle *jith);
33744
33745
33746 inline void **nativeMap(bool constructing);
33747 inline void *nativeCodeForPC(bool constructing, jsbytecode *pc);
33748
33749 uint32_t getUseCount() const { return useCount; }
33750 uint32_t incUseCount() { return ++useCount; }
33751 uint32_t *addressOfUseCount() { return &useCount; }
33752 void resetUseCount() { useCount = 0; }
33753
33754
33755
33756
33757
33758
33759 size_t sizeOfJitScripts(JSMallocSizeOfFun mallocSizeOf);
33760
33761
33762 public:
33763 bool initScriptCounts(JSContext *cx);
33764 js::PCCounts getPCCounts(jsbytecode *pc);
33765 js::ScriptCounts releaseScriptCounts();
33766 void destroyScriptCounts(js::FreeOp *fop);
33767
33768 bool setSourceMap(JSContext *cx, jschar *sourceMap);
33769 jschar *getSourceMap();
33770 jschar *releaseSourceMap();
33771 void destroySourceMap(js::FreeOp *fop);
33772
33773 jsbytecode *main() {
33774 return code + mainOffset;
33775 }
33776
33777
33778
33779
33780
33781
33782 size_t computedSizeOfData();
33783 size_t sizeOfData(JSMallocSizeOfFun mallocSizeOf);
33784
33785 uint32_t numNotes();
33786
33787
33788 jssrcnote *notes() { return (jssrcnote *)(code + length); }
33789
33790 bool hasArray(ArrayKind kind) { return (hasArrayBits & (1 << kind)); }
33791 void setHasArray(ArrayKind kind) { hasArrayBits |= (1 << kind); }
33792 void cloneHasArray(JSScript *script) { hasArrayBits = script->hasArrayBits; }
33793
33794 bool hasConsts() { return hasArray(CONSTS); }
33795 bool hasObjects() { return hasArray(OBJECTS); }
33796 bool hasRegexps() { return hasArray(REGEXPS); }
33797 bool hasTrynotes() { return hasArray(TRYNOTES); }
33798 bool hasClosedArgs() { return hasArray(CLOSED_ARGS); }
33799 bool hasClosedVars() { return hasArray(CLOSED_VARS); }
33800
33801 #define OFF(fooOff,hasFoo,t) (fooOff() + (hasFoo() ? sizeof(t) : 0))
33802
33803 size_t constsOffset() { return 0; }
33804 size_t objectsOffset() { return (constsOffset() + (hasConsts() ? sizeof(js::ConstArray) : 0)); }
33805 size_t regexpsOffset() { return (objectsOffset() + (hasObjects() ? sizeof(js::ObjectArray) : 0)); }
33806 size_t trynotesOffset() { return (regexpsOffset() + (hasRegexps() ? sizeof(js::ObjectArray) : 0)); }
33807 size_t closedArgsOffset() { return (trynotesOffset() + (hasTrynotes() ? sizeof(js::TryNoteArray) : 0)); }
33808 size_t closedVarsOffset() { return (closedArgsOffset() + (hasClosedArgs() ? sizeof(js::ClosedSlotArray) : 0)); }
33809
33810 js::ConstArray *consts() {
33811 do { } while(0);
33812 return reinterpret_cast<js::ConstArray *>(data + constsOffset());
33813 }
33814
33815 js::ObjectArray *objects() {
33816 do { } while(0);
33817 return reinterpret_cast<js::ObjectArray *>(data + objectsOffset());
33818 }
33819
33820 js::ObjectArray *regexps() {
33821 do { } while(0);
33822 return reinterpret_cast<js::ObjectArray *>(data + regexpsOffset());
33823 }
33824
33825 js::TryNoteArray *trynotes() {
33826 do { } while(0);
33827 return reinterpret_cast<js::TryNoteArray *>(data + trynotesOffset());
33828 }
33829
33830 js::ClosedSlotArray *closedArgs() {
33831 do { } while(0);
33832 return reinterpret_cast<js::ClosedSlotArray *>(data + closedArgsOffset());
33833 }
33834
33835 js::ClosedSlotArray *closedVars() {
33836 do { } while(0);
33837 return reinterpret_cast<js::ClosedSlotArray *>(data + closedVarsOffset());
33838 }
33839
33840 uint32_t numClosedArgs() {
33841 return hasClosedArgs() ? closedArgs()->length : 0;
33842 }
33843
33844 uint32_t numClosedVars() {
33845 return hasClosedVars() ? closedVars()->length : 0;
33846 }
33847
33848 js::HeapPtrAtom &getAtom(size_t index) const {
33849 do { } while(0);
33850 return atoms[index];
33851 }
33852
33853 js::PropertyName *getName(size_t index) {
33854 return getAtom(index)->asPropertyName();
33855 }
33856
33857 JSObject *getObject(size_t index) {
33858 js::ObjectArray *arr = objects();
33859 do { } while(0);
33860 return arr->vector[index];
33861 }
33862
33863 JSVersion getVersion() const {
33864 return JSVersion(version);
33865 }
33866
33867 inline JSFunction *getFunction(size_t index);
33868 inline JSFunction *getCallerFunction();
33869
33870 inline JSObject *getRegExp(size_t index);
33871
33872 const js::Value &getConst(size_t index) {
33873 js::ConstArray *arr = consts();
33874 do { } while(0);
33875 return arr->vector[index];
33876 }
33877
33878
33879
33880
33881
33882
33883 inline bool isEmpty() const;
33884
33885 uint32_t getClosedArg(uint32_t index) {
33886 js::ClosedSlotArray *arr = closedArgs();
33887 do { } while(0);
33888 return arr->vector[index];
33889 }
33890
33891 uint32_t getClosedVar(uint32_t index) {
33892 js::ClosedSlotArray *arr = closedVars();
33893 do { } while(0);
33894 return arr->vector[index];
33895 }
33896 # 870 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscript.h"
33897 private:
33898
33899
33900
33901
33902 void recompileForStepMode(js::FreeOp *fop);
33903
33904
33905 bool tryNewStepMode(JSContext *cx, uint32_t newValue);
33906
33907 bool ensureHasDebugScript(JSContext *cx);
33908 js::DebugScript *debugScript();
33909 js::DebugScript *releaseDebugScript();
33910 void destroyDebugScript(js::FreeOp *fop);
33911
33912 public:
33913 bool hasBreakpointsAt(jsbytecode *pc) { return !!getBreakpointSite(pc); }
33914 bool hasAnyBreakpointsOrStepMode() { return hasDebugScript; }
33915
33916 js::BreakpointSite *getBreakpointSite(jsbytecode *pc)
33917 {
33918 do { } while(0);
33919 return hasDebugScript ? debugScript()->breakpoints[pc - code] : __null;
33920 }
33921
33922 js::BreakpointSite *getOrCreateBreakpointSite(JSContext *cx, jsbytecode *pc,
33923 js::GlobalObject *scriptGlobal);
33924
33925 void destroyBreakpointSite(js::FreeOp *fop, jsbytecode *pc);
33926
33927 void clearBreakpointsIn(js::FreeOp *fop, js::Debugger *dbg, JSObject *handler);
33928 void clearTraps(js::FreeOp *fop);
33929
33930 void markTrapClosures(JSTracer *trc);
33931
33932
33933
33934
33935
33936
33937
33938 bool setStepModeFlag(JSContext *cx, bool step);
33939
33940
33941
33942
33943
33944
33945
33946 bool changeStepModeCount(JSContext *cx, int delta);
33947
33948 bool stepModeEnabled() { return hasDebugScript && !!debugScript()->stepMode; }
33949
33950
33951
33952
33953
33954 void finalize(js::FreeOp *fop);
33955
33956 static inline void writeBarrierPre(JSScript *script);
33957 static inline void writeBarrierPost(JSScript *script, void *addr);
33958
33959 static inline js::ThingRootKind rootKind() { return js::THING_ROOT_SCRIPT; }
33960
33961 static JSPrincipals *normalizeOriginPrincipals(JSPrincipals *principals,
33962 JSPrincipals *originPrincipals) {
33963 return originPrincipals ? originPrincipals : principals;
33964 }
33965
33966 void markChildren(JSTracer *trc);
33967 };
33968
33969 typedef int moz_static_assert87[(sizeof(JSScript::ArrayBitsT) * 8 >= JSScript::LIMIT) ? 1 : -1];
33970
33971
33972 typedef int moz_static_assert88[(sizeof(JSScript) % js::gc::Cell::CellSize == 0) ? 1 : -1];
33973
33974 static inline unsigned
33975 StackDepth(JSScript *script)
33976 {
33977 return script->nslots - script->nfixed;
33978 }
33979
33980
33981
33982
33983
33984
33985
33986 extern __attribute__((visibility("default"))) void
33987 js_CallNewScriptHook(JSContext *cx, JSScript *script, JSFunction *fun);
33988
33989 namespace js {
33990
33991 extern void
33992 CallDestroyScriptHook(FreeOp *fop, JSScript *script);
33993
33994 extern const char *
33995 SaveScriptFilename(JSContext *cx, const char *filename);
33996
33997 struct ScriptFilenameEntry
33998 {
33999 bool marked;
34000 char filename[1];
34001
34002 static ScriptFilenameEntry *fromFilename(const char *filename) {
34003 return (ScriptFilenameEntry *)(filename - __builtin_offsetof (ScriptFilenameEntry, filename));
34004 }
34005 };
34006
34007 struct ScriptFilenameHasher
34008 {
34009 typedef const char *Lookup;
34010 static HashNumber hash(const char *l) { return JS_HashString(l); }
34011 static bool match(const ScriptFilenameEntry *e, const char *l) {
34012 return strcmp(e->filename, l) == 0;
34013 }
34014 };
34015
34016 typedef HashSet<ScriptFilenameEntry *,
34017 ScriptFilenameHasher,
34018 SystemAllocPolicy> ScriptFilenameTable;
34019
34020 inline void
34021 MarkScriptFilename(JSRuntime *rt, const char *filename);
34022
34023 extern void
34024 SweepScriptFilenames(JSRuntime *rt);
34025
34026 extern void
34027 FreeScriptFilenames(JSRuntime *rt);
34028
34029 struct ScriptAndCounts
34030 {
34031 JSScript *script;
34032 ScriptCounts scriptCounts;
34033
34034 PCCounts &getPCCounts(jsbytecode *pc) const {
34035 do { } while(0);
34036 return scriptCounts.pcCountsVector[pc - script->code];
34037 }
34038 };
34039
34040 }
34041
34042
34043
34044
34045
34046
34047 #define js_GetSrcNote(script,pc) js_GetSrcNoteCached(cx, script, pc)
34048
34049 extern jssrcnote *
34050 js_GetSrcNoteCached(JSContext *cx, JSScript *script, jsbytecode *pc);
34051
34052 extern jsbytecode *
34053 js_LineNumberToPC(JSScript *script, unsigned lineno);
34054
34055 extern __attribute__((visibility("default"))) unsigned
34056 js_GetScriptLineExtent(JSScript *script);
34057
34058 namespace js {
34059
34060 extern unsigned
34061 PCToLineNumber(JSScript *script, jsbytecode *pc);
34062
34063 extern unsigned
34064 PCToLineNumber(unsigned startLine, jssrcnote *notes, jsbytecode *code, jsbytecode *pc);
34065
34066 extern unsigned
34067 CurrentLine(JSContext *cx);
34068 # 1051 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscript.h"
34069 enum LineOption {
34070 CALLED_FROM_JSOP_EVAL,
34071 NOT_CALLED_FROM_JSOP_EVAL
34072 };
34073
34074 inline void
34075 CurrentScriptFileLineOrigin(JSContext *cx, unsigned *linenop, LineOption = NOT_CALLED_FROM_JSOP_EVAL);
34076
34077 extern JSScript *
34078 CloneScript(JSContext *cx, JSScript *script);
34079
34080
34081
34082
34083
34084
34085 template<XDRMode mode>
34086 bool
34087 XDRScript(XDRState<mode> *xdr, JSScript **scriptp, JSScript *parentScript);
34088
34089 }
34090 # 17 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsfun.h" 2
34091 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsstr.h" 1
34092 # 18 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsfun.h" 2
34093 # 37 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsfun.h"
34094 #define JSFUN_PROTOTYPE 0x0800
34095
34096
34097 #define JSFUN_EXPR_CLOSURE 0x1000
34098 #define JSFUN_EXTENDED 0x2000
34099 #define JSFUN_INTERPRETED 0x4000
34100 #define JSFUN_NULL_CLOSURE 0x8000
34101 #define JSFUN_KINDMASK 0xc000
34102
34103
34104 namespace js { class FunctionExtended; }
34105
34106 struct JSFunction : public JSObject
34107 {
34108 uint16_t nargs;
34109
34110 uint16_t flags;
34111 union U {
34112 js::Native native;
34113 struct Scripted {
34114 JSScript *script_;
34115
34116 JSObject *env_;
34117
34118 } i;
34119 void *nativeOrScript;
34120 } u;
34121 js::HeapPtrAtom atom;
34122
34123 bool hasDefaults() const { return flags & 0x0400; }
34124 bool hasRest() const { return flags & 0x0100; }
34125 bool isInterpreted() const { return kind() >= 0x4000; }
34126 bool isNative() const { return !isInterpreted(); }
34127 bool isNativeConstructor() const { return flags & 0x0200; }
34128 bool isHeavyweight() const { return ((flags) & 0x80); }
34129 bool isNullClosure() const { return kind() == 0x8000; }
34130 bool isFunctionPrototype() const { return flags & 0x0800; }
34131 bool isInterpretedConstructor() const { return isInterpreted() && !isFunctionPrototype(); }
34132
34133 uint16_t kind() const { return flags & 0xc000; }
34134 void setKind(uint16_t k) {
34135 do { } while(0);
34136 flags = (flags & ~0xc000) | k;
34137 }
34138
34139
34140 inline bool inStrictMode() const;
34141
34142 void setArgCount(uint16_t nargs) {
34143 do { } while(0);
34144 this->nargs = nargs;
34145 }
34146
34147 void setHasRest() {
34148 do { } while(0);
34149 this->flags |= 0x0100;
34150 }
34151
34152 void setHasDefaults() {
34153 do { } while(0);
34154 this->flags |= 0x0400;
34155 }
34156
34157
34158 enum { MAX_ARGS_AND_VARS = 2 * ((1U << 16) - 1) };
34159
34160
34161
34162
34163
34164 inline JSObject *environment() const;
34165 inline void setEnvironment(JSObject *obj);
34166 inline void initEnvironment(JSObject *obj);
34167
34168 static inline size_t offsetOfEnvironment() { return __builtin_offsetof (JSFunction, u.i.env_); }
34169
34170 JSScript *script() const {
34171 do { } while(0);
34172 return *(js::HeapPtrScript *)&u.i.script_;
34173 }
34174
34175 js::HeapPtrScript &mutableScript() {
34176 do { } while(0);
34177 return *(js::HeapPtrScript *)&u.i.script_;
34178 }
34179
34180 inline void setScript(JSScript *script_);
34181 inline void initScript(JSScript *script_);
34182
34183 JSScript *maybeScript() const {
34184 return isInterpreted() ? script() : __null;
34185 }
34186
34187 JSNative native() const {
34188 do { } while(0);
34189 return u.native;
34190 }
34191
34192 JSNative maybeNative() const {
34193 return isInterpreted() ? __null : native();
34194 }
34195
34196 static unsigned offsetOfNativeOrScript() {
34197 typedef int moz_static_assert89[(__builtin_offsetof (U, native) == __builtin_offsetof (U, i.script_)) ? 1 : -1];
34198 typedef int moz_static_assert90[(__builtin_offsetof (U, native) == __builtin_offsetof (U, nativeOrScript)) ? 1 : -1];
34199 return __builtin_offsetof (JSFunction, u.nativeOrScript);
34200 }
34201
34202
34203
34204 static const js::gc::AllocKind FinalizeKind = js::gc::FINALIZE_OBJECT2_BACKGROUND;
34205 static const js::gc::AllocKind ExtendedFinalizeKind = js::gc::FINALIZE_OBJECT4_BACKGROUND;
34206 # 163 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsfun.h"
34207 inline void trace(JSTracer *trc);
34208
34209
34210
34211 inline bool initBoundFunction(JSContext *cx, js::HandleValue thisArg,
34212 const js::Value *args, unsigned argslen);
34213
34214 inline JSObject *getBoundFunctionTarget() const;
34215 inline const js::Value &getBoundFunctionThis() const;
34216 inline const js::Value &getBoundFunctionArgument(unsigned which) const;
34217 inline size_t getBoundFunctionArgumentCount() const;
34218
34219 private:
34220 inline js::FunctionExtended *toExtended();
34221 inline const js::FunctionExtended *toExtended() const;
34222
34223 inline bool isExtended() const {
34224 typedef int moz_static_assert91[(FinalizeKind != ExtendedFinalizeKind) ? 1 : -1];
34225 do { } while(0);
34226 return !!(flags & 0x2000);
34227 }
34228
34229 public:
34230
34231 inline void initializeExtended();
34232 inline void setExtendedSlot(size_t which, const js::Value &val);
34233 inline const js::Value &getExtendedSlot(size_t which) const;
34234
34235 private:
34236
34237
34238
34239
34240 inline JSFunction *toFunction() ;
34241 inline const JSFunction *toFunction() const ;
34242 };
34243
34244 inline JSFunction *
34245 JSObject::toFunction()
34246 {
34247 do { } while(0);
34248 return static_cast<JSFunction *>(this);
34249 }
34250
34251 inline const JSFunction *
34252 JSObject::toFunction() const
34253 {
34254 do { } while(0);
34255 return static_cast<const JSFunction *>(this);
34256 }
34257
34258 extern JSString *
34259 fun_toStringHelper(JSContext *cx, JSObject *obj, unsigned indent);
34260
34261 extern JSFunction *
34262 js_NewFunction(JSContext *cx, JSObject *funobj, JSNative native, unsigned nargs,
34263 unsigned flags, js::HandleObject parent, JSAtom *atom,
34264 js::gc::AllocKind kind = JSFunction::FinalizeKind);
34265
34266 extern JSFunction *
34267 js_CloneFunctionObject(JSContext *cx, js::HandleFunction fun,
34268 js::HandleObject parent, js::HandleObject proto,
34269 js::gc::AllocKind kind = JSFunction::FinalizeKind);
34270
34271 extern JSFunction *
34272 js_DefineFunction(JSContext *cx, js::HandleObject obj, js::HandleId id, JSNative native,
34273 unsigned nargs, unsigned flags,
34274 js::gc::AllocKind kind = JSFunction::FinalizeKind);
34275
34276
34277
34278
34279 #define JSV2F_CONSTRUCT INITIAL_CONSTRUCT
34280 #define JSV2F_SEARCH_STACK 0x10000
34281
34282 extern JSFunction *
34283 js_ValueToFunction(JSContext *cx, const js::Value *vp, unsigned flags);
34284
34285 extern JSObject *
34286 js_ValueToCallableObject(JSContext *cx, js::Value *vp, unsigned flags);
34287
34288 extern void
34289 js_ReportIsNotFunction(JSContext *cx, const js::Value *vp, unsigned flags);
34290
34291 extern void
34292 js_PutCallObject(js::StackFrame *fp, js::CallObject &callobj);
34293
34294 namespace js {
34295
34296
34297
34298
34299
34300
34301 class FunctionExtended : public JSFunction
34302 {
34303 friend struct JSFunction;
34304
34305
34306 HeapValue extendedSlots[2];
34307 };
34308
34309 }
34310
34311 inline js::FunctionExtended *
34312 JSFunction::toExtended()
34313 {
34314 do { } while(0);
34315 return static_cast<js::FunctionExtended *>(this);
34316 }
34317
34318 inline const js::FunctionExtended *
34319 JSFunction::toExtended() const
34320 {
34321 do { } while(0);
34322 return static_cast<const js::FunctionExtended *>(this);
34323 }
34324
34325 extern void
34326 js_PutArgsObject(js::StackFrame *fp);
34327
34328 inline bool
34329 js_IsNamedLambda(JSFunction *fun) { return (fun->flags & 0x08) && fun->atom; }
34330
34331 namespace js {
34332
34333 template<XDRMode mode>
34334 bool
34335 XDRInterpretedFunction(XDRState<mode> *xdr, JSObject **objp, JSScript *parentScript);
34336
34337 extern JSObject *
34338 CloneInterpretedFunction(JSContext *cx, JSFunction *fun);
34339
34340 }
34341
34342 extern JSBool
34343 js_fun_apply(JSContext *cx, unsigned argc, js::Value *vp);
34344
34345 extern JSBool
34346 js_fun_call(JSContext *cx, unsigned argc, js::Value *vp);
34347
34348 extern JSObject*
34349 js_fun_bind(JSContext *cx, js::HandleObject target, js::HandleValue thisArg,
34350 js::Value *boundArgs, unsigned argslen);
34351 # 12 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack.h" 2
34352 # 1 "./jsautooplen.h" 1
34353
34354
34355
34356
34357
34358 #define JSOP_NOP_LENGTH 1
34359 #define JSOP_UNDEFINED_LENGTH 1
34360 #define JSOP_POPV_LENGTH 1
34361 #define JSOP_ENTERWITH_LENGTH 1
34362 #define JSOP_LEAVEWITH_LENGTH 1
34363 #define JSOP_RETURN_LENGTH 1
34364 #define JSOP_GOTO_LENGTH 5
34365 #define JSOP_IFEQ_LENGTH 5
34366 #define JSOP_IFNE_LENGTH 5
34367 #define JSOP_ARGUMENTS_LENGTH 1
34368 #define JSOP_SWAP_LENGTH 1
34369 #define JSOP_POPN_LENGTH 3
34370 #define JSOP_DUP_LENGTH 1
34371 #define JSOP_DUP2_LENGTH 1
34372 #define JSOP_SETCONST_LENGTH 5
34373 #define JSOP_BITOR_LENGTH 1
34374 #define JSOP_BITXOR_LENGTH 1
34375 #define JSOP_BITAND_LENGTH 1
34376 #define JSOP_EQ_LENGTH 1
34377 #define JSOP_NE_LENGTH 1
34378 #define JSOP_LT_LENGTH 1
34379 #define JSOP_LE_LENGTH 1
34380 #define JSOP_GT_LENGTH 1
34381 #define JSOP_GE_LENGTH 1
34382 #define JSOP_LSH_LENGTH 1
34383 #define JSOP_RSH_LENGTH 1
34384 #define JSOP_URSH_LENGTH 1
34385 #define JSOP_ADD_LENGTH 1
34386 #define JSOP_SUB_LENGTH 1
34387 #define JSOP_MUL_LENGTH 1
34388 #define JSOP_DIV_LENGTH 1
34389 #define JSOP_MOD_LENGTH 1
34390 #define JSOP_NOT_LENGTH 1
34391 #define JSOP_BITNOT_LENGTH 1
34392 #define JSOP_NEG_LENGTH 1
34393 #define JSOP_POS_LENGTH 1
34394 #define JSOP_DELNAME_LENGTH 5
34395 #define JSOP_DELPROP_LENGTH 5
34396 #define JSOP_DELELEM_LENGTH 1
34397 #define JSOP_TYPEOF_LENGTH 1
34398 #define JSOP_VOID_LENGTH 1
34399 #define JSOP_INCNAME_LENGTH 6
34400 #define JSOP_INCPROP_LENGTH 6
34401 #define JSOP_INCELEM_LENGTH 2
34402 #define JSOP_DECNAME_LENGTH 6
34403 #define JSOP_DECPROP_LENGTH 6
34404 #define JSOP_DECELEM_LENGTH 2
34405 #define JSOP_NAMEINC_LENGTH 6
34406 #define JSOP_PROPINC_LENGTH 6
34407 #define JSOP_ELEMINC_LENGTH 2
34408 #define JSOP_NAMEDEC_LENGTH 6
34409 #define JSOP_PROPDEC_LENGTH 6
34410 #define JSOP_ELEMDEC_LENGTH 2
34411 #define JSOP_GETPROP_LENGTH 5
34412 #define JSOP_SETPROP_LENGTH 5
34413 #define JSOP_GETELEM_LENGTH 1
34414 #define JSOP_SETELEM_LENGTH 1
34415 #define JSOP_CALLNAME_LENGTH 5
34416 #define JSOP_CALL_LENGTH 3
34417 #define JSOP_NAME_LENGTH 5
34418 #define JSOP_DOUBLE_LENGTH 5
34419 #define JSOP_STRING_LENGTH 5
34420 #define JSOP_ZERO_LENGTH 1
34421 #define JSOP_ONE_LENGTH 1
34422 #define JSOP_NULL_LENGTH 1
34423 #define JSOP_THIS_LENGTH 1
34424 #define JSOP_FALSE_LENGTH 1
34425 #define JSOP_TRUE_LENGTH 1
34426 #define JSOP_OR_LENGTH 5
34427 #define JSOP_AND_LENGTH 5
34428 #define JSOP_TABLESWITCH_LENGTH -1
34429 #define JSOP_LOOKUPSWITCH_LENGTH -1
34430 #define JSOP_STRICTEQ_LENGTH 1
34431 #define JSOP_STRICTNE_LENGTH 1
34432 #define JSOP_SETCALL_LENGTH 1
34433 #define JSOP_ITER_LENGTH 2
34434 #define JSOP_MOREITER_LENGTH 1
34435 #define JSOP_ITERNEXT_LENGTH 2
34436 #define JSOP_ENDITER_LENGTH 1
34437 #define JSOP_FUNAPPLY_LENGTH 3
34438 #define JSOP_OBJECT_LENGTH 5
34439 #define JSOP_POP_LENGTH 1
34440 #define JSOP_NEW_LENGTH 3
34441 #define JSOP_UNUSED0_LENGTH 1
34442 #define JSOP_GETARG_LENGTH 3
34443 #define JSOP_SETARG_LENGTH 3
34444 #define JSOP_GETLOCAL_LENGTH 3
34445 #define JSOP_SETLOCAL_LENGTH 3
34446 #define JSOP_UINT16_LENGTH 3
34447 #define JSOP_NEWINIT_LENGTH 5
34448 #define JSOP_NEWARRAY_LENGTH 4
34449 #define JSOP_NEWOBJECT_LENGTH 5
34450 #define JSOP_ENDINIT_LENGTH 1
34451 #define JSOP_INITPROP_LENGTH 5
34452 #define JSOP_INITELEM_LENGTH 1
34453 #define JSOP_UNUSED14_LENGTH 1
34454 #define JSOP_UNUSED15_LENGTH 1
34455 #define JSOP_INCARG_LENGTH 3
34456 #define JSOP_DECARG_LENGTH 3
34457 #define JSOP_ARGINC_LENGTH 3
34458 #define JSOP_ARGDEC_LENGTH 3
34459 #define JSOP_INCLOCAL_LENGTH 3
34460 #define JSOP_DECLOCAL_LENGTH 3
34461 #define JSOP_LOCALINC_LENGTH 3
34462 #define JSOP_LOCALDEC_LENGTH 3
34463 #define JSOP_LEAVEFORLETIN_LENGTH 1
34464 #define JSOP_LABEL_LENGTH 5
34465 #define JSOP_UNUSED3_LENGTH 1
34466 #define JSOP_FUNCALL_LENGTH 3
34467 #define JSOP_LOOPHEAD_LENGTH 1
34468 #define JSOP_BINDNAME_LENGTH 5
34469 #define JSOP_SETNAME_LENGTH 5
34470 #define JSOP_THROW_LENGTH 1
34471 #define JSOP_IN_LENGTH 1
34472 #define JSOP_INSTANCEOF_LENGTH 1
34473 #define JSOP_DEBUGGER_LENGTH 1
34474 #define JSOP_GOSUB_LENGTH 5
34475 #define JSOP_RETSUB_LENGTH 1
34476 #define JSOP_EXCEPTION_LENGTH 1
34477 #define JSOP_LINENO_LENGTH 3
34478 #define JSOP_CONDSWITCH_LENGTH 1
34479 #define JSOP_CASE_LENGTH 5
34480 #define JSOP_DEFAULT_LENGTH 5
34481 #define JSOP_EVAL_LENGTH 3
34482 #define JSOP_ENUMELEM_LENGTH 1
34483 #define JSOP_GETTER_LENGTH 1
34484 #define JSOP_SETTER_LENGTH 1
34485 #define JSOP_DEFFUN_LENGTH 5
34486 #define JSOP_DEFCONST_LENGTH 5
34487 #define JSOP_DEFVAR_LENGTH 5
34488 #define JSOP_LAMBDA_LENGTH 5
34489 #define JSOP_CALLEE_LENGTH 1
34490 #define JSOP_UNUSED31_LENGTH 1
34491 #define JSOP_PICK_LENGTH 2
34492 #define JSOP_TRY_LENGTH 1
34493 #define JSOP_FINALLY_LENGTH 1
34494 #define JSOP_GETALIASEDVAR_LENGTH 9
34495 #define JSOP_CALLALIASEDVAR_LENGTH 9
34496 #define JSOP_SETALIASEDVAR_LENGTH 9
34497 #define JSOP_INCALIASEDVAR_LENGTH 10
34498 #define JSOP_DECALIASEDVAR_LENGTH 10
34499 #define JSOP_ALIASEDVARINC_LENGTH 10
34500 #define JSOP_ALIASEDVARDEC_LENGTH 10
34501 #define JSOP_UNUSED8_LENGTH 1
34502 #define JSOP_UNUSED9_LENGTH 1
34503 #define JSOP_UNUSED10_LENGTH 1
34504 #define JSOP_UNUSED11_LENGTH 1
34505 #define JSOP_UNUSED12_LENGTH 1
34506 #define JSOP_UNUSED13_LENGTH 1
34507 #define JSOP_BACKPATCH_LENGTH 5
34508 #define JSOP_BACKPATCH_POP_LENGTH 5
34509 #define JSOP_THROWING_LENGTH 1
34510 #define JSOP_SETRVAL_LENGTH 1
34511 #define JSOP_RETRVAL_LENGTH 1
34512 #define JSOP_GETGNAME_LENGTH 5
34513 #define JSOP_SETGNAME_LENGTH 5
34514 #define JSOP_INCGNAME_LENGTH 6
34515 #define JSOP_DECGNAME_LENGTH 6
34516 #define JSOP_GNAMEINC_LENGTH 6
34517 #define JSOP_GNAMEDEC_LENGTH 6
34518 #define JSOP_REGEXP_LENGTH 5
34519 #define JSOP_DEFXMLNS_LENGTH 1
34520 #define JSOP_ANYNAME_LENGTH 1
34521 #define JSOP_QNAMEPART_LENGTH 5
34522 #define JSOP_QNAMECONST_LENGTH 5
34523 #define JSOP_QNAME_LENGTH 1
34524 #define JSOP_TOATTRNAME_LENGTH 1
34525 #define JSOP_TOATTRVAL_LENGTH 1
34526 #define JSOP_ADDATTRNAME_LENGTH 1
34527 #define JSOP_ADDATTRVAL_LENGTH 1
34528 #define JSOP_BINDXMLNAME_LENGTH 1
34529 #define JSOP_SETXMLNAME_LENGTH 1
34530 #define JSOP_XMLNAME_LENGTH 1
34531 #define JSOP_DESCENDANTS_LENGTH 1
34532 #define JSOP_FILTER_LENGTH 5
34533 #define JSOP_ENDFILTER_LENGTH 5
34534 #define JSOP_TOXML_LENGTH 1
34535 #define JSOP_TOXMLLIST_LENGTH 1
34536 #define JSOP_XMLTAGEXPR_LENGTH 1
34537 #define JSOP_XMLELTEXPR_LENGTH 1
34538 #define JSOP_XMLCDATA_LENGTH 5
34539 #define JSOP_XMLCOMMENT_LENGTH 5
34540 #define JSOP_XMLPI_LENGTH 5
34541 #define JSOP_DELDESC_LENGTH 1
34542 #define JSOP_CALLPROP_LENGTH 5
34543 #define JSOP_ENTERLET0_LENGTH 5
34544 #define JSOP_ENTERLET1_LENGTH 5
34545 #define JSOP_UINT24_LENGTH 4
34546 #define JSOP_UNUSED18_LENGTH 1
34547 #define JSOP_UNUSED19_LENGTH 1
34548 #define JSOP_UNUSED20_LENGTH 1
34549 #define JSOP_STARTXML_LENGTH 1
34550 #define JSOP_STARTXMLEXPR_LENGTH 1
34551 #define JSOP_CALLELEM_LENGTH 1
34552 #define JSOP_STOP_LENGTH 1
34553 #define JSOP_GETXPROP_LENGTH 5
34554 #define JSOP_CALLXMLNAME_LENGTH 1
34555 #define JSOP_TYPEOFEXPR_LENGTH 1
34556 #define JSOP_ENTERBLOCK_LENGTH 5
34557 #define JSOP_LEAVEBLOCK_LENGTH 3
34558 #define JSOP_UNUSED1_LENGTH 1
34559 #define JSOP_UNUSED2_LENGTH 1
34560 #define JSOP_GENERATOR_LENGTH 1
34561 #define JSOP_YIELD_LENGTH 1
34562 #define JSOP_ARRAYPUSH_LENGTH 3
34563 #define JSOP_GETFUNNS_LENGTH 1
34564 #define JSOP_ENUMCONSTELEM_LENGTH 1
34565 #define JSOP_LEAVEBLOCKEXPR_LENGTH 3
34566 #define JSOP_UNUSED21_LENGTH 1
34567 #define JSOP_UNUSED22_LENGTH 1
34568 #define JSOP_UNUSED23_LENGTH 1
34569 #define JSOP_CALLGNAME_LENGTH 5
34570 #define JSOP_CALLLOCAL_LENGTH 3
34571 #define JSOP_CALLARG_LENGTH 3
34572 #define JSOP_BINDGNAME_LENGTH 5
34573 #define JSOP_INT8_LENGTH 2
34574 #define JSOP_INT32_LENGTH 5
34575 #define JSOP_LENGTH_LENGTH 5
34576 #define JSOP_HOLE_LENGTH 1
34577 #define JSOP_UNUSED17_LENGTH 1
34578 #define JSOP_UNUSED24_LENGTH 1
34579 #define JSOP_UNUSED25_LENGTH 1
34580 #define JSOP_UNUSED29_LENGTH 1
34581 #define JSOP_UNUSED30_LENGTH 1
34582 #define JSOP_REST_LENGTH 1
34583 #define JSOP_TOID_LENGTH 1
34584 #define JSOP_IMPLICITTHIS_LENGTH 5
34585 #define JSOP_LOOPENTRY_LENGTH 1
34586 #define JSOP_ACTUALSFILLED_LENGTH 3
34587 # 13 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack.h" 2
34588
34589 struct JSContext;
34590 struct JSCompartment;
34591
34592
34593 namespace js { namespace mjit { struct CallSite; }}
34594 typedef js::mjit::CallSite JSInlinedSite;
34595
34596
34597
34598
34599 typedef size_t JSRejoinState;
34600
34601 namespace js {
34602
34603 class StackFrame;
34604 class FrameRegs;
34605 class StackSegment;
34606 class StackSpace;
34607 class ContextStack;
34608
34609 class InvokeArgsGuard;
34610 class InvokeFrameGuard;
34611 class FrameGuard;
34612 class ExecuteFrameGuard;
34613 class DummyFrameGuard;
34614 class GeneratorFrameGuard;
34615
34616 class CallIter;
34617 class ScriptFrameIter;
34618 class AllFramesIter;
34619
34620 class ArgumentsObject;
34621 class StaticBlockObject;
34622
34623
34624 namespace mjit {
34625 struct JITScript;
34626 jsbytecode *NativeToPC(JITScript *jit, void *ncode, CallSite **pinline);
34627 }
34628
34629
34630 namespace detail {
34631 struct OOMCheck;
34632 }
34633 # 161 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack.h"
34634 class CallReceiver
34635 {
34636 protected:
34637
34638
34639
34640
34641
34642 void setUsedRval() const {}
34643 void clearUsedRval() const {}
34644
34645 Value *argv_;
34646 public:
34647 friend CallReceiver CallReceiverFromVp(Value *);
34648 friend CallReceiver CallReceiverFromArgv(Value *);
34649 Value *base() const { return argv_ - 2; }
34650 JSObject &callee() const { do { } while(0); return argv_[-2].toObject(); }
34651 Value &calleev() const { do { } while(0); return argv_[-2]; }
34652 Value &thisv() const { return argv_[-1]; }
34653
34654 Value &rval() const {
34655 setUsedRval();
34656 return argv_[-2];
34657 }
34658
34659 Value *spAfterCall() const {
34660 setUsedRval();
34661 return argv_ - 1;
34662 }
34663
34664 void setCallee(Value calleev) {
34665 clearUsedRval();
34666 this->calleev() = calleev;
34667 }
34668 };
34669
34670 __attribute__((always_inline)) inline CallReceiver
34671 CallReceiverFromArgv(Value *argv)
34672 {
34673 CallReceiver receiver;
34674 receiver.clearUsedRval();
34675 receiver.argv_ = argv;
34676 return receiver;
34677 }
34678
34679 __attribute__((always_inline)) inline CallReceiver
34680 CallReceiverFromVp(Value *vp)
34681 {
34682 return CallReceiverFromArgv(vp + 2);
34683 }
34684
34685
34686
34687 class CallArgs : public CallReceiver
34688 {
34689 protected:
34690 unsigned argc_;
34691 public:
34692 friend CallArgs CallArgsFromVp(unsigned, Value *);
34693 friend CallArgs CallArgsFromArgv(unsigned, Value *);
34694 friend CallArgs CallArgsFromSp(unsigned, Value *);
34695 Value &operator[](unsigned i) const { do { } while(0); return argv_[i]; }
34696 Value *array() const { return argv_; }
34697 unsigned length() const { return argc_; }
34698 Value *end() const { return argv_ + argc_; }
34699 bool hasDefined(unsigned i) const { return i < argc_ && !argv_[i].isUndefined(); }
34700 };
34701
34702 __attribute__((always_inline)) inline CallArgs
34703 CallArgsFromArgv(unsigned argc, Value *argv)
34704 {
34705 CallArgs args;
34706 args.clearUsedRval();
34707 args.argv_ = argv;
34708 args.argc_ = argc;
34709 return args;
34710 }
34711
34712 __attribute__((always_inline)) inline CallArgs
34713 CallArgsFromVp(unsigned argc, Value *vp)
34714 {
34715 return CallArgsFromArgv(argc, vp + 2);
34716 }
34717
34718 __attribute__((always_inline)) inline CallArgs
34719 CallArgsFromSp(unsigned argc, Value *sp)
34720 {
34721 return CallArgsFromArgv(argc, sp - argc);
34722 }
34723 # 260 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack.h"
34724 class CallArgsList : public CallArgs
34725 {
34726 friend class StackSegment;
34727 CallArgsList *prev_;
34728 bool active_;
34729 public:
34730 friend CallArgsList CallArgsListFromVp(unsigned, Value *, CallArgsList *);
34731 friend CallArgsList CallArgsListFromArgv(unsigned, Value *, CallArgsList *);
34732 CallArgsList *prev() const { return prev_; }
34733 bool active() const { return active_; }
34734 void setActive() { active_ = true; }
34735 void setInactive() { active_ = false; }
34736 };
34737
34738 __attribute__((always_inline)) inline CallArgsList
34739 CallArgsListFromArgv(unsigned argc, Value *argv, CallArgsList *prev)
34740 {
34741 CallArgsList args;
34742
34743
34744
34745 args.argv_ = argv;
34746 args.argc_ = argc;
34747 args.prev_ = prev;
34748 args.active_ = false;
34749 return args;
34750 }
34751
34752 __attribute__((always_inline)) inline CallArgsList
34753 CallArgsListFromVp(unsigned argc, Value *vp, CallArgsList *prev)
34754 {
34755 return CallArgsListFromArgv(argc, vp + 2, prev);
34756 }
34757
34758
34759
34760
34761 enum InitialFrameFlags {
34762 INITIAL_NONE = 0,
34763 INITIAL_CONSTRUCT = 0x80,
34764 INITIAL_LOWERED = 0x200000
34765 };
34766
34767 enum ExecuteType {
34768 EXECUTE_GLOBAL = 0x1,
34769 EXECUTE_DIRECT_EVAL = 0x8,
34770 EXECUTE_INDIRECT_EVAL = 0x9,
34771 EXECUTE_DEBUG = 0x18
34772 };
34773
34774
34775
34776 class StackFrame
34777 {
34778 public:
34779 enum Flags {
34780
34781 GLOBAL = 0x1,
34782 FUNCTION = 0x2,
34783 DUMMY = 0x4,
34784
34785
34786 EVAL = 0x8,
34787 DEBUGGER = 0x10,
34788 GENERATOR = 0x20,
34789 FLOATING_GENERATOR = 0x40,
34790 CONSTRUCTING = 0x80,
34791
34792
34793 YIELDING = 0x100,
34794 FINISHED_IN_INTERP = 0x200,
34795
34796
34797 OVERFLOW_ARGS = 0x400,
34798 UNDERFLOW_ARGS = 0x800,
34799
34800
34801 HAS_CALL_OBJ = 0x1000,
34802 HAS_ARGS_OBJ = 0x2000,
34803 HAS_HOOK_DATA = 0x4000,
34804 HAS_ANNOTATION = 0x8000,
34805 HAS_RVAL = 0x10000,
34806 HAS_SCOPECHAIN = 0x20000,
34807 HAS_PREVPC = 0x40000,
34808 HAS_BLOCKCHAIN = 0x80000,
34809
34810
34811 DOWN_FRAMES_EXPANDED = 0x100000,
34812 LOWERED_CALL_APPLY = 0x200000
34813 };
34814
34815 private:
34816 mutable uint32_t flags_;
34817 union {
34818 JSScript *script;
34819 JSFunction *fun;
34820 } exec;
34821 union {
34822 unsigned nactual;
34823 JSScript *evalScript;
34824 } u;
34825 mutable JSObject *scopeChain_;
34826 StackFrame *prev_;
34827 void *ncode_;
34828
34829
34830 Value rval_;
34831 StaticBlockObject *blockChain_;
34832 ArgumentsObject *argsObj_;
34833 jsbytecode *prevpc_;
34834 JSInlinedSite *prevInline_;
34835 void *hookData_;
34836 void *annotation_;
34837 JSRejoinState rejoin_;
34838
34839
34840 static void staticAsserts() {
34841 typedef int moz_static_assert92[(__builtin_offsetof (StackFrame, rval_) % sizeof(Value) == 0) ? 1 : -1];
34842 typedef int moz_static_assert93[(sizeof(StackFrame) % sizeof(Value) == 0) ? 1 : -1];
34843 }
34844
34845 inline void initPrev(JSContext *cx);
34846 jsbytecode *prevpcSlow(JSInlinedSite **pinlined);
34847
34848 public:
34849 # 394 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack.h"
34850 void initCallFrame(JSContext *cx, JSFunction &callee,
34851 JSScript *script, uint32_t nactual, StackFrame::Flags flags);
34852
34853
34854 void initFixupFrame(StackFrame *prev, StackFrame::Flags flags, void *ncode, unsigned nactual);
34855
34856
34857 void initExecuteFrame(JSScript *script, StackFrame *prev, FrameRegs *regs,
34858 const Value &thisv, JSObject &scopeChain, ExecuteType type);
34859
34860
34861 enum TriggerPostBarriers {
34862 DoPostBarrier = true,
34863 NoPostBarrier = false
34864 };
34865 template <class T, class U, TriggerPostBarriers doPostBarrier>
34866 void stealFrameAndSlots(JSContext *cx, StackFrame *fp, T *vp,
34867 StackFrame *otherfp, U *othervp, Value *othersp);
34868 void writeBarrierPost();
34869
34870
34871 void initDummyFrame(JSContext *cx, JSObject &chain);
34872 # 428 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack.h"
34873 bool isFunctionFrame() const {
34874 return !!(flags_ & FUNCTION);
34875 }
34876
34877 bool isGlobalFrame() const {
34878 return !!(flags_ & GLOBAL);
34879 }
34880
34881 bool isDummyFrame() const {
34882 return !!(flags_ & DUMMY);
34883 }
34884
34885 bool isScriptFrame() const {
34886 bool retval = !!(flags_ & (FUNCTION | GLOBAL));
34887 do { } while(0);
34888 return retval;
34889 }
34890 # 458 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack.h"
34891 bool isEvalFrame() const {
34892 do { } while (0);
34893 return flags_ & EVAL;
34894 }
34895
34896 bool isEvalInFunction() const {
34897 return (flags_ & (EVAL | FUNCTION)) == (EVAL | FUNCTION);
34898 }
34899
34900 bool isNonEvalFunctionFrame() const {
34901 return (flags_ & (FUNCTION | EVAL)) == FUNCTION;
34902 }
34903
34904 inline bool isStrictEvalFrame() const {
34905 return isEvalFrame() && script()->strictModeCode;
34906 }
34907
34908 bool isNonStrictEvalFrame() const {
34909 return isEvalFrame() && !script()->strictModeCode;
34910 }
34911
34912 bool isDirectEvalFrame() const {
34913 return isEvalFrame() && script()->staticLevel > 0;
34914 }
34915
34916 bool isNonStrictDirectEvalFrame() const {
34917 return isNonStrictEvalFrame() && isDirectEvalFrame();
34918 }
34919 # 500 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack.h"
34920 StackFrame *prev() const {
34921 return prev_;
34922 }
34923
34924 inline void resetGeneratorPrev(JSContext *cx);
34925 inline void resetInlinePrev(StackFrame *prevfp, jsbytecode *prevpc);
34926
34927 inline void initInlineFrame(JSFunction *fun, StackFrame *prevfp, jsbytecode *prevpc);
34928
34929 inline JSObject *createRestParameter(JSContext *cx);
34930 # 519 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack.h"
34931 Value *slots() const {
34932 return (Value *)(this + 1);
34933 }
34934
34935 Value *base() const {
34936 return slots() + script()->nfixed;
34937 }
34938
34939 Value &varSlot(unsigned i) {
34940 do { } while(0);
34941 do { } while (0);
34942 return slots()[i];
34943 }
34944
34945 Value &localSlot(unsigned i) {
34946
34947 do { } while(0);
34948 return slots()[i];
34949 }
34950 # 574 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack.h"
34951 jsbytecode *pcQuadratic(const ContextStack &stack, StackFrame *next = __null,
34952 JSInlinedSite **pinlined = __null);
34953
34954 jsbytecode *prevpc(JSInlinedSite **pinlined) {
34955 if (flags_ & HAS_PREVPC) {
34956 if (pinlined)
34957 *pinlined = prevInline_;
34958 return prevpc_;
34959 }
34960 return prevpcSlow(pinlined);
34961 }
34962
34963 JSInlinedSite *prevInline() {
34964 do { } while(0);
34965 return prevInline_;
34966 }
34967
34968 JSScript *script() const {
34969 do { } while(0);
34970 return isFunctionFrame()
34971 ? isEvalFrame() ? u.evalScript : fun()->script()
34972 : exec.script;
34973 }
34974
34975 JSScript *functionScript() const {
34976 do { } while(0);
34977 return isEvalFrame() ? u.evalScript : fun()->script();
34978 }
34979
34980 JSScript *globalScript() const {
34981 do { } while(0);
34982 return exec.script;
34983 }
34984
34985 JSScript *maybeScript() const {
34986 return isScriptFrame() ? script() : __null;
34987 }
34988
34989 size_t numFixed() const {
34990 return script()->nfixed;
34991 }
34992
34993 size_t numSlots() const {
34994 return script()->nslots;
34995 }
34996
34997 size_t numGlobalVars() const {
34998 do { } while(0);
34999 return exec.script->nfixed;
35000 }
35001 # 634 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack.h"
35002 JSFunction* fun() const {
35003 do { } while(0);
35004 return exec.fun;
35005 }
35006
35007 JSFunction* maybeFun() const {
35008 return isFunctionFrame() ? fun() : __null;
35009 }
35010
35011 JSFunction* maybeScriptFunction() const {
35012 if (!isFunctionFrame())
35013 return __null;
35014 const StackFrame *fp = this;
35015 while (fp->isEvalFrame())
35016 fp = fp->prev();
35017 return fp->script()->function();
35018 }
35019 # 672 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack.h"
35020 bool hasArgs() const {
35021 return isNonEvalFunctionFrame();
35022 }
35023
35024 unsigned numFormalArgs() const {
35025 do { } while(0);
35026 return fun()->nargs;
35027 }
35028
35029 Value &formalArg(unsigned i) const {
35030 do { } while(0);
35031 return formalArgs()[i];
35032 }
35033
35034 Value *formalArgs() const {
35035 do { } while(0);
35036 return (Value *)this - numFormalArgs();
35037 }
35038
35039 Value *formalArgsEnd() const {
35040 do { } while(0);
35041 return (Value *)this;
35042 }
35043
35044 Value *maybeFormalArgs() const {
35045 return (flags_ & (FUNCTION | EVAL)) == FUNCTION
35046 ? formalArgs()
35047 : __null;
35048 }
35049
35050 inline unsigned numActualArgs() const;
35051 inline Value *actualArgs() const;
35052 inline Value *actualArgsEnd() const;
35053
35054 inline Value &canonicalActualArg(unsigned i) const;
35055 template <class Op>
35056 inline bool forEachCanonicalActualArg(Op op, unsigned start = 0, unsigned count = unsigned(-1));
35057 template <class Op> inline bool forEachFormalArg(Op op);
35058
35059
35060
35061 bool hasArgsObj() const {
35062
35063
35064
35065
35066
35067
35068
35069 return !!(flags_ & HAS_ARGS_OBJ);
35070 }
35071
35072 ArgumentsObject &argsObj() const {
35073 do { } while(0);
35074 return *argsObj_;
35075 }
35076
35077 ArgumentsObject *maybeArgsObj() const {
35078 return hasArgsObj() ? &argsObj() : __null;
35079 }
35080
35081 void initArgsObj(ArgumentsObject &argsObj) {
35082 do { } while(0);
35083 do { } while(0);
35084 argsObj_ = &argsObj;
35085 flags_ |= HAS_ARGS_OBJ;
35086 }
35087 # 754 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack.h"
35088 Value &functionThis() const {
35089 do { } while(0);
35090 if (isEvalFrame())
35091 return ((Value *)this)[-1];
35092 return formalArgs()[-1];
35093 }
35094
35095 JSObject &constructorThis() const {
35096 do { } while(0);
35097 return formalArgs()[-1].toObject();
35098 }
35099
35100 Value &globalThis() const {
35101 do { } while(0);
35102 return ((Value *)this)[-1];
35103 }
35104
35105 Value &thisValue() const {
35106 if (flags_ & (EVAL | GLOBAL))
35107 return ((Value *)this)[-1];
35108 return formalArgs()[-1];
35109 }
35110 # 786 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack.h"
35111 JSFunction &callee() const {
35112 do { } while(0);
35113 return *calleev().toObject().toFunction();
35114 }
35115
35116 const Value &calleev() const {
35117 do { } while(0);
35118 return mutableCalleev();
35119 }
35120
35121 const Value &maybeCalleev() const {
35122 do { } while(0);
35123 Value &calleev = flags_ & (EVAL | GLOBAL)
35124 ? ((Value *)this)[-2]
35125 : formalArgs()[-2];
35126 do { } while(0);
35127 return calleev;
35128 }
35129
35130 Value &mutableCalleev() const {
35131 do { } while(0);
35132 if (isEvalFrame())
35133 return ((Value *)this)[-2];
35134 return formalArgs()[-2];
35135 }
35136
35137 CallReceiver callReceiver() const {
35138 return CallReceiverFromArgv(formalArgs());
35139 }
35140 # 846 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack.h"
35141 inline HandleObject scopeChain() const;
35142 inline GlobalObject &global() const;
35143
35144 bool hasCallObj() const {
35145 bool ret = !!(flags_ & HAS_CALL_OBJ);
35146 do { } while (0);
35147 return ret;
35148 }
35149
35150 inline CallObject &callObj() const;
35151 inline void initScopeChain(CallObject &callobj);
35152 inline void setScopeChain(JSObject &obj);
35153 # 874 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack.h"
35154 inline JSObject &varObj();
35155
35156
35157
35158 bool hasBlockChain() const {
35159 return (flags_ & HAS_BLOCKCHAIN) && blockChain_;
35160 }
35161
35162 StaticBlockObject *maybeBlockChain() {
35163 return (flags_ & HAS_BLOCKCHAIN) ? blockChain_ : __null;
35164 }
35165
35166 StaticBlockObject &blockChain() const {
35167 do { } while(0);
35168 return *blockChain_;
35169 }
35170
35171
35172 bool pushBlock(JSContext *cx, StaticBlockObject &block);
35173 void popBlock(JSContext *cx);
35174
35175
35176 void popWith(JSContext *cx);
35177
35178
35179
35180
35181
35182 inline bool functionPrologue(JSContext *cx);
35183
35184
35185
35186
35187
35188
35189
35190 inline void functionEpilogue(JSContext *cx);
35191
35192
35193
35194
35195
35196 inline void updateEpilogueFlags();
35197
35198 inline bool maintainNestingState() const;
35199 # 927 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack.h"
35200 inline JSCompartment *compartment() const;
35201
35202
35203
35204 void* annotation() const {
35205 return (flags_ & HAS_ANNOTATION) ? annotation_ : __null;
35206 }
35207
35208 void setAnnotation(void *annot) {
35209 flags_ |= HAS_ANNOTATION;
35210 annotation_ = annot;
35211 }
35212
35213
35214
35215 JSRejoinState rejoin() const {
35216 return rejoin_;
35217 }
35218
35219 void setRejoin(JSRejoinState state) {
35220 rejoin_ = state;
35221 }
35222
35223
35224
35225 void setDownFramesExpanded() {
35226 flags_ |= DOWN_FRAMES_EXPANDED;
35227 }
35228
35229 bool downFramesExpanded() {
35230 return !!(flags_ & DOWN_FRAMES_EXPANDED);
35231 }
35232
35233
35234
35235 bool hasHookData() const {
35236 return !!(flags_ & HAS_HOOK_DATA);
35237 }
35238
35239 void* hookData() const {
35240 do { } while(0);
35241 return hookData_;
35242 }
35243
35244 void* maybeHookData() const {
35245 return hasHookData() ? hookData_ : __null;
35246 }
35247
35248 void setHookData(void *v) {
35249 hookData_ = v;
35250 flags_ |= HAS_HOOK_DATA;
35251 }
35252
35253
35254
35255 bool hasReturnValue() const {
35256 return !!(flags_ & HAS_RVAL);
35257 }
35258
35259 Value &returnValue() {
35260 if (!(flags_ & HAS_RVAL))
35261 rval_.setUndefined();
35262 return rval_;
35263 }
35264
35265 void markReturnValue() {
35266 flags_ |= HAS_RVAL;
35267 }
35268
35269 void setReturnValue(const Value &v) {
35270 rval_ = v;
35271 markReturnValue();
35272 }
35273
35274 void clearReturnValue() {
35275 rval_.setUndefined();
35276 markReturnValue();
35277 }
35278
35279
35280
35281 void *nativeReturnAddress() const {
35282 return ncode_;
35283 }
35284
35285 void setNativeReturnAddress(void *addr) {
35286 ncode_ = addr;
35287 }
35288
35289 void **addressOfNativeReturnAddress() {
35290 return &ncode_;
35291 }
35292 # 1028 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack.h"
35293 bool isGeneratorFrame() const {
35294 return !!(flags_ & GENERATOR);
35295 }
35296
35297 bool isFloatingGenerator() const {
35298 do { } while (0);
35299 return !!(flags_ & FLOATING_GENERATOR);
35300 }
35301
35302 void initFloatingGenerator() {
35303 do { } while(0);
35304 flags_ |= (GENERATOR | FLOATING_GENERATOR);
35305 }
35306
35307 void unsetFloatingGenerator() {
35308 flags_ &= ~FLOATING_GENERATOR;
35309 }
35310
35311 void setFloatingGenerator() {
35312 flags_ |= FLOATING_GENERATOR;
35313 }
35314 # 1057 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack.h"
35315 bool isFramePushedByExecute() const {
35316 return !!(flags_ & (GLOBAL | EVAL));
35317 }
35318
35319
35320
35321
35322
35323 InitialFrameFlags initialFlags() const {
35324 typedef int moz_static_assert94[((int)INITIAL_NONE == 0) ? 1 : -1];
35325 typedef int moz_static_assert95[((int)INITIAL_CONSTRUCT == (int)CONSTRUCTING) ? 1 : -1];
35326 typedef int moz_static_assert96[((int)INITIAL_LOWERED == (int)LOWERED_CALL_APPLY) ? 1 : -1];
35327 uint32_t mask = CONSTRUCTING | LOWERED_CALL_APPLY;
35328 do { } while(0);
35329 return InitialFrameFlags(flags_ & mask);
35330 }
35331
35332 bool isConstructing() const {
35333 return !!(flags_ & CONSTRUCTING);
35334 }
35335
35336
35337
35338
35339
35340
35341
35342 bool loweredCallOrApply() const {
35343 return !!(flags_ & LOWERED_CALL_APPLY);
35344 }
35345
35346 bool isDebuggerFrame() const {
35347 return !!(flags_ & DEBUGGER);
35348 }
35349
35350 bool hasOverflowArgs() const {
35351 return !!(flags_ & OVERFLOW_ARGS);
35352 }
35353
35354 bool isYielding() {
35355 return !!(flags_ & YIELDING);
35356 }
35357
35358 void setYielding() {
35359 flags_ |= YIELDING;
35360 }
35361
35362 void clearYielding() {
35363 flags_ &= ~YIELDING;
35364 }
35365
35366 void setFinishedInInterpreter() {
35367 flags_ |= FINISHED_IN_INTERP;
35368 }
35369
35370 bool finishedInInterpreter() const {
35371 return !!(flags_ & FINISHED_IN_INTERP);
35372 }
35373
35374 public:
35375
35376
35377 static size_t offsetOfFlags() {
35378 return __builtin_offsetof (StackFrame, flags_);
35379 }
35380
35381 static size_t offsetOfExec() {
35382 return __builtin_offsetof (StackFrame, exec);
35383 }
35384
35385 static size_t offsetOfNumActual() {
35386 return __builtin_offsetof (StackFrame, u.nactual);
35387 }
35388
35389 static size_t offsetOfScopeChain() {
35390 return __builtin_offsetof (StackFrame, scopeChain_);
35391 }
35392
35393 static size_t offsetOfPrev() {
35394 return __builtin_offsetof (StackFrame, prev_);
35395 }
35396
35397 static size_t offsetOfReturnValue() {
35398 return __builtin_offsetof (StackFrame, rval_);
35399 }
35400
35401 static size_t offsetOfArgsObj() {
35402 return __builtin_offsetof (StackFrame, argsObj_);
35403 }
35404
35405 static ptrdiff_t offsetOfNcode() {
35406 return __builtin_offsetof (StackFrame, ncode_);
35407 }
35408
35409 static ptrdiff_t offsetOfCallee(JSFunction *fun) {
35410 do { } while(0);
35411 return -(fun->nargs + 2) * sizeof(Value);
35412 }
35413
35414 static ptrdiff_t offsetOfThis(JSFunction *fun) {
35415 return fun == __null
35416 ? -1 * ptrdiff_t(sizeof(Value))
35417 : -(fun->nargs + 1) * ptrdiff_t(sizeof(Value));
35418 }
35419
35420 static ptrdiff_t offsetOfFormalArg(JSFunction *fun, unsigned i) {
35421 do { } while(0);
35422 return (-(int)fun->nargs + i) * sizeof(Value);
35423 }
35424
35425 static size_t offsetOfFixed(unsigned i) {
35426 return sizeof(StackFrame) + i * sizeof(Value);
35427 }
35428
35429
35430 inline mjit::JITScript *jit();
35431
35432
35433 void methodjitStaticAsserts();
35434
35435 public:
35436 void mark(JSTracer *trc);
35437 };
35438
35439 static const size_t VALUES_PER_STACK_FRAME = sizeof(StackFrame) / sizeof(Value);
35440
35441 static inline unsigned
35442 ToReportFlags(InitialFrameFlags initial)
35443 {
35444 return unsigned(initial & StackFrame::CONSTRUCTING);
35445 }
35446
35447 static inline StackFrame::Flags
35448 ToFrameFlags(InitialFrameFlags initial)
35449 {
35450 return StackFrame::Flags(initial);
35451 }
35452
35453 static inline InitialFrameFlags
35454 InitialFrameFlagsFromConstructing(bool b)
35455 {
35456 return b ? INITIAL_CONSTRUCT : INITIAL_NONE;
35457 }
35458
35459 static inline bool
35460 InitialFrameFlagsAreConstructing(InitialFrameFlags initial)
35461 {
35462 return !!(initial & INITIAL_CONSTRUCT);
35463 }
35464
35465 static inline bool
35466 InitialFrameFlagsAreLowered(InitialFrameFlags initial)
35467 {
35468 return !!(initial & INITIAL_LOWERED);
35469 }
35470
35471 inline StackFrame * Valueify(JSStackFrame *fp) { return (StackFrame *)fp; }
35472 static inline JSStackFrame * Jsvalify(StackFrame *fp) { return (JSStackFrame *)fp; }
35473
35474
35475
35476 class FrameRegs
35477 {
35478 public:
35479 Value *sp;
35480 jsbytecode *pc;
35481 private:
35482 JSInlinedSite *inlined_;
35483 StackFrame *fp_;
35484 public:
35485 StackFrame *fp() const { return fp_; }
35486 JSInlinedSite *inlined() const { return inlined_; }
35487
35488
35489 static const size_t offsetOfFp = 3 * sizeof(void *);
35490 static const size_t offsetOfInlined = 2 * sizeof(void *);
35491 static void staticAssert() {
35492 typedef int moz_static_assert97[(offsetOfFp == __builtin_offsetof (FrameRegs, fp_)) ? 1 : -1];
35493 typedef int moz_static_assert98[(offsetOfInlined == __builtin_offsetof (FrameRegs, inlined_)) ? 1 : -1];
35494 }
35495 void clearInlined() { inlined_ = __null; }
35496
35497
35498 void rebaseFromTo(const FrameRegs &from, StackFrame &to) {
35499 fp_ = &to;
35500 sp = to.slots() + (from.sp - from.fp_->slots());
35501 pc = from.pc;
35502 inlined_ = from.inlined_;
35503 do { } while(0);
35504 }
35505
35506
35507 void popFrame(Value *newsp) {
35508 pc = fp_->prevpc(&inlined_);
35509 sp = newsp;
35510 fp_ = fp_->prev();
35511 do { } while(0);
35512 }
35513
35514
35515 void popPartialFrame(Value *newsp) {
35516 sp = newsp;
35517 fp_ = fp_->prev();
35518 do { } while(0);
35519 }
35520
35521
35522 void restorePartialFrame(Value *newfp) {
35523 fp_ = (StackFrame *) newfp;
35524 }
35525
35526
35527 void refreshFramePointer(StackFrame *fp) {
35528 fp_ = fp;
35529 }
35530
35531
35532 void prepareToRun(StackFrame &fp, JSScript *script) {
35533 pc = script->code;
35534 sp = fp.slots() + script->nfixed;
35535 fp_ = &fp;
35536 inlined_ = __null;
35537 }
35538
35539 void setToEndOfScript() {
35540 JSScript *script = fp()->script();
35541 sp = fp()->base();
35542 pc = script->code + script->length - 1;
35543 do { } while(0);
35544 }
35545
35546
35547 void initDummyFrame(StackFrame &fp) {
35548 pc = __null;
35549 sp = fp.slots();
35550 fp_ = &fp;
35551 inlined_ = __null;
35552 }
35553
35554
35555 void expandInline(StackFrame *innerfp, jsbytecode *innerpc) {
35556 pc = innerpc;
35557 fp_ = innerfp;
35558 inlined_ = __null;
35559 }
35560
35561
35562
35563 void updateForNcode(mjit::JITScript *jit, void *ncode) {
35564 pc = mjit::NativeToPC(jit, ncode, &inlined_);
35565 }
35566
35567 };
35568
35569
35570
35571 class StackSegment
35572 {
35573
35574 StackSegment *const prevInContext_;
35575
35576
35577 StackSegment *const prevInMemory_;
35578
35579
35580 FrameRegs *regs_;
35581
35582
35583 CallArgsList *calls_;
35584
35585 public:
35586 StackSegment(StackSegment *prevInContext,
35587 StackSegment *prevInMemory,
35588 FrameRegs *regs,
35589 CallArgsList *calls)
35590 : prevInContext_(prevInContext),
35591 prevInMemory_(prevInMemory),
35592 regs_(regs),
35593 calls_(calls)
35594 {}
35595
35596
35597
35598 Value *slotsBegin() const {
35599 return (Value *)(this + 1);
35600 }
35601
35602
35603
35604 FrameRegs &regs() const {
35605 do { } while(0);
35606 return *regs_;
35607 }
35608
35609 FrameRegs *maybeRegs() const {
35610 return regs_;
35611 }
35612
35613 StackFrame *fp() const {
35614 return regs_->fp();
35615 }
35616
35617 StackFrame *maybefp() const {
35618 return regs_ ? regs_->fp() : __null;
35619 }
35620
35621 jsbytecode *maybepc() const {
35622 return regs_ ? regs_->pc : __null;
35623 }
35624
35625 CallArgsList &calls() const {
35626 do { } while(0);
35627 return *calls_;
35628 }
35629
35630 CallArgsList *maybeCalls() const {
35631 return calls_;
35632 }
35633
35634 Value *callArgv() const {
35635 return calls_->array();
35636 }
35637
35638 Value *maybeCallArgv() const {
35639 return calls_ ? calls_->array() : __null;
35640 }
35641
35642 StackSegment *prevInContext() const {
35643 return prevInContext_;
35644 }
35645
35646 StackSegment *prevInMemory() const {
35647 return prevInMemory_;
35648 }
35649
35650 void repointRegs(FrameRegs *regs) {
35651 do { } while (0);
35652 regs_ = regs;
35653 }
35654
35655 bool isEmpty() const {
35656 return !calls_ && !regs_;
35657 }
35658
35659 bool contains(const StackFrame *fp) const;
35660 bool contains(const FrameRegs *regs) const;
35661 bool contains(const CallArgsList *call) const;
35662
35663 StackFrame *computeNextFrame(const StackFrame *fp) const;
35664
35665 Value *end() const;
35666
35667 FrameRegs *pushRegs(FrameRegs &regs);
35668 void popRegs(FrameRegs *regs);
35669 void pushCall(CallArgsList &callList);
35670 void pointAtCall(CallArgsList &callList);
35671 void popCall();
35672
35673
35674
35675 static const size_t offsetOfRegs() { return __builtin_offsetof (StackSegment, regs_); }
35676 };
35677
35678 static const size_t VALUES_PER_STACK_SEGMENT = sizeof(StackSegment) / sizeof(Value);
35679 typedef int moz_static_assert99[(sizeof(StackSegment) % sizeof(Value) == 0) ? 1 : -1];
35680
35681
35682
35683 class StackSpace
35684 {
35685 StackSegment *seg_;
35686 Value *base_;
35687 mutable Value *conservativeEnd_;
35688
35689
35690
35691 Value *defaultEnd_;
35692 Value *trustedEnd_;
35693
35694 void assertInvariants() const {
35695 do { } while(0);
35696
35697
35698
35699
35700 do { } while(0);
35701 do { } while(0);
35702 }
35703
35704
35705 static const size_t CAPACITY_VALS = 512 * 1024;
35706 static const size_t CAPACITY_BYTES = CAPACITY_VALS * sizeof(Value);
35707
35708
35709 static const size_t COMMIT_VALS = 16 * 1024;
35710 static const size_t COMMIT_BYTES = COMMIT_VALS * sizeof(Value);
35711
35712
35713 static const size_t BUFFER_VALS = 16 * 1024;
35714 static const size_t BUFFER_BYTES = BUFFER_VALS * sizeof(Value);
35715
35716 static void staticAsserts() {
35717 typedef int moz_static_assert100[(CAPACITY_VALS % COMMIT_VALS == 0) ? 1 : -1];
35718 }
35719
35720 friend class AllFramesIter;
35721 friend class ContextStack;
35722 friend class StackFrame;
35723 # 1474 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack.h"
35724 static const size_t CX_COMPARTMENT = 0xc;
35725
35726 inline bool ensureSpace(JSContext *cx, MaybeReportError report,
35727 Value *from, ptrdiff_t nvals,
35728 JSCompartment *dest = (JSCompartment *)CX_COMPARTMENT) const;
35729 __attribute__((visibility("default"))) bool ensureSpaceSlow(JSContext *cx, MaybeReportError report,
35730 Value *from, ptrdiff_t nvals,
35731 JSCompartment *dest) const;
35732
35733 StackSegment &findContainingSegment(const StackFrame *target) const;
35734
35735 public:
35736 StackSpace();
35737 bool init();
35738 ~StackSpace();
35739 # 1501 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack.h"
35740 static const unsigned ARGS_LENGTH_MAX = CAPACITY_VALS - (2 * BUFFER_VALS);
35741
35742
35743 inline Value *firstUnused() const { return seg_ ? seg_->end() : base_; }
35744
35745 StackSegment &containingSegment(const StackFrame *target) const;
35746 # 1516 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack.h"
35747 static const size_t STACK_JIT_EXTRA = ( 8 + 18) * 10;
35748 # 1532 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack.h"
35749 inline Value *getStackLimit(JSContext *cx, MaybeReportError report);
35750 bool tryBumpLimit(JSContext *cx, Value *from, unsigned nvals, Value **limit);
35751
35752
35753 void mark(JSTracer *trc);
35754 void markFrameSlots(JSTracer *trc, StackFrame *fp, Value *slotsEnd, jsbytecode *pc);
35755
35756
35757 void markActiveCompartments();
35758
35759
35760 __attribute__((visibility("default"))) size_t sizeOfCommitted();
35761
35762
35763
35764
35765 };
35766
35767
35768
35769 class ContextStack
35770 {
35771 StackSegment *seg_;
35772 StackSpace *const space_;
35773 JSContext *cx_;
35774 # 1566 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack.h"
35775 bool onTop() const;
35776
35777
35778
35779
35780 void assertSpaceInSync() const {}
35781
35782
35783
35784 StackSegment *pushSegment(JSContext *cx);
35785 enum MaybeExtend { CAN_EXTEND = true, CANT_EXTEND = false };
35786 Value *ensureOnTop(JSContext *cx, MaybeReportError report, unsigned nvars,
35787 MaybeExtend extend, bool *pushedSeg,
35788 JSCompartment *dest = (JSCompartment *)StackSpace::CX_COMPARTMENT);
35789
35790 inline StackFrame *
35791 getCallFrame(JSContext *cx, MaybeReportError report, const CallArgs &args,
35792 JSFunction *fun, JSScript *script, StackFrame::Flags *pflags) const;
35793
35794
35795 void popSegment();
35796 friend class InvokeArgsGuard;
35797 void popInvokeArgs(const InvokeArgsGuard &iag);
35798 friend class FrameGuard;
35799 void popFrame(const FrameGuard &fg);
35800 friend class GeneratorFrameGuard;
35801 void popGeneratorFrame(const GeneratorFrameGuard &gfg);
35802
35803 friend class StackIter;
35804
35805 public:
35806 ContextStack(JSContext *cx);
35807 ~ContextStack();
35808
35809
35810
35811
35812
35813
35814
35815 bool empty() const { return !seg_; }
35816
35817
35818
35819
35820
35821
35822
35823 inline bool hasfp() const { return seg_ && seg_->maybeRegs(); }
35824
35825
35826
35827
35828
35829 inline FrameRegs *maybeRegs() const { return seg_ ? seg_->maybeRegs() : __null; }
35830 inline StackFrame *maybefp() const { return seg_ ? seg_->maybefp() : __null; }
35831
35832
35833 inline FrameRegs &regs() const { do { } while(0); return seg_->regs(); }
35834 inline StackFrame *fp() const { do { } while(0); return seg_->fp(); }
35835
35836
35837 StackSpace &space() const { return *space_; }
35838
35839
35840 bool containsSlow(const StackFrame *target) const;
35841 # 1641 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack.h"
35842 bool pushInvokeArgs(JSContext *cx, unsigned argc, InvokeArgsGuard *ag);
35843
35844
35845 bool pushInvokeFrame(JSContext *cx, const CallArgs &args,
35846 InitialFrameFlags initial, InvokeFrameGuard *ifg);
35847
35848
35849 bool pushExecuteFrame(JSContext *cx, JSScript *script, const Value &thisv,
35850 JSObject &scopeChain, ExecuteType type,
35851 StackFrame *evalInFrame, ExecuteFrameGuard *efg);
35852
35853
35854
35855
35856
35857
35858
35859 bool pushGeneratorFrame(JSContext *cx, JSGenerator *gen, GeneratorFrameGuard *gfg);
35860 # 1669 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack.h"
35861 bool pushDummyFrame(JSContext *cx, JSCompartment *dest, JSObject &scopeChain, DummyFrameGuard *dfg);
35862
35863
35864
35865
35866
35867
35868 bool pushInlineFrame(JSContext *cx, FrameRegs &regs, const CallArgs &args,
35869 JSFunction &callee, JSScript *script,
35870 InitialFrameFlags initial);
35871 bool pushInlineFrame(JSContext *cx, FrameRegs &regs, const CallArgs &args,
35872 JSFunction &callee, JSScript *script,
35873 InitialFrameFlags initial, Value **stackLimit);
35874 void popInlineFrame(FrameRegs &regs);
35875
35876
35877 void popFrameAfterOverflow();
35878
35879
35880 inline JSScript *currentScript(jsbytecode **pc = __null) const;
35881 inline JSScript *currentScriptWithDiagnostics(jsbytecode **pc = __null) const;
35882
35883
35884 inline HandleObject currentScriptedScopeChain() const;
35885
35886
35887
35888
35889
35890
35891 StackFrame *getFixupFrame(JSContext *cx, MaybeReportError report,
35892 const CallArgs &args, JSFunction *fun, JSScript *script,
35893 void *ncode, InitialFrameFlags initial, Value **stackLimit);
35894
35895 bool saveFrameChain();
35896 void restoreFrameChain();
35897
35898
35899
35900
35901
35902 inline void repointRegs(FrameRegs *regs) { do { } while(0); seg_->repointRegs(regs); }
35903 # 1719 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack.h"
35904 void threadReset();
35905
35906
35907
35908 static size_t offsetOfSeg() { return __builtin_offsetof (ContextStack, seg_); }
35909 };
35910
35911
35912
35913 class InvokeArgsGuard : public CallArgsList
35914 {
35915 friend class ContextStack;
35916 ContextStack *stack_;
35917 bool pushedSeg_;
35918 void setPushed(ContextStack &stack) { do { } while(0); stack_ = &stack; }
35919 public:
35920 InvokeArgsGuard() : CallArgsList(), stack_(__null), pushedSeg_(false) {}
35921 ~InvokeArgsGuard() { if (pushed()) stack_->popInvokeArgs(*this); }
35922 bool pushed() const { return !!stack_; }
35923 void pop() { stack_->popInvokeArgs(*this); stack_ = __null; }
35924 };
35925
35926 class FrameGuard
35927 {
35928 protected:
35929 friend class ContextStack;
35930 ContextStack *stack_;
35931 bool pushedSeg_;
35932 FrameRegs regs_;
35933 FrameRegs *prevRegs_;
35934 void setPushed(ContextStack &stack) { stack_ = &stack; }
35935 public:
35936 FrameGuard() : stack_(__null), pushedSeg_(false) {}
35937 ~FrameGuard() { if (pushed()) stack_->popFrame(*this); }
35938 bool pushed() const { return !!stack_; }
35939 void pop() { stack_->popFrame(*this); stack_ = __null; }
35940
35941 StackFrame *fp() const { return regs_.fp(); }
35942 };
35943
35944 class InvokeFrameGuard : public FrameGuard
35945 {};
35946
35947 class ExecuteFrameGuard : public FrameGuard
35948 {};
35949
35950 class DummyFrameGuard : public FrameGuard
35951 {};
35952
35953 class GeneratorFrameGuard : public FrameGuard
35954 {
35955 friend class ContextStack;
35956 JSGenerator *gen_;
35957 Value *stackvp_;
35958 public:
35959 ~GeneratorFrameGuard() { if (pushed()) stack_->popGeneratorFrame(*this); }
35960 };
35961 # 1797 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack.h"
35962 class StackIter
35963 {
35964 friend class ContextStack;
35965 JSContext *maybecx_;
35966 public:
35967 enum SavedOption { STOP_AT_SAVED, GO_THROUGH_SAVED };
35968 private:
35969 SavedOption savedOption_;
35970
35971 enum State { DONE, SCRIPTED, NATIVE, IMPLICIT_NATIVE };
35972 State state_;
35973
35974 StackFrame *fp_;
35975 CallArgsList *calls_;
35976
35977 StackSegment *seg_;
35978 Value *sp_;
35979 jsbytecode *pc_;
35980 JSScript *script_;
35981 CallArgs args_;
35982
35983 void poisonRegs();
35984 void popFrame();
35985 void popCall();
35986 void settleOnNewSegment();
35987 void settleOnNewState();
35988 void startOnSegment(StackSegment *seg);
35989
35990 public:
35991 StackIter(JSContext *cx, SavedOption = STOP_AT_SAVED);
35992 StackIter(JSRuntime *rt, StackSegment &seg);
35993
35994 bool done() const { return state_ == DONE; }
35995 StackIter &operator++();
35996
35997 bool operator==(const StackIter &rhs) const;
35998 bool operator!=(const StackIter &rhs) const { return !(*this == rhs); }
35999
36000 bool isScript() const { do { } while(0); return state_ == SCRIPTED; }
36001 bool isImplicitNativeCall() const {
36002 do { } while(0);
36003 return state_ == IMPLICIT_NATIVE;
36004 }
36005 bool isNativeCall() const {
36006 do { } while(0);
36007 return state_ == NATIVE || state_ == IMPLICIT_NATIVE;
36008 }
36009
36010 bool isFunctionFrame() const;
36011 bool isEvalFrame() const;
36012 bool isNonEvalFunctionFrame() const;
36013 bool isConstructing() const;
36014
36015 StackFrame *fp() const { do { } while(0); return fp_; }
36016 Value *sp() const { do { } while(0); return sp_; }
36017 jsbytecode *pc() const { do { } while(0); return pc_; }
36018 JSScript *script() const { do { } while(0); return script_; }
36019 JSFunction *callee() const;
36020 Value calleev() const;
36021 Value thisv() const;
36022
36023 CallArgs nativeArgs() const { do { } while(0); return args_; }
36024 };
36025
36026
36027 class ScriptFrameIter : public StackIter
36028 {
36029 void settle() {
36030 while (!done() && !isScript())
36031 StackIter::operator++();
36032 }
36033
36034 public:
36035 ScriptFrameIter(JSContext *cx, StackIter::SavedOption opt = StackIter::STOP_AT_SAVED)
36036 : StackIter(cx, opt) { settle(); }
36037
36038 ScriptFrameIter &operator++() { StackIter::operator++(); settle(); return *this; }
36039 };
36040
36041
36042
36043
36044
36045
36046
36047 class AllFramesIter
36048 {
36049 public:
36050 AllFramesIter(StackSpace &space);
36051
36052 bool done() const { return fp_ == __null; }
36053 AllFramesIter& operator++();
36054
36055 StackFrame *fp() const { return fp_; }
36056
36057 private:
36058 void settle();
36059 StackSegment *seg_;
36060 StackFrame *fp_;
36061 };
36062
36063 }
36064 # 33 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscntxt.h" 2
36065 # 41 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscntxt.h"
36066 extern "C" {
36067 struct DtoaState;
36068 }
36069
36070 struct JSSharpInfo {
36071 bool hasGen;
36072 bool isSharp;
36073
36074 JSSharpInfo() : hasGen(false), isSharp(false) {}
36075 };
36076
36077 typedef js::HashMap<JSObject *, JSSharpInfo> JSSharpTable;
36078
36079 struct JSSharpObjectMap {
36080 unsigned depth;
36081 uint32_t sharpgen;
36082 JSSharpTable table;
36083
36084 JSSharpObjectMap(JSContext *cx) : depth(0), sharpgen(0), table(js::TempAllocPolicy(cx)) {
36085 table.init();
36086 }
36087 };
36088
36089 namespace js {
36090
36091 namespace mjit {
36092 class JaegerRuntime;
36093 }
36094
36095 class MathCache;
36096 class WeakMapBase;
36097 class InterpreterFrames;
36098 class DebugScopes;
36099
36100
36101
36102
36103
36104
36105
36106 struct GSNCache {
36107 typedef HashMap<jsbytecode *,
36108 jssrcnote *,
36109 PointerHasher<jsbytecode *, 0>,
36110 SystemAllocPolicy> Map;
36111
36112 jsbytecode *code;
36113 Map map;
36114
36115 GSNCache() : code(__null) { }
36116
36117 void purge();
36118 };
36119
36120 inline GSNCache *
36121 GetGSNCache(JSContext *cx);
36122
36123 struct PendingProxyOperation {
36124 PendingProxyOperation *next;
36125 RootedObject object;
36126 PendingProxyOperation(JSContext *cx, JSObject *object) : next(__null), object(cx, object) {}
36127 };
36128
36129 typedef Vector<ScriptAndCounts, 0, SystemAllocPolicy> ScriptAndCountsVector;
36130
36131 struct ConservativeGCData
36132 {
36133
36134
36135
36136
36137 uintptr_t *nativeStackTop;
36138 # 126 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscntxt.h"
36139 union {
36140 jmp_buf jmpbuf;
36141 uintptr_t words[(((sizeof(jmp_buf))+(sizeof(uintptr_t))-1)/(sizeof(uintptr_t)))];
36142 } registerSnapshot;
36143
36144 ConservativeGCData() {
36145 PodZero(this);
36146 }
36147
36148 ~ConservativeGCData() {
36149
36150
36151
36152
36153
36154 do { } while(0);
36155
36156 }
36157
36158 __attribute__((noinline)) void recordStackTop();
36159
36160
36161 void updateForRequestEnd(unsigned suspendCount) {
36162 if (suspendCount)
36163 recordStackTop();
36164 else
36165 nativeStackTop = __null;
36166 }
36167
36168
36169 bool hasStackToScan() const {
36170 return !!nativeStackTop;
36171 }
36172 };
36173
36174 class ToSourceCache
36175 {
36176 typedef HashMap<JSFunction *,
36177 JSString *,
36178 DefaultHasher<JSFunction *>,
36179 SystemAllocPolicy> Map;
36180 Map *map_;
36181 public:
36182 ToSourceCache() : map_(__null) {}
36183 JSString *lookup(JSFunction *fun);
36184 void put(JSFunction *fun, JSString *);
36185 void purge();
36186 };
36187
36188 class EvalCache
36189 {
36190 static const unsigned SHIFT = 6;
36191 static const unsigned LENGTH = 1 << SHIFT;
36192 JSScript *table_[LENGTH];
36193
36194 public:
36195 EvalCache() { PodArrayZero(table_); }
36196 JSScript **bucket(JSLinearString *str);
36197 void purge();
36198 };
36199
36200 class NativeIterCache
36201 {
36202 static const size_t SIZE = size_t(1) << 8;
36203
36204
36205 JSObject *data[SIZE];
36206
36207 static size_t getIndex(uint32_t key) {
36208 return size_t(key) % SIZE;
36209 }
36210
36211 public:
36212
36213 JSObject *last;
36214
36215 NativeIterCache()
36216 : last(__null) {
36217 PodArrayZero(data);
36218 }
36219
36220 void purge() {
36221 last = __null;
36222 PodArrayZero(data);
36223 }
36224
36225 JSObject *get(uint32_t key) const {
36226 return data[getIndex(key)];
36227 }
36228
36229 void set(uint32_t key, JSObject *iterobj) {
36230 data[getIndex(key)] = iterobj;
36231 }
36232 };
36233
36234
36235
36236
36237
36238
36239 class NewObjectCache
36240 {
36241
36242 static const unsigned MAX_OBJ_SIZE = 4 * sizeof(void*) + 16 * sizeof(Value);
36243 static inline void staticAsserts();
36244
36245 struct Entry
36246 {
36247
36248 Class *clasp;
36249 # 250 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscntxt.h"
36250 gc::Cell *key;
36251
36252
36253 gc::AllocKind kind;
36254
36255
36256 uint32_t nbytes;
36257
36258
36259
36260
36261
36262 char templateObject[MAX_OBJ_SIZE];
36263 };
36264
36265 Entry entries[41];
36266
36267 public:
36268
36269 typedef int EntryIndex;
36270
36271 NewObjectCache() { PodZero(this); }
36272 void purge() { PodZero(this); }
36273
36274
36275
36276
36277
36278 inline bool lookupProto(Class *clasp, JSObject *proto, gc::AllocKind kind, EntryIndex *pentry);
36279 inline bool lookupGlobal(Class *clasp, js::GlobalObject *global, gc::AllocKind kind, EntryIndex *pentry);
36280 inline bool lookupType(Class *clasp, js::types::TypeObject *type, gc::AllocKind kind, EntryIndex *pentry);
36281
36282
36283 inline JSObject *newObjectFromHit(JSContext *cx, EntryIndex entry);
36284
36285
36286 inline void fillProto(EntryIndex entry, Class *clasp, JSObject *proto, gc::AllocKind kind, JSObject *obj);
36287 inline void fillGlobal(EntryIndex entry, Class *clasp, js::GlobalObject *global, gc::AllocKind kind, JSObject *obj);
36288 inline void fillType(EntryIndex entry, Class *clasp, js::types::TypeObject *type, gc::AllocKind kind, JSObject *obj);
36289
36290
36291 void invalidateEntriesForShape(JSContext *cx, Shape *shape, JSObject *proto);
36292
36293 private:
36294 inline bool lookup(Class *clasp, gc::Cell *key, gc::AllocKind kind, EntryIndex *pentry);
36295 inline void fill(EntryIndex entry, Class *clasp, gc::Cell *key, gc::AllocKind kind, JSObject *obj);
36296 static inline void copyCachedToObject(JSObject *dst, JSObject *src);
36297 };
36298 # 306 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscntxt.h"
36299 class FreeOp : public JSFreeOp {
36300 bool shouldFreeLater_;
36301 bool onBackgroundThread_;
36302
36303 public:
36304 static FreeOp *get(JSFreeOp *fop) {
36305 return static_cast<FreeOp *>(fop);
36306 }
36307
36308 FreeOp(JSRuntime *rt, bool shouldFreeLater, bool onBackgroundThread)
36309 : JSFreeOp(rt),
36310 shouldFreeLater_(shouldFreeLater),
36311 onBackgroundThread_(onBackgroundThread)
36312 {
36313 }
36314
36315 bool shouldFreeLater() const {
36316 return shouldFreeLater_;
36317 }
36318
36319 bool onBackgroundThread() const {
36320 return onBackgroundThread_;
36321 }
36322
36323 inline void free_(void* p);
36324
36325 template <class T> inline void delete_(T *p) { if (p) { p->~T(); free_(p); } } template <class T> inline void array_delete(T *p) { if (p) { void* p0 = (void *)(uintptr_t(p) - js::OffTheBooks::JSMinAlignment); size_t n = *(size_t *)p0; for (size_t i = 0; i < n; i++) (p + i)->~T(); free_(p0); } }
36326
36327 static void staticAsserts() {
36328
36329
36330
36331
36332
36333
36334 typedef int moz_static_assert101[(__builtin_offsetof (FreeOp, shouldFreeLater_) == sizeof(JSFreeOp)) ? 1 : -1];
36335 }
36336 };
36337
36338 }
36339
36340 namespace JS {
36341 struct RuntimeSizes;
36342 }
36343
36344 struct JSRuntime : js::RuntimeFriendFields
36345 {
36346
36347 JSCompartment *atomsCompartment;
36348
36349
36350 js::CompartmentVector compartments;
36351
36352
36353
36354 public:
36355 void *ownerThread() const { return ownerThread_; }
36356 void clearOwnerThread();
36357 void setOwnerThread();
36358 __attribute__((visibility("default"))) bool onOwnerThread() const;
36359 private:
36360 void *ownerThread_;
36361 public:
36362
36363
36364
36365
36366
36367
36368 js::StackSpace stackSpace;
36369
36370
36371 static const size_t TEMP_LIFO_ALLOC_PRIMARY_CHUNK_SIZE = 1 << 12;
36372 js::LifoAlloc tempLifoAlloc;
36373
36374 private:
36375
36376
36377
36378
36379 JSC::ExecutableAllocator *execAlloc_;
36380 WTF::BumpPointerAllocator *bumpAlloc_;
36381
36382 js::mjit::JaegerRuntime *jaegerRuntime_;
36383
36384
36385 JSC::ExecutableAllocator *createExecutableAllocator(JSContext *cx);
36386 WTF::BumpPointerAllocator *createBumpPointerAllocator(JSContext *cx);
36387 js::mjit::JaegerRuntime *createJaegerRuntime(JSContext *cx);
36388
36389 public:
36390 JSC::ExecutableAllocator *getExecAlloc(JSContext *cx) {
36391 return execAlloc_ ? execAlloc_ : createExecutableAllocator(cx);
36392 }
36393 JSC::ExecutableAllocator &execAlloc() {
36394 do { } while(0);
36395 return *execAlloc_;
36396 }
36397 WTF::BumpPointerAllocator *getBumpPointerAllocator(JSContext *cx) {
36398 return bumpAlloc_ ? bumpAlloc_ : createBumpPointerAllocator(cx);
36399 }
36400
36401 js::mjit::JaegerRuntime *getJaegerRuntime(JSContext *cx) {
36402 return jaegerRuntime_ ? jaegerRuntime_ : createJaegerRuntime(cx);
36403 }
36404 bool hasJaegerRuntime() const {
36405 return jaegerRuntime_;
36406 }
36407 js::mjit::JaegerRuntime &jaegerRuntime() {
36408 do { } while(0);
36409 return *jaegerRuntime_;
36410 }
36411
36412
36413
36414 uintptr_t nativeStackBase;
36415
36416
36417 size_t nativeStackQuota;
36418
36419
36420
36421
36422
36423 js::InterpreterFrames *interpreterFrames;
36424
36425
36426 JSContextCallback cxCallback;
36427
36428
36429 JSDestroyCompartmentCallback destroyCompartmentCallback;
36430
36431 js::ActivityCallback activityCallback;
36432 void *activityCallbackArg;
36433
36434
36435
36436 unsigned suspendCount;
36437
36438
36439 unsigned requestDepth;
36440 # 460 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscntxt.h"
36441 js::GCChunkSet gcChunkSet;
36442 # 469 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscntxt.h"
36443 js::gc::Chunk *gcSystemAvailableChunkListHead;
36444 js::gc::Chunk *gcUserAvailableChunkListHead;
36445 js::gc::ChunkPool gcChunkPool;
36446
36447 js::RootedValueMap gcRootsHash;
36448 js::GCLocks gcLocksHash;
36449 unsigned gcKeepAtoms;
36450 size_t gcBytes;
36451 size_t gcMaxBytes;
36452 size_t gcMaxMallocBytes;
36453
36454
36455
36456
36457
36458
36459 volatile uint32_t gcNumArenasFreeCommitted;
36460 js::GCMarker gcMarker;
36461 void *gcVerifyData;
36462 bool gcChunkAllocationSinceLastGC;
36463 int64_t gcNextFullGCTime;
36464 int64_t gcJitReleaseTime;
36465 JSGCMode gcMode;
36466
36467
36468 bool gcShouldCleanUpEverything;
36469
36470
36471
36472
36473
36474
36475 volatile uintptr_t gcIsNeeded;
36476
36477 js::WeakMapBase *gcWeakMapList;
36478 js::gcstats::Statistics gcStats;
36479
36480
36481 uint64_t gcNumber;
36482
36483
36484 uint64_t gcStartNumber;
36485
36486
36487 bool gcIsFull;
36488
36489
36490 js::gcreason::Reason gcTriggerReason;
36491
36492
36493
36494
36495
36496 bool gcStrictCompartmentChecking;
36497
36498
36499
36500
36501
36502 js::gc::State gcIncrementalState;
36503
36504
36505 bool gcLastMarkSlice;
36506
36507
36508
36509
36510
36511
36512 volatile uintptr_t gcInterFrameGC;
36513
36514
36515 int64_t gcSliceBudget;
36516
36517
36518
36519
36520
36521 bool gcIncrementalEnabled;
36522
36523
36524
36525
36526
36527
36528 bool gcExactScanningEnabled;
36529 # 572 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscntxt.h"
36530 bool gcPoke;
36531 bool gcRunning;
36532 # 614 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscntxt.h"
36533 int gcZeal() { return 0; }
36534 bool needZealousGC() { return false; }
36535
36536
36537 JSGCCallback gcCallback;
36538 js::GCSliceCallback gcSliceCallback;
36539 JSFinalizeCallback gcFinalizeCallback;
36540
36541 private:
36542
36543
36544
36545
36546 volatile ptrdiff_t gcMallocBytes;
36547
36548 public:
36549
36550
36551
36552
36553
36554
36555 JSTraceDataOp gcBlackRootsTraceOp;
36556 void *gcBlackRootsData;
36557 JSTraceDataOp gcGrayRootsTraceOp;
36558 void *gcGrayRootsData;
36559
36560
36561 js::AutoGCRooter *autoGCRooters;
36562
36563
36564 js::ScriptAndCountsVector *scriptAndCountsVector;
36565
36566
36567 js::Value NaNValue;
36568 js::Value negativeInfinityValue;
36569 js::Value positiveInfinityValue;
36570
36571 JSAtom *emptyString;
36572
36573
36574 JSCList contextList;
36575
36576 bool hasContexts() const {
36577 return !((&contextList)->next == (&contextList));
36578 }
36579
36580
36581 JSDebugHooks debugHooks;
36582
36583
36584 bool debugMode;
36585
36586
36587 bool profilingScripts;
36588
36589
36590 bool alwaysPreserveCode;
36591
36592
36593 JSBool hadOutOfMemory;
36594
36595
36596
36597
36598
36599 JSCList debuggerList;
36600
36601
36602 js::DebugScopes *debugScopes;
36603
36604
36605 void *data;
36606
36607
36608
36609 PRLock *gcLock;
36610
36611 js::GCHelperThread gcHelperThread;
36612
36613
36614 private:
36615 js::FreeOp defaultFreeOp_;
36616
36617 public:
36618 js::FreeOp *defaultFreeOp() {
36619 return &defaultFreeOp_;
36620 }
36621
36622 uint32_t debuggerMutations;
36623
36624 const JSSecurityCallbacks *securityCallbacks;
36625 JSDestroyPrincipalsOp destroyPrincipals;
36626
36627
36628 const JSStructuredCloneCallbacks *structuredCloneCallbacks;
36629
36630
36631 JSAccumulateTelemetryDataCallback telemetryCallback;
36632
36633
36634
36635
36636
36637
36638 int32_t propertyRemovals;
36639
36640
36641 const char *thousandsSeparator;
36642 const char *decimalSeparator;
36643 const char *numGrouping;
36644
36645
36646
36647
36648
36649 bool waiveGCQuota;
36650
36651 private:
36652 js::MathCache *mathCache_;
36653 js::MathCache *createMathCache(JSContext *cx);
36654 public:
36655 js::MathCache *getMathCache(JSContext *cx) {
36656 return mathCache_ ? mathCache_ : createMathCache(cx);
36657 }
36658
36659 js::GSNCache gsnCache;
36660 js::PropertyCache propertyCache;
36661 js::NewObjectCache newObjectCache;
36662 js::NativeIterCache nativeIterCache;
36663 js::ToSourceCache toSourceCache;
36664 js::EvalCache evalCache;
36665
36666
36667 DtoaState *dtoaState;
36668
36669
36670 js::PendingProxyOperation *pendingProxyOperation;
36671
36672 js::ConservativeGCData conservativeGC;
36673
36674 private:
36675 JSPrincipals *trustedPrincipals_;
36676 public:
36677 void setTrustedPrincipals(JSPrincipals *p) { trustedPrincipals_ = p; }
36678 JSPrincipals *trustedPrincipals() const { return trustedPrincipals_; }
36679
36680
36681 JSAtomState atomState;
36682
36683
36684 js::StaticStrings staticStrings;
36685
36686 JSWrapObjectCallback wrapObjectCallback;
36687 JSSameCompartmentWrapObjectCallback sameCompartmentWrapObjectCallback;
36688 JSPreWrapCallback preWrapObjectCallback;
36689 js::PreserveWrapperCallback preserveWrapperCallback;
36690
36691 js::ScriptFilenameTable scriptFilenameTable;
36692 # 783 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscntxt.h"
36693 int32_t inOOMReport;
36694
36695 bool jitHardening;
36696
36697 JSRuntime();
36698 ~JSRuntime();
36699
36700 bool init(uint32_t maxbytes);
36701
36702 JSRuntime *thisFromCtor() { return this; }
36703
36704
36705
36706
36707
36708 void* malloc_(size_t bytes, JSContext *cx = __null) {
36709 updateMallocCounter(cx, bytes);
36710 void *p = ::js_malloc(bytes);
36711 return (__builtin_expect((!!p), 1)) ? p : onOutOfMemory(__null, bytes, cx);
36712 }
36713
36714
36715
36716
36717
36718 void* calloc_(size_t bytes, JSContext *cx = __null) {
36719 updateMallocCounter(cx, bytes);
36720 void *p = ::js_calloc(bytes);
36721 return (__builtin_expect((!!p), 1)) ? p : onOutOfMemory(reinterpret_cast<void *>(1), bytes, cx);
36722 }
36723
36724 void* realloc_(void* p, size_t oldBytes, size_t newBytes, JSContext *cx = __null) {
36725 do { } while(0);
36726 updateMallocCounter(cx, newBytes - oldBytes);
36727 void *p2 = ::js_realloc(p, newBytes);
36728 return (__builtin_expect((!!p2), 1)) ? p2 : onOutOfMemory(p, newBytes, cx);
36729 }
36730
36731 void* realloc_(void* p, size_t bytes, JSContext *cx = __null) {
36732
36733
36734
36735
36736 if (!p)
36737 updateMallocCounter(cx, bytes);
36738 void *p2 = ::js_realloc(p, bytes);
36739 return (__builtin_expect((!!p2), 1)) ? p2 : onOutOfMemory(p, bytes, cx);
36740 }
36741
36742 inline void free_(void* p) {
36743
36744 js::Foreground::free_(p);
36745 }
36746
36747 template <class T> __attribute__((always_inline)) inline T *new_() { void *memory = malloc_(sizeof(T)); return memory ? new(memory) T () : __null; } template <class T, class P1> __attribute__((always_inline)) inline T *new_(P1 p1) { void *memory = malloc_(sizeof(T)); return memory ? new(memory) T (p1) : __null; } template <class T, class P1, class P2> __attribute__((always_inline)) inline T *new_(P1 p1, P2 p2) { void *memory = malloc_(sizeof(T)); return memory ? new(memory) T (p1, p2) : __null; } template <class T, class P1, class P2, class P3> __attribute__((always_inline)) inline T *new_(P1 p1, P2 p2, P3 p3) { void *memory = malloc_(sizeof(T)); return memory ? new(memory) T (p1, p2, p3) : __null; } template <class T, class P1, class P2, class P3, class P4> __attribute__((always_inline)) inline T *new_(P1 p1, P2 p2, P3 p3, P4 p4) { void *memory = malloc_(sizeof(T)); return memory ? new(memory) T (p1, p2, p3, p4) : __null; } template <class T, class P1, class P2, class P3, class P4, class P5> __attribute__((always_inline)) inline T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) { void *memory = malloc_(sizeof(T)); return memory ? new(memory) T (p1, p2, p3, p4, p5) : __null; } template <class T, class P1, class P2, class P3, class P4, class P5, class P6> __attribute__((always_inline)) inline T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6) { void *memory = malloc_(sizeof(T)); return memory ? new(memory) T (p1, p2, p3, p4, p5, p6) : __null; } template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7> __attribute__((always_inline)) inline T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7) { void *memory = malloc_(sizeof(T)); return memory ? new(memory) T (p1, p2, p3, p4, p5, p6, p7) : __null; } template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8> __attribute__((always_inline)) inline T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8) { void *memory = malloc_(sizeof(T)); return memory ? new(memory) T (p1, p2, p3, p4, p5, p6, p7, p8) : __null; } template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9> __attribute__((always_inline)) inline T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9) { void *memory = malloc_(sizeof(T)); return memory ? new(memory) T (p1, p2, p3, p4, p5, p6, p7, p8, p9) : __null; } template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10> __attribute__((always_inline)) inline T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10) { void *memory = malloc_(sizeof(T)); return memory ? new(memory) T (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10) : __null; } template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class P11> __attribute__((always_inline)) inline T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11) { void *memory = malloc_(sizeof(T)); return memory ? new(memory) T (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11) : __null; } template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class P11, class P12> __attribute__((always_inline)) inline T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11, P12 p12) { void *memory = malloc_(sizeof(T)); return memory ? new(memory) T (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12) : __null; } static const int JSMinAlignment = 8; template <class T> __attribute__((always_inline)) inline T *array_new(size_t n) { uint64_t numBytes64 = uint64_t(JSMinAlignment) + uint64_t(sizeof(T)) * uint64_t(n); size_t numBytes = size_t(numBytes64); if (numBytes64 != numBytes) { do { } while(0); return __null; } void *memory = malloc_(numBytes); if (!memory) return __null; *(size_t *)memory = n; memory = (void*)(uintptr_t(memory) + JSMinAlignment); return new(memory) T[n]; }
36748 template <class T> __attribute__((always_inline)) inline void delete_(T *p) { if (p) { p->~T(); free_(p); } } template <class T> __attribute__((always_inline)) inline void array_delete(T *p) { if (p) { void* p0 = (void *)(uintptr_t(p) - js::OffTheBooks::JSMinAlignment); size_t n = *(size_t *)p0; for (size_t i = 0; i < n; i++) (p + i)->~T(); free_(p0); } }
36749
36750 void setGCMaxMallocBytes(size_t value);
36751
36752 void resetGCMallocBytes() { gcMallocBytes = ptrdiff_t(gcMaxMallocBytes); }
36753 # 852 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscntxt.h"
36754 void updateMallocCounter(JSContext *cx, size_t nbytes);
36755
36756 bool isTooMuchMalloc() const {
36757 return gcMallocBytes <= 0;
36758 }
36759
36760
36761
36762
36763 __attribute__((visibility("default"))) void onTooMuchMalloc();
36764 # 871 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscntxt.h"
36765 __attribute__((visibility("default"))) void * onOutOfMemory(void *p, size_t nbytes, JSContext *cx);
36766
36767 void triggerOperationCallback();
36768
36769 void setJitHardening(bool enabled);
36770 bool getJitHardening() const {
36771 return jitHardening;
36772 }
36773
36774 void sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf, JS::RuntimeSizes *runtime);
36775 size_t sizeOfExplicitNonHeap();
36776 };
36777
36778
36779 #define JS_PROPERTY_CACHE(cx) (cx->runtime->propertyCache)
36780
36781 #define JS_KEEP_ATOMS(rt) (rt)->gcKeepAtoms++;
36782 #define JS_UNKEEP_ATOMS(rt) (rt)->gcKeepAtoms--;
36783 # 904 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscntxt.h"
36784 namespace js {
36785
36786 struct AutoResolving;
36787
36788 static inline bool
36789 OptionsHasAllowXML(uint32_t options)
36790 {
36791 return !!(options & ((uint32_t)1 << (6)));
36792 }
36793
36794 static inline bool
36795 OptionsHasMoarXML(uint32_t options)
36796 {
36797 return !!(options & ((uint32_t)1 << (7)));
36798 }
36799
36800 static inline bool
36801 OptionsSameVersionFlags(uint32_t self, uint32_t other)
36802 {
36803 static const uint32_t mask = ((uint32_t)1 << (7));
36804 return !((self & mask) ^ (other & mask));
36805 }
36806 # 935 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscntxt.h"
36807 namespace VersionFlags {
36808 static const unsigned MASK = 0x0FFF;
36809 static const unsigned ALLOW_XML = 0x1000;
36810 static const unsigned MOAR_XML = 0x2000;
36811 static const unsigned FULL_MASK = 0x3FFF;
36812 }
36813
36814 static inline JSVersion
36815 VersionNumber(JSVersion version)
36816 {
36817 return JSVersion(uint32_t(version) & VersionFlags::MASK);
36818 }
36819
36820 static inline bool
36821 VersionHasAllowXML(JSVersion version)
36822 {
36823 return !!(version & VersionFlags::ALLOW_XML);
36824 }
36825
36826 static inline bool
36827 VersionHasMoarXML(JSVersion version)
36828 {
36829 return !!(version & VersionFlags::MOAR_XML);
36830 }
36831
36832
36833 static inline bool
36834 VersionShouldParseXML(JSVersion version)
36835 {
36836 return VersionHasMoarXML(version) || VersionNumber(version) >= JSVERSION_1_6;
36837 }
36838
36839 static inline JSVersion
36840 VersionExtractFlags(JSVersion version)
36841 {
36842 return JSVersion(uint32_t(version) & ~VersionFlags::MASK);
36843 }
36844
36845 static inline void
36846 VersionCopyFlags(JSVersion *version, JSVersion from)
36847 {
36848 *version = JSVersion(VersionNumber(*version) | VersionExtractFlags(from));
36849 }
36850
36851 static inline bool
36852 VersionHasFlags(JSVersion version)
36853 {
36854 return !!VersionExtractFlags(version);
36855 }
36856
36857 static inline unsigned
36858 VersionFlagsToOptions(JSVersion version)
36859 {
36860 unsigned copts = (VersionHasAllowXML(version) ? ((uint32_t)1 << (6)) : 0) |
36861 (VersionHasMoarXML(version) ? ((uint32_t)1 << (7)) : 0);
36862 do { } while(0);
36863 return copts;
36864 }
36865
36866 static inline JSVersion
36867 OptionFlagsToVersion(unsigned options, JSVersion version)
36868 {
36869 uint32_t v = version;
36870 v &= ~(VersionFlags::ALLOW_XML | VersionFlags::MOAR_XML);
36871 if (OptionsHasAllowXML(options))
36872 v |= VersionFlags::ALLOW_XML;
36873 if (OptionsHasMoarXML(options))
36874 v |= VersionFlags::MOAR_XML;
36875 return JSVersion(v);
36876 }
36877
36878 static inline bool
36879 VersionIsKnown(JSVersion version)
36880 {
36881 return VersionNumber(version) != JSVERSION_UNKNOWN;
36882 }
36883
36884 typedef HashSet<JSObject *,
36885 DefaultHasher<JSObject *>,
36886 SystemAllocPolicy> BusyArraysSet;
36887
36888 inline void
36889 FreeOp::free_(void* p) {
36890
36891 if (shouldFreeLater()) {
36892 runtime()->gcHelperThread.freeLater(p);
36893 return;
36894 }
36895
36896 runtime()->free_(p);
36897 }
36898
36899 }
36900
36901 struct JSContext : js::ContextFriendFields
36902 {
36903 explicit JSContext(JSRuntime *rt);
36904 JSContext *thisDuringConstruction() { return this; }
36905 ~JSContext();
36906
36907
36908 JSCList link;
36909
36910 private:
36911
36912 JSVersion defaultVersion;
36913 JSVersion versionOverride;
36914 bool hasVersionOverride;
36915
36916
36917 JSBool throwing;
36918 js::Value exception;
36919
36920
36921 unsigned runOptions;
36922
36923 public:
36924 int32_t reportGranularity;
36925
36926
36927 JSLocaleCallbacks *localeCallbacks;
36928
36929 js::AutoResolving *resolvingList;
36930
36931
36932 bool generatingError;
36933
36934
36935 JSCompartment *compartment;
36936
36937 inline void setCompartment(JSCompartment *compartment);
36938
36939
36940 js::ContextStack stack;
36941
36942
36943 inline bool hasfp() const { return stack.hasfp(); }
36944 inline js::StackFrame* fp() const { return stack.fp(); }
36945 inline js::StackFrame* maybefp() const { return stack.maybefp(); }
36946 inline js::FrameRegs& regs() const { return stack.regs(); }
36947 inline js::FrameRegs* maybeRegs() const { return stack.maybeRegs(); }
36948
36949
36950 void resetCompartment();
36951
36952
36953 void wrapPendingException();
36954
36955 private:
36956
36957 js::ParseMapPool *parseMapPool_;
36958
36959 public:
36960
36961 JSObject *globalObject;
36962
36963
36964 JSSharpObjectMap sharpObjectMap;
36965 js::BusyArraysSet busyArrays;
36966
36967
36968 JSArgumentFormatMap *argumentFormatMap;
36969
36970
36971 char *lastMessage;
36972
36973
36974 JSErrorReporter errorReporter;
36975
36976
36977 JSOperationCallback operationCallback;
36978
36979
36980 void *data;
36981 void *data2;
36982
36983 inline js::RegExpStatics *regExpStatics();
36984
36985 public:
36986 js::ParseMapPool &parseMapPool() {
36987 do { } while(0);
36988 return *parseMapPool_;
36989 }
36990
36991 inline bool ensureParseMapPool();
36992
36993
36994
36995
36996
36997 inline bool canSetDefaultVersion() const;
36998
36999
37000 inline void overrideVersion(JSVersion newVersion);
37001
37002
37003 void setDefaultVersion(JSVersion version) {
37004 defaultVersion = version;
37005 }
37006
37007 void clearVersionOverride() { hasVersionOverride = false; }
37008 JSVersion getDefaultVersion() const { return defaultVersion; }
37009 bool isVersionOverridden() const { return hasVersionOverride; }
37010
37011 JSVersion getVersionOverride() const {
37012 do { } while(0);
37013 return versionOverride;
37014 }
37015
37016
37017
37018
37019
37020 inline bool maybeOverrideVersion(JSVersion newVersion);
37021
37022
37023
37024
37025
37026 void maybeMigrateVersionOverride() {
37027 do { } while(0);
37028 if ((__builtin_expect((isVersionOverridden()), 0))) {
37029 defaultVersion = versionOverride;
37030 clearVersionOverride();
37031 }
37032 }
37033 # 1170 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscntxt.h"
37034 inline JSVersion findVersion() const;
37035
37036 void setRunOptions(unsigned ropts) {
37037 do { } while(0);
37038 runOptions = ropts;
37039 }
37040
37041
37042 inline void setCompileOptions(unsigned newcopts);
37043
37044 unsigned getRunOptions() const { return runOptions; }
37045 inline unsigned getCompileOptions() const;
37046 inline unsigned allOptions() const;
37047
37048 bool hasRunOption(unsigned ropt) const {
37049 do { } while(0);
37050 return !!(runOptions & ropt);
37051 }
37052
37053 bool hasStrictOption() const { return hasRunOption(((uint32_t)1 << (0))); }
37054 bool hasWErrorOption() const { return hasRunOption(((uint32_t)1 << (1))); }
37055 bool hasAtLineOption() const { return hasRunOption(((uint32_t)1 << (5))); }
37056
37057 js::LifoAlloc &tempLifoAlloc() { return runtime->tempLifoAlloc; }
37058 inline js::LifoAlloc &typeLifoAlloc();
37059
37060 inline js::PropertyTree &propertyTree();
37061
37062
37063 unsigned outstandingRequests;
37064
37065
37066
37067
37068
37069 unsigned resolveFlags;
37070
37071
37072 int64_t rngSeed;
37073
37074
37075 js::Value iterValue;
37076
37077
37078 bool methodJitEnabled;
37079
37080 js::mjit::JaegerRuntime &jaegerRuntime() { return runtime->jaegerRuntime(); }
37081
37082
37083 bool inferenceEnabled;
37084
37085 bool typeInferenceEnabled() { return inferenceEnabled; }
37086
37087
37088 void updateJITEnabled();
37089 # 1239 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscntxt.h"
37090 DSTOffsetCache dstOffsetCache;
37091
37092
37093 JSObject *enumerators;
37094
37095 private:
37096
37097
37098
37099
37100
37101
37102 js::Vector<JSGenerator *, 2, js::SystemAllocPolicy> genStack;
37103
37104 public:
37105
37106 JSGenerator *generatorFor(js::StackFrame *fp) const;
37107
37108
37109 inline bool ensureGeneratorStackSpace();
37110
37111 bool enterGenerator(JSGenerator *gen) {
37112 return genStack.append(gen);
37113 }
37114
37115 void leaveGenerator(JSGenerator *gen) {
37116 do { } while(0);
37117 genStack.popBack();
37118 }
37119
37120 inline void* malloc_(size_t bytes) {
37121 return runtime->malloc_(bytes, this);
37122 }
37123
37124 inline void* mallocNoReport(size_t bytes) {
37125 do { } while(0);
37126 return runtime->malloc_(bytes, __null);
37127 }
37128
37129 inline void* calloc_(size_t bytes) {
37130 return runtime->calloc_(bytes, this);
37131 }
37132
37133 inline void* realloc_(void* p, size_t bytes) {
37134 return runtime->realloc_(p, bytes, this);
37135 }
37136
37137 inline void* realloc_(void* p, size_t oldBytes, size_t newBytes) {
37138 return runtime->realloc_(p, oldBytes, newBytes, this);
37139 }
37140
37141 inline void free_(void* p) {
37142 runtime->free_(p);
37143 }
37144
37145 template <class T> inline T *new_() { void *memory = malloc_(sizeof(T)); return memory ? new(memory) T () : __null; } template <class T, class P1> inline T *new_(P1 p1) { void *memory = malloc_(sizeof(T)); return memory ? new(memory) T (p1) : __null; } template <class T, class P1, class P2> inline T *new_(P1 p1, P2 p2) { void *memory = malloc_(sizeof(T)); return memory ? new(memory) T (p1, p2) : __null; } template <class T, class P1, class P2, class P3> inline T *new_(P1 p1, P2 p2, P3 p3) { void *memory = malloc_(sizeof(T)); return memory ? new(memory) T (p1, p2, p3) : __null; } template <class T, class P1, class P2, class P3, class P4> inline T *new_(P1 p1, P2 p2, P3 p3, P4 p4) { void *memory = malloc_(sizeof(T)); return memory ? new(memory) T (p1, p2, p3, p4) : __null; } template <class T, class P1, class P2, class P3, class P4, class P5> inline T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) { void *memory = malloc_(sizeof(T)); return memory ? new(memory) T (p1, p2, p3, p4, p5) : __null; } template <class T, class P1, class P2, class P3, class P4, class P5, class P6> inline T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6) { void *memory = malloc_(sizeof(T)); return memory ? new(memory) T (p1, p2, p3, p4, p5, p6) : __null; } template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7> inline T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7) { void *memory = malloc_(sizeof(T)); return memory ? new(memory) T (p1, p2, p3, p4, p5, p6, p7) : __null; } template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8> inline T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8) { void *memory = malloc_(sizeof(T)); return memory ? new(memory) T (p1, p2, p3, p4, p5, p6, p7, p8) : __null; } template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9> inline T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9) { void *memory = malloc_(sizeof(T)); return memory ? new(memory) T (p1, p2, p3, p4, p5, p6, p7, p8, p9) : __null; } template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10> inline T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10) { void *memory = malloc_(sizeof(T)); return memory ? new(memory) T (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10) : __null; } template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class P11> inline T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11) { void *memory = malloc_(sizeof(T)); return memory ? new(memory) T (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11) : __null; } template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class P11, class P12> inline T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11, P12 p12) { void *memory = malloc_(sizeof(T)); return memory ? new(memory) T (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12) : __null; } static const int JSMinAlignment = 8; template <class T> inline T *array_new(size_t n) { uint64_t numBytes64 = uint64_t(JSMinAlignment) + uint64_t(sizeof(T)) * uint64_t(n); size_t numBytes = size_t(numBytes64); if (numBytes64 != numBytes) { do { } while(0); return __null; } void *memory = malloc_(numBytes); if (!memory) return __null; *(size_t *)memory = n; memory = (void*)(uintptr_t(memory) + JSMinAlignment); return new(memory) T[n]; }
37146 template <class T> inline void delete_(T *p) { if (p) { p->~T(); free_(p); } } template <class T> inline void array_delete(T *p) { if (p) { void* p0 = (void *)(uintptr_t(p) - js::OffTheBooks::JSMinAlignment); size_t n = *(size_t *)p0; for (size_t i = 0; i < n; i++) (p + i)->~T(); free_(p0); } }
37147
37148 void purge();
37149
37150
37151 inline void assertValidStackDepth(unsigned depth);
37152
37153 bool isExceptionPending() {
37154 return throwing;
37155 }
37156
37157 js::Value getPendingException() {
37158 do { } while(0);
37159 return exception;
37160 }
37161
37162 void setPendingException(js::Value v);
37163
37164 void clearPendingException() {
37165 this->throwing = false;
37166 this->exception.setUndefined();
37167 }
37168 # 1337 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscntxt.h"
37169 unsigned activeCompilations;
37170
37171
37172
37173
37174
37175 bool runningWithTrustedPrincipals() const;
37176
37177 __attribute__((visibility("default"))) size_t sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf) const;
37178
37179 static inline JSContext *fromLinkField(JSCList *link) {
37180 do { } while(0);
37181 return reinterpret_cast<JSContext *>(uintptr_t(link) - __builtin_offsetof (JSContext, link));
37182 }
37183
37184 void mark(JSTracer *trc);
37185
37186 private:
37187
37188
37189
37190
37191
37192
37193 __attribute__((visibility("default"))) void checkMallocGCPressure(void *p);
37194 };
37195
37196 namespace js {
37197
37198 class AutoAllowUnaliasedVarAccess
37199 {
37200 JSContext *cx;
37201 public:
37202 AutoAllowUnaliasedVarAccess(JSContext *cx) : cx(cx) {
37203
37204
37205
37206 }
37207 ~AutoAllowUnaliasedVarAccess() {
37208
37209
37210
37211
37212 }
37213 };
37214
37215 struct AutoResolving {
37216 public:
37217 enum Kind {
37218 LOOKUP,
37219 WATCH
37220 };
37221
37222 AutoResolving(JSContext *cx, JSObject *obj, jsid id, Kind kind = LOOKUP
37223 )
37224 : context(cx), object(obj), id(id), kind(kind), link(cx->resolvingList)
37225 {
37226 do { } while (0);
37227 do { } while(0);
37228 cx->resolvingList = this;
37229 }
37230
37231 ~AutoResolving() {
37232 do { } while(0);
37233 context->resolvingList = link;
37234 }
37235
37236 bool alreadyStarted() const {
37237 return link && alreadyStartedSlow();
37238 }
37239
37240 private:
37241 bool alreadyStartedSlow() const;
37242
37243 JSContext *const context;
37244 JSObject *const object;
37245 jsid const id;
37246 Kind const kind;
37247 AutoResolving *const link;
37248
37249 };
37250
37251
37252 class AutoXMLRooter : private AutoGCRooter {
37253 public:
37254 AutoXMLRooter(JSContext *cx, JSXML *xml
37255 )
37256 : AutoGCRooter(cx, XML), xml(xml)
37257 {
37258 do { } while (0);
37259 do { } while(0);
37260 }
37261
37262 friend void AutoGCRooter::trace(JSTracer *trc);
37263
37264 private:
37265 JSXML * const xml;
37266
37267 };
37268
37269
37270
37271 #define JS_LOCK_GC(rt) PR_Lock((rt)->gcLock)
37272 #define JS_UNLOCK_GC(rt) PR_Unlock((rt)->gcLock)
37273
37274
37275
37276
37277
37278 class AutoLockGC
37279 {
37280 public:
37281 explicit AutoLockGC(JSRuntime *rt = __null
37282 )
37283 : runtime(rt)
37284 {
37285 do { } while (0);
37286
37287
37288 if (rt)
37289 PR_Lock((rt)->gcLock);
37290
37291 }
37292
37293 ~AutoLockGC()
37294 {
37295
37296 if (runtime)
37297 PR_Unlock((runtime)->gcLock);
37298
37299 }
37300
37301 bool locked() const {
37302 return !!runtime;
37303 }
37304
37305 void lock(JSRuntime *rt) {
37306 do { } while(0);
37307 do { } while(0);
37308 runtime = rt;
37309 PR_Lock((rt)->gcLock);
37310 }
37311
37312 private:
37313 JSRuntime *runtime;
37314
37315 };
37316
37317 class AutoUnlockGC {
37318 private:
37319 JSRuntime *rt;
37320
37321
37322 public:
37323 explicit AutoUnlockGC(JSRuntime *rt
37324 )
37325 : rt(rt)
37326 {
37327 do { } while (0);
37328 PR_Unlock((rt)->gcLock);
37329 }
37330 ~AutoUnlockGC() { PR_Lock((rt)->gcLock); }
37331 };
37332
37333 class AutoKeepAtoms {
37334 JSRuntime *rt;
37335
37336
37337 public:
37338 explicit AutoKeepAtoms(JSRuntime *rt
37339 )
37340 : rt(rt)
37341 {
37342 do { } while (0);
37343 (rt)->gcKeepAtoms++;;
37344 }
37345 ~AutoKeepAtoms() { (rt)->gcKeepAtoms--;; }
37346 };
37347
37348 class AutoReleasePtr {
37349 JSContext *cx;
37350 void *ptr;
37351
37352
37353 AutoReleasePtr(const AutoReleasePtr &other) ;
37354 AutoReleasePtr operator=(const AutoReleasePtr &other) ;
37355
37356 public:
37357 explicit AutoReleasePtr(JSContext *cx, void *ptr
37358 )
37359 : cx(cx), ptr(ptr)
37360 {
37361 do { } while (0);
37362 }
37363 ~AutoReleasePtr() { cx->free_(ptr); }
37364 };
37365
37366
37367
37368
37369 class AutoReleaseNullablePtr {
37370 JSContext *cx;
37371 void *ptr;
37372
37373
37374 AutoReleaseNullablePtr(const AutoReleaseNullablePtr &other) ;
37375 AutoReleaseNullablePtr operator=(const AutoReleaseNullablePtr &other) ;
37376
37377 public:
37378 explicit AutoReleaseNullablePtr(JSContext *cx, void *ptr
37379 )
37380 : cx(cx), ptr(ptr)
37381 {
37382 do { } while (0);
37383 }
37384 void reset(void *ptr2) {
37385 if (ptr)
37386 cx->free_(ptr);
37387 ptr = ptr2;
37388 }
37389 ~AutoReleaseNullablePtr() { if (ptr) cx->free_(ptr); }
37390 };
37391
37392 }
37393
37394 class JSAutoResolveFlags
37395 {
37396 public:
37397 JSAutoResolveFlags(JSContext *cx, unsigned flags
37398 )
37399 : mContext(cx), mSaved(cx->resolveFlags)
37400 {
37401 do { } while (0);
37402 cx->resolveFlags = flags;
37403 }
37404
37405 ~JSAutoResolveFlags() { mContext->resolveFlags = mSaved; }
37406
37407 private:
37408 JSContext *mContext;
37409 unsigned mSaved;
37410
37411 };
37412
37413 namespace js {
37414
37415
37416
37417
37418 class ContextIter {
37419 JSCList *begin;
37420 JSCList *end;
37421
37422 public:
37423 explicit ContextIter(JSRuntime *rt) {
37424 end = &rt->contextList;
37425 begin = end->next;
37426 }
37427
37428 bool done() const {
37429 return begin == end;
37430 }
37431
37432 void next() {
37433 do { } while(0);
37434 begin = begin->next;
37435 }
37436
37437 JSContext *get() const {
37438 do { } while(0);
37439 return JSContext::fromLinkField(begin);
37440 }
37441
37442 operator JSContext *() const {
37443 return get();
37444 }
37445
37446 JSContext *operator ->() const {
37447 return get();
37448 }
37449 };
37450
37451
37452
37453
37454
37455 extern JSContext *
37456 NewContext(JSRuntime *rt, size_t stackChunkSize);
37457
37458 enum DestroyContextMode {
37459 DCM_NO_GC,
37460 DCM_FORCE_GC,
37461 DCM_NEW_FAILED
37462 };
37463
37464 extern void
37465 DestroyContext(JSContext *cx, DestroyContextMode mode);
37466
37467 }
37468 # 1653 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscntxt.h"
37469 namespace js {
37470
37471
37472 extern void
37473 ReportUsageError(JSContext *cx, JSObject *callee, const char *msg);
37474
37475 }
37476
37477 extern void
37478 js_ReportOutOfMemory(JSContext *cx);
37479
37480 extern __attribute__((visibility("default"))) void
37481 js_ReportAllocationOverflow(JSContext *cx);
37482
37483
37484
37485
37486
37487 extern __attribute__((visibility("default"))) void
37488 js_ReportErrorAgain(JSContext *cx, const char *message, JSErrorReport *report);
37489
37490 extern void
37491 js_ReportIsNotDefined(JSContext *cx, const char *name);
37492
37493
37494
37495
37496 extern JSBool
37497 js_ReportIsNullOrUndefined(JSContext *cx, int spindex, const js::Value &v,
37498 JSString *fallback);
37499
37500 extern void
37501 js_ReportMissingArg(JSContext *cx, const js::Value &v, unsigned arg);
37502
37503
37504
37505
37506
37507
37508 extern JSBool
37509 js_ReportValueErrorFlags(JSContext *cx, unsigned flags, const unsigned errorNumber,
37510 int spindex, const js::Value &v, JSString *fallback,
37511 const char *arg1, const char *arg2);
37512
37513 #define js_ReportValueError(cx,errorNumber,spindex,v,fallback) ((void)js_ReportValueErrorFlags(cx, JSREPORT_ERROR, errorNumber, spindex, v, fallback, NULL, NULL))
37514
37515
37516
37517 #define js_ReportValueError2(cx,errorNumber,spindex,v,fallback,arg1) ((void)js_ReportValueErrorFlags(cx, JSREPORT_ERROR, errorNumber, spindex, v, fallback, arg1, NULL))
37518
37519
37520
37521 #define js_ReportValueError3(cx,errorNumber,spindex,v,fallback,arg1,arg2) ((void)js_ReportValueErrorFlags(cx, JSREPORT_ERROR, errorNumber, spindex, v, fallback, arg1, arg2))
37522
37523
37524
37525 extern JSErrorFormatString js_ErrorFormatString[JSErr_Limit];
37526
37527
37528 #define JS_ASSERT_REQUEST_DEPTH(cx) JS_ASSERT((cx)->runtime->requestDepth >= 1)
37529 # 1721 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscntxt.h"
37530 extern JSBool
37531 js_InvokeOperationCallback(JSContext *cx);
37532
37533 extern JSBool
37534 js_HandleExecutionInterrupt(JSContext *cx);
37535
37536 extern jsbytecode*
37537 js_GetCurrentBytecodePC(JSContext* cx);
37538
37539 extern JSScript *
37540 js_GetCurrentScript(JSContext* cx);
37541
37542
37543
37544
37545
37546
37547 static __attribute__((always_inline)) inline bool
37548 JS_CHECK_OPERATION_LIMIT(JSContext *cx)
37549 {
37550 do { } while(0);
37551 return !cx->runtime->interrupt || js_InvokeOperationCallback(cx);
37552 }
37553
37554 namespace js {
37555
37556
37557 namespace mjit {
37558 void ExpandInlineFrames(JSCompartment *compartment);
37559 }
37560
37561
37562 }
37563
37564
37565 enum FrameExpandKind {
37566 FRAME_EXPAND_NONE = 0,
37567 FRAME_EXPAND_ALL = 1
37568 };
37569
37570 namespace js {
37571
37572
37573
37574 static __attribute__((always_inline)) inline void
37575 MakeRangeGCSafe(Value *vec, size_t len)
37576 {
37577 PodZero(vec, len);
37578 }
37579
37580 static __attribute__((always_inline)) inline void
37581 MakeRangeGCSafe(Value *beg, Value *end)
37582 {
37583 PodZero(beg, end - beg);
37584 }
37585
37586 static __attribute__((always_inline)) inline void
37587 MakeRangeGCSafe(jsid *beg, jsid *end)
37588 {
37589 for (jsid *id = beg; id != end; ++id)
37590 *id = INT_TO_JSID(0);
37591 }
37592
37593 static __attribute__((always_inline)) inline void
37594 MakeRangeGCSafe(jsid *vec, size_t len)
37595 {
37596 MakeRangeGCSafe(vec, vec + len);
37597 }
37598
37599 static __attribute__((always_inline)) inline void
37600 MakeRangeGCSafe(const Shape **beg, const Shape **end)
37601 {
37602 PodZero(beg, end - beg);
37603 }
37604
37605 static __attribute__((always_inline)) inline void
37606 MakeRangeGCSafe(const Shape **vec, size_t len)
37607 {
37608 PodZero(vec, len);
37609 }
37610
37611 static __attribute__((always_inline)) inline void
37612 SetValueRangeToUndefined(Value *beg, Value *end)
37613 {
37614 for (Value *v = beg; v != end; ++v)
37615 v->setUndefined();
37616 }
37617
37618 static __attribute__((always_inline)) inline void
37619 SetValueRangeToUndefined(Value *vec, size_t len)
37620 {
37621 SetValueRangeToUndefined(vec, vec + len);
37622 }
37623
37624 static __attribute__((always_inline)) inline void
37625 SetValueRangeToNull(Value *beg, Value *end)
37626 {
37627 for (Value *v = beg; v != end; ++v)
37628 v->setNull();
37629 }
37630
37631 static __attribute__((always_inline)) inline void
37632 SetValueRangeToNull(Value *vec, size_t len)
37633 {
37634 SetValueRangeToNull(vec, vec + len);
37635 }
37636
37637 class AutoObjectVector : public AutoVectorRooter<JSObject *>
37638 {
37639 public:
37640 explicit AutoObjectVector(JSContext *cx
37641 )
37642 : AutoVectorRooter<JSObject *>(cx, OBJVECTOR)
37643 {
37644 do { } while (0);
37645 }
37646
37647
37648 };
37649
37650 class AutoShapeVector : public AutoVectorRooter<const Shape *>
37651 {
37652 public:
37653 explicit AutoShapeVector(JSContext *cx
37654 )
37655 : AutoVectorRooter<const Shape *>(cx, SHAPEVECTOR)
37656 {
37657 do { } while (0);
37658 }
37659
37660
37661 };
37662
37663 class AutoValueArray : public AutoGCRooter
37664 {
37665 js::Value *start_;
37666 unsigned length_;
37667 SkipRoot skip;
37668
37669 public:
37670 AutoValueArray(JSContext *cx, js::Value *start, unsigned length
37671 )
37672 : AutoGCRooter(cx, VALARRAY), start_(start), length_(length), skip(cx, start, length)
37673 {
37674 do { } while (0);
37675 }
37676
37677 Value *start() { return start_; }
37678 unsigned length() const { return length_; }
37679
37680
37681 };
37682 # 1885 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscntxt.h"
37683 class RuntimeAllocPolicy
37684 {
37685 JSRuntime *const runtime;
37686
37687 public:
37688 RuntimeAllocPolicy(JSRuntime *rt) : runtime(rt) {}
37689 RuntimeAllocPolicy(JSContext *cx) : runtime(cx->runtime) {}
37690 void *malloc_(size_t bytes) { return runtime->malloc_(bytes); }
37691 void *realloc_(void *p, size_t bytes) { return runtime->realloc_(p, bytes); }
37692 void free_(void *p) { runtime->free_(p); }
37693 void reportAllocOverflow() const {}
37694 };
37695
37696
37697
37698
37699 class ContextAllocPolicy
37700 {
37701 JSContext *const cx;
37702
37703 public:
37704 ContextAllocPolicy(JSContext *cx) : cx(cx) {}
37705 JSContext *context() const { return cx; }
37706 void *malloc_(size_t bytes) { return cx->malloc_(bytes); }
37707 void *realloc_(void *p, size_t oldBytes, size_t bytes) { return cx->realloc_(p, oldBytes, bytes); }
37708 void free_(void *p) { cx->free_(p); }
37709 void reportAllocOverflow() const { js_ReportAllocationOverflow(cx); }
37710 };
37711
37712 }
37713 # 13 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsarray.h" 2
37714
37715
37716
37717
37718
37719
37720 const unsigned MIN_SPARSE_INDEX = 256;
37721
37722 namespace js {
37723
37724 const uint32_t MAX_ARRAY_INDEX = 4294967294u;
37725 }
37726
37727 inline JSBool
37728 js_IdIsIndex(jsid id, uint32_t *indexp)
37729 {
37730 if (JSID_IS_INT(id)) {
37731 int32_t i = JSID_TO_INT(id);
37732 if (i < 0)
37733 return (int)0;
37734 *indexp = (uint32_t)i;
37735 return (int)1;
37736 }
37737
37738 if ((__builtin_expect((!JSID_IS_STRING(id)), 0)))
37739 return (int)0;
37740
37741 return js::StringIsArrayIndex(JSID_TO_ATOM(id), indexp);
37742 }
37743
37744 extern JSObject *
37745 js_InitArrayClass(JSContext *cx, JSObject *obj);
37746
37747 extern bool
37748 js_InitContextBusyArrayTable(JSContext *cx);
37749
37750 namespace js {
37751
37752
37753 extern JSObject *
37754 NewDenseEmptyArray(JSContext *cx, JSObject *proto=__null);
37755
37756
37757 extern JSObject *
37758 NewDenseAllocatedArray(JSContext *cx, uint32_t length, JSObject *proto=__null);
37759
37760
37761
37762
37763
37764
37765 extern JSObject *
37766 NewDenseAllocatedEmptyArray(JSContext *cx, uint32_t length, JSObject *proto=__null);
37767
37768
37769
37770
37771
37772 extern JSObject *
37773 NewDenseUnallocatedArray(JSContext *cx, uint32_t length, JSObject *proto=__null);
37774
37775
37776 extern JSObject *
37777 NewDenseCopiedArray(JSContext *cx, uint32_t length, const Value *vp, JSObject *proto = __null);
37778
37779
37780 extern JSObject *
37781 NewSlowEmptyArray(JSContext *cx);
37782
37783 }
37784
37785 extern JSBool
37786 js_GetLengthProperty(JSContext *cx, JSObject *obj, uint32_t *lengthp);
37787
37788 extern JSBool
37789 js_SetLengthProperty(JSContext *cx, JSObject *obj, double length);
37790
37791 namespace js {
37792
37793 extern JSBool
37794 array_defineElement(JSContext *cx, HandleObject obj, uint32_t index, const Value *value,
37795 PropertyOp getter, StrictPropertyOp setter, unsigned attrs);
37796
37797 extern JSBool
37798 array_deleteElement(JSContext *cx, HandleObject obj, uint32_t index, Value *rval, JSBool strict);
37799
37800
37801
37802
37803
37804
37805
37806 extern bool
37807 GetElements(JSContext *cx, HandleObject aobj, uint32_t length, js::Value *vp);
37808
37809
37810
37811 extern JSBool
37812 array_sort(JSContext *cx, unsigned argc, js::Value *vp);
37813
37814 extern JSBool
37815 array_push(JSContext *cx, unsigned argc, js::Value *vp);
37816
37817 extern JSBool
37818 array_pop(JSContext *cx, unsigned argc, js::Value *vp);
37819
37820 extern JSBool
37821 array_concat(JSContext *cx, unsigned argc, js::Value *vp);
37822
37823 extern JSBool
37824 array_shift(JSContext *cx, unsigned argc, js::Value *vp);
37825
37826 }
37827 # 139 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsarray.h"
37828 extern JSBool
37829 js_NewbornArrayPush(JSContext *cx, js::HandleObject obj, const js::Value &v);
37830
37831 JSBool
37832 js_PrototypeHasIndexedProperties(JSContext *cx, JSObject *obj);
37833
37834
37835
37836
37837 JSBool
37838 js_GetDenseArrayElementValue(JSContext *cx, JSObject *obj, jsid id,
37839 js::Value *vp);
37840
37841
37842 JSBool
37843 js_Array(JSContext *cx, unsigned argc, js::Value *vp);
37844 # 15 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobjinlines.h" 2
37845 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsbool.h" 1
37846
37847
37848
37849
37850
37851
37852
37853 #define jsbool_h___
37854
37855
37856
37857
37858
37859
37860
37861 extern JSObject *
37862 js_InitBooleanClass(JSContext *cx, JSObject *obj);
37863
37864 extern JSString *
37865 js_BooleanToString(JSContext *cx, JSBool b);
37866
37867 namespace js {
37868
37869 inline bool
37870 BooleanGetPrimitiveValue(JSContext *cx, JSObject &obj, Value *vp);
37871
37872 }
37873
37874 extern JSBool
37875 js_ValueToBoolean(const js::Value &v);
37876 # 16 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobjinlines.h" 2
37877
37878 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsfun.h" 1
37879 # 18 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobjinlines.h" 2
37880 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsiter.h" 1
37881 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsiter.h"
37882 #define jsiter_h___
37883
37884
37885
37886
37887
37888
37889
37890 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsversion.h" 1
37891 # 42 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsversion.h"
37892 #define JS_VERSION_ECMA_3 148
37893 #define JS_VERSION_ECMA_3_TEST 149
37894 # 124 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsversion.h"
37895 #define JS_HAS_STR_HTML_HELPERS 1
37896 #define JS_HAS_OBJ_PROTO_PROP 1
37897 #define JS_HAS_OBJ_WATCHPOINT 1
37898 #define JS_HAS_TOSOURCE 1
37899 #define JS_HAS_CATCH_GUARD 1
37900 #define JS_HAS_UNEVAL 1
37901 #define JS_HAS_CONST 1
37902 #define JS_HAS_FUN_EXPR_STMT 1
37903 #define JS_HAS_NO_SUCH_METHOD 1
37904 #define JS_HAS_GENERATORS 1
37905 #define JS_HAS_BLOCK_SCOPE 1
37906 #define JS_HAS_DESTRUCTURING 2
37907 #define JS_HAS_GENERATOR_EXPRS 1
37908 #define JS_HAS_EXPR_CLOSURES 1
37909 # 146 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsversion.h"
37910 #define JS_HAS_NEW_GLOBAL_OBJECT 1
37911
37912
37913 #define JS_HAS_MAKE_SYSTEM_OBJECT 1
37914
37915
37916 #define JS_HAS_DESTRUCTURING_SHORTHAND (JS_HAS_DESTRUCTURING == 2)
37917
37918
37919
37920
37921
37922 #define OLD_GETTER_SETTER_METHODS 1
37923
37924
37925 #define USE_NEW_OBJECT_REPRESENTATION 0
37926
37927
37928
37929
37930 #define NEW_OBJECT_REPRESENTATION_ONLY() MOZ_NOT_REACHED("don't call this! to be used in the new object representation")
37931 # 18 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsiter.h" 2
37932 # 26 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsiter.h"
37933 #define JSITER_ACTIVE 0x1000
37934 #define JSITER_UNREUSABLE 0x2000
37935
37936 namespace js {
37937
37938 struct NativeIterator {
37939 HeapPtrObject obj;
37940 HeapPtr<JSFlatString> *props_array;
37941 HeapPtr<JSFlatString> *props_cursor;
37942 HeapPtr<JSFlatString> *props_end;
37943 const Shape **shapes_array;
37944 uint32_t shapes_length;
37945 uint32_t shapes_key;
37946 uint32_t flags;
37947 JSObject *next;
37948
37949 bool isKeyIter() const { return (flags & 0x2) == 0; }
37950
37951 inline HeapPtr<JSFlatString> *begin() const {
37952 return props_array;
37953 }
37954
37955 inline HeapPtr<JSFlatString> *end() const {
37956 return props_end;
37957 }
37958
37959 size_t numKeys() const {
37960 return end() - begin();
37961 }
37962
37963 HeapPtr<JSFlatString> *current() const {
37964 do { } while(0);
37965 return props_cursor;
37966 }
37967
37968 void incCursor() {
37969 props_cursor = props_cursor + 1;
37970 }
37971
37972 static NativeIterator *allocateIterator(JSContext *cx, uint32_t slength,
37973 const js::AutoIdVector &props);
37974 void init(JSObject *obj, unsigned flags, uint32_t slength, uint32_t key);
37975
37976 void mark(JSTracer *trc);
37977 };
37978
37979 class ElementIteratorObject : public JSObject {
37980 public:
37981 enum {
37982 TargetSlot,
37983 IndexSlot,
37984 NumSlots
37985 };
37986
37987 static JSObject *create(JSContext *cx, HandleObject target);
37988
37989 inline uint32_t getIndex() const;
37990 inline void setIndex(uint32_t index);
37991 inline JSObject *getTargetObject() const;
37992 # 130 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsiter.h"
37993 bool iteratorNext(JSContext *cx, Value *vp);
37994 };
37995
37996 bool
37997 VectorToIdArray(JSContext *cx, AutoIdVector &props, JSIdArray **idap);
37998
37999 bool
38000 GetIterator(JSContext *cx, HandleObject obj, unsigned flags, Value *vp);
38001
38002 bool
38003 VectorToKeyIterator(JSContext *cx, HandleObject obj, unsigned flags, AutoIdVector &props, Value *vp);
38004
38005 bool
38006 VectorToValueIterator(JSContext *cx, HandleObject obj, unsigned flags, AutoIdVector &props, Value *vp);
38007
38008
38009
38010
38011
38012 bool
38013 EnumeratedIdVectorToIterator(JSContext *cx, HandleObject obj, unsigned flags, AutoIdVector &props, Value *vp);
38014
38015
38016
38017
38018
38019
38020
38021 extern JSBool
38022 ValueToIterator(JSContext *cx, unsigned flags, Value *vp);
38023
38024 extern bool
38025 CloseIterator(JSContext *cx, JSObject *iterObj);
38026
38027 extern bool
38028 UnwindIteratorForException(JSContext *cx, JSObject *obj);
38029
38030 extern void
38031 UnwindIteratorForUncatchableException(JSContext *cx, JSObject *obj);
38032
38033 }
38034
38035 extern bool
38036 js_SuppressDeletedProperty(JSContext *cx, js::HandleObject obj, jsid id);
38037
38038 extern bool
38039 js_SuppressDeletedElement(JSContext *cx, js::HandleObject obj, uint32_t index);
38040
38041 extern bool
38042 js_SuppressDeletedElements(JSContext *cx, js::HandleObject obj, uint32_t begin, uint32_t end);
38043
38044
38045
38046
38047
38048
38049 extern JSBool
38050 js_IteratorMore(JSContext *cx, js::HandleObject iterobj, js::Value *rval);
38051
38052 extern JSBool
38053 js_IteratorNext(JSContext *cx, JSObject *iterobj, js::Value *rval);
38054
38055 extern JSBool
38056 js_ThrowStopIteration(JSContext *cx);
38057
38058 namespace js {
38059
38060
38061
38062
38063
38064
38065
38066 inline bool
38067 Next(JSContext *cx, HandleObject iter, Value *vp)
38068 {
38069 if (!js_IteratorMore(cx, iter, vp))
38070 return false;
38071 if (vp->toBoolean())
38072 return js_IteratorNext(cx, iter, vp);
38073 vp->setMagic(JS_NO_ITER_VALUE);
38074 return true;
38075 }
38076 # 226 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsiter.h"
38077 template <class Op>
38078 bool
38079 ForOf(JSContext *cx, const Value &iterable, Op op)
38080 {
38081 Value iterv(iterable);
38082 if (!ValueToIterator(cx, 0x20, &iterv))
38083 return false;
38084 RootedObject iter(cx, &iterv.toObject());
38085
38086 bool ok = true;
38087 while (ok) {
38088 Value v;
38089 ok = Next(cx, iter, &v);
38090 if (ok) {
38091 if (v.isMagic(JS_NO_ITER_VALUE))
38092 break;
38093 ok = op(cx, v);
38094 }
38095 }
38096
38097 bool throwing = !ok && cx->isExceptionPending();
38098 Value exc;
38099 if (throwing) {
38100 exc = cx->getPendingException();
38101 cx->clearPendingException();
38102 }
38103 bool closedOK = CloseIterator(cx, iter);
38104 if (throwing && closedOK)
38105 cx->setPendingException(exc);
38106 return ok && closedOK;
38107 }
38108
38109 }
38110
38111
38112
38113
38114
38115
38116 typedef enum JSGeneratorState {
38117 JSGEN_NEWBORN,
38118 JSGEN_OPEN,
38119 JSGEN_RUNNING,
38120 JSGEN_CLOSING,
38121 JSGEN_CLOSED
38122 } JSGeneratorState;
38123
38124 struct JSGenerator {
38125 js::HeapPtrObject obj;
38126 JSGeneratorState state;
38127 js::FrameRegs regs;
38128 JSObject *enumerators;
38129 js::StackFrame *floating;
38130 js::HeapValue floatingStack[1];
38131
38132 js::StackFrame *floatingFrame() {
38133 return floating;
38134 }
38135
38136 js::StackFrame *liveFrame() {
38137 do { } while(0)
38138 ;
38139 return regs.fp();
38140 }
38141 };
38142
38143 extern JSObject *
38144 js_NewGenerator(JSContext *cx);
38145 # 306 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsiter.h"
38146 inline js::StackFrame *
38147 js_FloatingFrameIfGenerator(JSContext *cx, js::StackFrame *fp)
38148 {
38149 if ((__builtin_expect((fp->isGeneratorFrame()), 0)))
38150 return cx->generatorFor(fp)->floatingFrame();
38151 return fp;
38152 }
38153
38154
38155 extern JSGenerator *
38156 js_FloatingFrameToGenerator(js::StackFrame *fp);
38157
38158 inline js::StackFrame *
38159 js_LiveFrameIfGenerator(js::StackFrame *fp)
38160 {
38161 return fp->isGeneratorFrame() ? js_FloatingFrameToGenerator(fp)->liveFrame() : fp;
38162 }
38163
38164
38165
38166 extern JSObject *
38167 js_InitIteratorClasses(JSContext *cx, JSObject *obj);
38168 # 19 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobjinlines.h" 2
38169
38170 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsnum.h" 1
38171
38172
38173
38174
38175
38176
38177
38178 #define jsnum_h___
38179
38180
38181
38182
38183
38184
38185
38186 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/NumericConversions.h" 1
38187 # 17 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsnum.h" 2
38188
38189 extern double js_NaN;
38190 extern double js_PositiveInfinity;
38191 extern double js_NegativeInfinity;
38192
38193 namespace js {
38194
38195 extern bool
38196 InitRuntimeNumberState(JSRuntime *rt);
38197
38198 extern void
38199 FinishRuntimeNumberState(JSRuntime *rt);
38200
38201 }
38202
38203
38204 extern JSObject *
38205 js_InitNumberClass(JSContext *cx, JSObject *obj);
38206
38207
38208
38209
38210 extern const char js_isNaN_str[];
38211 extern const char js_isFinite_str[];
38212 extern const char js_parseFloat_str[];
38213 extern const char js_parseInt_str[];
38214
38215 class JSString;
38216 class JSFixedString;
38217
38218
38219
38220
38221
38222
38223 extern JSString *
38224 js_NumberToString(JSContext *cx, double d);
38225
38226 namespace js {
38227
38228 extern JSFixedString *
38229 Int32ToString(JSContext *cx, int32_t i);
38230
38231
38232
38233
38234
38235 extern bool
38236 NumberValueToStringBuffer(JSContext *cx, const Value &v, StringBuffer &sb);
38237
38238
38239 extern JSFixedString *
38240 NumberToString(JSContext *cx, double d);
38241
38242 extern JSFixedString *
38243 IndexToString(JSContext *cx, uint32_t index);
38244
38245
38246
38247
38248
38249
38250 struct ToCStringBuf
38251 {
38252
38253
38254
38255
38256
38257 static const size_t sbufSize = 34;
38258 char sbuf[sbufSize];
38259 char *dbuf;
38260
38261 ToCStringBuf();
38262 ~ToCStringBuf();
38263 };
38264
38265
38266
38267
38268
38269
38270
38271 extern char *
38272 NumberToCString(JSContext *cx, ToCStringBuf *cbuf, double d, int base = 10);
38273
38274
38275
38276
38277
38278 const double DOUBLE_INTEGRAL_PRECISION_LIMIT = uint64_t(1) << 53;
38279 # 121 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsnum.h"
38280 extern bool
38281 GetPrefixInteger(JSContext *cx, const jschar *start, const jschar *end, int base,
38282 const jschar **endp, double *dp);
38283
38284
38285 __attribute__((always_inline)) inline bool
38286 ToNumber(JSContext *cx, Value *vp)
38287 {
38288 if (vp->isNumber())
38289 return true;
38290 double d;
38291 extern bool ToNumberSlow(JSContext *cx, js::Value v, double *dp);
38292 if (!ToNumberSlow(cx, *vp, &d))
38293 return false;
38294 vp->setNumber(d);
38295 return true;
38296 }
38297
38298
38299
38300
38301
38302
38303
38304 __attribute__((always_inline)) inline bool
38305 ToUint32(JSContext *cx, const js::Value &v, uint32_t *out)
38306 {
38307 if (v.isInt32()) {
38308 *out = (uint32_t)v.toInt32();
38309 return true;
38310 }
38311 extern bool ToUint32Slow(JSContext *cx, const js::Value &v, uint32_t *ip);
38312 return ToUint32Slow(cx, v, out);
38313 }
38314
38315
38316
38317
38318
38319
38320 __attribute__((always_inline)) inline bool
38321 ValueToUint16(JSContext *cx, const js::Value &v, uint16_t *out)
38322 {
38323 if (v.isInt32()) {
38324 *out = uint16_t(v.toInt32());
38325 return true;
38326 }
38327 extern bool ValueToUint16Slow(JSContext *cx, const js::Value &v, uint16_t *out);
38328 return ValueToUint16Slow(cx, v, out);
38329 }
38330
38331 JSBool
38332 num_parseInt(JSContext *cx, unsigned argc, Value *vp);
38333
38334 }
38335 # 187 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsnum.h"
38336 extern JSBool
38337 js_strtod(JSContext *cx, const jschar *s, const jschar *send,
38338 const jschar **ep, double *dp);
38339
38340 extern JSBool
38341 js_num_valueOf(JSContext *cx, unsigned argc, js::Value *vp);
38342
38343 namespace js {
38344
38345 static __attribute__((always_inline)) inline bool
38346 ValueFitsInInt32(const Value &v, int32_t *pi)
38347 {
38348 if (v.isInt32()) {
38349 *pi = v.toInt32();
38350 return true;
38351 }
38352 return v.isDouble() && MOZ_DOUBLE_IS_INT32(v.toDouble(), pi);
38353 }
38354 # 215 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsnum.h"
38355 static __attribute__((always_inline)) inline bool
38356 IsDefinitelyIndex(const Value &v, uint32_t *indexp)
38357 {
38358 if (v.isInt32() && v.toInt32() >= 0) {
38359 *indexp = v.toInt32();
38360 return true;
38361 }
38362
38363 int32_t i;
38364 if (v.isDouble() && MOZ_DOUBLE_IS_INT32(v.toDouble(), &i) && i >= 0) {
38365 *indexp = uint32_t(i);
38366 return true;
38367 }
38368
38369 return false;
38370 }
38371
38372
38373 static inline bool
38374 ToInteger(JSContext *cx, const js::Value &v, double *dp)
38375 {
38376 if (v.isInt32()) {
38377 *dp = v.toInt32();
38378 return true;
38379 }
38380 if (v.isDouble()) {
38381 *dp = v.toDouble();
38382 } else {
38383 extern bool ToNumberSlow(JSContext *cx, Value v, double *dp);
38384 if (!ToNumberSlow(cx, v, dp))
38385 return false;
38386 }
38387 *dp = ToInteger(*dp);
38388 return true;
38389 }
38390
38391 }
38392 # 21 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobjinlines.h" 2
38393
38394 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsprobes.h" 1
38395 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsprobes.h"
38396 #define _JSPROBES_H
38397 # 20 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsprobes.h"
38398 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/methodjit/MethodJIT.h" 1
38399 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/methodjit/MethodJIT.h"
38400 #define jsjaeger_h__
38401
38402
38403 #define JSGC_INCREMENTAL_MJ
38404
38405
38406 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscntxt.h" 1
38407 # 16 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/methodjit/MethodJIT.h" 2
38408 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscompartment.h" 1
38409
38410
38411
38412
38413
38414
38415 #define jscompartment_h___
38416 # 17 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscompartment.h"
38417 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/GlobalObject.h" 1
38418 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/GlobalObject.h"
38419 #define GlobalObject_h___
38420
38421
38422
38423 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsarray.h" 1
38424 # 14 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/GlobalObject.h" 2
38425 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsbool.h" 1
38426 # 15 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/GlobalObject.h" 2
38427 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsexn.h" 1
38428 # 12 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsexn.h"
38429 #define jsexn_h___
38430
38431
38432
38433
38434
38435
38436 extern JSObject *
38437 js_InitExceptionClasses(JSContext *cx, JSObject *obj);
38438 # 30 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsexn.h"
38439 extern JSBool
38440 js_ErrorToException(JSContext *cx, const char *message, JSErrorReport *reportp,
38441 JSErrorCallback callback, void *userRef);
38442 # 50 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsexn.h"
38443 extern JSBool
38444 js_ReportUncaughtException(JSContext *cx);
38445
38446 extern JSErrorReport *
38447 js_ErrorFromException(JSContext *cx, jsval exn);
38448
38449 extern const JSErrorFormatString *
38450 js_GetLocalizedErrorMessage(JSContext* cx, void *userRef, const char *locale,
38451 const unsigned errorNumber);
38452 # 68 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsexn.h"
38453 extern JSObject *
38454 js_CopyErrorObject(JSContext *cx, js::HandleObject errobj, js::HandleObject scope);
38455
38456 static inline JSProtoKey
38457 GetExceptionProtoKey(int exn)
38458 {
38459 do { } while(0);
38460 do { } while(0);
38461 return JSProtoKey(JSProto_Error + exn);
38462 }
38463 # 16 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/GlobalObject.h" 2
38464
38465 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsiter.h" 1
38466 # 18 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/GlobalObject.h" 2
38467 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsnum.h" 1
38468 # 19 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/GlobalObject.h" 2
38469
38470
38471
38472 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/builtin/RegExp.h" 1
38473 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/builtin/RegExp.h"
38474 #define RegExp_h___
38475
38476 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsprvtd.h" 1
38477 # 12 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/builtin/RegExp.h" 2
38478
38479 JSObject *
38480 js_InitRegExpClass(JSContext *cx, JSObject *obj);
38481
38482
38483
38484
38485
38486
38487 namespace js {
38488
38489
38490
38491
38492
38493
38494 bool
38495 ExecuteRegExp(JSContext *cx, RegExpStatics *res, RegExpObject &reobj,
38496 JSLinearString *input, const jschar *chars, size_t length,
38497 size_t *lastIndex, RegExpExecType type, Value *rval);
38498
38499 bool
38500 ExecuteRegExp(JSContext *cx, RegExpStatics *res, RegExpShared &shared,
38501 JSLinearString *input, const jschar *chars, size_t length,
38502 size_t *lastIndex, RegExpExecType type, Value *rval);
38503
38504 extern JSBool
38505 regexp_exec(JSContext *cx, unsigned argc, Value *vp);
38506
38507 extern JSBool
38508 regexp_test(JSContext *cx, unsigned argc, Value *vp);
38509
38510 }
38511 # 23 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/GlobalObject.h" 2
38512
38513 extern JSObject *
38514 js_InitObjectClass(JSContext *cx, JSObject *obj);
38515
38516 extern JSObject *
38517 js_InitFunctionClass(JSContext *cx, JSObject *obj);
38518
38519 extern JSObject *
38520 js_InitTypedArrayClasses(JSContext *cx, JSObject *obj);
38521
38522 namespace js {
38523
38524 class Debugger;
38525 # 64 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/GlobalObject.h"
38526 class GlobalObject : public JSObject
38527 {
38528
38529
38530
38531
38532 static const unsigned STANDARD_CLASS_SLOTS = JSProto_LIMIT * 3;
38533
38534
38535 static const unsigned THROWTYPEERROR = STANDARD_CLASS_SLOTS;
38536 static const unsigned GENERATOR_PROTO = THROWTYPEERROR + 1;
38537 static const unsigned REGEXP_STATICS = GENERATOR_PROTO + 1;
38538 static const unsigned FUNCTION_NS = REGEXP_STATICS + 1;
38539 static const unsigned RUNTIME_CODEGEN_ENABLED = FUNCTION_NS + 1;
38540 static const unsigned EVAL = RUNTIME_CODEGEN_ENABLED + 1;
38541 static const unsigned FLAGS = EVAL + 1;
38542 static const unsigned DEBUGGERS = FLAGS + 1;
38543
38544
38545 static const unsigned RESERVED_SLOTS = DEBUGGERS + 1;
38546
38547 void staticAsserts() {
38548
38549
38550
38551
38552
38553 typedef int moz_static_assert102[((JSProto_LIMIT * 3 + 8) == RESERVED_SLOTS) ? 1 : -1];
38554 }
38555
38556 static const int32_t FLAGS_CLEARED = 0x1;
38557
38558 inline void setFlags(int32_t flags);
38559 inline void initFlags(int32_t flags);
38560
38561 friend JSObject *
38562 ::js_InitObjectClass(JSContext *cx, JSObject *obj);
38563 friend JSObject *
38564 ::js_InitFunctionClass(JSContext *cx, JSObject *obj);
38565
38566
38567 JSObject *
38568 initFunctionAndObjectClasses(JSContext *cx);
38569
38570 inline void setDetailsForKey(JSProtoKey key, JSObject *ctor, JSObject *proto);
38571 inline void setObjectClassDetails(JSFunction *ctor, JSObject *proto);
38572 inline void setFunctionClassDetails(JSFunction *ctor, JSObject *proto);
38573
38574 inline void setThrowTypeError(JSFunction *fun);
38575
38576 inline void setOriginalEval(JSObject *evalobj);
38577
38578 Value getConstructor(JSProtoKey key) const {
38579 do { } while(0);
38580 return getSlot(key);
38581 }
38582
38583 Value getPrototype(JSProtoKey key) const {
38584 do { } while(0);
38585 return getSlot(JSProto_LIMIT + key);
38586 }
38587
38588 bool classIsInitialized(JSProtoKey key) const {
38589 bool inited = !getConstructor(key).isUndefined();
38590 do { } while(0);
38591 return inited;
38592 }
38593
38594 bool functionObjectClassesInitialized() const {
38595 bool inited = classIsInitialized(JSProto_Function);
38596 do { } while(0);
38597 return inited;
38598 }
38599
38600 bool arrayClassInitialized() const {
38601 return classIsInitialized(JSProto_Array);
38602 }
38603
38604 bool booleanClassInitialized() const {
38605 return classIsInitialized(JSProto_Boolean);
38606 }
38607 bool numberClassInitialized() const {
38608 return classIsInitialized(JSProto_Number);
38609 }
38610 bool stringClassInitialized() const {
38611 return classIsInitialized(JSProto_String);
38612 }
38613 bool regexpClassInitialized() const {
38614 return classIsInitialized(JSProto_RegExp);
38615 }
38616 bool arrayBufferClassInitialized() const {
38617 return classIsInitialized(JSProto_ArrayBuffer);
38618 }
38619 bool errorClassesInitialized() const {
38620 return classIsInitialized(JSProto_Error);
38621 }
38622
38623 public:
38624 static GlobalObject *create(JSContext *cx, Class *clasp);
38625
38626
38627
38628
38629
38630 JSFunction *
38631 createConstructor(JSContext *cx, JSNative ctor, JSAtom *name, unsigned length,
38632 gc::AllocKind kind = JSFunction::FinalizeKind);
38633 # 180 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/GlobalObject.h"
38634 JSObject *createBlankPrototype(JSContext *cx, js::Class *clasp);
38635
38636
38637
38638
38639
38640 JSObject *createBlankPrototypeInheriting(JSContext *cx, js::Class *clasp, JSObject &proto);
38641
38642 JSObject *getOrCreateObjectPrototype(JSContext *cx) {
38643 if (functionObjectClassesInitialized())
38644 return &getPrototype(JSProto_Object).toObject();
38645 Rooted<GlobalObject*> self(cx, this);
38646 if (!initFunctionAndObjectClasses(cx))
38647 return __null;
38648 return &self->getPrototype(JSProto_Object).toObject();
38649 }
38650
38651 JSObject *getOrCreateFunctionPrototype(JSContext *cx) {
38652 if (functionObjectClassesInitialized())
38653 return &getPrototype(JSProto_Function).toObject();
38654 Rooted<GlobalObject*> self(cx, this);
38655 if (!initFunctionAndObjectClasses(cx))
38656 return __null;
38657 return &self->getPrototype(JSProto_Function).toObject();
38658 }
38659
38660 JSObject *getOrCreateArrayPrototype(JSContext *cx) {
38661 if (arrayClassInitialized())
38662 return &getPrototype(JSProto_Array).toObject();
38663 Rooted<GlobalObject*> self(cx, this);
38664 if (!js_InitArrayClass(cx, this))
38665 return __null;
38666 return &self->getPrototype(JSProto_Array).toObject();
38667 }
38668
38669 JSObject *getOrCreateBooleanPrototype(JSContext *cx) {
38670 if (booleanClassInitialized())
38671 return &getPrototype(JSProto_Boolean).toObject();
38672 Rooted<GlobalObject*> self(cx, this);
38673 if (!js_InitBooleanClass(cx, this))
38674 return __null;
38675 return &self->getPrototype(JSProto_Boolean).toObject();
38676 }
38677
38678 JSObject *getOrCreateNumberPrototype(JSContext *cx) {
38679 if (numberClassInitialized())
38680 return &getPrototype(JSProto_Number).toObject();
38681 Rooted<GlobalObject*> self(cx, this);
38682 if (!js_InitNumberClass(cx, this))
38683 return __null;
38684 return &self->getPrototype(JSProto_Number).toObject();
38685 }
38686
38687 JSObject *getOrCreateStringPrototype(JSContext *cx) {
38688 if (stringClassInitialized())
38689 return &getPrototype(JSProto_String).toObject();
38690 Rooted<GlobalObject*> self(cx, this);
38691 if (!js_InitStringClass(cx, this))
38692 return __null;
38693 return &self->getPrototype(JSProto_String).toObject();
38694 }
38695
38696 JSObject *getOrCreateRegExpPrototype(JSContext *cx) {
38697 if (regexpClassInitialized())
38698 return &getPrototype(JSProto_RegExp).toObject();
38699 Rooted<GlobalObject*> self(cx, this);
38700 if (!js_InitRegExpClass(cx, this))
38701 return __null;
38702 return &self->getPrototype(JSProto_RegExp).toObject();
38703 }
38704
38705 JSObject *getOrCreateArrayBufferPrototype(JSContext *cx) {
38706 if (arrayBufferClassInitialized())
38707 return &getPrototype(JSProto_ArrayBuffer).toObject();
38708 Rooted<GlobalObject*> self(cx, this);
38709 if (!js_InitTypedArrayClasses(cx, this))
38710 return __null;
38711 return &self->getPrototype(JSProto_ArrayBuffer).toObject();
38712 }
38713
38714 JSObject *getOrCreateCustomErrorPrototype(JSContext *cx, int exnType) {
38715 JSProtoKey key = GetExceptionProtoKey(exnType);
38716 if (errorClassesInitialized())
38717 return &getPrototype(key).toObject();
38718 Rooted<GlobalObject*> self(cx, this);
38719 if (!js_InitExceptionClasses(cx, this))
38720 return __null;
38721 return &self->getPrototype(key).toObject();
38722 }
38723
38724 JSObject *getOrCreateGeneratorPrototype(JSContext *cx) {
38725 Value v = getSlotRef(GENERATOR_PROTO);
38726 if (v.isObject())
38727 return &v.toObject();
38728 Rooted<GlobalObject*> self(cx, this);
38729 if (!js_InitIteratorClasses(cx, this))
38730 return __null;
38731 return &self->getSlot(GENERATOR_PROTO).toObject();
38732 }
38733
38734 inline RegExpStatics *getRegExpStatics() const;
38735
38736 JSObject *getThrowTypeError() const {
38737 do { } while(0);
38738 return &getSlot(THROWTYPEERROR).toObject();
38739 }
38740
38741 void clear(JSContext *cx);
38742
38743 bool isCleared() const {
38744 return getSlot(FLAGS).toInt32() & FLAGS_CLEARED;
38745 }
38746
38747 bool isRuntimeCodeGenEnabled(JSContext *cx);
38748
38749 const Value &getOriginalEval() const {
38750 do { } while(0);
38751 return getSlot(EVAL);
38752 }
38753
38754 bool getFunctionNamespace(JSContext *cx, Value *vp);
38755
38756 static bool initGeneratorClass(JSContext *cx, Handle<GlobalObject*> global);
38757 static bool initStandardClasses(JSContext *cx, Handle<GlobalObject*> global);
38758
38759 typedef js::Vector<js::Debugger *, 0, js::SystemAllocPolicy> DebuggerVector;
38760
38761
38762
38763
38764
38765 DebuggerVector *getDebuggers();
38766
38767
38768
38769
38770
38771 static DebuggerVector *getOrCreateDebuggers(JSContext *cx, Handle<GlobalObject*> global);
38772
38773 static bool addDebugger(JSContext *cx, Handle<GlobalObject*> global, Debugger *dbg);
38774 };
38775
38776
38777
38778
38779
38780
38781 extern bool
38782 LinkConstructorAndPrototype(JSContext *cx, JSObject *ctor, JSObject *proto);
38783
38784
38785
38786
38787
38788 extern bool
38789 DefinePropertiesAndBrand(JSContext *cx, JSObject *obj, JSPropertySpec *ps, JSFunctionSpec *fs);
38790
38791 typedef HashSet<GlobalObject *, DefaultHasher<GlobalObject *>, SystemAllocPolicy> GlobalObjectSet;
38792
38793 }
38794
38795 inline bool
38796 JSObject::isGlobal() const
38797 {
38798 return !!(js::GetObjectClass(this)->flags & (1<<((8 + 8)+2)));
38799 }
38800
38801 js::GlobalObject &
38802 JSObject::asGlobal()
38803 {
38804 do { } while(0);
38805 return *static_cast<js::GlobalObject *>(this);
38806 }
38807 # 18 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscompartment.h" 2
38808 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/RegExpObject.h" 1
38809 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/RegExpObject.h"
38810 #define RegExpObject_h__
38811
38812
38813
38814 # 1 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 1 3 4
38815 # 14 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/RegExpObject.h" 2
38816
38817 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobj.h" 1
38818 # 16 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/RegExpObject.h" 2
38819
38820
38821
38822 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/Yarr.h" 1
38823 # 33 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/Yarr.h"
38824 #define Yarr_h
38825
38826 # 1 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include-fixed/limits.h" 1 3 4
38827 # 30 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include-fixed/limits.h" 3 4
38828 #define _GCC_LIMITS_H_
38829
38830
38831
38832 # 1 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include-fixed/syslimits.h" 1 3 4
38833
38834
38835
38836
38837
38838 #define _GCC_NEXT_LIMITS_H
38839 # 1 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include-fixed/limits.h" 1 3 4
38840 # 169 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include-fixed/limits.h" 3 4
38841 # 1 "/usr/include/limits.h" 1 3 4
38842 # 25 "/usr/include/limits.h" 3 4
38843 #define _LIBC_LIMITS_H_ 1
38844
38845
38846
38847
38848
38849
38850
38851 #define MB_LEN_MAX 16
38852 # 133 "/usr/include/limits.h" 3 4
38853 #define LLONG_MIN (-LLONG_MAX-1)
38854
38855
38856 #define LLONG_MAX __LONG_LONG_MAX__
38857
38858
38859 #define ULLONG_MAX (LLONG_MAX * 2ULL + 1)
38860
38861
38862
38863
38864
38865 # 1 "/usr/include/bits/posix1_lim.h" 1 3 4
38866 # 26 "/usr/include/bits/posix1_lim.h" 3 4
38867 #define _BITS_POSIX1_LIM_H 1
38868
38869
38870
38871
38872
38873 #define _POSIX_AIO_LISTIO_MAX 2
38874
38875
38876 #define _POSIX_AIO_MAX 1
38877
38878
38879 #define _POSIX_ARG_MAX 4096
38880
38881
38882
38883 #define _POSIX_CHILD_MAX 25
38884
38885
38886
38887
38888
38889 #define _POSIX_DELAYTIMER_MAX 32
38890
38891
38892
38893 #define _POSIX_HOST_NAME_MAX 255
38894
38895
38896 #define _POSIX_LINK_MAX 8
38897
38898
38899 #define _POSIX_LOGIN_NAME_MAX 9
38900
38901
38902 #define _POSIX_MAX_CANON 255
38903
38904
38905
38906 #define _POSIX_MAX_INPUT 255
38907
38908
38909 #define _POSIX_MQ_OPEN_MAX 8
38910
38911
38912 #define _POSIX_MQ_PRIO_MAX 32
38913
38914
38915 #define _POSIX_NAME_MAX 14
38916
38917
38918
38919 #define _POSIX_NGROUPS_MAX 8
38920
38921
38922
38923
38924
38925
38926 #define _POSIX_OPEN_MAX 20
38927
38928
38929
38930
38931
38932
38933
38934 #define _POSIX_FD_SETSIZE _POSIX_OPEN_MAX
38935
38936
38937
38938 #define _POSIX_PATH_MAX 256
38939
38940
38941 #define _POSIX_PIPE_BUF 512
38942
38943
38944
38945 #define _POSIX_RE_DUP_MAX 255
38946
38947
38948 #define _POSIX_RTSIG_MAX 8
38949
38950
38951 #define _POSIX_SEM_NSEMS_MAX 256
38952
38953
38954 #define _POSIX_SEM_VALUE_MAX 32767
38955
38956
38957 #define _POSIX_SIGQUEUE_MAX 32
38958
38959
38960 #define _POSIX_SSIZE_MAX 32767
38961
38962
38963 #define _POSIX_STREAM_MAX 8
38964
38965
38966 #define _POSIX_SYMLINK_MAX 255
38967
38968
38969
38970 #define _POSIX_SYMLOOP_MAX 8
38971
38972
38973 #define _POSIX_TIMER_MAX 32
38974
38975
38976 #define _POSIX_TTY_NAME_MAX 9
38977
38978
38979 #define _POSIX_TZNAME_MAX 6
38980
38981
38982
38983 #define _POSIX_QLIMIT 1
38984
38985
38986
38987 #define _POSIX_HIWAT _POSIX_PIPE_BUF
38988
38989
38990 #define _POSIX_UIO_MAXIOV 16
38991
38992
38993
38994 #define _POSIX_CLOCKRES_MIN 20000000
38995
38996
38997
38998 # 1 "/usr/include/bits/local_lim.h" 1 3 4
38999 # 26 "/usr/include/bits/local_lim.h" 3 4
39000 #define __undef_NR_OPEN
39001
39002
39003 #define __undef_LINK_MAX
39004
39005
39006 #define __undef_OPEN_MAX
39007
39008
39009 #define __undef_ARG_MAX
39010
39011
39012
39013 # 1 "/usr/include/linux/limits.h" 1 3 4
39014
39015 #define _LINUX_LIMITS_H
39016
39017 #define NR_OPEN 1024
39018
39019 #define NGROUPS_MAX 65536
39020 #define ARG_MAX 131072
39021 #define LINK_MAX 127
39022 #define MAX_CANON 255
39023 #define MAX_INPUT 255
39024 #define NAME_MAX 255
39025 #define PATH_MAX 4096
39026 #define PIPE_BUF 4096
39027 #define XATTR_NAME_MAX 255
39028 #define XATTR_SIZE_MAX 65536
39029 #define XATTR_LIST_MAX 65536
39030
39031 #define RTSIG_MAX 32
39032 # 40 "/usr/include/bits/local_lim.h" 2 3 4
39033
39034
39035
39036 #undef NR_OPEN
39037 #undef __undef_NR_OPEN
39038
39039
39040
39041 #undef LINK_MAX
39042 #undef __undef_LINK_MAX
39043
39044
39045
39046 #undef OPEN_MAX
39047 #undef __undef_OPEN_MAX
39048
39049
39050
39051 #undef ARG_MAX
39052 #undef __undef_ARG_MAX
39053
39054
39055
39056 #define _POSIX_THREAD_KEYS_MAX 128
39057
39058 #define PTHREAD_KEYS_MAX 1024
39059
39060
39061 #define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
39062
39063 #define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS
39064
39065
39066 #define _POSIX_THREAD_THREADS_MAX 64
39067
39068 #undef PTHREAD_THREADS_MAX
39069
39070
39071
39072 #define AIO_PRIO_DELTA_MAX 20
39073
39074
39075 #define PTHREAD_STACK_MIN 16384
39076
39077
39078 #define DELAYTIMER_MAX 2147483647
39079
39080
39081 #define TTY_NAME_MAX 32
39082
39083
39084 #define LOGIN_NAME_MAX 256
39085
39086
39087 #define HOST_NAME_MAX 64
39088
39089
39090 #define MQ_PRIO_MAX 32768
39091
39092
39093 #define SEM_VALUE_MAX (2147483647)
39094 # 158 "/usr/include/bits/posix1_lim.h" 2 3 4
39095
39096
39097
39098 #define SSIZE_MAX LONG_MAX
39099 # 146 "/usr/include/limits.h" 2 3 4
39100
39101
39102
39103 # 1 "/usr/include/bits/posix2_lim.h" 1 3 4
39104 # 24 "/usr/include/bits/posix2_lim.h" 3 4
39105 #define _BITS_POSIX2_LIM_H 1
39106
39107
39108
39109 #define _POSIX2_BC_BASE_MAX 99
39110
39111
39112 #define _POSIX2_BC_DIM_MAX 2048
39113
39114
39115 #define _POSIX2_BC_SCALE_MAX 99
39116
39117
39118 #define _POSIX2_BC_STRING_MAX 1000
39119
39120
39121
39122 #define _POSIX2_COLL_WEIGHTS_MAX 2
39123
39124
39125
39126 #define _POSIX2_EXPR_NEST_MAX 32
39127
39128
39129 #define _POSIX2_LINE_MAX 2048
39130
39131
39132
39133 #define _POSIX2_RE_DUP_MAX 255
39134
39135
39136
39137 #define _POSIX2_CHARCLASS_NAME_MAX 14
39138
39139
39140
39141
39142
39143
39144
39145 #define BC_BASE_MAX _POSIX2_BC_BASE_MAX
39146
39147
39148 #define BC_DIM_MAX _POSIX2_BC_DIM_MAX
39149
39150
39151 #define BC_SCALE_MAX _POSIX2_BC_SCALE_MAX
39152
39153
39154 #define BC_STRING_MAX _POSIX2_BC_STRING_MAX
39155
39156
39157 #define COLL_WEIGHTS_MAX 255
39158
39159
39160 #define EXPR_NEST_MAX _POSIX2_EXPR_NEST_MAX
39161
39162
39163 #define LINE_MAX _POSIX2_LINE_MAX
39164
39165
39166 #define CHARCLASS_NAME_MAX 2048
39167
39168
39169
39170 #define RE_DUP_MAX (0x7fff)
39171 # 150 "/usr/include/limits.h" 2 3 4
39172
39173
39174
39175 # 1 "/usr/include/bits/xopen_lim.h" 1 3 4
39176 # 31 "/usr/include/bits/xopen_lim.h" 3 4
39177 #define _XOPEN_LIM_H 1
39178
39179 #define __need_IOV_MAX
39180 # 1 "/usr/include/bits/stdio_lim.h" 1 3 4
39181 # 24 "/usr/include/bits/stdio_lim.h" 3 4
39182 #define L_tmpnam 20
39183 #define TMP_MAX 238328
39184 #define FILENAME_MAX 4096
39185
39186
39187 #define L_ctermid 9
39188
39189 #define L_cuserid 9
39190
39191
39192
39193
39194
39195 #undef FOPEN_MAX
39196 #define FOPEN_MAX 16
39197
39198
39199
39200 #define IOV_MAX 1024
39201 # 35 "/usr/include/bits/xopen_lim.h" 2 3 4
39202 # 66 "/usr/include/bits/xopen_lim.h" 3 4
39203 #define _XOPEN_IOV_MAX _POSIX_UIO_MAXIOV
39204
39205
39206
39207
39208 #define NL_ARGMAX _POSIX_ARG_MAX
39209
39210
39211 #define NL_LANGMAX _POSIX2_LINE_MAX
39212
39213
39214 #define NL_MSGMAX INT_MAX
39215
39216
39217
39218 #define NL_NMAX INT_MAX
39219
39220
39221 #define NL_SETMAX INT_MAX
39222
39223
39224 #define NL_TEXTMAX INT_MAX
39225
39226
39227 #define NZERO 20
39228 # 110 "/usr/include/bits/xopen_lim.h" 3 4
39229 #define WORD_BIT 32
39230 # 130 "/usr/include/bits/xopen_lim.h" 3 4
39231 #define LONG_BIT 32
39232 # 154 "/usr/include/limits.h" 2 3 4
39233 # 170 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include-fixed/limits.h" 2 3 4
39234 # 8 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include-fixed/syslimits.h" 2 3 4
39235 #undef _GCC_NEXT_LIMITS_H
39236 # 35 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include-fixed/limits.h" 2 3 4
39237 # 61 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include-fixed/limits.h" 3 4
39238 #define _LIMITS_H___
39239
39240
39241 #undef CHAR_BIT
39242 #define CHAR_BIT __CHAR_BIT__
39243
39244
39245
39246
39247
39248
39249
39250 #undef SCHAR_MIN
39251 #define SCHAR_MIN (-SCHAR_MAX - 1)
39252 #undef SCHAR_MAX
39253 #define SCHAR_MAX __SCHAR_MAX__
39254
39255
39256 #undef UCHAR_MAX
39257
39258
39259
39260 #define UCHAR_MAX (SCHAR_MAX * 2 + 1)
39261
39262
39263
39264
39265 #undef CHAR_MIN
39266
39267
39268
39269 #define CHAR_MIN 0
39270
39271 #undef CHAR_MAX
39272 #define CHAR_MAX UCHAR_MAX
39273 # 104 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include-fixed/limits.h" 3 4
39274 #undef SHRT_MIN
39275 #define SHRT_MIN (-SHRT_MAX - 1)
39276 #undef SHRT_MAX
39277 #define SHRT_MAX __SHRT_MAX__
39278
39279
39280 #undef USHRT_MAX
39281
39282
39283
39284 #define USHRT_MAX (SHRT_MAX * 2 + 1)
39285
39286
39287
39288 #undef INT_MIN
39289 #define INT_MIN (-INT_MAX - 1)
39290 #undef INT_MAX
39291 #define INT_MAX __INT_MAX__
39292
39293
39294 #undef UINT_MAX
39295 #define UINT_MAX (INT_MAX * 2U + 1U)
39296
39297
39298
39299 #undef LONG_MIN
39300 #define LONG_MIN (-LONG_MAX - 1L)
39301 #undef LONG_MAX
39302 #define LONG_MAX __LONG_MAX__
39303
39304
39305 #undef ULONG_MAX
39306 #define ULONG_MAX (LONG_MAX * 2UL + 1UL)
39307 # 152 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include-fixed/limits.h" 3 4
39308 #undef LONG_LONG_MIN
39309 #define LONG_LONG_MIN (-LONG_LONG_MAX - 1LL)
39310 #undef LONG_LONG_MAX
39311 #define LONG_LONG_MAX __LONG_LONG_MAX__
39312
39313
39314 #undef ULONG_LONG_MAX
39315 #define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1ULL)
39316 # 36 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/Yarr.h" 2
39317
39318 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/YarrInterpreter.h" 1
39319 # 31 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/YarrInterpreter.h"
39320 #define YarrInterpreter_h
39321
39322 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/YarrPattern.h" 1
39323 # 32 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/YarrPattern.h"
39324 #define YarrPattern_h
39325
39326 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/wtfbridge.h" 1
39327
39328
39329
39330
39331
39332
39333
39334 #define jswtfbridge_h__
39335 # 17 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/wtfbridge.h"
39336 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/String.h" 1
39337 # 18 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/wtfbridge.h" 2
39338 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/wtf/Platform.h" 1
39339 # 29 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/wtf/Platform.h"
39340 #define WTF_Platform_h
39341
39342
39343
39344
39345 #define PLATFORM(WTF_FEATURE) (defined WTF_PLATFORM_ ##WTF_FEATURE && WTF_PLATFORM_ ##WTF_FEATURE)
39346
39347
39348
39349
39350
39351 #define COMPILER(WTF_FEATURE) (defined WTF_COMPILER_ ##WTF_FEATURE && WTF_COMPILER_ ##WTF_FEATURE)
39352
39353 #define CPU(WTF_FEATURE) (defined WTF_CPU_ ##WTF_FEATURE && WTF_CPU_ ##WTF_FEATURE)
39354
39355 #define HAVE(WTF_FEATURE) (defined HAVE_ ##WTF_FEATURE && HAVE_ ##WTF_FEATURE)
39356
39357
39358 #define OS(WTF_FEATURE) (defined WTF_OS_ ##WTF_FEATURE && WTF_OS_ ##WTF_FEATURE)
39359
39360
39361
39362
39363
39364 #define USE(WTF_FEATURE) (defined WTF_USE_ ##WTF_FEATURE && WTF_USE_ ##WTF_FEATURE)
39365
39366 #define ENABLE(WTF_FEATURE) (defined ENABLE_ ##WTF_FEATURE && ENABLE_ ##WTF_FEATURE)
39367 # 80 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/wtf/Platform.h"
39368 #define RVCT_VERSION_AT_LEAST(major,minor,patch,build) 0
39369
39370
39371
39372
39373
39374 #define WTF_COMPILER_GCC 1
39375 #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
39376 #define GCC_VERSION_AT_LEAST(major,minor,patch) (GCC_VERSION >= (major * 10000 + minor * 100 + patch))
39377 # 233 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/wtf/Platform.h"
39378 #define WTF_CPU_ARM 1
39379 # 247 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/wtf/Platform.h"
39380 #define WTF_ARM_ARCH_AT_LEAST(N) (CPU(ARM) && WTF_ARM_ARCH_VERSION >= N)
39381 # 279 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/wtf/Platform.h"
39382 #define WTF_ARM_ARCH_VERSION 7
39383 # 318 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/wtf/Platform.h"
39384 #define WTF_THUMB_ARCH_VERSION 4
39385 # 346 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/wtf/Platform.h"
39386 #define WTF_CPU_ARM_TRADITIONAL 1
39387 #define WTF_CPU_ARM_THUMB2 0
39388 # 362 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/wtf/Platform.h"
39389 #define WTF_CPU_NEEDS_ALIGNED_ACCESS 1
39390 # 425 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/wtf/Platform.h"
39391 #define WTF_OS_LINUX 1
39392 # 478 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/wtf/Platform.h"
39393 #define WTF_OS_UNIX 1
39394 # 532 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/wtf/Platform.h"
39395 #define WTF_PLATFORM_IOS_SIMULATOR 0
39396
39397
39398
39399 #define WTF_PLATFORM_IOS 0
39400 # 621 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/wtf/Platform.h"
39401 #define WTF_USE_ICU_UNICODE 1
39402 # 760 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/wtf/Platform.h"
39403 #define HAVE_SIGNAL_H 1
39404 # 772 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/wtf/Platform.h"
39405 #define HAVE_TM_GMTOFF 1
39406 #define HAVE_TM_ZONE 1
39407 #define HAVE_TIMEGM 1
39408 # 870 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/wtf/Platform.h"
39409 #define HAVE_ERRNO_H 1
39410
39411
39412 #define HAVE_LANGINFO_H 1
39413
39414 #define HAVE_MMAP 1
39415 #define HAVE_SBRK 1
39416 #define HAVE_STRINGS_H 1
39417 #define HAVE_SYS_PARAM_H 1
39418 #define HAVE_SYS_TIME_H 1
39419 # 896 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/wtf/Platform.h"
39420 #define ENABLE_FAST_MALLOC_MATCH_VALIDATION 0
39421
39422
39423
39424 #define ENABLE_ICONDATABASE 1
39425
39426
39427
39428 #define ENABLE_DATABASE 1
39429
39430
39431
39432 #define ENABLE_JAVASCRIPT_DEBUGGER 1
39433
39434
39435
39436 #define ENABLE_FTPDIR 1
39437
39438
39439
39440 #define ENABLE_CONTEXT_MENUS 1
39441
39442
39443
39444 #define ENABLE_DRAG_SUPPORT 1
39445
39446
39447
39448 #define ENABLE_DATA_TRANSFER_ITEMS 0
39449
39450
39451
39452 #define ENABLE_DASHBOARD_SUPPORT 0
39453
39454
39455
39456 #define ENABLE_INSPECTOR 1
39457
39458
39459
39460 #define ENABLE_JAVA_BRIDGE 0
39461
39462
39463
39464 #define ENABLE_NETSCAPE_PLUGIN_API 1
39465
39466
39467
39468 #define ENABLE_NETSCAPE_PLUGIN_METADATA_CACHE 0
39469
39470
39471
39472 #define ENABLE_PURGEABLE_MEMORY 0
39473
39474
39475
39476 #define WTF_USE_PLUGIN_HOST_PROCESS 0
39477
39478
39479
39480 #define ENABLE_ORIENTATION_EVENTS 0
39481
39482
39483
39484 #define ENABLE_OPCODE_STATS 0
39485
39486
39487
39488 #define ENABLE_GLOBAL_FASTMALLOC_NEW 1
39489
39490
39491 #define ENABLE_DEBUG_WITH_BREAKPOINT 0
39492 #define ENABLE_SAMPLING_COUNTERS 0
39493 #define ENABLE_SAMPLING_FLAGS 0
39494 #define ENABLE_OPCODE_SAMPLING 0
39495 #define ENABLE_CODEBLOCK_SAMPLING 0
39496 # 980 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/wtf/Platform.h"
39497 #define ENABLE_GEOLOCATION 0
39498
39499
39500
39501 #define ENABLE_GESTURE_RECOGNIZER 0
39502
39503
39504
39505 #define ENABLE_NOTIFICATIONS 0
39506
39507
39508
39509
39510
39511
39512
39513 #define ENABLE_TEXT_CARET 1
39514
39515
39516
39517 #define ENABLE_ON_FIRST_TEXTAREA_FOCUS_SELECT_ALL 0
39518
39519
39520
39521 #define ENABLE_FULLSCREEN_API 0
39522 # 1016 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/wtf/Platform.h"
39523 #define WTF_USE_JSVALUE32_64 1
39524
39525
39526
39527
39528 #define ENABLE_REPAINT_THROTTLING 0
39529 # 1064 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/wtf/Platform.h"
39530 #define ENABLE_JIT_USE_SOFT_MODULO 1
39531
39532
39533
39534
39535 #define ENABLE_JIT_OPTIMIZE_CALL 1
39536
39537
39538 #define ENABLE_JIT_OPTIMIZE_NATIVE_CALL 1
39539
39540
39541 #define ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS 1
39542
39543
39544 #define ENABLE_JIT_OPTIMIZE_METHOD_CALLS 1
39545 # 1087 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/wtf/Platform.h"
39546 #define JSC_HOST_CALL
39547
39548
39549
39550
39551 #define HAVE_COMPUTED_GOTO 1
39552
39553
39554
39555
39556
39557
39558 #define ENABLE_REGEXP_TRACING 0
39559
39560
39561
39562
39563
39564
39565 #define ENABLE_YARR_JIT 1
39566
39567
39568 #define ENABLE_YARR_JIT_DEBUG 0
39569
39570
39571
39572 #define ENABLE_ASSEMBLER 1
39573 # 1128 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/wtf/Platform.h"
39574 #define ENABLE_EXECUTABLE_ALLOCATOR_DEMAND 1
39575 # 1137 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/wtf/Platform.h"
39576 #define ENABLE_SMOOTH_SCROLLING 0
39577
39578
39579
39580 #define ENABLE_WEB_ARCHIVE 0
39581 # 1176 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/wtf/Platform.h"
39582 #define WARN_UNUSED_RETURN __attribute__ ((warn_unused_result))
39583 # 1186 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/wtf/Platform.h"
39584 #define WTF_PLATFORM_CFNETWORK Error USE_macro_should_be_used_with_CFNETWORK
39585
39586 #define ENABLE_JSC_ZOMBIES 0
39587 # 1226 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/wtf/Platform.h"
39588 #define WTF_USE_EXPORT_MACROS 0
39589 # 19 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/wtfbridge.h" 2
39590 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/jit/ExecutableAllocator.h" 1
39591 # 27 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/jit/ExecutableAllocator.h"
39592 #define ExecutableAllocator_h
39593
39594 # 1 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stddef.h" 1 3 4
39595 # 30 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/jit/ExecutableAllocator.h" 2
39596
39597
39598 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsalloc.h" 1
39599 # 33 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/jit/ExecutableAllocator.h" 2
39600
39601
39602
39603 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/wtf/Assertions.h" 1
39604 # 27 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/wtf/Assertions.h"
39605 #define WTF_Assertions_h
39606
39607 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/wtf/Platform.h" 1
39608 # 30 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/wtf/Assertions.h" 2
39609
39610
39611
39612
39613
39614
39615
39616 #define ASSERT_DISABLED 1
39617
39618
39619 #define ASSERT(assertion) MOZ_ASSERT(assertion)
39620 #define ASSERT_UNUSED(variable,assertion) do { (void)variable; ASSERT(assertion); } while (0)
39621
39622
39623
39624 #define ASSERT_NOT_REACHED() MOZ_NOT_REACHED("")
39625 #define CRASH() MOZ_CRASH()
39626 #define COMPILE_ASSERT(exp,name) MOZ_STATIC_ASSERT(exp, #name)
39627 # 37 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/jit/ExecutableAllocator.h" 2
39628 # 74 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/jit/ExecutableAllocator.h"
39629 #define INITIAL_PROTECTION_FLAGS (PROT_READ | PROT_WRITE | PROT_EXEC)
39630
39631
39632
39633
39634
39635
39636 namespace JSC {
39637
39638 class ExecutableAllocator;
39639
39640 enum CodeKind { METHOD_CODE, REGEXP_CODE };
39641
39642
39643 class ExecutablePool {
39644
39645 friend class js::OffTheBooks; friend class js::Foreground; friend class js::UnwantedForeground; friend struct ::JSContext; friend struct ::JSRuntime;
39646 friend class ExecutableAllocator;
39647 private:
39648 struct Allocation {
39649 char* pages;
39650 size_t size;
39651
39652
39653
39654 };
39655
39656 ExecutableAllocator* m_allocator;
39657 char* m_freePtr;
39658 char* m_end;
39659 Allocation m_allocation;
39660
39661
39662 unsigned m_refCount;
39663
39664
39665 size_t m_mjitCodeMethod;
39666 size_t m_mjitCodeRegexp;
39667
39668 public:
39669
39670 bool m_destroy;
39671
39672
39673
39674 size_t m_gcNumber;
39675
39676 void release(bool willDestroy = false)
39677 {
39678 do { } while(0);
39679
39680
39681 if (--m_refCount == 0) {
39682 js::UnwantedForeground::delete_(this);
39683 }
39684 }
39685
39686 private:
39687
39688
39689
39690 void addRef()
39691 {
39692 do { } while(0);
39693 ++m_refCount;
39694 }
39695
39696 ExecutablePool(ExecutableAllocator* allocator, Allocation a)
39697 : m_allocator(allocator), m_freePtr(a.pages), m_end(m_freePtr + a.size), m_allocation(a),
39698 m_refCount(1), m_mjitCodeMethod(0), m_mjitCodeRegexp(0), m_destroy(false), m_gcNumber(0)
39699 { }
39700
39701 ~ExecutablePool();
39702
39703 void* alloc(size_t n, CodeKind kind)
39704 {
39705 do { } while(0);
39706 void *result = m_freePtr;
39707 m_freePtr += n;
39708
39709 if ( kind == REGEXP_CODE )
39710 m_mjitCodeRegexp += n;
39711 else
39712 m_mjitCodeMethod += n;
39713
39714 return result;
39715 }
39716
39717 size_t available() const {
39718 do { } while(0);
39719 return m_end - m_freePtr;
39720 }
39721 };
39722
39723 enum AllocationBehavior
39724 {
39725 AllocationCanRandomize,
39726 AllocationDeterministic
39727 };
39728
39729 class ExecutableAllocator {
39730 typedef void (*DestroyCallback)(void* addr, size_t size);
39731 enum ProtectionSetting { Writable, Executable };
39732 DestroyCallback destroyCallback;
39733
39734 void initSeed();
39735
39736 public:
39737 explicit ExecutableAllocator(AllocationBehavior allocBehavior)
39738 : destroyCallback(__null),
39739 allocBehavior(allocBehavior)
39740 {
39741 if (!pageSize) {
39742 pageSize = determinePageSize();
39743 # 196 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/jit/ExecutableAllocator.h"
39744 largeAllocSize = pageSize * 16;
39745 }
39746
39747
39748
39749
39750
39751 do { } while(0);
39752 }
39753
39754 ~ExecutableAllocator()
39755 {
39756 for (size_t i = 0; i < m_smallPools.length(); i++)
39757 m_smallPools[i]->release( true);
39758
39759
39760 }
39761
39762
39763
39764
39765 void* alloc(size_t n, ExecutablePool** poolp, CodeKind type)
39766 {
39767
39768
39769
39770 n = roundUpAllocationSize(n, sizeof(void*));
39771 if (n == OVERSIZE_ALLOCATION) {
39772 *poolp = __null;
39773 return __null;
39774 }
39775
39776 *poolp = poolForSize(n);
39777 if (!*poolp)
39778 return __null;
39779
39780
39781
39782 void *result = (*poolp)->alloc(n, type);
39783 do { } while(0);
39784 return result;
39785 }
39786
39787 void releasePoolPages(ExecutablePool *pool) {
39788 do { } while(0);
39789 if (destroyCallback)
39790 destroyCallback(pool->m_allocation.pages, pool->m_allocation.size);
39791 systemRelease(pool->m_allocation);
39792 do { } while(0);
39793 m_pools.remove(m_pools.lookup(pool));
39794 }
39795
39796 void sizeOfCode(size_t *method, size_t *regexp, size_t *unused) const;
39797
39798 void setDestroyCallback(DestroyCallback destroyCallback) {
39799 this->destroyCallback = destroyCallback;
39800 }
39801
39802 void setRandomize(bool enabled) {
39803 allocBehavior = enabled ? AllocationCanRandomize : AllocationDeterministic;
39804 }
39805
39806 private:
39807 static size_t pageSize;
39808 static size_t largeAllocSize;
39809
39810
39811
39812
39813 static const size_t OVERSIZE_ALLOCATION = size_t(-1);
39814
39815 static size_t roundUpAllocationSize(size_t request, size_t granularity)
39816 {
39817
39818
39819
39820
39821
39822
39823 if ((std::numeric_limits<size_t>::max() - granularity) <= request)
39824 return OVERSIZE_ALLOCATION;
39825
39826
39827 size_t size = request + (granularity - 1);
39828 size = size & ~(granularity - 1);
39829 do { } while(0);
39830 return size;
39831 }
39832
39833
39834 ExecutablePool::Allocation systemAlloc(size_t n);
39835 static void systemRelease(const ExecutablePool::Allocation& alloc);
39836 void *computeRandomAllocationAddress();
39837
39838 ExecutablePool* createPool(size_t n)
39839 {
39840 size_t allocSize = roundUpAllocationSize(n, pageSize);
39841 if (allocSize == OVERSIZE_ALLOCATION)
39842 return __null;
39843
39844 if (!m_pools.initialized() && !m_pools.init())
39845 return __null;
39846
39847
39848
39849
39850 ExecutablePool::Allocation a = systemAlloc(allocSize);
39851
39852 if (!a.pages)
39853 return __null;
39854
39855 ExecutablePool *pool = js::OffTheBooks::new_<ExecutablePool>(this, a);
39856 if (!pool) {
39857 systemRelease(a);
39858 return __null;
39859 }
39860 m_pools.put(pool);
39861 return pool;
39862 }
39863
39864 public:
39865 ExecutablePool* poolForSize(size_t n)
39866 {
39867
39868
39869
39870
39871
39872
39873 ExecutablePool *minPool = __null;
39874 for (size_t i = 0; i < m_smallPools.length(); i++) {
39875 ExecutablePool *pool = m_smallPools[i];
39876 if (n <= pool->available() && (!minPool || pool->available() < minPool->available()))
39877 minPool = pool;
39878 }
39879 if (minPool) {
39880 minPool->addRef();
39881 return minPool;
39882 }
39883
39884
39885
39886 if (n > largeAllocSize)
39887 return createPool(n);
39888
39889
39890 ExecutablePool* pool = createPool(largeAllocSize);
39891 if (!pool)
39892 return __null;
39893
39894
39895 if (m_smallPools.length() < maxSmallPools) {
39896
39897 m_smallPools.append(pool);
39898 pool->addRef();
39899 } else {
39900
39901 int iMin = 0;
39902 for (size_t i = 1; i < m_smallPools.length(); i++)
39903 if (m_smallPools[i]->available() <
39904 m_smallPools[iMin]->available())
39905 {
39906 iMin = i;
39907 }
39908
39909
39910
39911 ExecutablePool *minPool = m_smallPools[iMin];
39912 if ((pool->available() - n) > minPool->available()) {
39913 minPool->release();
39914 m_smallPools[iMin] = pool;
39915 pool->addRef();
39916 }
39917 }
39918
39919
39920 return pool;
39921 }
39922 # 386 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/jit/ExecutableAllocator.h"
39923 static void makeWritable(void*, size_t) {}
39924 static void makeExecutable(void*, size_t) {}
39925 # 451 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/jit/ExecutableAllocator.h"
39926 static void cacheFlush(void* code, size_t size)
39927 {
39928 asm volatile (
39929 "push {r7}\n"
39930 "mov r0, %0\n"
39931 "mov r1, %1\n"
39932 "mov r7, #0xf0000\n"
39933 "add r7, r7, #0x2\n"
39934 "mov r2, #0x0\n"
39935 "svc 0x0\n"
39936 "pop {r7}\n"
39937 :
39938 : "r" (code), "r" (reinterpret_cast<char*>(code) + size)
39939 : "r0", "r1", "r2");
39940 }
39941
39942
39943
39944
39945
39946
39947
39948 private:
39949
39950
39951
39952
39953
39954
39955 static const size_t maxSmallPools = 4;
39956 typedef js::Vector<ExecutablePool *, maxSmallPools, js::SystemAllocPolicy> SmallExecPoolVector;
39957 SmallExecPoolVector m_smallPools;
39958
39959
39960
39961
39962 typedef js::HashSet<ExecutablePool *, js::DefaultHasher<ExecutablePool *>, js::SystemAllocPolicy>
39963 ExecPoolHashSet;
39964 ExecPoolHashSet m_pools;
39965 AllocationBehavior allocBehavior;
39966
39967 static size_t determinePageSize();
39968 };
39969
39970 }
39971 # 20 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/wtfbridge.h" 2
39972
39973 namespace JSC { namespace Yarr {
39974
39975
39976
39977
39978
39979 typedef jschar UChar;
39980 typedef JSLinearString UString;
39981
39982 using namespace js::unicode;
39983
39984 class Unicode {
39985 public:
39986 static UChar toUpper(UChar c) { return ToUpperCase(c); }
39987 static UChar toLower(UChar c) { return ToLowerCase(c); }
39988 };
39989
39990
39991
39992
39993
39994
39995 template<typename T>
39996 class RefCounted {
39997 };
39998
39999 template<typename T>
40000 class RefPtr {
40001 T *ptr;
40002 public:
40003 RefPtr(T *p) { ptr = p; }
40004 operator bool() const { return ptr != __null; }
40005 const T *operator ->() const { return ptr; }
40006 T *get() { return ptr; }
40007 };
40008
40009 template<typename T>
40010 class PassRefPtr {
40011 T *ptr;
40012 public:
40013 PassRefPtr(T *p) { ptr = p; }
40014 operator T*() { return ptr; }
40015 };
40016
40017 template<typename T>
40018 class PassOwnPtr {
40019 T *ptr;
40020 public:
40021 PassOwnPtr(T *p) { ptr = p; }
40022
40023 T *get() { return ptr; }
40024 };
40025
40026 template<typename T>
40027 class OwnPtr {
40028 T *ptr;
40029 public:
40030 OwnPtr() : ptr(__null) { }
40031 OwnPtr(PassOwnPtr<T> p) : ptr(p.get()) { }
40032
40033 ~OwnPtr() {
40034 if (ptr)
40035 js::Foreground::delete_(ptr);
40036 }
40037
40038 OwnPtr<T> &operator=(PassOwnPtr<T> p) {
40039 ptr = p.get();
40040 return *this;
40041 }
40042
40043 T *operator ->() { return ptr; }
40044
40045 T *get() { return ptr; }
40046
40047 T *release() {
40048 T *result = ptr;
40049 ptr = __null;
40050 return result;
40051 }
40052 };
40053
40054 template<typename T>
40055 PassRefPtr<T> adoptRef(T *p) { return PassRefPtr<T>(p); }
40056
40057 template<typename T>
40058 PassOwnPtr<T> adoptPtr(T *p) { return PassOwnPtr<T>(p); }
40059
40060 #define WTF_MAKE_FAST_ALLOCATED
40061
40062 template<typename T>
40063 class Ref {
40064 T &val;
40065 public:
40066 Ref(T &val) : val(val) { }
40067 operator T&() const { return val; }
40068 };
40069
40070
40071
40072
40073
40074 template<typename T, size_t N = 0>
40075 class Vector {
40076 public:
40077 js::Vector<T, N, js::SystemAllocPolicy> impl;
40078 public:
40079 Vector() {}
40080
40081 Vector(const Vector &v) {
40082
40083 (void) append(v);
40084 }
40085
40086 size_t size() const {
40087 return impl.length();
40088 }
40089
40090 T &operator[](size_t i) {
40091 return impl[i];
40092 }
40093
40094 const T &operator[](size_t i) const {
40095 return impl[i];
40096 }
40097
40098 T &at(size_t i) {
40099 return impl[i];
40100 }
40101
40102 const T *begin() const {
40103 return impl.begin();
40104 }
40105
40106 T &last() {
40107 return impl.back();
40108 }
40109
40110 bool isEmpty() const {
40111 return impl.empty();
40112 }
40113
40114 template <typename U>
40115 void append(const U &u) {
40116
40117 (void) impl.append(static_cast<T>(u));
40118 }
40119
40120 template <size_t M>
40121 void append(const Vector<T,M> &v) {
40122
40123 (void) impl.append(v.impl);
40124 }
40125
40126 void insert(size_t i, const T& t) {
40127
40128 (void) impl.insert(&impl[i], t);
40129 }
40130
40131 void remove(size_t i) {
40132 impl.erase(&impl[i]);
40133 }
40134
40135 void clear() {
40136 return impl.clear();
40137 }
40138
40139 void shrink(size_t newLength) {
40140
40141 do { } while(0);
40142 (void) impl.resize(newLength);
40143 }
40144
40145 void deleteAllValues() {
40146 for (T *p = impl.begin(); p != impl.end(); ++p)
40147 js::Foreground::delete_(*p);
40148 }
40149 };
40150
40151 template<typename T>
40152 class Vector<OwnPtr<T> > {
40153 public:
40154 js::Vector<T *, 0, js::SystemAllocPolicy> impl;
40155 public:
40156 Vector() {}
40157
40158 size_t size() const {
40159 return impl.length();
40160 }
40161
40162 void append(T *t) {
40163
40164 (void) impl.append(t);
40165 }
40166
40167 PassOwnPtr<T> operator[](size_t i) {
40168 return PassOwnPtr<T>(impl[i]);
40169 }
40170
40171 void clear() {
40172 for (T **p = impl.begin(); p != impl.end(); ++p)
40173 js::Foreground::delete_(*p);
40174 return impl.clear();
40175 }
40176 };
40177
40178 template <typename T, size_t N>
40179 inline void
40180 deleteAllValues(Vector<T, N> &v) {
40181 v.deleteAllValues();
40182 }
40183
40184
40185
40186
40187
40188
40189 class JSGlobalData {
40190 public:
40191 ExecutableAllocator *regexAllocator;
40192
40193 JSGlobalData(ExecutableAllocator *regexAllocator)
40194 : regexAllocator(regexAllocator) { }
40195 };
40196
40197
40198
40199
40200
40201
40202 const size_t notFound = size_t(-1);
40203
40204
40205
40206
40207
40208 #define UNUSED_PARAM(e)
40209
40210 }
40211
40212
40213
40214
40215
40216
40217 namespace std {
40218 # 276 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/wtfbridge.h"
40219 template<typename T>
40220 inline T
40221 min(T t1, T t2)
40222 {
40223 return ((t1)<(t2)?(t1):(t2));
40224 }
40225
40226 template<typename T>
40227 inline T
40228 max(T t1, T t2)
40229 {
40230 return ((t1)>(t2)?(t1):(t2));
40231 }
40232
40233 template<typename T>
40234 inline void
40235 swap(T &t1, T &t2)
40236 {
40237 T tmp = t1;
40238 t1 = t2;
40239 t2 = tmp;
40240 }
40241 }
40242
40243 }
40244 # 35 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/YarrPattern.h" 2
40245 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/ASCIICType.h" 1
40246 # 34 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/ASCIICType.h"
40247 #define WTF_ASCIICType_h
40248
40249 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/wtf/Assertions.h" 1
40250 # 37 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/ASCIICType.h" 2
40251 # 48 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/ASCIICType.h"
40252 namespace WTF {
40253
40254 inline bool isASCII(char c) { return !(c & ~0x7F); }
40255 inline bool isASCII(unsigned short c) { return !(c & ~0x7F); }
40256
40257 inline bool isASCII(wchar_t c) { return !(c & ~0x7F); }
40258
40259 inline bool isASCII(int c) { return !(c & ~0x7F); }
40260 inline bool isASCII(unsigned c) { return !(c & ~0x7F); }
40261
40262 inline bool isASCIIAlpha(char c) { return (c | 0x20) >= 'a' && (c | 0x20) <= 'z'; }
40263 inline bool isASCIIAlpha(unsigned short c) { return (c | 0x20) >= 'a' && (c | 0x20) <= 'z'; }
40264
40265 inline bool isASCIIAlpha(wchar_t c) { return (c | 0x20) >= 'a' && (c | 0x20) <= 'z'; }
40266
40267 inline bool isASCIIAlpha(int c) { return (c | 0x20) >= 'a' && (c | 0x20) <= 'z'; }
40268 inline bool isASCIIAlpha(unsigned c) { return (c | 0x20) >= 'a' && (c | 0x20) <= 'z'; }
40269
40270 inline bool isASCIIAlphanumeric(char c) { return (c >= '0' && c <= '9') || ((c | 0x20) >= 'a' && (c | 0x20) <= 'z'); }
40271 inline bool isASCIIAlphanumeric(unsigned short c) { return (c >= '0' && c <= '9') || ((c | 0x20) >= 'a' && (c | 0x20) <= 'z'); }
40272
40273 inline bool isASCIIAlphanumeric(wchar_t c) { return (c >= '0' && c <= '9') || ((c | 0x20) >= 'a' && (c | 0x20) <= 'z'); }
40274
40275 inline bool isASCIIAlphanumeric(int c) { return (c >= '0' && c <= '9') || ((c | 0x20) >= 'a' && (c | 0x20) <= 'z'); }
40276 inline bool isASCIIAlphanumeric(unsigned c) { return (c >= '0' && c <= '9') || ((c | 0x20) >= 'a' && (c | 0x20) <= 'z'); }
40277
40278 inline bool isASCIIDigit(char c) { return (c >= '0') & (c <= '9'); }
40279 inline bool isASCIIDigit(unsigned short c) { return (c >= '0') & (c <= '9'); }
40280
40281 inline bool isASCIIDigit(wchar_t c) { return (c >= '0') & (c <= '9'); }
40282
40283 inline bool isASCIIDigit(int c) { return (c >= '0') & (c <= '9'); }
40284 inline bool isASCIIDigit(unsigned c) { return (c >= '0') & (c <= '9'); }
40285
40286 inline bool isASCIIHexDigit(char c) { return (c >= '0' && c <= '9') || ((c | 0x20) >= 'a' && (c | 0x20) <= 'f'); }
40287 inline bool isASCIIHexDigit(unsigned short c) { return (c >= '0' && c <= '9') || ((c | 0x20) >= 'a' && (c | 0x20) <= 'f'); }
40288
40289 inline bool isASCIIHexDigit(wchar_t c) { return (c >= '0' && c <= '9') || ((c | 0x20) >= 'a' && (c | 0x20) <= 'f'); }
40290
40291 inline bool isASCIIHexDigit(int c) { return (c >= '0' && c <= '9') || ((c | 0x20) >= 'a' && (c | 0x20) <= 'f'); }
40292 inline bool isASCIIHexDigit(unsigned c) { return (c >= '0' && c <= '9') || ((c | 0x20) >= 'a' && (c | 0x20) <= 'f'); }
40293
40294 inline bool isASCIIOctalDigit(char c) { return (c >= '0') & (c <= '7'); }
40295 inline bool isASCIIOctalDigit(unsigned short c) { return (c >= '0') & (c <= '7'); }
40296
40297 inline bool isASCIIOctalDigit(wchar_t c) { return (c >= '0') & (c <= '7'); }
40298
40299 inline bool isASCIIOctalDigit(int c) { return (c >= '0') & (c <= '7'); }
40300 inline bool isASCIIOctalDigit(unsigned c) { return (c >= '0') & (c <= '7'); }
40301
40302 inline bool isASCIILower(char c) { return c >= 'a' && c <= 'z'; }
40303 inline bool isASCIILower(unsigned short c) { return c >= 'a' && c <= 'z'; }
40304
40305 inline bool isASCIILower(wchar_t c) { return c >= 'a' && c <= 'z'; }
40306
40307 inline bool isASCIILower(int c) { return c >= 'a' && c <= 'z'; }
40308 inline bool isASCIILower(unsigned c) { return c >= 'a' && c <= 'z'; }
40309
40310 inline bool isASCIIUpper(char c) { return c >= 'A' && c <= 'Z'; }
40311 inline bool isASCIIUpper(unsigned short c) { return c >= 'A' && c <= 'Z'; }
40312
40313 inline bool isASCIIUpper(wchar_t c) { return c >= 'A' && c <= 'Z'; }
40314
40315 inline bool isASCIIUpper(int c) { return c >= 'A' && c <= 'Z'; }
40316 inline bool isASCIIUpper(unsigned c) { return c >= 'A' && c <= 'Z'; }
40317 # 127 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/ASCIICType.h"
40318 inline bool isASCIISpace(char c) { return c <= ' ' && (c == ' ' || (c <= 0xD && c >= 0x9)); }
40319 inline bool isASCIISpace(unsigned short c) { return c <= ' ' && (c == ' ' || (c <= 0xD && c >= 0x9)); }
40320
40321 inline bool isASCIISpace(wchar_t c) { return c <= ' ' && (c == ' ' || (c <= 0xD && c >= 0x9)); }
40322
40323 inline bool isASCIISpace(int c) { return c <= ' ' && (c == ' ' || (c <= 0xD && c >= 0x9)); }
40324 inline bool isASCIISpace(unsigned c) { return c <= ' ' && (c == ' ' || (c <= 0xD && c >= 0x9)); }
40325
40326 inline char toASCIILower(char c) { return c | ((c >= 'A' && c <= 'Z') << 5); }
40327 inline unsigned short toASCIILower(unsigned short c) { return c | ((c >= 'A' && c <= 'Z') << 5); }
40328
40329 inline wchar_t toASCIILower(wchar_t c) { return c | ((c >= 'A' && c <= 'Z') << 5); }
40330
40331 inline int toASCIILower(int c) { return c | ((c >= 'A' && c <= 'Z') << 5); }
40332 inline unsigned toASCIILower(unsigned c) { return c | ((c >= 'A' && c <= 'Z') << 5); }
40333
40334
40335 inline char toASCIIUpper(char c) { return static_cast<char>(c & ~((c >= 'a' && c <= 'z') << 5)); }
40336 inline unsigned short toASCIIUpper(unsigned short c) { return static_cast<unsigned short>(c & ~((c >= 'a' && c <= 'z') << 5)); }
40337
40338 inline wchar_t toASCIIUpper(wchar_t c) { return static_cast<wchar_t>(c & ~((c >= 'a' && c <= 'z') << 5)); }
40339
40340 inline int toASCIIUpper(int c) { return static_cast<int>(c & ~((c >= 'a' && c <= 'z') << 5)); }
40341 inline unsigned toASCIIUpper(unsigned c) { return static_cast<unsigned>(c & ~((c >= 'a' && c <= 'z') << 5)); }
40342
40343 inline int toASCIIHexValue(char c) { do { } while(0); return c < 'A' ? c - '0' : (c - 'A' + 10) & 0xF; }
40344 inline int toASCIIHexValue(unsigned short c) { do { } while(0); return c < 'A' ? c - '0' : (c - 'A' + 10) & 0xF; }
40345
40346 inline int toASCIIHexValue(wchar_t c) { do { } while(0); return c < 'A' ? c - '0' : (c - 'A' + 10) & 0xF; }
40347
40348 inline int toASCIIHexValue(int c) { do { } while(0); return c < 'A' ? c - '0' : (c - 'A' + 10) & 0xF; }
40349 inline int toASCIIHexValue(unsigned c) { do { } while(0); return c < 'A' ? c - '0' : (c - 'A' + 10) & 0xF; }
40350
40351 inline bool isASCIIPrintable(char c) { return c >= ' ' && c <= '~'; }
40352 inline bool isASCIIPrintable(unsigned short c) { return c >= ' ' && c <= '~'; }
40353
40354 inline bool isASCIIPrintable(wchar_t c) { return c >= ' ' && c <= '~'; }
40355
40356 inline bool isASCIIPrintable(int c) { return c >= ' ' && c <= '~'; }
40357 inline bool isASCIIPrintable(unsigned c) { return c >= ' ' && c <= '~'; }
40358 }
40359
40360 using WTF::isASCII;
40361 using WTF::isASCIIAlpha;
40362 using WTF::isASCIIAlphanumeric;
40363 using WTF::isASCIIDigit;
40364 using WTF::isASCIIHexDigit;
40365 using WTF::isASCIILower;
40366 using WTF::isASCIIOctalDigit;
40367 using WTF::isASCIIPrintable;
40368 using WTF::isASCIISpace;
40369 using WTF::isASCIIUpper;
40370 using WTF::toASCIIHexValue;
40371 using WTF::toASCIILower;
40372 using WTF::toASCIIUpper;
40373 # 36 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/YarrPattern.h" 2
40374
40375 namespace JSC { namespace Yarr {
40376
40377 enum ErrorCode {
40378 NoError,
40379 PatternTooLarge,
40380 QuantifierOutOfOrder,
40381 QuantifierWithoutAtom,
40382 MissingParentheses,
40383 ParenthesesUnmatched,
40384 ParenthesesTypeInvalid,
40385 CharacterClassUnmatched,
40386 CharacterClassInvalidRange,
40387 CharacterClassOutOfOrder,
40388 EscapeUnterminated,
40389 QuantifierTooLarge,
40390 NumberOfErrorCodes
40391 };
40392
40393 struct PatternDisjunction;
40394
40395 struct CharacterRange {
40396 UChar begin;
40397 UChar end;
40398
40399 CharacterRange(UChar begin, UChar end)
40400 : begin(begin)
40401 , end(end)
40402 {
40403 }
40404 };
40405
40406 struct CharacterClassTable : RefCounted<CharacterClassTable> {
40407 friend class js::OffTheBooks;
40408 const char* m_table;
40409 bool m_inverted;
40410 static PassRefPtr<CharacterClassTable> create(const char* table, bool inverted)
40411 {
40412 return adoptRef(js::OffTheBooks::new_<CharacterClassTable>(table, inverted));
40413 }
40414
40415 private:
40416 CharacterClassTable(const char* table, bool inverted)
40417 : m_table(table)
40418 , m_inverted(inverted)
40419 {
40420 }
40421 };
40422
40423 struct CharacterClass {
40424
40425 public:
40426
40427
40428
40429 CharacterClass(PassRefPtr<CharacterClassTable> table)
40430 : m_table(table)
40431 {
40432 }
40433 ~CharacterClass()
40434 {
40435 js::Foreground::delete_(m_table.get());
40436 }
40437 Vector<UChar> m_matches;
40438 Vector<CharacterRange> m_ranges;
40439 Vector<UChar> m_matchesUnicode;
40440 Vector<CharacterRange> m_rangesUnicode;
40441 RefPtr<CharacterClassTable> m_table;
40442 };
40443
40444 enum QuantifierType {
40445 QuantifierFixedCount,
40446 QuantifierGreedy,
40447 QuantifierNonGreedy
40448 };
40449
40450 struct PatternTerm {
40451 enum Type {
40452 TypeAssertionBOL,
40453 TypeAssertionEOL,
40454 TypeAssertionWordBoundary,
40455 TypePatternCharacter,
40456 TypeCharacterClass,
40457 TypeBackReference,
40458 TypeForwardReference,
40459 TypeParenthesesSubpattern,
40460 TypeParentheticalAssertion
40461 } type;
40462 bool m_capture :1;
40463 bool m_invert :1;
40464 union {
40465 UChar patternCharacter;
40466 CharacterClass* characterClass;
40467 unsigned backReferenceSubpatternId;
40468 struct {
40469 PatternDisjunction* disjunction;
40470 unsigned subpatternId;
40471 unsigned lastSubpatternId;
40472 bool isCopy;
40473 bool isTerminal;
40474 } parentheses;
40475 };
40476 QuantifierType quantityType;
40477 unsigned quantityCount;
40478 int inputPosition;
40479 unsigned frameLocation;
40480
40481
40482 PatternTerm()
40483 : type(PatternTerm::TypePatternCharacter)
40484 , m_capture(false)
40485 , m_invert(false)
40486 {
40487 patternCharacter = 0;
40488 quantityType = QuantifierFixedCount;
40489 quantityCount = 1;
40490 }
40491
40492 PatternTerm(UChar ch)
40493 : type(PatternTerm::TypePatternCharacter)
40494 , m_capture(false)
40495 , m_invert(false)
40496 {
40497 patternCharacter = ch;
40498 quantityType = QuantifierFixedCount;
40499 quantityCount = 1;
40500 }
40501
40502 PatternTerm(CharacterClass* charClass, bool invert)
40503 : type(PatternTerm::TypeCharacterClass)
40504 , m_capture(false)
40505 , m_invert(invert)
40506 {
40507 characterClass = charClass;
40508 quantityType = QuantifierFixedCount;
40509 quantityCount = 1;
40510 }
40511
40512 PatternTerm(Type type, unsigned subpatternId, PatternDisjunction* disjunction, bool capture = false, bool invert = false)
40513 : type(type)
40514 , m_capture(capture)
40515 , m_invert(invert)
40516 {
40517 parentheses.disjunction = disjunction;
40518 parentheses.subpatternId = subpatternId;
40519 parentheses.isCopy = false;
40520 parentheses.isTerminal = false;
40521 quantityType = QuantifierFixedCount;
40522 quantityCount = 1;
40523 }
40524
40525 PatternTerm(Type type, bool invert = false)
40526 : type(type)
40527 , m_capture(false)
40528 , m_invert(invert)
40529 {
40530 quantityType = QuantifierFixedCount;
40531 quantityCount = 1;
40532 }
40533
40534 PatternTerm(unsigned spatternId)
40535 : type(TypeBackReference)
40536 , m_capture(false)
40537 , m_invert(false)
40538 {
40539 backReferenceSubpatternId = spatternId;
40540 quantityType = QuantifierFixedCount;
40541 quantityCount = 1;
40542 }
40543
40544 static PatternTerm ForwardReference()
40545 {
40546 return PatternTerm(TypeForwardReference);
40547 }
40548
40549 static PatternTerm BOL()
40550 {
40551 return PatternTerm(TypeAssertionBOL);
40552 }
40553
40554 static PatternTerm EOL()
40555 {
40556 return PatternTerm(TypeAssertionEOL);
40557 }
40558
40559 static PatternTerm WordBoundary(bool invert)
40560 {
40561 return PatternTerm(TypeAssertionWordBoundary, invert);
40562 }
40563
40564 bool invert()
40565 {
40566 return m_invert;
40567 }
40568
40569 bool capture()
40570 {
40571 return m_capture;
40572 }
40573
40574 void quantify(unsigned count, QuantifierType type)
40575 {
40576 quantityCount = count;
40577 quantityType = type;
40578 }
40579 };
40580
40581 struct PatternAlternative {
40582
40583 public:
40584 PatternAlternative(PatternDisjunction* disjunction)
40585 : m_parent(disjunction)
40586 , m_onceThrough(false)
40587 , m_hasFixedSize(false)
40588 , m_startsWithBOL(false)
40589 , m_containsBOL(false)
40590 {
40591 }
40592
40593 PatternTerm& lastTerm()
40594 {
40595 do { } while(0);
40596 return m_terms[m_terms.size() - 1];
40597 }
40598
40599 void removeLastTerm()
40600 {
40601 do { } while(0);
40602 m_terms.shrink(m_terms.size() - 1);
40603 }
40604
40605 void setOnceThrough()
40606 {
40607 m_onceThrough = true;
40608 }
40609
40610 bool onceThrough()
40611 {
40612 return m_onceThrough;
40613 }
40614
40615 Vector<PatternTerm> m_terms;
40616 PatternDisjunction* m_parent;
40617 unsigned m_minimumSize;
40618 bool m_onceThrough : 1;
40619 bool m_hasFixedSize : 1;
40620 bool m_startsWithBOL : 1;
40621 bool m_containsBOL : 1;
40622 };
40623
40624 struct PatternDisjunction {
40625
40626 public:
40627 PatternDisjunction(PatternAlternative* parent = 0)
40628 : m_parent(parent)
40629 , m_hasFixedSize(false)
40630 {
40631 }
40632
40633 ~PatternDisjunction()
40634 {
40635 deleteAllValues(m_alternatives);
40636 }
40637
40638 PatternAlternative* addNewAlternative()
40639 {
40640 PatternAlternative* alternative = js::OffTheBooks::new_<PatternAlternative>(this);
40641 m_alternatives.append(alternative);
40642 return alternative;
40643 }
40644
40645 Vector<PatternAlternative*> m_alternatives;
40646 PatternAlternative* m_parent;
40647 unsigned m_minimumSize;
40648 unsigned m_callFrameSize;
40649 bool m_hasFixedSize;
40650 };
40651
40652
40653
40654
40655
40656 CharacterClass* newlineCreate();
40657 CharacterClass* digitsCreate();
40658 CharacterClass* spacesCreate();
40659 CharacterClass* wordcharCreate();
40660 CharacterClass* nondigitsCreate();
40661 CharacterClass* nonspacesCreate();
40662 CharacterClass* nonwordcharCreate();
40663
40664 struct TermChain {
40665 TermChain(PatternTerm term)
40666 : term(term)
40667 {}
40668
40669 PatternTerm term;
40670 Vector<TermChain> hotTerms;
40671 };
40672
40673 struct YarrPattern {
40674 YarrPattern(const UString& pattern, bool ignoreCase, bool multiline, ErrorCode* error);
40675
40676 ~YarrPattern()
40677 {
40678 deleteAllValues(m_disjunctions);
40679 deleteAllValues(m_userCharacterClasses);
40680 }
40681
40682 void reset()
40683 {
40684 m_numSubpatterns = 0;
40685 m_maxBackReference = 0;
40686
40687 m_containsBackreferences = false;
40688 m_containsBOL = false;
40689
40690 newlineCached = 0;
40691 digitsCached = 0;
40692 spacesCached = 0;
40693 wordcharCached = 0;
40694 nondigitsCached = 0;
40695 nonspacesCached = 0;
40696 nonwordcharCached = 0;
40697
40698 deleteAllValues(m_disjunctions);
40699 m_disjunctions.clear();
40700 deleteAllValues(m_userCharacterClasses);
40701 m_userCharacterClasses.clear();
40702 }
40703
40704 bool containsIllegalBackReference()
40705 {
40706 return m_maxBackReference > m_numSubpatterns;
40707 }
40708
40709 CharacterClass* newlineCharacterClass()
40710 {
40711 if (!newlineCached)
40712 m_userCharacterClasses.append(newlineCached = newlineCreate());
40713 return newlineCached;
40714 }
40715 CharacterClass* digitsCharacterClass()
40716 {
40717 if (!digitsCached)
40718 m_userCharacterClasses.append(digitsCached = digitsCreate());
40719 return digitsCached;
40720 }
40721 CharacterClass* spacesCharacterClass()
40722 {
40723 if (!spacesCached)
40724 m_userCharacterClasses.append(spacesCached = spacesCreate());
40725 return spacesCached;
40726 }
40727 CharacterClass* wordcharCharacterClass()
40728 {
40729 if (!wordcharCached)
40730 m_userCharacterClasses.append(wordcharCached = wordcharCreate());
40731 return wordcharCached;
40732 }
40733 CharacterClass* nondigitsCharacterClass()
40734 {
40735 if (!nondigitsCached)
40736 m_userCharacterClasses.append(nondigitsCached = nondigitsCreate());
40737 return nondigitsCached;
40738 }
40739 CharacterClass* nonspacesCharacterClass()
40740 {
40741 if (!nonspacesCached)
40742 m_userCharacterClasses.append(nonspacesCached = nonspacesCreate());
40743 return nonspacesCached;
40744 }
40745 CharacterClass* nonwordcharCharacterClass()
40746 {
40747 if (!nonwordcharCached)
40748 m_userCharacterClasses.append(nonwordcharCached = nonwordcharCreate());
40749 return nonwordcharCached;
40750 }
40751
40752 bool m_ignoreCase : 1;
40753 bool m_multiline : 1;
40754 bool m_containsBackreferences : 1;
40755 bool m_containsBOL : 1;
40756 unsigned m_numSubpatterns;
40757 unsigned m_maxBackReference;
40758 PatternDisjunction* m_body;
40759 Vector<PatternDisjunction*, 4> m_disjunctions;
40760 Vector<CharacterClass*> m_userCharacterClasses;
40761
40762 private:
40763 ErrorCode compile(const UString& patternString);
40764
40765 CharacterClass* newlineCached;
40766 CharacterClass* digitsCached;
40767 CharacterClass* spacesCached;
40768 CharacterClass* wordcharCached;
40769 CharacterClass* nondigitsCached;
40770 CharacterClass* nonspacesCached;
40771 CharacterClass* nonwordcharCached;
40772 };
40773
40774 } }
40775 # 34 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/YarrInterpreter.h" 2
40776
40777 namespace WTF {
40778 class BumpPointerAllocator;
40779 }
40780 using WTF::BumpPointerAllocator;
40781
40782 namespace JSC { namespace Yarr {
40783
40784 class ByteDisjunction;
40785
40786 struct ByteTerm {
40787 enum Type {
40788 TypeBodyAlternativeBegin,
40789 TypeBodyAlternativeDisjunction,
40790 TypeBodyAlternativeEnd,
40791 TypeAlternativeBegin,
40792 TypeAlternativeDisjunction,
40793 TypeAlternativeEnd,
40794 TypeSubpatternBegin,
40795 TypeSubpatternEnd,
40796 TypeAssertionBOL,
40797 TypeAssertionEOL,
40798 TypeAssertionWordBoundary,
40799 TypePatternCharacterOnce,
40800 TypePatternCharacterFixed,
40801 TypePatternCharacterGreedy,
40802 TypePatternCharacterNonGreedy,
40803 TypePatternCasedCharacterOnce,
40804 TypePatternCasedCharacterFixed,
40805 TypePatternCasedCharacterGreedy,
40806 TypePatternCasedCharacterNonGreedy,
40807 TypeCharacterClass,
40808 TypeBackReference,
40809 TypeParenthesesSubpattern,
40810 TypeParenthesesSubpatternOnceBegin,
40811 TypeParenthesesSubpatternOnceEnd,
40812 TypeParenthesesSubpatternTerminalBegin,
40813 TypeParenthesesSubpatternTerminalEnd,
40814 TypeParentheticalAssertionBegin,
40815 TypeParentheticalAssertionEnd,
40816 TypeCheckInput,
40817 TypeUncheckInput
40818 } type;
40819 union {
40820 struct {
40821 union {
40822 UChar patternCharacter;
40823 struct {
40824 UChar lo;
40825 UChar hi;
40826 } casedCharacter;
40827 CharacterClass* characterClass;
40828 unsigned subpatternId;
40829 };
40830 union {
40831 ByteDisjunction* parenthesesDisjunction;
40832 unsigned parenthesesWidth;
40833 };
40834 QuantifierType quantityType;
40835 unsigned quantityCount;
40836 } atom;
40837 struct {
40838 int next;
40839 int end;
40840 bool onceThrough;
40841 } alternative;
40842 unsigned checkInputCount;
40843 };
40844 unsigned frameLocation;
40845 bool m_capture : 1;
40846 bool m_invert : 1;
40847 int inputPosition;
40848
40849
40850 ByteTerm()
40851 {
40852 }
40853
40854 ByteTerm(UChar ch, int inputPos, unsigned frameLocation, unsigned quantityCount, QuantifierType quantityType)
40855 : frameLocation(frameLocation)
40856 , m_capture(false)
40857 , m_invert(false)
40858 {
40859 switch (quantityType) {
40860 case QuantifierFixedCount:
40861 type = (quantityCount == 1) ? ByteTerm::TypePatternCharacterOnce : ByteTerm::TypePatternCharacterFixed;
40862 break;
40863 case QuantifierGreedy:
40864 type = ByteTerm::TypePatternCharacterGreedy;
40865 break;
40866 case QuantifierNonGreedy:
40867 type = ByteTerm::TypePatternCharacterNonGreedy;
40868 break;
40869 }
40870
40871 atom.patternCharacter = ch;
40872 atom.quantityType = quantityType;
40873 atom.quantityCount = quantityCount;
40874 inputPosition = inputPos;
40875 }
40876
40877 ByteTerm(UChar lo, UChar hi, int inputPos, unsigned frameLocation, unsigned quantityCount, QuantifierType quantityType)
40878 : frameLocation(frameLocation)
40879 , m_capture(false)
40880 , m_invert(false)
40881 {
40882 switch (quantityType) {
40883 case QuantifierFixedCount:
40884 type = (quantityCount == 1) ? ByteTerm::TypePatternCasedCharacterOnce : ByteTerm::TypePatternCasedCharacterFixed;
40885 break;
40886 case QuantifierGreedy:
40887 type = ByteTerm::TypePatternCasedCharacterGreedy;
40888 break;
40889 case QuantifierNonGreedy:
40890 type = ByteTerm::TypePatternCasedCharacterNonGreedy;
40891 break;
40892 }
40893
40894 atom.casedCharacter.lo = lo;
40895 atom.casedCharacter.hi = hi;
40896 atom.quantityType = quantityType;
40897 atom.quantityCount = quantityCount;
40898 inputPosition = inputPos;
40899 }
40900
40901 ByteTerm(CharacterClass* characterClass, bool invert, int inputPos)
40902 : type(ByteTerm::TypeCharacterClass)
40903 , m_capture(false)
40904 , m_invert(invert)
40905 {
40906 atom.characterClass = characterClass;
40907 atom.quantityType = QuantifierFixedCount;
40908 atom.quantityCount = 1;
40909 inputPosition = inputPos;
40910 }
40911
40912 ByteTerm(Type type, unsigned subpatternId, ByteDisjunction* parenthesesInfo, bool capture, int inputPos)
40913 : type(type)
40914 , m_capture(capture)
40915 , m_invert(false)
40916 {
40917 atom.subpatternId = subpatternId;
40918 atom.parenthesesDisjunction = parenthesesInfo;
40919 atom.quantityType = QuantifierFixedCount;
40920 atom.quantityCount = 1;
40921 inputPosition = inputPos;
40922 }
40923
40924 ByteTerm(Type type, bool invert = false)
40925 : type(type)
40926 , m_capture(false)
40927 , m_invert(invert)
40928 {
40929 atom.quantityType = QuantifierFixedCount;
40930 atom.quantityCount = 1;
40931 }
40932
40933 ByteTerm(Type type, unsigned subpatternId, bool capture, bool invert, int inputPos)
40934 : type(type)
40935 , m_capture(capture)
40936 , m_invert(invert)
40937 {
40938 atom.subpatternId = subpatternId;
40939 atom.quantityType = QuantifierFixedCount;
40940 atom.quantityCount = 1;
40941 inputPosition = inputPos;
40942 }
40943
40944 static ByteTerm BOL(int inputPos)
40945 {
40946 ByteTerm term(TypeAssertionBOL);
40947 term.inputPosition = inputPos;
40948 return term;
40949 }
40950
40951 static ByteTerm CheckInput(unsigned count)
40952 {
40953 ByteTerm term(TypeCheckInput);
40954 term.checkInputCount = count;
40955 return term;
40956 }
40957
40958 static ByteTerm UncheckInput(unsigned count)
40959 {
40960 ByteTerm term(TypeUncheckInput);
40961 term.checkInputCount = count;
40962 return term;
40963 }
40964
40965 static ByteTerm EOL(int inputPos)
40966 {
40967 ByteTerm term(TypeAssertionEOL);
40968 term.inputPosition = inputPos;
40969 return term;
40970 }
40971
40972 static ByteTerm WordBoundary(bool invert, int inputPos)
40973 {
40974 ByteTerm term(TypeAssertionWordBoundary, invert);
40975 term.inputPosition = inputPos;
40976 return term;
40977 }
40978
40979 static ByteTerm BackReference(unsigned subpatternId, int inputPos)
40980 {
40981 return ByteTerm(TypeBackReference, subpatternId, false, false, inputPos);
40982 }
40983
40984 static ByteTerm BodyAlternativeBegin(bool onceThrough)
40985 {
40986 ByteTerm term(TypeBodyAlternativeBegin);
40987 term.alternative.next = 0;
40988 term.alternative.end = 0;
40989 term.alternative.onceThrough = onceThrough;
40990 return term;
40991 }
40992
40993 static ByteTerm BodyAlternativeDisjunction(bool onceThrough)
40994 {
40995 ByteTerm term(TypeBodyAlternativeDisjunction);
40996 term.alternative.next = 0;
40997 term.alternative.end = 0;
40998 term.alternative.onceThrough = onceThrough;
40999 return term;
41000 }
41001
41002 static ByteTerm BodyAlternativeEnd()
41003 {
41004 ByteTerm term(TypeBodyAlternativeEnd);
41005 term.alternative.next = 0;
41006 term.alternative.end = 0;
41007 term.alternative.onceThrough = false;
41008 return term;
41009 }
41010
41011 static ByteTerm AlternativeBegin()
41012 {
41013 ByteTerm term(TypeAlternativeBegin);
41014 term.alternative.next = 0;
41015 term.alternative.end = 0;
41016 term.alternative.onceThrough = false;
41017 return term;
41018 }
41019
41020 static ByteTerm AlternativeDisjunction()
41021 {
41022 ByteTerm term(TypeAlternativeDisjunction);
41023 term.alternative.next = 0;
41024 term.alternative.end = 0;
41025 term.alternative.onceThrough = false;
41026 return term;
41027 }
41028
41029 static ByteTerm AlternativeEnd()
41030 {
41031 ByteTerm term(TypeAlternativeEnd);
41032 term.alternative.next = 0;
41033 term.alternative.end = 0;
41034 term.alternative.onceThrough = false;
41035 return term;
41036 }
41037
41038 static ByteTerm SubpatternBegin()
41039 {
41040 return ByteTerm(TypeSubpatternBegin);
41041 }
41042
41043 static ByteTerm SubpatternEnd()
41044 {
41045 return ByteTerm(TypeSubpatternEnd);
41046 }
41047
41048 bool invert()
41049 {
41050 return m_invert;
41051 }
41052
41053 bool capture()
41054 {
41055 return m_capture;
41056 }
41057 };
41058
41059 class ByteDisjunction {
41060
41061 public:
41062 ByteDisjunction(unsigned numSubpatterns, unsigned frameSize)
41063 : m_numSubpatterns(numSubpatterns)
41064 , m_frameSize(frameSize)
41065 {
41066 }
41067
41068 Vector<ByteTerm> terms;
41069 unsigned m_numSubpatterns;
41070 unsigned m_frameSize;
41071 };
41072
41073 struct BytecodePattern {
41074
41075 public:
41076 BytecodePattern(PassOwnPtr<ByteDisjunction> body, const Vector<ByteDisjunction*> &allParenthesesInfo, YarrPattern& pattern, BumpPointerAllocator* allocator)
41077 : m_body(body)
41078 , m_ignoreCase(pattern.m_ignoreCase)
41079 , m_multiline(pattern.m_multiline)
41080 , m_allocator(allocator)
41081 {
41082 newlineCharacterClass = pattern.newlineCharacterClass();
41083 wordcharCharacterClass = pattern.wordcharCharacterClass();
41084
41085 m_allParenthesesInfo.append(allParenthesesInfo);
41086 m_userCharacterClasses.append(pattern.m_userCharacterClasses);
41087
41088
41089
41090 pattern.m_userCharacterClasses.clear();
41091 }
41092
41093 ~BytecodePattern()
41094 {
41095 deleteAllValues(m_allParenthesesInfo);
41096 deleteAllValues(m_userCharacterClasses);
41097 }
41098
41099 OwnPtr<ByteDisjunction> m_body;
41100 bool m_ignoreCase;
41101 bool m_multiline;
41102
41103
41104 BumpPointerAllocator* m_allocator;
41105
41106 CharacterClass* newlineCharacterClass;
41107 CharacterClass* wordcharCharacterClass;
41108
41109 private:
41110 Vector<ByteDisjunction*> m_allParenthesesInfo;
41111 Vector<CharacterClass*> m_userCharacterClasses;
41112 };
41113
41114 } }
41115 # 38 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/Yarr.h" 2
41116
41117
41118 namespace JSC { namespace Yarr {
41119
41120 #define YarrStackSpaceForBackTrackInfoPatternCharacter 1
41121 #define YarrStackSpaceForBackTrackInfoCharacterClass 1
41122 #define YarrStackSpaceForBackTrackInfoBackReference 2
41123 #define YarrStackSpaceForBackTrackInfoAlternative 1
41124 #define YarrStackSpaceForBackTrackInfoParentheticalAssertion 1
41125 #define YarrStackSpaceForBackTrackInfoParenthesesOnce 1
41126 #define YarrStackSpaceForBackTrackInfoParenthesesTerminal 1
41127 #define YarrStackSpaceForBackTrackInfoParentheses 2
41128
41129 static const unsigned quantifyInfinite = (2147483647 * 2U + 1U);
41130
41131
41132
41133 static const unsigned matchLimit = 1000000;
41134
41135 enum JSRegExpResult {
41136 JSRegExpMatch = 1,
41137 JSRegExpNoMatch = 0,
41138 JSRegExpErrorNoMatch = -1,
41139 JSRegExpErrorHitLimit = -2,
41140 JSRegExpErrorNoMemory = -3,
41141 JSRegExpErrorInternal = -4
41142 };
41143
41144 PassOwnPtr<BytecodePattern> byteCompile(YarrPattern&, BumpPointerAllocator*);
41145 int interpret(BytecodePattern*, const UChar* input, unsigned start, unsigned length, int* output);
41146
41147 } }
41148 # 20 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/RegExpObject.h" 2
41149
41150 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/YarrJIT.h" 1
41151 # 31 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/YarrJIT.h"
41152 #define YarrJIT_h
41153
41154
41155
41156
41157
41158 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/MacroAssembler.h" 1
41159 # 31 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/MacroAssembler.h"
41160 #define MacroAssembler_h
41161 # 42 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/MacroAssembler.h"
41162 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/MacroAssemblerARM.h" 1
41163 # 33 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/MacroAssemblerARM.h"
41164 #define MacroAssemblerARM_h
41165
41166
41167
41168
41169
41170 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/ARMAssembler.h" 1
41171 # 32 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/ARMAssembler.h"
41172 #define ARMAssembler_h
41173 # 41 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/ARMAssembler.h"
41174 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/AssemblerBufferWithConstantPool.h" 1
41175 # 32 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/AssemblerBufferWithConstantPool.h"
41176 #define AssemblerBufferWithConstantPool_h
41177
41178
41179
41180
41181
41182 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/AssemblerBuffer.h" 1
41183 # 31 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/AssemblerBuffer.h"
41184 #define AssemblerBuffer_h
41185
41186
41187
41188
41189
41190
41191
41192 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/wtf/Assertions.h" 1
41193 # 40 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/AssemblerBuffer.h" 2
41194
41195 namespace JSC {
41196
41197 class AssemblerBuffer {
41198 static const int inlineCapacity = 256;
41199 public:
41200 AssemblerBuffer()
41201 : m_buffer(m_inlineBuffer)
41202 , m_capacity(inlineCapacity)
41203 , m_size(0)
41204 , m_oom(false)
41205 {
41206 }
41207
41208 ~AssemblerBuffer()
41209 {
41210 if (m_buffer != m_inlineBuffer)
41211 free(m_buffer);
41212 }
41213
41214 void ensureSpace(int space)
41215 {
41216 if (m_size > m_capacity - space)
41217 grow();
41218 }
41219
41220 bool isAligned(int alignment) const
41221 {
41222 return !(m_size & (alignment - 1));
41223 }
41224
41225 void putByteUnchecked(int value)
41226 {
41227 do { } while(0);
41228 m_buffer[m_size] = char(value);
41229 m_size++;
41230 }
41231
41232 void putByte(int value)
41233 {
41234 if (m_size > m_capacity - 4)
41235 grow();
41236 putByteUnchecked(value);
41237 }
41238
41239 void putShortUnchecked(int value)
41240 {
41241 do { } while(0);
41242 *reinterpret_cast<short*>(&m_buffer[m_size]) = short(value);
41243 m_size += 2;
41244 }
41245
41246 void putShort(int value)
41247 {
41248 if (m_size > m_capacity - 4)
41249 grow();
41250 putShortUnchecked(value);
41251 }
41252
41253 void putIntUnchecked(int value)
41254 {
41255 do { } while(0);
41256 *reinterpret_cast<int*>(&m_buffer[m_size]) = value;
41257 m_size += 4;
41258 }
41259
41260 void putInt64Unchecked(int64_t value)
41261 {
41262 do { } while(0);
41263 *reinterpret_cast<int64_t*>(&m_buffer[m_size]) = value;
41264 m_size += 8;
41265 }
41266
41267 void putInt(int value)
41268 {
41269 if (m_size > m_capacity - 4)
41270 grow();
41271 putIntUnchecked(value);
41272 }
41273
41274 void* data() const
41275 {
41276 return m_buffer;
41277 }
41278
41279 int size() const
41280 {
41281 return m_size;
41282 }
41283
41284 bool oom() const
41285 {
41286 return m_oom;
41287 }
41288
41289
41290
41291
41292
41293 void* executableAllocAndCopy(ExecutableAllocator* allocator, ExecutablePool** poolp, CodeKind kind)
41294 {
41295 if (m_oom || m_size == 0) {
41296 *poolp = __null;
41297 return 0;
41298 }
41299
41300 void* result = allocator->alloc(m_size, poolp, kind);
41301 if (!result) {
41302 *poolp = __null;
41303 return 0;
41304 }
41305 do { } while(0);
41306
41307 ExecutableAllocator::makeWritable(result, m_size);
41308
41309 return memcpy(result, m_buffer, m_size);
41310 }
41311
41312 unsigned char *buffer() const {
41313 do { } while(0);
41314 return reinterpret_cast<unsigned char *>(m_buffer);
41315 }
41316
41317 protected:
41318 void append(const char* data, int size)
41319 {
41320 if (m_size > m_capacity - size)
41321 grow(size);
41322
41323
41324 if (m_oom)
41325 return;
41326 memcpy(m_buffer + m_size, data, size);
41327 m_size += size;
41328 }
41329 # 191 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/AssemblerBuffer.h"
41330 void grow(int extraCapacity = 0)
41331 {
41332
41333
41334
41335
41336 int newCapacity = m_capacity + m_capacity + extraCapacity;
41337 char* newBuffer;
41338
41339 if (m_buffer == m_inlineBuffer) {
41340 newBuffer = static_cast<char*>(malloc(newCapacity));
41341 if (!newBuffer) {
41342 m_size = 0;
41343 m_oom = true;
41344 return;
41345 }
41346 memcpy(newBuffer, m_buffer, m_size);
41347 } else {
41348 newBuffer = static_cast<char*>(realloc(m_buffer, newCapacity));
41349 if (!newBuffer) {
41350 m_size = 0;
41351 m_oom = true;
41352 return;
41353 }
41354 }
41355
41356 m_buffer = newBuffer;
41357 m_capacity = newCapacity;
41358 }
41359
41360 char m_inlineBuffer[inlineCapacity];
41361 char* m_buffer;
41362 int m_capacity;
41363 int m_size;
41364 bool m_oom;
41365 };
41366
41367 }
41368 # 39 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/AssemblerBufferWithConstantPool.h" 2
41369 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/wtf/SegmentedVector.h" 1
41370 # 30 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/wtf/SegmentedVector.h"
41371 #define SegmentedVector_h
41372
41373
41374
41375
41376 namespace WTF {
41377
41378
41379 template <typename T, size_t SegmentSize> class SegmentedVector;
41380 template <typename T, size_t SegmentSize> class SegmentedVectorIterator {
41381 private:
41382 friend class SegmentedVector<T, SegmentSize>;
41383 public:
41384 typedef SegmentedVectorIterator<T, SegmentSize> Iterator;
41385
41386 ~SegmentedVectorIterator() { }
41387
41388 T& operator*() const { return (*m_vector.m_segments[m_segment])[m_index]; }
41389 T* operator->() const { return &(*m_vector.m_segments[m_segment])[m_index]; }
41390
41391
41392 Iterator& operator++()
41393 {
41394 do { } while(0);
41395 ++m_index;
41396
41397 if (m_index >= m_vector.m_segments[m_segment]->length()) {
41398
41399 if (m_segment + 1 < m_vector.m_segments.length()) {
41400
41401 do { } while(0);
41402 ++m_segment;
41403 m_index = 0;
41404 } else {
41405
41406 m_segment = 0;
41407 m_index = SegmentSize;
41408 }
41409 }
41410 return *this;
41411 }
41412
41413 bool operator==(const Iterator& other) const
41414 {
41415 return (m_index == other.m_index && m_segment = other.m_segment && &m_vector == &other.m_vector);
41416 }
41417
41418 bool operator!=(const Iterator& other) const
41419 {
41420 return (m_index != other.m_index || m_segment != other.m_segment || &m_vector != &other.m_vector);
41421 }
41422
41423 SegmentedVectorIterator& operator=(const SegmentedVectorIterator<T, SegmentSize>& other)
41424 {
41425 m_vector = other.m_vector;
41426 m_segment = other.m_segment;
41427 m_index = other.m_index;
41428 return *this;
41429 }
41430
41431 private:
41432 SegmentedVectorIterator(SegmentedVector<T, SegmentSize>& vector, size_t segment, size_t index)
41433 : m_vector(vector)
41434 , m_segment(segment)
41435 , m_index(index)
41436 {
41437 }
41438
41439 SegmentedVector<T, SegmentSize>& m_vector;
41440 size_t m_segment;
41441 size_t m_index;
41442 };
41443
41444
41445
41446
41447 template <typename T, size_t SegmentSize> class SegmentedVector {
41448 friend class SegmentedVectorIterator<T, SegmentSize>;
41449 public:
41450 typedef SegmentedVectorIterator<T, SegmentSize> Iterator;
41451
41452 SegmentedVector()
41453 : m_size(0)
41454 {
41455 m_segments.append(&m_inlineSegment);
41456 }
41457
41458 ~SegmentedVector()
41459 {
41460 deleteAllSegments();
41461 }
41462
41463 size_t size() const { return m_size; }
41464 bool isEmpty() const { return !size(); }
41465
41466 T& at(size_t index)
41467 {
41468 if (index < SegmentSize)
41469 return m_inlineSegment[index];
41470 return segmentFor(index)->at(subscriptFor(index));
41471 }
41472
41473 T& operator[](size_t index)
41474 {
41475 return at(index);
41476 }
41477
41478 T& last()
41479 {
41480 return at(size() - 1);
41481 }
41482
41483 template <typename U> void append(const U& value)
41484 {
41485 ++m_size;
41486
41487 if (m_size <= SegmentSize) {
41488
41489 m_inlineSegment.append(value);
41490 return;
41491 }
41492
41493 if (!segmentExistsFor(m_size - 1))
41494 m_segments.append(new Segment);
41495
41496 segmentFor(m_size - 1)->append(value);
41497 }
41498
41499 T& alloc()
41500 {
41501 append<T>(T());
41502 return last();
41503 }
41504
41505 void removeLast()
41506 {
41507 if (m_size <= SegmentSize)
41508 m_inlineSegment.removeLast();
41509 else
41510 segmentFor(m_size - 1)->removeLast();
41511 --m_size;
41512 }
41513
41514 void grow(size_t size)
41515 {
41516 do { } while(0);
41517 ensureSegmentsFor(size);
41518 m_size = size;
41519 }
41520
41521 void clear()
41522 {
41523 deleteAllSegments();
41524 m_segments.resize(1);
41525 m_inlineSegment.clear();
41526 m_size = 0;
41527 }
41528
41529 Iterator begin()
41530 {
41531 return Iterator(*this, 0, m_size ? 0 : SegmentSize);
41532 }
41533
41534 Iterator end()
41535 {
41536 return Iterator(*this, 0, SegmentSize);
41537 }
41538
41539 private:
41540 typedef js::Vector<T, SegmentSize ,js::SystemAllocPolicy > Segment;
41541
41542 void deleteAllSegments()
41543 {
41544
41545
41546
41547 for (size_t i = 1; i < m_segments.length(); i++)
41548 delete m_segments[i];
41549 }
41550
41551 bool segmentExistsFor(size_t index)
41552 {
41553
41554 return index / SegmentSize < m_segments.length();
41555 }
41556
41557 Segment* segmentFor(size_t index)
41558 {
41559 return m_segments[index / SegmentSize];
41560 }
41561
41562 size_t subscriptFor(size_t index)
41563 {
41564 return index % SegmentSize;
41565 }
41566
41567 void ensureSegmentsFor(size_t size)
41568 {
41569 size_t segmentCount = m_size / SegmentSize;
41570 if (m_size % SegmentSize)
41571 ++segmentCount;
41572
41573 segmentCount = segmentCount > 1 ? segmentCount : 1;
41574
41575 size_t neededSegmentCount = size / SegmentSize;
41576 if (size % SegmentSize)
41577 ++neededSegmentCount;
41578
41579
41580 size_t end = neededSegmentCount - 1;
41581 for (size_t i = segmentCount - 1; i < end; ++i)
41582 ensureSegment(i, SegmentSize);
41583
41584
41585 ensureSegment(end, subscriptFor(size - 1) + 1);
41586 }
41587
41588 void ensureSegment(size_t segmentIndex, size_t size)
41589 {
41590 do { } while(0);
41591 if (segmentIndex == m_segments.size())
41592 m_segments.append(new Segment);
41593 m_segments[segmentIndex]->grow(size);
41594 }
41595
41596 size_t m_size;
41597 Segment m_inlineSegment;
41598 js::Vector<Segment*, 32 ,js::SystemAllocPolicy > m_segments;
41599 };
41600
41601 }
41602
41603 using WTF::SegmentedVector;
41604 # 40 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/AssemblerBufferWithConstantPool.h" 2
41605 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/wtf/Assertions.h" 1
41606 # 41 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/AssemblerBufferWithConstantPool.h" 2
41607
41608 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/methodjit/Logging.h" 1
41609 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/methodjit/Logging.h"
41610 #define jsjaeger_logging_h__
41611
41612
41613 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/prmjtime.h" 1
41614 # 13 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/methodjit/Logging.h" 2
41615
41616
41617
41618 namespace js {
41619
41620 #define JSPEW_CHAN_MAP(_) _(Abort) _(Scripts) _(Prof) _(JSOps) _(Insns) _(VMFrame) _(PICs) _(SlowCalls) _(Analysis) _(Regalloc) _(Inlining) _(Recompile)
41621 # 32 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/methodjit/Logging.h"
41622 enum JaegerSpewChannel {
41623 #define _(name) JSpew_ ##name,
41624 JSpew_Abort, JSpew_Scripts, JSpew_Prof, JSpew_JSOps, JSpew_Insns, JSpew_VMFrame, JSpew_PICs, JSpew_SlowCalls, JSpew_Analysis, JSpew_Regalloc, JSpew_Inlining, JSpew_Recompile,
41625 #undef _
41626 JSpew_Terminator
41627 };
41628 # 88 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/methodjit/Logging.h"
41629 static inline void JaegerSpew(JaegerSpewChannel channel, const char *fmt, ...)
41630 {
41631 }
41632
41633
41634
41635 }
41636 # 43 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/AssemblerBufferWithConstantPool.h" 2
41637
41638 #define ASSEMBLER_HAS_CONSTANT_POOL 1
41639
41640 namespace JSC {
41641 # 94 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/AssemblerBufferWithConstantPool.h"
41642 template <int maxPoolSize, int barrierSize, int maxInstructionSize, class AssemblerType>
41643 class AssemblerBufferWithConstantPool: public AssemblerBuffer {
41644 typedef SegmentedVector<uint32_t, 512> LoadOffsets;
41645 public:
41646 enum {
41647 UniqueConst,
41648 ReusableConst,
41649 UnusedEntry
41650 };
41651
41652 AssemblerBufferWithConstantPool()
41653 : AssemblerBuffer()
41654 , m_numConsts(0)
41655 , m_maxDistance(maxPoolSize)
41656 , m_lastConstDelta(0)
41657 , m_flushCount(0)
41658 {
41659 m_pool = static_cast<uint32_t*>(malloc(maxPoolSize));
41660 m_mask = static_cast<char*>(malloc(maxPoolSize / sizeof(uint32_t)));
41661 }
41662
41663 ~AssemblerBufferWithConstantPool()
41664 {
41665 free(m_mask);
41666 free(m_pool);
41667 }
41668
41669 void ensureSpace(int space)
41670 {
41671 flushIfNoSpaceFor(space);
41672 AssemblerBuffer::ensureSpace(space);
41673 }
41674
41675 void ensureSpace(int insnSpace, int constSpace)
41676 {
41677 flushIfNoSpaceFor(insnSpace, constSpace);
41678 AssemblerBuffer::ensureSpace(insnSpace);
41679 }
41680
41681 bool isAligned(int alignment)
41682 {
41683 flushIfNoSpaceFor(alignment);
41684 return AssemblerBuffer::isAligned(alignment);
41685 }
41686
41687 void putByteUnchecked(int value)
41688 {
41689 AssemblerBuffer::putByteUnchecked(value);
41690 correctDeltas(1);
41691 }
41692
41693 void putByte(int value)
41694 {
41695 flushIfNoSpaceFor(1);
41696 AssemblerBuffer::putByte(value);
41697 correctDeltas(1);
41698 }
41699
41700 void putShortUnchecked(int value)
41701 {
41702 AssemblerBuffer::putShortUnchecked(value);
41703 correctDeltas(2);
41704 }
41705
41706 void putShort(int value)
41707 {
41708 flushIfNoSpaceFor(2);
41709 AssemblerBuffer::putShort(value);
41710 correctDeltas(2);
41711 }
41712
41713 void putIntUnchecked(int value)
41714 {
41715 AssemblerBuffer::putIntUnchecked(value);
41716 correctDeltas(4);
41717 }
41718
41719 void putInt(int value)
41720 {
41721 flushIfNoSpaceFor(4);
41722 AssemblerBuffer::putInt(value);
41723 correctDeltas(4);
41724 }
41725
41726 void putInt64Unchecked(int64_t value)
41727 {
41728 AssemblerBuffer::putInt64Unchecked(value);
41729 correctDeltas(8);
41730 }
41731
41732 int size()
41733 {
41734 flushIfNoSpaceFor(maxInstructionSize, sizeof(uint64_t));
41735 return AssemblerBuffer::size();
41736 }
41737
41738 int uncheckedSize()
41739 {
41740 return AssemblerBuffer::size();
41741 }
41742
41743 void* executableAllocAndCopy(ExecutableAllocator* allocator, ExecutablePool** poolp, CodeKind kind)
41744 {
41745 flushConstantPool(false);
41746 return AssemblerBuffer::executableAllocAndCopy(allocator, poolp, kind);
41747 }
41748
41749 void putIntWithConstantInt(uint32_t insn, uint32_t constant, bool isReusable = false)
41750 {
41751 flushIfNoSpaceFor(4, 4);
41752
41753 m_loadOffsets.append(AssemblerBuffer::size());
41754 if (isReusable)
41755 for (int i = 0; i < m_numConsts; ++i) {
41756 if (m_mask[i] == ReusableConst && m_pool[i] == constant) {
41757 AssemblerBuffer::putInt(AssemblerType::patchConstantPoolLoad(insn, i));
41758 correctDeltas(4);
41759 return;
41760 }
41761 }
41762
41763 m_pool[m_numConsts] = constant;
41764 m_mask[m_numConsts] = static_cast<char>(isReusable ? ReusableConst : UniqueConst);
41765
41766 AssemblerBuffer::putInt(AssemblerType::patchConstantPoolLoad(insn, m_numConsts));
41767 ++m_numConsts;
41768
41769 correctDeltas(4, 4);
41770 }
41771
41772
41773 void flushWithoutBarrier(bool isForced = false)
41774 {
41775
41776 if (isForced || (5 * m_numConsts * sizeof(uint32_t)) > (3 * maxPoolSize))
41777 flushConstantPool(false);
41778 }
41779
41780 uint32_t* poolAddress()
41781 {
41782 return m_pool;
41783 }
41784
41785 int sizeOfConstantPool()
41786 {
41787 return m_numConsts;
41788 }
41789
41790 int flushCount()
41791 {
41792 return m_flushCount;
41793 }
41794
41795 private:
41796 void correctDeltas(int insnSize)
41797 {
41798 m_maxDistance -= insnSize;
41799 do { } while(0);
41800 m_lastConstDelta -= insnSize;
41801 if (m_lastConstDelta < 0)
41802 m_lastConstDelta = 0;
41803 }
41804
41805 void correctDeltas(int insnSize, int constSize)
41806 {
41807 correctDeltas(insnSize);
41808
41809 m_maxDistance -= m_lastConstDelta;
41810 do { } while(0);
41811 m_lastConstDelta = constSize;
41812 }
41813
41814 void flushConstantPool(bool useBarrier = true)
41815 {
41816 js::JaegerSpew(js::JSpew_Insns, " -- FLUSHING CONSTANT POOL WITH %d CONSTANTS --\n",
41817 m_numConsts);
41818 if (m_numConsts == 0)
41819 return;
41820 m_flushCount++;
41821 int alignPool = (AssemblerBuffer::size() + (useBarrier ? barrierSize : 0)) & (sizeof(uint64_t) - 1);
41822
41823 if (alignPool)
41824 alignPool = sizeof(uint64_t) - alignPool;
41825
41826
41827 if (useBarrier)
41828 AssemblerBuffer::putInt(AssemblerType::placeConstantPoolBarrier(m_numConsts * sizeof(uint32_t) + alignPool));
41829
41830 if (alignPool) {
41831 if (alignPool & 1)
41832 AssemblerBuffer::putByte(AssemblerType::padForAlign8);
41833 if (alignPool & 2)
41834 AssemblerBuffer::putShort(AssemblerType::padForAlign16);
41835 if (alignPool & 4)
41836 AssemblerBuffer::putInt(AssemblerType::padForAlign32);
41837 }
41838
41839 int constPoolOffset = AssemblerBuffer::size();
41840 append(reinterpret_cast<char*>(m_pool), m_numConsts * sizeof(uint32_t));
41841
41842
41843 for (LoadOffsets::Iterator iter = m_loadOffsets.begin(); iter != m_loadOffsets.end(); ++iter) {
41844 void* loadAddr = reinterpret_cast<void*>(m_buffer + *iter);
41845 AssemblerType::patchConstantPoolLoad(loadAddr, reinterpret_cast<void*>(m_buffer + constPoolOffset));
41846 }
41847
41848 m_loadOffsets.clear();
41849 m_numConsts = 0;
41850 m_maxDistance = maxPoolSize;
41851 do { } while(0);
41852
41853 }
41854
41855 void flushIfNoSpaceFor(int nextInsnSize)
41856 {
41857 if (m_numConsts == 0) {
41858 m_maxDistance = maxPoolSize;
41859 return;
41860 }
41861 int lastConstDelta = m_lastConstDelta > nextInsnSize ? m_lastConstDelta - nextInsnSize : 0;
41862 if ((m_maxDistance < nextInsnSize + lastConstDelta + barrierSize + (int)sizeof(uint32_t)))
41863 flushConstantPool();
41864 }
41865
41866 void flushIfNoSpaceFor(int nextInsnSize, int nextConstSize)
41867 {
41868 if (m_numConsts == 0) {
41869 m_maxDistance = maxPoolSize;
41870 return;
41871 }
41872 if ((m_maxDistance < nextInsnSize + m_lastConstDelta + nextConstSize + barrierSize + (int)sizeof(uint32_t)) ||
41873 (m_numConsts * sizeof(uint32_t) + nextConstSize >= maxPoolSize))
41874 flushConstantPool();
41875 }
41876
41877 uint32_t* m_pool;
41878 char* m_mask;
41879 LoadOffsets m_loadOffsets;
41880
41881 int m_numConsts;
41882 int m_maxDistance;
41883 int m_lastConstDelta;
41884 int m_flushCount;
41885 };
41886
41887 }
41888 # 42 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/ARMAssembler.h" 2
41889 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/wtf/Assertions.h" 1
41890 # 43 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/ARMAssembler.h" 2
41891
41892
41893 #define IPFX " %s"
41894 #define ISPFX " "
41895 # 57 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/ARMAssembler.h"
41896 #define MAYBE_PAD ""
41897 #define FIXME_INSN_PRINTING ((void) 0)
41898
41899
41900
41901
41902
41903 namespace JSC {
41904
41905 typedef uint32_t ARMWord;
41906
41907 namespace ARMRegisters {
41908 typedef enum {
41909 r0 = 0,
41910 r1,
41911 r2,
41912 r3,
41913 S0 = r3,
41914 r4,
41915 r5,
41916 r6,
41917 r7,
41918 r8,
41919 S1 = r8,
41920 r9,
41921 r10,
41922 r11,
41923 r12,
41924 ip = r12,
41925 r13,
41926 sp = r13,
41927 r14,
41928 lr = r14,
41929 r15,
41930 pc = r15
41931 } RegisterID;
41932
41933 typedef enum {
41934 d0,
41935 d1,
41936 d2,
41937 d3,
41938 SD0 = d3,
41939 d4,
41940 d5,
41941 d6,
41942 d7,
41943 d8,
41944 d9,
41945 d10,
41946 d11,
41947 d12,
41948 d13,
41949 d14,
41950 d15,
41951 d16,
41952 d17,
41953 d18,
41954 d19,
41955 d20,
41956 d21,
41957 d22,
41958 d23,
41959 d24,
41960 d25,
41961 d26,
41962 d27,
41963 d28,
41964 d29,
41965 d30,
41966 d31
41967 } FPRegisterID;
41968
41969 inline FPRegisterID floatShadow(FPRegisterID s)
41970 {
41971 return (FPRegisterID)(s*2);
41972 }
41973 inline FPRegisterID doubleShadow(FPRegisterID d)
41974 {
41975 return (FPRegisterID)(d / 2);
41976 }
41977 }
41978
41979 class ARMAssembler {
41980 public:
41981
41982
41983
41984
41985
41986
41987 ARMAssembler() { }
41988
41989
41990 typedef ARMRegisters::RegisterID RegisterID;
41991 typedef ARMRegisters::FPRegisterID FPRegisterID;
41992 typedef AssemblerBufferWithConstantPool<2048, 4, 4, ARMAssembler> ARMBuffer;
41993 typedef SegmentedVector<int, 64> Jumps;
41994
41995 unsigned char *buffer() const { return m_buffer.buffer(); }
41996 bool oom() const { return m_buffer.oom(); }
41997
41998
41999 typedef enum {
42000 EQ = 0x00000000,
42001 NE = 0x10000000,
42002 CS = 0x20000000,
42003 CC = 0x30000000,
42004 MI = 0x40000000,
42005 PL = 0x50000000,
42006 VS = 0x60000000,
42007 VC = 0x70000000,
42008 HI = 0x80000000,
42009 LS = 0x90000000,
42010 GE = 0xa0000000,
42011 LT = 0xb0000000,
42012 GT = 0xc0000000,
42013 LE = 0xd0000000,
42014 AL = 0xe0000000
42015 } Condition;
42016
42017
42018 enum {
42019 AND = (0x0 << 21),
42020 EOR = (0x1 << 21),
42021 SUB = (0x2 << 21),
42022 RSB = (0x3 << 21),
42023 ADD = (0x4 << 21),
42024 ADC = (0x5 << 21),
42025 SBC = (0x6 << 21),
42026 RSC = (0x7 << 21),
42027 TST = (0x8 << 21),
42028 TEQ = (0x9 << 21),
42029 CMP = (0xa << 21),
42030 CMN = (0xb << 21),
42031 ORR = (0xc << 21),
42032 MOV = (0xd << 21),
42033 BIC = (0xe << 21),
42034 MVN = (0xf << 21),
42035 MUL = 0x00000090,
42036 MULL = 0x00c00090,
42037 FCPYD = 0x0eb00b40,
42038 FADDD = 0x0e300b00,
42039 FNEGD = 0x0eb10b40,
42040 FABSD = 0x0eb00bc0,
42041 FDIVD = 0x0e800b00,
42042 FSUBD = 0x0e300b40,
42043 FMULD = 0x0e200b00,
42044 FCMPD = 0x0eb40b40,
42045 FSQRTD = 0x0eb10bc0,
42046 DTR = 0x05000000,
42047 LDRH = 0x00100090,
42048 STRH = 0x00000090,
42049 DTRH = 0x00000090,
42050 STMDB = 0x09200000,
42051 LDMIA = 0x08b00000,
42052 B = 0x0a000000,
42053 BL = 0x0b000000
42054
42055 ,BX = 0x012fff10
42056
42057
42058 ,CLZ = 0x016f0f10,
42059 BKPT = 0xe1200070,
42060 BLX = 0x012fff30
42061
42062
42063 ,MOVW = 0x03000000,
42064 MOVT = 0x03400000
42065
42066 };
42067
42068 enum {
42069 OP2_IMM = (1 << 25),
42070 OP2_IMMh = (1 << 22),
42071 OP2_INV_IMM = (1 << 26),
42072 SET_CC = (1 << 20),
42073 OP2_OFSREG = (1 << 25),
42074 DT_UP = (1 << 23),
42075 DT_BYTE = (1 << 22),
42076 DT_WB = (1 << 21),
42077
42078 DT_PRE = (1 << 24),
42079
42080 HDT_UH = (1 << 5),
42081
42082 HDT_IMM = (1 << 22),
42083
42084 HDT_S = (1 << 6),
42085 DT_LOAD = (1 << 20)
42086 };
42087
42088
42089 enum {
42090 BRANCH_MASK = 0x00ffffff,
42091 NONARM = 0xf0000000,
42092 SDT_MASK = 0x0c000000,
42093 SDT_OFFSET_MASK = 0xfff
42094 };
42095
42096 enum {
42097 BOFFSET_MIN = -0x00800000,
42098 BOFFSET_MAX = 0x007fffff,
42099 SDT = 0x04000000
42100 };
42101
42102 enum {
42103 padForAlign8 = (int)0x00,
42104 padForAlign16 = (int)0x0000,
42105 padForAlign32 = (int)0xe12fff7f
42106 };
42107
42108 typedef enum {
42109 LSL = 0,
42110 LSR = 1,
42111 ASR = 2,
42112 ROR = 3
42113 } Shift;
42114
42115 static const ARMWord INVALID_IMM = 0xf0000000;
42116 static const ARMWord InvalidBranchTarget = 0xffffffff;
42117 static const int DefaultPrefetching = 2;
42118
42119 class JmpSrc {
42120 friend class ARMAssembler;
42121 public:
42122 JmpSrc()
42123 : m_offset(-1)
42124 {
42125 }
42126
42127 private:
42128 JmpSrc(int offset)
42129 : m_offset(offset)
42130 {
42131 }
42132
42133 int m_offset;
42134 };
42135
42136 class JmpDst {
42137 friend class ARMAssembler;
42138 public:
42139 JmpDst()
42140 : m_offset(-1)
42141 , m_used(false)
42142 {
42143 }
42144
42145 bool isUsed() const { return m_used; }
42146 void used() { m_used = true; }
42147 bool isValid() const { return m_offset != -1; }
42148 private:
42149 JmpDst(int offset)
42150 : m_offset(offset)
42151 , m_used(false)
42152 {
42153 do { } while(0);
42154 }
42155
42156 int m_offset : 31;
42157 bool m_used : 1;
42158 };
42159
42160
42161
42162 void emitInst(ARMWord op, int rd, int rn, ARMWord op2)
42163 {
42164 do { } while(0);
42165 m_buffer.putInt(op | RN(rn) | RD(rd) | op2);
42166 }
42167
42168
42169
42170
42171
42172
42173 ARMWord getOp2RotLSL(int lsl)
42174 {
42175 do { } while(0);
42176 do { } while(0);
42177
42178 return (-(lsl/2) & 0xf) << 8;
42179 }
42180
42181 void and_r(int rd, int rn, ARMWord op2, Condition cc = AL)
42182 {
42183 spewInsWithOp2("and", cc, rd, rn, op2);
42184 emitInst(static_cast<ARMWord>(cc) | AND, rd, rn, op2);
42185 }
42186
42187 void ands_r(int rd, int rn, ARMWord op2, Condition cc = AL)
42188 {
42189 spewInsWithOp2("ands", cc, rd, rn, op2);
42190 emitInst(static_cast<ARMWord>(cc) | AND | SET_CC, rd, rn, op2);
42191 }
42192
42193 void eor_r(int rd, int rn, ARMWord op2, Condition cc = AL)
42194 {
42195 spewInsWithOp2("eor", cc, rd, rn, op2);
42196 emitInst(static_cast<ARMWord>(cc) | EOR, rd, rn, op2);
42197 }
42198
42199 void eors_r(int rd, int rn, ARMWord op2, Condition cc = AL)
42200 {
42201 spewInsWithOp2("eors", cc, rd, rn, op2);
42202 emitInst(static_cast<ARMWord>(cc) | EOR | SET_CC, rd, rn, op2);
42203 }
42204
42205 void sub_r(int rd, int rn, ARMWord op2, Condition cc = AL)
42206 {
42207 spewInsWithOp2("sub", cc, rd, rn, op2);
42208 emitInst(static_cast<ARMWord>(cc) | SUB, rd, rn, op2);
42209 }
42210
42211 void subs_r(int rd, int rn, ARMWord op2, Condition cc = AL)
42212 {
42213 spewInsWithOp2("subs", cc, rd, rn, op2);
42214 emitInst(static_cast<ARMWord>(cc) | SUB | SET_CC, rd, rn, op2);
42215 }
42216
42217 void rsb_r(int rd, int rn, ARMWord op2, Condition cc = AL)
42218 {
42219 spewInsWithOp2("rsb", cc, rd, rn, op2);
42220 emitInst(static_cast<ARMWord>(cc) | RSB, rd, rn, op2);
42221 }
42222
42223 void rsbs_r(int rd, int rn, ARMWord op2, Condition cc = AL)
42224 {
42225 spewInsWithOp2("rsbs", cc, rd, rn, op2);
42226 emitInst(static_cast<ARMWord>(cc) | RSB | SET_CC, rd, rn, op2);
42227 }
42228
42229 void add_r(int rd, int rn, ARMWord op2, Condition cc = AL)
42230 {
42231 spewInsWithOp2("add", cc, rd, rn, op2);
42232 emitInst(static_cast<ARMWord>(cc) | ADD, rd, rn, op2);
42233 }
42234
42235 void adds_r(int rd, int rn, ARMWord op2, Condition cc = AL)
42236 {
42237 spewInsWithOp2("adds", cc, rd, rn, op2);
42238 emitInst(static_cast<ARMWord>(cc) | ADD | SET_CC, rd, rn, op2);
42239 }
42240
42241 void adc_r(int rd, int rn, ARMWord op2, Condition cc = AL)
42242 {
42243 spewInsWithOp2("adc", cc, rd, rn, op2);
42244 emitInst(static_cast<ARMWord>(cc) | ADC, rd, rn, op2);
42245 }
42246
42247 void adcs_r(int rd, int rn, ARMWord op2, Condition cc = AL)
42248 {
42249 spewInsWithOp2("adcs", cc, rd, rn, op2);
42250 emitInst(static_cast<ARMWord>(cc) | ADC | SET_CC, rd, rn, op2);
42251 }
42252
42253 void sbc_r(int rd, int rn, ARMWord op2, Condition cc = AL)
42254 {
42255 spewInsWithOp2("sbc", cc, rd, rn, op2);
42256 emitInst(static_cast<ARMWord>(cc) | SBC, rd, rn, op2);
42257 }
42258
42259 void sbcs_r(int rd, int rn, ARMWord op2, Condition cc = AL)
42260 {
42261 spewInsWithOp2("sbcs", cc, rd, rn, op2);
42262 emitInst(static_cast<ARMWord>(cc) | SBC | SET_CC, rd, rn, op2);
42263 }
42264
42265 void rsc_r(int rd, int rn, ARMWord op2, Condition cc = AL)
42266 {
42267 spewInsWithOp2("rsc", cc, rd, rn, op2);
42268 emitInst(static_cast<ARMWord>(cc) | RSC, rd, rn, op2);
42269 }
42270
42271 void rscs_r(int rd, int rn, ARMWord op2, Condition cc = AL)
42272 {
42273 spewInsWithOp2("rscs", cc, rd, rn, op2);
42274 emitInst(static_cast<ARMWord>(cc) | RSC | SET_CC, rd, rn, op2);
42275 }
42276
42277 void tst_r(int rn, ARMWord op2, Condition cc = AL)
42278 {
42279 spewInsWithOp2("tst", cc, rn, op2);
42280 emitInst(static_cast<ARMWord>(cc) | TST | SET_CC, 0, rn, op2);
42281 }
42282
42283 void teq_r(int rn, ARMWord op2, Condition cc = AL)
42284 {
42285 spewInsWithOp2("teq", cc, rn, op2);
42286 emitInst(static_cast<ARMWord>(cc) | TEQ | SET_CC, 0, rn, op2);
42287 }
42288
42289 void cmp_r(int rn, ARMWord op2, Condition cc = AL)
42290 {
42291 spewInsWithOp2("cmp", cc, rn, op2);
42292 emitInst(static_cast<ARMWord>(cc) | CMP | SET_CC, 0, rn, op2);
42293 }
42294
42295 void cmn_r(int rn, ARMWord op2, Condition cc = AL)
42296 {
42297 spewInsWithOp2("cmn", cc, rn, op2);
42298 emitInst(static_cast<ARMWord>(cc) | CMN | SET_CC, 0, rn, op2);
42299 }
42300
42301 void orr_r(int rd, int rn, ARMWord op2, Condition cc = AL)
42302 {
42303 spewInsWithOp2("orr", cc, rd, rn, op2);
42304 emitInst(static_cast<ARMWord>(cc) | ORR, rd, rn, op2);
42305 }
42306
42307 void orrs_r(int rd, int rn, ARMWord op2, Condition cc = AL)
42308 {
42309 spewInsWithOp2("orrs", cc, rd, rn, op2);
42310 emitInst(static_cast<ARMWord>(cc) | ORR | SET_CC, rd, rn, op2);
42311 }
42312
42313 void mov_r(int rd, ARMWord op2, Condition cc = AL)
42314 {
42315 spewInsWithOp2("mov", cc, rd, op2);
42316 emitInst(static_cast<ARMWord>(cc) | MOV, rd, ARMRegisters::r0, op2);
42317 }
42318
42319
42320 void movw_r(int rd, ARMWord op2, Condition cc = AL)
42321 {
42322 do { } while(0);
42323 js::JaegerSpew(js::JSpew_Insns,
42324 " %s" "%-15s %s, 0x%04x\n", "", "movw", nameGpReg(rd), (op2 & 0xfff) | ((op2 >> 4) & 0xf000));
42325 m_buffer.putInt(static_cast<ARMWord>(cc) | MOVW | RD(rd) | op2);
42326 }
42327
42328 void movt_r(int rd, ARMWord op2, Condition cc = AL)
42329 {
42330 do { } while(0);
42331 js::JaegerSpew(js::JSpew_Insns,
42332 " %s" "%-15s %s, 0x%04x\n", "", "movt", nameGpReg(rd), (op2 & 0xfff) | ((op2 >> 4) & 0xf000));
42333 m_buffer.putInt(static_cast<ARMWord>(cc) | MOVT | RD(rd) | op2);
42334 }
42335
42336
42337 void movs_r(int rd, ARMWord op2, Condition cc = AL)
42338 {
42339 spewInsWithOp2("movs", cc, rd, op2);
42340 emitInst(static_cast<ARMWord>(cc) | MOV | SET_CC, rd, ARMRegisters::r0, op2);
42341 }
42342
42343 void bic_r(int rd, int rn, ARMWord op2, Condition cc = AL)
42344 {
42345 spewInsWithOp2("bic", cc, rd, rn, op2);
42346 emitInst(static_cast<ARMWord>(cc) | BIC, rd, rn, op2);
42347 }
42348
42349 void bics_r(int rd, int rn, ARMWord op2, Condition cc = AL)
42350 {
42351 spewInsWithOp2("bics", cc, rd, rn, op2);
42352 emitInst(static_cast<ARMWord>(cc) | BIC | SET_CC, rd, rn, op2);
42353 }
42354
42355 void mvn_r(int rd, ARMWord op2, Condition cc = AL)
42356 {
42357 spewInsWithOp2("mvn", cc, rd, op2);
42358 emitInst(static_cast<ARMWord>(cc) | MVN, rd, ARMRegisters::r0, op2);
42359 }
42360
42361 void mvns_r(int rd, ARMWord op2, Condition cc = AL)
42362 {
42363 spewInsWithOp2("mvns", cc, rd, op2);
42364 emitInst(static_cast<ARMWord>(cc) | MVN | SET_CC, rd, ARMRegisters::r0, op2);
42365 }
42366
42367 void mul_r(int rd, int rn, int rm, Condition cc = AL)
42368 {
42369 spewInsWithOp2("mul", cc, rd, rn, static_cast<ARMWord>(rm));
42370 m_buffer.putInt(static_cast<ARMWord>(cc) | MUL | RN(rd) | RS(rn) | RM(rm));
42371 }
42372
42373 void muls_r(int rd, int rn, int rm, Condition cc = AL)
42374 {
42375 spewInsWithOp2("muls", cc, rd, rn, static_cast<ARMWord>(rm));
42376 m_buffer.putInt(static_cast<ARMWord>(cc) | MUL | SET_CC | RN(rd) | RS(rn) | RM(rm));
42377 }
42378
42379 void mull_r(int rdhi, int rdlo, int rn, int rm, Condition cc = AL)
42380 {
42381 js::JaegerSpew(js::JSpew_Insns,
42382 " %s" "%-15s %s, %s, %s, %s\n", "", "mull", nameGpReg(rdlo), nameGpReg(rdhi), nameGpReg(rn), nameGpReg(rm));
42383 m_buffer.putInt(static_cast<ARMWord>(cc) | MULL | RN(rdhi) | RD(rdlo) | RS(rn) | RM(rm));
42384 }
42385
42386
42387 void ldr_imm(int rd, ARMWord imm, Condition cc = AL)
42388 {
42389 char mnemonic[16];
42390 snprintf(mnemonic, 16, "ldr%s", nameCC(cc));
42391 js::JaegerSpew(js::JSpew_Insns,
42392 " %s" "%-15s %s, =0x%x @ (%d) (reusable pool entry)\n", "", mnemonic, nameGpReg(rd), imm, static_cast<int32_t>(imm));
42393 m_buffer.putIntWithConstantInt(static_cast<ARMWord>(cc) | DTR | DT_LOAD | DT_UP | RN(ARMRegisters::pc) | RD(rd), imm, true);
42394 }
42395
42396 void ldr_un_imm(int rd, ARMWord imm, Condition cc = AL)
42397 {
42398 char mnemonic[16];
42399 snprintf(mnemonic, 16, "ldr%s", nameCC(cc));
42400 js::JaegerSpew(js::JSpew_Insns,
42401 " %s" "%-15s %s, =0x%x @ (%d)\n", "", mnemonic, nameGpReg(rd), imm, static_cast<int32_t>(imm));
42402 m_buffer.putIntWithConstantInt(static_cast<ARMWord>(cc) | DTR | DT_LOAD | DT_UP | RN(ARMRegisters::pc) | RD(rd), imm);
42403 }
42404
42405 void mem_imm_off(bool isLoad, bool isSigned, int size, bool posOffset,
42406 int rd, int rb, ARMWord offset, Condition cc = AL)
42407 {
42408 do { } while(0);
42409 char const * mnemonic_act = (isLoad) ? ("ld") : ("st");
42410 char const * mnemonic_sign = (isSigned) ? ("s") : ("");
42411
42412 char const * mnemonic_size = __null;
42413 switch (size / 8) {
42414 case 1:
42415 mnemonic_size = "b";
42416 break;
42417 case 2:
42418 mnemonic_size = "h";
42419 break;
42420 case 4:
42421 mnemonic_size = "";
42422 break;
42423 }
42424 char const * off_sign = (posOffset) ? ("+") : ("-");
42425 js::JaegerSpew(js::JSpew_Insns,
42426 " %s" "%sr%s%s %s, [%s, #%s%u]\n",
42427 "", mnemonic_act, mnemonic_sign, mnemonic_size,
42428 nameGpReg(rd), nameGpReg(rb), off_sign, offset);
42429 if (size == 32 || (size == 8 && !isSigned)) {
42430
42431 emitInst(static_cast<ARMWord>(cc) | DTR |
42432 (isLoad ? DT_LOAD : 0) |
42433 (size == 8 ? DT_BYTE : 0) |
42434 (posOffset ? DT_UP : 0), rd, rb, offset);
42435 } else {
42436
42437 emitInst(static_cast<ARMWord>(cc) | DTRH | HDT_IMM | DT_PRE |
42438 (isLoad ? DT_LOAD : 0) |
42439 (size == 16 ? HDT_UH : 0) |
42440 (isSigned ? HDT_S : 0) |
42441 (posOffset ? DT_UP : 0), rd, rb, offset);
42442 }
42443 }
42444
42445 void mem_reg_off(bool isLoad, bool isSigned, int size, bool posOffset, int rd, int rb, int rm, Condition cc = AL)
42446 {
42447 char const * mnemonic_act = (isLoad) ? ("ld") : ("st");
42448 char const * mnemonic_sign = (isSigned) ? ("s") : ("");
42449
42450 char const * mnemonic_size = __null;
42451 switch (size / 8) {
42452 case 1:
42453 mnemonic_size = "b";
42454 break;
42455 case 2:
42456 mnemonic_size = "h";
42457 break;
42458 case 4:
42459 mnemonic_size = "";
42460 break;
42461 }
42462 char const * off_sign = (posOffset) ? ("+") : ("-");
42463 js::JaegerSpew(js::JSpew_Insns,
42464 " %s" "%sr%s%s %s, [%s, #%s%s]\n", "", mnemonic_act, mnemonic_sign, mnemonic_size,
42465 nameGpReg(rd), nameGpReg(rb), off_sign, nameGpReg(rm));
42466 if (size == 32 || (size == 8 && !isSigned)) {
42467
42468 emitInst(static_cast<ARMWord>(cc) | DTR |
42469 (isLoad ? DT_LOAD : 0) |
42470 (size == 8 ? DT_BYTE : 0) |
42471 (posOffset ? DT_UP : 0) |
42472 OP2_OFSREG, rd, rb, rm);
42473 } else {
42474
42475 emitInst(static_cast<ARMWord>(cc) | DTRH | DT_PRE |
42476 (isLoad ? DT_LOAD : 0) |
42477 (size == 16 ? HDT_UH : 0) |
42478 (isSigned ? HDT_S : 0) |
42479 (posOffset ? DT_UP : 0), rd, rb, rm);
42480 }
42481 }
42482
42483
42484
42485
42486 void dtr_u(bool isLoad, int rd, int rb, ARMWord offset, Condition cc = AL)
42487 {
42488 char const * mnemonic = (isLoad) ? ("ldr") : ("str");
42489 js::JaegerSpew(js::JSpew_Insns,
42490 " %s" "%-15s %s, [%s, #+%u]\n", "", mnemonic, nameGpReg(rd), nameGpReg(rb), offset);
42491 emitInst(static_cast<ARMWord>(cc) | DTR | (isLoad ? DT_LOAD : 0) | DT_UP, rd, rb, offset);
42492 }
42493
42494
42495
42496
42497 void dtr_ur(bool isLoad, int rd, int rb, int rm, Condition cc = AL)
42498 {
42499 char const * mnemonic = (isLoad) ? ("ldr") : ("str");
42500 js::JaegerSpew(js::JSpew_Insns,
42501 " %s" "%-15s %s, [%s, +%s]\n", "", mnemonic, nameGpReg(rd), nameGpReg(rb), nameGpReg(rm));
42502 emitInst(static_cast<ARMWord>(cc) | DTR | (isLoad ? DT_LOAD : 0) | DT_UP | OP2_OFSREG, rd, rb, rm);
42503 }
42504
42505
42506
42507
42508 void dtr_d(bool isLoad, int rd, int rb, ARMWord offset, Condition cc = AL)
42509 {
42510 char const * mnemonic = (isLoad) ? ("ldr") : ("str");
42511 js::JaegerSpew(js::JSpew_Insns,
42512 " %s" "%-15s %s, [%s, #-%u]\n", "", mnemonic, nameGpReg(rd), nameGpReg(rb), offset);
42513 emitInst(static_cast<ARMWord>(cc) | DTR | (isLoad ? DT_LOAD : 0), rd, rb, offset);
42514 }
42515
42516
42517
42518
42519 void dtr_dr(bool isLoad, int rd, int rb, int rm, Condition cc = AL)
42520 {
42521 char const * mnemonic = (isLoad) ? ("ldr") : ("str");
42522 js::JaegerSpew(js::JSpew_Insns,
42523 " %s" "%-15s %s, [%s, -%s]\n", "", mnemonic, nameGpReg(rd), nameGpReg(rb), nameGpReg(rm));
42524 emitInst(static_cast<ARMWord>(cc) | DTR | (isLoad ? DT_LOAD : 0) | OP2_OFSREG, rd, rb, rm);
42525 }
42526
42527
42528
42529
42530 void dtrb_u(bool isLoad, int rd, int rb, ARMWord offset, Condition cc = AL)
42531 {
42532 char const * mnemonic = (isLoad) ? ("ldrb") : ("strb");
42533 js::JaegerSpew(js::JSpew_Insns,
42534 " %s" "%-15s %s, [%s, #+%u]\n", "", mnemonic, nameGpReg(rd), nameGpReg(rb), offset);
42535 emitInst(static_cast<ARMWord>(cc) | DTR | DT_BYTE | (isLoad ? DT_LOAD : 0) | DT_UP, rd, rb, offset);
42536 }
42537
42538
42539
42540
42541 void dtrsb_u(bool isLoad, int rd, int rb, ARMWord offset, Condition cc = AL)
42542 {
42543 char const * mnemonic = (isLoad) ? ("ldrsb") : ("strb");
42544 js::JaegerSpew(js::JSpew_Insns,
42545 " %s" "%-15s %s, [%s, #+%u]\n", "", mnemonic, nameGpReg(rd), nameGpReg(rb), offset);
42546 emitInst(static_cast<ARMWord>(cc) | DTRH | HDT_S | (isLoad ? DT_LOAD : 0) | DT_UP, rd, rb, offset);
42547 }
42548
42549
42550
42551
42552 void dtrb_ur(bool isLoad, int rd, int rb, int rm, Condition cc = AL)
42553 {
42554 char const * mnemonic = (isLoad) ? ("ldrb") : ("strb");
42555 js::JaegerSpew(js::JSpew_Insns,
42556 " %s" "%-15s %s, [%s, +%s]\n", "", mnemonic, nameGpReg(rd), nameGpReg(rb), nameGpReg(rm));
42557 emitInst(static_cast<ARMWord>(cc) | DTR | DT_BYTE | (isLoad ? DT_LOAD : 0) | DT_UP | OP2_OFSREG, rd, rb, rm);
42558 }
42559
42560
42561
42562
42563 void dtrb_d(bool isLoad, int rd, int rb, ARMWord offset, Condition cc = AL)
42564 {
42565 char const * mnemonic = (isLoad) ? ("ldrb") : ("strb");
42566 js::JaegerSpew(js::JSpew_Insns,
42567 " %s" "%-15s %s, [%s, #-%u]\n", "", mnemonic, nameGpReg(rd), nameGpReg(rb), offset);
42568 emitInst(static_cast<ARMWord>(cc) | DTR | DT_BYTE | (isLoad ? DT_LOAD : 0), rd, rb, offset);
42569 }
42570
42571
42572
42573
42574 void dtrsb_d(bool isLoad, int rd, int rb, ARMWord offset, Condition cc = AL)
42575 {
42576 do { } while(0);
42577 char const * mnemonic = (isLoad) ? ("ldrsb") : ("strb");
42578 js::JaegerSpew(js::JSpew_Insns,
42579 " %s" "%-15s %s, [%s, #-%u]\n", "", mnemonic, nameGpReg(rd), nameGpReg(rb), offset);
42580 emitInst(static_cast<ARMWord>(cc) | DTRH | HDT_S | (isLoad ? DT_LOAD : 0), rd, rb, offset);
42581 }
42582
42583
42584
42585
42586 void dtrb_dr(bool isLoad, int rd, int rb, int rm, Condition cc = AL)
42587 {
42588 char const * mnemonic = (isLoad) ? ("ldrb") : ("strb");
42589 js::JaegerSpew(js::JSpew_Insns,
42590 " %s" "%-15s %s, [%s, -%s]\n", "", mnemonic, nameGpReg(rd), nameGpReg(rb), nameGpReg(rm));
42591 emitInst(static_cast<ARMWord>(cc) | DTR | DT_BYTE | (isLoad ? DT_LOAD : 0) | OP2_OFSREG, rd, rb, rm);
42592 }
42593
42594 void ldrh_r(int rd, int rb, int rm, Condition cc = AL)
42595 {
42596 js::JaegerSpew(js::JSpew_Insns,
42597 " %s" "%-15s %s, [%s, +%s]\n", "", "ldrh", nameGpReg(rd), nameGpReg(rb), nameGpReg(rm));
42598 emitInst(static_cast<ARMWord>(cc) | LDRH | HDT_UH | DT_UP | DT_PRE, rd, rb, rm);
42599 }
42600
42601 void ldrh_d(int rd, int rb, ARMWord offset, Condition cc = AL)
42602 {
42603 js::JaegerSpew(js::JSpew_Insns,
42604 " %s" "%-15s %s, [%s, #-%u]\n", "", "ldrh", nameGpReg(rd), nameGpReg(rb), offset);
42605 emitInst(static_cast<ARMWord>(cc) | LDRH | HDT_UH | DT_PRE, rd, rb, offset);
42606 }
42607
42608 void ldrh_u(int rd, int rb, ARMWord offset, Condition cc = AL)
42609 {
42610 js::JaegerSpew(js::JSpew_Insns,
42611 " %s" "%-15s %s, [%s, #+%u]\n", "", "ldrh", nameGpReg(rd), nameGpReg(rb), offset);
42612 emitInst(static_cast<ARMWord>(cc) | LDRH | HDT_UH | DT_UP | DT_PRE, rd, rb, offset);
42613 }
42614
42615 void ldrsh_d(int rd, int rb, ARMWord offset, Condition cc = AL)
42616 {
42617 js::JaegerSpew(js::JSpew_Insns,
42618 " %s" "%-15s %s, [%s, #-%u]\n", "", "ldrsh", nameGpReg(rd), nameGpReg(rb), offset);
42619 emitInst(static_cast<ARMWord>(cc) | LDRH | HDT_UH | HDT_S | DT_PRE, rd, rb, offset);
42620 }
42621
42622 void ldrsh_u(int rd, int rb, ARMWord offset, Condition cc = AL)
42623 {
42624 js::JaegerSpew(js::JSpew_Insns,
42625 " %s" "%-15s %s, [%s, #+%u]\n", "", "ldrsh", nameGpReg(rd), nameGpReg(rb), offset);
42626 emitInst(static_cast<ARMWord>(cc) | LDRH | HDT_UH | HDT_S | DT_UP | DT_PRE, rd, rb, offset);
42627 }
42628
42629 void strh_r(int rb, int rm, int rd, Condition cc = AL)
42630 {
42631 js::JaegerSpew(js::JSpew_Insns,
42632 " %s" "%-15s %s, [%s, +%s]\n", "", "strh", nameGpReg(rd), nameGpReg(rb), nameGpReg(rm));
42633 emitInst(static_cast<ARMWord>(cc) | STRH | HDT_UH | DT_UP | DT_PRE, rd, rb, rm);
42634 }
42635
42636 void push_r(int reg, Condition cc = AL)
42637 {
42638 js::JaegerSpew(js::JSpew_Insns,
42639 " %s" "%-15s {%s}\n", "", "push", nameGpReg(reg));
42640 do { } while(0);
42641 m_buffer.putInt(cc | DTR | DT_WB | RN(ARMRegisters::sp) | RD(reg) | 0x4);
42642 }
42643
42644 void pop_r(int reg, Condition cc = AL)
42645 {
42646 js::JaegerSpew(js::JSpew_Insns,
42647 " %s" "%-15s {%s}\n", "", "pop", nameGpReg(reg));
42648 do { } while(0);
42649 m_buffer.putInt(cc | (DTR ^ DT_PRE) | DT_LOAD | DT_UP | RN(ARMRegisters::sp) | RD(reg) | 0x4);
42650 }
42651
42652 inline void poke_r(int reg, Condition cc = AL)
42653 {
42654 dtr_d(false, ARMRegisters::sp, 0, reg, cc);
42655 }
42656
42657 inline void peek_r(int reg, Condition cc = AL)
42658 {
42659 dtr_u(true, reg, ARMRegisters::sp, 0, cc);
42660 }
42661
42662
42663
42664
42665 void clz_r(int rd, int rm, Condition cc = AL)
42666 {
42667 spewInsWithOp2("clz", cc, rd, static_cast<ARMWord>(rm));
42668 m_buffer.putInt(static_cast<ARMWord>(cc) | CLZ | RD(rd) | RM(rm));
42669 }
42670
42671
42672 void bkpt(ARMWord value)
42673 {
42674
42675 js::JaegerSpew(js::JSpew_Insns,
42676 " %s" "%-15s #0x%04x\n", "", "bkpt", value);
42677 m_buffer.putInt(BKPT | ((value & 0xfff0) << 4) | (value & 0xf));
42678
42679
42680
42681
42682 }
42683
42684 void bx(int rm, Condition cc = AL)
42685 {
42686
42687 js::JaegerSpew(
42688 js::JSpew_Insns,
42689 " %s" "bx%-13s %s\n", "", nameCC(cc), nameGpReg(rm));
42690 emitInst(static_cast<ARMWord>(cc) | BX, 0, 0, RM(rm));
42691
42692
42693
42694 }
42695
42696 JmpSrc blx(int rm, Condition cc = AL)
42697 {
42698
42699 int s = m_buffer.uncheckedSize();
42700 js::JaegerSpew(
42701 js::JSpew_Insns,
42702 " %s" "blx%-12s %s\n", "", nameCC(cc), nameGpReg(rm));
42703 emitInst(static_cast<ARMWord>(cc) | BLX, 0, 0, RM(rm));
42704
42705
42706
42707
42708
42709
42710
42711 return JmpSrc(s);
42712 }
42713
42714 static ARMWord lsl(int reg, ARMWord value)
42715 {
42716 do { } while(0);
42717 do { } while(0);
42718 return reg | (value << 7) | (LSL << 5);
42719 }
42720
42721 static ARMWord lsr(int reg, ARMWord value)
42722 {
42723 do { } while(0);
42724 do { } while(0);
42725 return reg | (value << 7) | (LSR << 5);
42726 }
42727
42728 static ARMWord asr(int reg, ARMWord value)
42729 {
42730 do { } while(0);
42731 do { } while(0);
42732 return reg | (value << 7) | (ASR << 5);
42733 }
42734
42735 static ARMWord lsl_r(int reg, int shiftReg)
42736 {
42737 do { } while(0);
42738 do { } while(0);
42739 return reg | (shiftReg << 8) | (LSL << 5) | 0x10;
42740 }
42741
42742 static ARMWord lsr_r(int reg, int shiftReg)
42743 {
42744 do { } while(0);
42745 do { } while(0);
42746 return reg | (shiftReg << 8) | (LSR << 5) | 0x10;
42747 }
42748
42749 static ARMWord asr_r(int reg, int shiftReg)
42750 {
42751 do { } while(0);
42752 do { } while(0);
42753 return reg | (shiftReg << 8) | (ASR << 5) | 0x10;
42754 }
42755
42756
42757
42758 void forceFlushConstantPool()
42759 {
42760 m_buffer.flushWithoutBarrier(true);
42761 }
42762
42763 int size()
42764 {
42765 return m_buffer.size();
42766 }
42767
42768 void ensureSpace(int insnSpace, int constSpace)
42769 {
42770 m_buffer.ensureSpace(insnSpace, constSpace);
42771 }
42772
42773 void ensureSpace(int space)
42774 {
42775 m_buffer.ensureSpace(space);
42776 }
42777
42778 int sizeOfConstantPool()
42779 {
42780 return m_buffer.sizeOfConstantPool();
42781 }
42782
42783 int flushCount()
42784 {
42785 return m_buffer.flushCount();
42786 }
42787
42788 JmpDst label()
42789 {
42790 JmpDst label(m_buffer.size());
42791 js::JaegerSpew(js::JSpew_Insns, " %s" "#label ((%d))\n", "", label.m_offset);
42792 return label;
42793 }
42794
42795 JmpDst align(int alignment)
42796 {
42797 while (!m_buffer.isAligned(alignment))
42798 mov_r(ARMRegisters::r0, ARMRegisters::r0);
42799
42800 return label();
42801 }
42802
42803 JmpSrc loadBranchTarget(int rd, Condition cc = AL, int useConstantPool = 0)
42804 {
42805
42806
42807
42808
42809 ensureSpace(sizeof(ARMWord), sizeof(ARMWord));
42810 int s = m_buffer.uncheckedSize();
42811 ldr_un_imm(rd, InvalidBranchTarget, cc);
42812 m_jumps.append(s | (useConstantPool & 0x1));
42813 return JmpSrc(s);
42814 }
42815
42816 JmpSrc jmp(Condition cc = AL, int useConstantPool = 0)
42817 {
42818 return loadBranchTarget(ARMRegisters::pc, cc, useConstantPool);
42819 }
42820
42821 void* executableAllocAndCopy(ExecutableAllocator* allocator, ExecutablePool **poolp, CodeKind kind);
42822 void executableCopy(void* buffer);
42823 void fixUpOffsets(void* buffer);
42824
42825
42826
42827 static ARMWord* getLdrImmAddress(ARMWord* insn)
42828 {
42829
42830
42831 if ((*insn & 0x0f7f0000) != 0x051f0000) {
42832
42833 do { } while(0);
42834 insn--;
42835 }
42836
42837
42838 do { } while(0);
42839
42840 ARMWord addr = reinterpret_cast<ARMWord>(insn) + DefaultPrefetching * sizeof(ARMWord);
42841 if (*insn & DT_UP)
42842 return reinterpret_cast<ARMWord*>(addr + (*insn & SDT_OFFSET_MASK));
42843 return reinterpret_cast<ARMWord*>(addr - (*insn & SDT_OFFSET_MASK));
42844 }
42845
42846 static ARMWord* getLdrImmAddressOnPool(ARMWord* insn, uint32_t* constPool)
42847 {
42848
42849 do { } while(0);
42850
42851 if (*insn & 0x1)
42852 return reinterpret_cast<ARMWord*>(constPool + ((*insn & SDT_OFFSET_MASK) >> 1));
42853 return getLdrImmAddress(insn);
42854 }
42855
42856 static void patchPointerInternal(intptr_t from, void* to)
42857 {
42858 ARMWord* insn = reinterpret_cast<ARMWord*>(from);
42859 ARMWord* addr = getLdrImmAddress(insn);
42860 *addr = reinterpret_cast<ARMWord>(to);
42861 }
42862
42863 static ARMWord patchConstantPoolLoad(ARMWord load, ARMWord value)
42864 {
42865 value = (value << 1) + 1;
42866 do { } while(0);
42867 return (load & ~0xfff) | value;
42868 }
42869
42870 static void patchConstantPoolLoad(void* loadAddr, void* constPoolAddr);
42871
42872
42873
42874 static void linkPointer(void* code, JmpDst from, void* to)
42875 {
42876 js::JaegerSpew(js::JSpew_Insns,
42877 " " "##linkPointer ((%p + %#x)) points to ((%p))\n",
42878 code, from.m_offset, to);
42879
42880 patchPointerInternal(reinterpret_cast<intptr_t>(code) + from.m_offset, to);
42881 }
42882
42883 static void repatchInt32(void* from, int32_t to)
42884 {
42885 js::JaegerSpew(js::JSpew_Insns,
42886 " " "##repatchInt32 ((%p)) holds ((%#x))\n",
42887 from, to);
42888
42889 patchPointerInternal(reinterpret_cast<intptr_t>(from), reinterpret_cast<void*>(to));
42890 }
42891
42892 static void repatchPointer(void* from, void* to)
42893 {
42894 js::JaegerSpew(js::JSpew_Insns,
42895 " " "##repatchPointer ((%p)) points to ((%p))\n",
42896 from, to);
42897
42898 patchPointerInternal(reinterpret_cast<intptr_t>(from), to);
42899 }
42900
42901 static void repatchLoadPtrToLEA(void* from)
42902 {
42903
42904
42905 ARMWord* insn = reinterpret_cast<ARMWord*>(from);
42906 do { } while(0);
42907
42908 *insn = (*insn & 0xf00ff0ff) | 0x02800000;
42909 ExecutableAllocator::cacheFlush(insn, sizeof(ARMWord));
42910 }
42911
42912 static void repatchLEAToLoadPtr(void* from)
42913 {
42914
42915 ARMWord* insn = reinterpret_cast<ARMWord*>(from);
42916 if ((*insn & 0x0ff00f00) == 0x05900000)
42917 return;
42918 do { } while(0);
42919 do { } while(0);
42920
42921 *insn = (*insn & 0xf00ff0ff) | 0x05900000;
42922 ExecutableAllocator::cacheFlush(insn, sizeof(ARMWord));
42923 }
42924
42925
42926
42927 void linkJump(JmpSrc from, JmpDst to)
42928 {
42929 ARMWord code = reinterpret_cast<ARMWord>(m_buffer.data());
42930 ARMWord* insn = reinterpret_cast<ARMWord*>(code + from.m_offset);
42931 ARMWord* addr = getLdrImmAddressOnPool(insn, m_buffer.poolAddress());
42932
42933 js::JaegerSpew(js::JSpew_Insns,
42934 " %s" "##linkJump ((%#x)) jumps to ((%#x))\n", "",
42935 from.m_offset, to.m_offset);
42936
42937 *addr = to.m_offset;
42938 }
42939
42940 static void linkJump(void* code, JmpSrc from, void* to)
42941 {
42942 js::JaegerSpew(js::JSpew_Insns,
42943 " " "##linkJump ((%p + %#x)) jumps to ((%p))\n",
42944 code, from.m_offset, to);
42945
42946 patchPointerInternal(reinterpret_cast<intptr_t>(code) + from.m_offset, to);
42947 }
42948
42949 static void relinkJump(void* from, void* to)
42950 {
42951 js::JaegerSpew(js::JSpew_Insns,
42952 " " "##relinkJump ((%p)) jumps to ((%p))\n",
42953 from, to);
42954
42955 patchPointerInternal(reinterpret_cast<intptr_t>(from), to);
42956 }
42957
42958 static bool canRelinkJump(void* from, void* to)
42959 {
42960 return true;
42961 }
42962
42963 static void linkCall(void* code, JmpSrc from, void* to)
42964 {
42965 js::JaegerSpew(js::JSpew_Insns,
42966 " " "##linkCall ((%p + %#x)) jumps to ((%p))\n",
42967 code, from.m_offset, to);
42968
42969 patchPointerInternal(reinterpret_cast<intptr_t>(code) + from.m_offset, to);
42970 }
42971
42972 static void relinkCall(void* from, void* to)
42973 {
42974 js::JaegerSpew(js::JSpew_Insns,
42975 " " "##relinkCall ((%p)) jumps to ((%p))\n",
42976 from, to);
42977
42978 patchPointerInternal(reinterpret_cast<intptr_t>(from), to);
42979 }
42980
42981
42982
42983 static void* getRelocatedAddress(void* code, JmpSrc jump)
42984 {
42985 return reinterpret_cast<void*>(reinterpret_cast<ARMWord*>(code) + jump.m_offset / sizeof(ARMWord));
42986 }
42987
42988 static void* getRelocatedAddress(void* code, JmpDst label)
42989 {
42990 return reinterpret_cast<void*>(reinterpret_cast<ARMWord*>(code) + label.m_offset / sizeof(ARMWord));
42991 }
42992
42993
42994
42995 static int getDifferenceBetweenLabels(JmpDst from, JmpSrc to)
42996 {
42997 return to.m_offset - from.m_offset;
42998 }
42999
43000 static int getDifferenceBetweenLabels(JmpDst from, JmpDst to)
43001 {
43002 return to.m_offset - from.m_offset;
43003 }
43004
43005 static unsigned getCallReturnOffset(JmpSrc call)
43006 {
43007 return call.m_offset + sizeof(ARMWord);
43008 }
43009
43010
43011
43012 static ARMWord getOp2Byte(ARMWord imm)
43013 {
43014 do { } while(0);
43015 return OP2_IMMh | (imm & 0x0f) | ((imm & 0xf0) << 4) ;
43016 }
43017
43018 static ARMWord getOp2(ARMWord imm);
43019
43020
43021
43022 static ARMWord getOp2RegScale(RegisterID reg, ARMWord scale);
43023
43024
43025 static ARMWord getImm16Op2(ARMWord imm)
43026 {
43027 if (imm <= 0xffff)
43028 return (imm & 0xf000) << 4 | (imm & 0xfff);
43029 return INVALID_IMM;
43030 }
43031
43032 ARMWord getImm(ARMWord imm, int tmpReg, bool invert = false);
43033 void moveImm(ARMWord imm, int dest);
43034 ARMWord encodeComplexImm(ARMWord imm, int dest);
43035
43036 ARMWord getOffsetForHalfwordDataTransfer(ARMWord imm, int tmpReg)
43037 {
43038
43039 if (imm <= 0xff)
43040 return getOp2Byte(imm);
43041
43042 return encodeComplexImm(imm, tmpReg);
43043 }
43044
43045
43046 void dataTransferN(bool isLoad, bool isSigned, int size, RegisterID srcDst, RegisterID base, int32_t offset);
43047
43048 void dataTransfer32(bool isLoad, RegisterID srcDst, RegisterID base, int32_t offset);
43049 void dataTransfer8(bool isLoad, RegisterID srcDst, RegisterID base, int32_t offset, bool isSigned);
43050 void baseIndexTransferN(bool isLoad, bool isSigned, int size, RegisterID srcDst, RegisterID base, RegisterID index, int scale, int32_t offset);
43051 void baseIndexTransfer32(bool isLoad, RegisterID srcDst, RegisterID base, RegisterID index, int scale, int32_t offset);
43052 void doubleTransfer(bool isLoad, FPRegisterID srcDst, RegisterID base, int32_t offset);
43053 void doubleTransfer(bool isLoad, FPRegisterID srcDst, RegisterID base, int32_t offset, RegisterID index, int32_t scale);
43054
43055 void floatTransfer(bool isLoad, FPRegisterID srcDst, RegisterID base, int32_t offset);
43056
43057 void baseIndexFloatTransfer(bool isLoad, bool isDouble, FPRegisterID srcDst, RegisterID base, RegisterID index, int scale, int32_t offset);
43058
43059
43060
43061 static ARMWord placeConstantPoolBarrier(int offset)
43062 {
43063 offset = (offset - sizeof(ARMWord)) >> 2;
43064 do { } while(0);
43065 return AL | B | (offset & BRANCH_MASK);
43066 }
43067
43068
43069 static char const * nameGpReg(int reg)
43070 {
43071 do { } while(0);
43072 do { } while(0);
43073 static char const * names[] = {
43074 "r0", "r1", "r2", "r3",
43075 "r4", "r5", "r6", "r7",
43076 "r8", "r9", "r10", "r11",
43077 "ip", "sp", "lr", "pc"
43078 };
43079 return names[reg];
43080 }
43081
43082 static char const * nameFpRegD(int reg)
43083 {
43084 do { } while(0);
43085 do { } while(0);
43086 static char const * names[] = {
43087 "d0", "d1", "d2", "d3",
43088 "d4", "d5", "d6", "d7",
43089 "d8", "d9", "d10", "d11",
43090 "d12", "d13", "d14", "d15",
43091 "d16", "d17", "d18", "d19",
43092 "d20", "d21", "d22", "d23",
43093 "d24", "d25", "d26", "d27",
43094 "d28", "d29", "d30", "d31"
43095 };
43096 return names[reg];
43097 }
43098 static char const * nameFpRegS(int reg)
43099 {
43100 do { } while(0);
43101 do { } while(0);
43102 static char const * names[] = {
43103 "s0", "s1", "s2", "s3",
43104 "s4", "s5", "s6", "s7",
43105 "s8", "s9", "s10", "s11",
43106 "s12", "s13", "s14", "s15",
43107 "s16", "s17", "s18", "s19",
43108 "s20", "s21", "s22", "s23",
43109 "s24", "s25", "s26", "s27",
43110 "s28", "s29", "s30", "s31"
43111 };
43112 return names[reg];
43113 }
43114
43115 static char const * nameCC(Condition cc)
43116 {
43117 do { } while(0);
43118 do { } while(0);
43119 do { } while(0);
43120
43121 uint32_t ccIndex = cc >> 28;
43122 static char const * names[] = {
43123 "eq", "ne",
43124 "cs", "cc",
43125 "mi", "pl",
43126 "vs", "vc",
43127 "hi", "ls",
43128 "ge", "lt",
43129 "gt", "le",
43130 " "
43131 };
43132 return names[ccIndex];
43133 }
43134
43135 private:
43136
43137 inline uint32_t decOp2Imm(uint32_t op2)
43138 {
43139 do { } while(0);
43140
43141 uint32_t imm8 = op2 & 0xff;
43142 uint32_t rot = ((op2 >> 7) & 0x1e);
43143
43144
43145
43146 uint32_t imm = (imm8 >> rot);
43147 if (rot > 0) {
43148 imm |= (imm8 << (32-rot));
43149 }
43150
43151 return imm;
43152 }
43153
43154
43155
43156 void fmtOp2(char * out, ARMWord op2)
43157 {
43158 static char const * const shifts[4] = {"LSL", "LSR", "ASR", "ROR"};
43159
43160 if ((op2 & OP2_IMM) || (op2 & OP2_IMMh)) {
43161
43162
43163 uint32_t imm = decOp2Imm(op2 & ~(OP2_IMM | OP2_IMMh));
43164 sprintf(out, "#0x%x @ (%d)", imm, static_cast<int32_t>(imm));
43165 } else {
43166
43167
43168 char const * rm = nameGpReg(op2 & 0xf);
43169 Shift type = static_cast<Shift>((op2 >> 5) & 0x3);
43170
43171
43172 if (op2 & (1<<4)) {
43173
43174
43175 char const * rs = nameGpReg((op2 >> 8) & 0xf);
43176 sprintf(out, "%s, %s %s", rm, shifts[type], rs);
43177 } else {
43178
43179
43180 uint32_t imm = (op2 >> 7) & 0x1f;
43181
43182
43183 if ((type == LSL) && (imm == 0)) {
43184
43185 sprintf(out, "%s", rm);
43186 return;
43187 }
43188
43189 if ((type == ROR) && (imm == 0)) {
43190
43191 sprintf(out, "%s, RRX", rm);
43192 return;
43193 }
43194
43195 if (((type == LSR) || (type == ASR)) && (imm == 0)) {
43196
43197
43198 imm = 32;
43199 }
43200
43201
43202
43203 sprintf(out, "%s, %s #%u", rm, shifts[type], imm);
43204 }
43205 }
43206 }
43207
43208 void spewInsWithOp2(char const * ins, Condition cc, int rd, int rn, ARMWord op2)
43209 {
43210 char mnemonic[16];
43211 snprintf(mnemonic, 16, "%s%s", ins, nameCC(cc));
43212
43213 char op2_fmt[48];
43214 fmtOp2(op2_fmt, op2);
43215
43216 js::JaegerSpew(js::JSpew_Insns,
43217 " %s" "%-15s %s, %s, %s\n", "", mnemonic, nameGpReg(rd), nameGpReg(rn), op2_fmt);
43218 }
43219
43220 void spewInsWithOp2(char const * ins, Condition cc, int r, ARMWord op2)
43221 {
43222 char mnemonic[16];
43223 snprintf(mnemonic, 16, "%s%s", ins, nameCC(cc));
43224
43225 char op2_fmt[48];
43226 fmtOp2(op2_fmt, op2);
43227
43228 js::JaegerSpew(js::JSpew_Insns,
43229 " %s" "%-15s %s, %s\n", "", mnemonic, nameGpReg(r), op2_fmt);
43230 }
43231
43232 ARMWord RM(int reg)
43233 {
43234 do { } while(0);
43235 return reg;
43236 }
43237
43238 ARMWord RS(int reg)
43239 {
43240 do { } while(0);
43241 return reg << 8;
43242 }
43243
43244 ARMWord RD(int reg)
43245 {
43246 do { } while(0);
43247 return reg << 12;
43248 }
43249
43250 ARMWord RN(int reg)
43251 {
43252 do { } while(0);
43253 return reg << 16;
43254 }
43255
43256 ARMWord DD(int reg)
43257 {
43258 do { } while(0);
43259
43260 return ((reg << 12) | (reg << 18)) & 0x0040f000;
43261 }
43262
43263 ARMWord DN(int reg)
43264 {
43265 do { } while(0);
43266
43267 return ((reg << 16) | (reg << 3)) & 0x000f0080;
43268 }
43269
43270 ARMWord DM(int reg)
43271 {
43272 do { } while(0);
43273
43274 return ((reg << 1) & 0x20) | (reg & 0xf);
43275 }
43276
43277 ARMWord SD(int reg)
43278 {
43279 do { } while(0);
43280
43281 return ((reg << 11) | (reg << 22)) & 0x0040f000;
43282 }
43283
43284 ARMWord SM(int reg)
43285 {
43286 do { } while(0);
43287
43288 return ((reg << 5) & 0x20) | ((reg >> 1) & 0xf);
43289 }
43290 ARMWord SN(int reg)
43291 {
43292 do { } while(0);
43293
43294 return ((reg << 15) & 0xf0000) | ((reg & 1) << 7);
43295 }
43296 static ARMWord getConditionalField(ARMWord i)
43297 {
43298 return i & 0xf0000000;
43299 }
43300
43301 int genInt(int reg, ARMWord imm, bool positive);
43302
43303 ARMBuffer m_buffer;
43304 Jumps m_jumps;
43305 public:
43306
43307 enum {
43308 VFP_DATA = 0x0E000A00,
43309 VFP_EXT = 0x0C000A00,
43310 VFP_XFER = 0x0E000A08,
43311 VFP_DXFER = 0x0C400A00,
43312
43313 VFP_DBL = (1<<8),
43314
43315
43316 VFP_ICVT = 0x00B80040,
43317 VFP_FPCVT = 0x00B700C0,
43318
43319 VFP_DTR = 0x01000000,
43320 VFP_MOV = 0x00000010,
43321
43322 FMSR = 0x0e000a10,
43323 FMRS = 0x0e100a10,
43324 FSITOD = 0x0eb80bc0,
43325 FUITOD = 0x0eb80b40,
43326 FTOSID = 0x0ebd0b40,
43327 FTOSIZD = 0x0ebd0bc0,
43328 FMSTAT = 0x0ef1fa10,
43329 FDTR = 0x0d000b00
43330
43331 };
43332 enum RegType {
43333 SIntReg32,
43334 UIntReg32,
43335 FloatReg32,
43336 FloatReg64
43337 };
43338
43339 const char * nameType(RegType t)
43340 {
43341 const char * const name[4] =
43342 {"S32", "U32", "F32", "F64"};
43343 return name[t];
43344 }
43345
43346 const char * nameTypedReg(RegType t, int reg)
43347 {
43348 switch(t) {
43349 case SIntReg32:
43350 case UIntReg32:
43351 return nameGpReg(reg);
43352 case FloatReg32:
43353 return nameFpRegS(reg);
43354 case FloatReg64:
43355 return nameFpRegD(reg);
43356 }
43357 return "";
43358 }
43359
43360 bool isFloatType(RegType rt)
43361 {
43362 if (rt == FloatReg32 || rt == FloatReg64)
43363 return true;
43364 return false;
43365 }
43366
43367 bool isIntType(RegType rt)
43368 {
43369 if (rt == FloatReg32 || rt == FloatReg64)
43370 return false;
43371 return true;
43372 }
43373
43374
43375
43376
43377
43378 void emitVFPInst(ARMWord op, ARMWord rd, ARMWord rn, ARMWord op2)
43379 {
43380 m_buffer.putInt(op | rn | rd | op2);
43381 }
43382
43383
43384 void fmem_imm_off(bool isLoad, bool isDouble, bool isUp, int dest, int rn, ARMWord offset, Condition cc = AL)
43385 {
43386 char const * ins = isLoad ? "vldr.f" : "vstr.f";
43387 js::JaegerSpew(js::JSpew_Insns,
43388 " %s" "%s%d %s, [%s, #%s%u]\n", "",
43389 ins, (isDouble ? 64 : 32), (isDouble ? nameFpRegD(dest) : nameFpRegS(dest)),
43390 nameGpReg(rn), (isUp ? "+" : "-"), offset);
43391 do { } while(0);
43392 emitVFPInst(static_cast<ARMWord>(cc) |
43393 VFP_EXT | VFP_DTR |
43394 (isDouble ? VFP_DBL : 0) |
43395 (isUp ? DT_UP : 0) |
43396 (isLoad ? DT_LOAD : 0), isDouble ? DD(dest) : SD(dest), RN(rn), offset);
43397
43398 }
43399
43400
43401
43402 void vcvt(RegType srcType, RegType dstType, int src, int dest, Condition cc = AL)
43403 {
43404 do { } while(0);
43405 do { } while(0);
43406
43407 js::JaegerSpew(js::JSpew_Insns,
43408 " %s" "vcvt.%s.%-15s, %s,%s\n", "",
43409 nameType(dstType), nameType(srcType),
43410 nameTypedReg(dstType,dest), nameTypedReg(srcType,src));
43411
43412 if (isFloatType(srcType) && isFloatType (dstType)) {
43413
43414 bool dblToFloat = srcType == FloatReg64;
43415 emitVFPInst(static_cast<ARMWord>(cc) | VFP_DATA | VFP_FPCVT |
43416 (dblToFloat ? VFP_DBL : 0),
43417 dblToFloat ? SD(dest) : DD(dest),
43418 dblToFloat ? DM(src) : SM(src), 0);
43419 } else {
43420 __builtin_unreachable();
43421 }
43422 }
43423
43424
43425 void vmov64 (bool fromFP, bool isDbl, int r1, int r2, int rFP, Condition cc = AL)
43426 {
43427 if (fromFP) {
43428 js::JaegerSpew(js::JSpew_Insns,
43429 " %s" "%-15s %s, %s, %s\n", "", "vmov",
43430 nameGpReg(r1), nameGpReg(r2), nameFpRegD(rFP));
43431 } else {
43432 js::JaegerSpew(js::JSpew_Insns,
43433 " %s" "%-15s %s, %s, %s\n", "", "vmov",
43434 nameFpRegD(rFP), nameGpReg(r1), nameGpReg(r2));
43435 }
43436 emitVFPInst(static_cast<ARMWord>(cc) | VFP_DXFER | VFP_MOV |
43437 (fromFP ? DT_LOAD : 0) |
43438 (isDbl ? VFP_DBL : 0), RD(r1), RN(r2), isDbl ? DM(rFP) : SM(rFP));
43439 }
43440
43441 void fcpyd_r(int dd, int dm, Condition cc = AL)
43442 {
43443 js::JaegerSpew(js::JSpew_Insns,
43444 " %s" "%-15s %s, %s\n", "", "vmov.f64",
43445 nameFpRegD(dd), nameFpRegD(dm));
43446
43447
43448 emitVFPInst(static_cast<ARMWord>(cc) | FCPYD, DD(dd), DM(dm), 0);
43449 }
43450
43451 void faddd_r(int dd, int dn, int dm, Condition cc = AL)
43452 {
43453 js::JaegerSpew(js::JSpew_Insns,
43454 " %s" "%-15s %s, %s, %s\n", "", "vadd.f64", nameFpRegD(dd), nameFpRegD(dn), nameFpRegD(dm));
43455
43456
43457 emitVFPInst(static_cast<ARMWord>(cc) | FADDD, DD(dd), DN(dn), DM(dm));
43458 }
43459
43460 void fnegd_r(int dd, int dm, Condition cc = AL)
43461 {
43462 js::JaegerSpew(js::JSpew_Insns,
43463 " %s" "%-15s %s, %s\n", "", "fnegd", nameFpRegD(dd), nameFpRegD(dm));
43464 m_buffer.putInt(static_cast<ARMWord>(cc) | FNEGD | DD(dd) | DM(dm));
43465 }
43466
43467 void fdivd_r(int dd, int dn, int dm, Condition cc = AL)
43468 {
43469 js::JaegerSpew(js::JSpew_Insns,
43470 " %s" "%-15s %s, %s, %s\n", "", "vdiv.f64", nameFpRegD(dd), nameFpRegD(dn), nameFpRegD(dm));
43471
43472
43473 emitVFPInst(static_cast<ARMWord>(cc) | FDIVD, DD(dd), DN(dn), DM(dm));
43474 }
43475
43476 void fsubd_r(int dd, int dn, int dm, Condition cc = AL)
43477 {
43478 js::JaegerSpew(js::JSpew_Insns,
43479 " %s" "%-15s %s, %s, %s\n", "", "vsub.f64", nameFpRegD(dd), nameFpRegD(dn), nameFpRegD(dm));
43480
43481
43482 emitVFPInst(static_cast<ARMWord>(cc) | FSUBD, DD(dd), DN(dn), DM(dm));
43483 }
43484
43485 void fabsd_r(int dd, int dm, Condition cc = AL)
43486 {
43487 js::JaegerSpew(js::JSpew_Insns,
43488 " %s" "%-15s %s, %s\n", "", "fabsd", nameFpRegD(dd), nameFpRegD(dm));
43489 m_buffer.putInt(static_cast<ARMWord>(cc) | FABSD | DD(dd) | DM(dm));
43490 }
43491
43492 void fmuld_r(int dd, int dn, int dm, Condition cc = AL)
43493 {
43494 js::JaegerSpew(js::JSpew_Insns,
43495 " %s" "%-15s %s, %s, %s\n", "", "vmul.f64", nameFpRegD(dd), nameFpRegD(dn), nameFpRegD(dm));
43496
43497
43498 emitVFPInst(static_cast<ARMWord>(cc) | FMULD, DD(dd), DN(dn), DM(dm));
43499 }
43500
43501 void fcmpd_r(int dd, int dm, Condition cc = AL)
43502 {
43503 js::JaegerSpew(js::JSpew_Insns,
43504 " %s" "%-15s %s, %s\n", "", "vcmp.f64", nameFpRegD(dd), nameFpRegD(dm));
43505
43506
43507 emitVFPInst(static_cast<ARMWord>(cc) | FCMPD, DD(dd), 0, DM(dm));
43508 }
43509
43510 void fsqrtd_r(int dd, int dm, Condition cc = AL)
43511 {
43512 js::JaegerSpew(js::JSpew_Insns,
43513 " %s" "%-15s %s, %s\n", "", "vsqrt.f64", nameFpRegD(dd), nameFpRegD(dm));
43514
43515
43516 emitVFPInst(static_cast<ARMWord>(cc) | FSQRTD, DD(dd), 0, DM(dm));
43517 }
43518
43519 void fmsr_r(int dd, int rn, Condition cc = AL)
43520 {
43521
43522
43523 emitVFPInst(static_cast<ARMWord>(cc) | FMSR, RD(rn), SN(dd), 0);
43524 }
43525
43526 void fmrs_r(int rd, int dn, Condition cc = AL)
43527 {
43528
43529
43530 emitVFPInst(static_cast<ARMWord>(cc) | FMRS, RD(rd), SN(dn), 0);
43531 }
43532
43533
43534
43535 void fsitod_r(int dd, int dm, Condition cc = AL)
43536 {
43537
43538
43539 emitVFPInst(static_cast<ARMWord>(cc) | FSITOD, DD(dd), 0, SM(dm));
43540 }
43541
43542 void fuitod_r(int dd, int dm, Condition cc = AL)
43543 {
43544
43545
43546 emitVFPInst(static_cast<ARMWord>(cc) | FUITOD, DD(dd), 0, SM(dm));
43547 }
43548
43549 void ftosid_r(int fd, int dm, Condition cc = AL)
43550 {
43551
43552 emitVFPInst(static_cast<ARMWord>(cc) | FTOSID, SD(fd), 0, DM(dm));
43553 }
43554
43555 void ftosizd_r(int fd, int dm, Condition cc = AL)
43556 {
43557
43558 emitVFPInst(static_cast<ARMWord>(cc) | FTOSIZD, SD(fd), 0, DM(dm));
43559 }
43560
43561 void fmstat(Condition cc = AL)
43562 {
43563
43564
43565 m_buffer.putInt(static_cast<ARMWord>(cc) | FMSTAT);
43566 }
43567 };
43568
43569 }
43570 # 40 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/MacroAssemblerARM.h" 2
43571 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/AbstractMacroAssembler.h" 1
43572 # 31 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/AbstractMacroAssembler.h"
43573 #define AbstractMacroAssembler_h
43574
43575
43576 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/MacroAssemblerCodeRef.h" 1
43577 # 31 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/MacroAssemblerCodeRef.h"
43578 #define MacroAssemblerCodeRef_h
43579 # 52 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/MacroAssemblerCodeRef.h"
43580 #define ASSERT_VALID_CODE_POINTER(ptr) ASSERT(ptr)
43581
43582 #define ASSERT_VALID_CODE_OFFSET(offset)
43583
43584
43585 namespace JSC {
43586
43587
43588
43589
43590
43591 class FunctionPtr {
43592 public:
43593 FunctionPtr()
43594 : m_value(0)
43595 {
43596 }
43597
43598 template<typename FunctionType>
43599 explicit FunctionPtr(FunctionType* value)
43600
43601
43602
43603
43604
43605 : m_value(reinterpret_cast<void*>(value))
43606
43607 {
43608 do { } while(0);
43609 }
43610
43611 void* value() const { return m_value; }
43612 void* executableAddress() const { return m_value; }
43613
43614
43615 private:
43616 void* m_value;
43617 };
43618
43619
43620
43621
43622
43623
43624
43625 class ReturnAddressPtr {
43626 public:
43627 ReturnAddressPtr()
43628 : m_value(0)
43629 {
43630 }
43631
43632 explicit ReturnAddressPtr(void* value)
43633 : m_value(value)
43634 {
43635 do { } while(0);
43636 }
43637
43638 explicit ReturnAddressPtr(FunctionPtr function)
43639 : m_value(function.value())
43640 {
43641 do { } while(0);
43642 }
43643
43644 void* value() const { return m_value; }
43645
43646 private:
43647 void* m_value;
43648 };
43649
43650
43651
43652
43653 class MacroAssemblerCodePtr {
43654 public:
43655 MacroAssemblerCodePtr()
43656 : m_value(0)
43657 {
43658 }
43659
43660 explicit MacroAssemblerCodePtr(void* value)
43661
43662
43663
43664
43665 : m_value(value)
43666
43667 {
43668 do { } while(0);
43669 }
43670
43671 explicit MacroAssemblerCodePtr(ReturnAddressPtr ra)
43672 : m_value(ra.value())
43673 {
43674 do { } while(0);
43675 }
43676
43677 void* executableAddress() const {
43678 return m_value;
43679 }
43680
43681
43682
43683
43684 void* dataLocation() const { do { } while(0); return m_value; }
43685
43686
43687 bool operator!()
43688 {
43689 return !m_value;
43690 }
43691
43692 ptrdiff_t operator -(const MacroAssemblerCodePtr &other) const
43693 {
43694 do { } while(0);
43695 return reinterpret_cast<uint8_t *>(m_value) -
43696 reinterpret_cast<uint8_t *>(other.m_value);
43697 }
43698
43699 private:
43700 void* m_value;
43701 };
43702
43703
43704
43705
43706
43707
43708 class MacroAssemblerCodeRef {
43709 public:
43710 MacroAssemblerCodeRef()
43711 : m_executablePool(__null),
43712 m_size(0)
43713 {
43714 }
43715
43716 MacroAssemblerCodeRef(void* code, ExecutablePool* executablePool, size_t size)
43717 : m_code(code)
43718 , m_executablePool(executablePool)
43719 , m_size(size)
43720 {
43721 }
43722
43723
43724 void release()
43725 {
43726 if (!m_executablePool)
43727 return;
43728
43729
43730
43731
43732
43733 m_executablePool->release();
43734 m_executablePool = __null;
43735 }
43736
43737 MacroAssemblerCodePtr m_code;
43738 ExecutablePool* m_executablePool;
43739 size_t m_size;
43740 };
43741
43742 }
43743 # 35 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/AbstractMacroAssembler.h" 2
43744 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/CodeLocation.h" 1
43745 # 31 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/CodeLocation.h"
43746 #define CodeLocation_h
43747
43748
43749
43750
43751
43752
43753 namespace JSC {
43754
43755 class CodeLocationInstruction;
43756 class CodeLocationLabel;
43757 class CodeLocationJump;
43758 class CodeLocationCall;
43759 class CodeLocationNearCall;
43760 class CodeLocationDataLabel32;
43761 class CodeLocationDataLabelPtr;
43762 # 59 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/CodeLocation.h"
43763 class CodeLocationCommon : public MacroAssemblerCodePtr {
43764 public:
43765 CodeLocationInstruction instructionAtOffset(int offset);
43766 CodeLocationLabel labelAtOffset(int offset);
43767 CodeLocationJump jumpAtOffset(int offset);
43768 CodeLocationCall callAtOffset(int offset);
43769 CodeLocationNearCall nearCallAtOffset(int offset);
43770 CodeLocationDataLabelPtr dataLabelPtrAtOffset(int offset);
43771 CodeLocationDataLabel32 dataLabel32AtOffset(int offset);
43772
43773 protected:
43774 CodeLocationCommon()
43775 {
43776 }
43777
43778 CodeLocationCommon(MacroAssemblerCodePtr location)
43779 : MacroAssemblerCodePtr(location)
43780 {
43781 }
43782 };
43783
43784 class CodeLocationInstruction : public CodeLocationCommon {
43785 public:
43786 CodeLocationInstruction() {}
43787 explicit CodeLocationInstruction(MacroAssemblerCodePtr location)
43788 : CodeLocationCommon(location) {}
43789 explicit CodeLocationInstruction(void* location)
43790 : CodeLocationCommon(MacroAssemblerCodePtr(location)) {}
43791 };
43792
43793 class CodeLocationLabel : public CodeLocationCommon {
43794 public:
43795 CodeLocationLabel() {}
43796 explicit CodeLocationLabel(MacroAssemblerCodePtr location)
43797 : CodeLocationCommon(location) {}
43798 explicit CodeLocationLabel(void* location)
43799 : CodeLocationCommon(MacroAssemblerCodePtr(location)) {}
43800 };
43801
43802 class CodeLocationJump : public CodeLocationCommon {
43803 public:
43804 CodeLocationJump() {}
43805 explicit CodeLocationJump(MacroAssemblerCodePtr location)
43806 : CodeLocationCommon(location) {}
43807 explicit CodeLocationJump(void* location)
43808 : CodeLocationCommon(MacroAssemblerCodePtr(location)) {}
43809 };
43810
43811 class CodeLocationCall : public CodeLocationCommon {
43812 public:
43813 CodeLocationCall() {}
43814 explicit CodeLocationCall(MacroAssemblerCodePtr location)
43815 : CodeLocationCommon(location) {}
43816 explicit CodeLocationCall(void* location)
43817 : CodeLocationCommon(MacroAssemblerCodePtr(location)) {}
43818 };
43819
43820 class CodeLocationNearCall : public CodeLocationCommon {
43821 public:
43822 CodeLocationNearCall() {}
43823 explicit CodeLocationNearCall(MacroAssemblerCodePtr location)
43824 : CodeLocationCommon(location) {}
43825 explicit CodeLocationNearCall(void* location)
43826 : CodeLocationCommon(MacroAssemblerCodePtr(location)) {}
43827 };
43828
43829 class CodeLocationDataLabel32 : public CodeLocationCommon {
43830 public:
43831 CodeLocationDataLabel32() {}
43832 explicit CodeLocationDataLabel32(MacroAssemblerCodePtr location)
43833 : CodeLocationCommon(location) {}
43834 explicit CodeLocationDataLabel32(void* location)
43835 : CodeLocationCommon(MacroAssemblerCodePtr(location)) {}
43836 };
43837
43838 class CodeLocationDataLabelPtr : public CodeLocationCommon {
43839 public:
43840 CodeLocationDataLabelPtr() {}
43841 explicit CodeLocationDataLabelPtr(MacroAssemblerCodePtr location)
43842 : CodeLocationCommon(location) {}
43843 explicit CodeLocationDataLabelPtr(void* location)
43844 : CodeLocationCommon(MacroAssemblerCodePtr(location)) {}
43845 };
43846
43847 inline CodeLocationInstruction CodeLocationCommon::instructionAtOffset(int offset)
43848 {
43849 ;
43850 return CodeLocationInstruction(reinterpret_cast<char*>(dataLocation()) + offset);
43851 }
43852
43853 inline CodeLocationLabel CodeLocationCommon::labelAtOffset(int offset)
43854 {
43855 ;
43856 return CodeLocationLabel(reinterpret_cast<char*>(dataLocation()) + offset);
43857 }
43858
43859 inline CodeLocationJump CodeLocationCommon::jumpAtOffset(int offset)
43860 {
43861 ;
43862 return CodeLocationJump(reinterpret_cast<char*>(dataLocation()) + offset);
43863 }
43864
43865 inline CodeLocationCall CodeLocationCommon::callAtOffset(int offset)
43866 {
43867 ;
43868 return CodeLocationCall(reinterpret_cast<char*>(dataLocation()) + offset);
43869 }
43870
43871 inline CodeLocationNearCall CodeLocationCommon::nearCallAtOffset(int offset)
43872 {
43873 ;
43874 return CodeLocationNearCall(reinterpret_cast<char*>(dataLocation()) + offset);
43875 }
43876
43877 inline CodeLocationDataLabelPtr CodeLocationCommon::dataLabelPtrAtOffset(int offset)
43878 {
43879 ;
43880 return CodeLocationDataLabelPtr(reinterpret_cast<char*>(dataLocation()) + offset);
43881 }
43882
43883 inline CodeLocationDataLabel32 CodeLocationCommon::dataLabel32AtOffset(int offset)
43884 {
43885 ;
43886 return CodeLocationDataLabel32(reinterpret_cast<char*>(dataLocation()) + offset);
43887 }
43888
43889 }
43890 # 36 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/AbstractMacroAssembler.h" 2
43891
43892
43893
43894 namespace JSC {
43895
43896 class LinkBuffer;
43897 class RepatchBuffer;
43898
43899 template <class AssemblerType>
43900 class AbstractMacroAssembler {
43901 public:
43902 typedef AssemblerType AssemblerType_T;
43903
43904 typedef MacroAssemblerCodePtr CodePtr;
43905 typedef MacroAssemblerCodeRef CodeRef;
43906
43907 class Jump;
43908
43909 typedef typename AssemblerType::RegisterID RegisterID;
43910 typedef typename AssemblerType::FPRegisterID FPRegisterID;
43911 typedef typename AssemblerType::JmpSrc JmpSrc;
43912 typedef typename AssemblerType::JmpDst JmpDst;
43913 # 72 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/AbstractMacroAssembler.h"
43914 enum Scale {
43915 TimesOne,
43916 TimesTwo,
43917 TimesFour,
43918 TimesEight
43919 };
43920
43921
43922
43923
43924 struct Address {
43925 explicit Address() {}
43926
43927 explicit Address(RegisterID base, int32_t offset = 0)
43928 : base(base)
43929 , offset(offset)
43930 {
43931 }
43932
43933 RegisterID base;
43934 int32_t offset;
43935 };
43936
43937 struct ExtendedAddress {
43938 explicit ExtendedAddress(RegisterID base, intptr_t offset = 0)
43939 : base(base)
43940 , offset(offset)
43941 {
43942 }
43943
43944 RegisterID base;
43945 intptr_t offset;
43946 };
43947 # 120 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/AbstractMacroAssembler.h"
43948 struct ImplicitAddress {
43949 ImplicitAddress(RegisterID base)
43950 : base(base)
43951 , offset(0)
43952 {
43953 }
43954
43955 ImplicitAddress(Address address)
43956 : base(address.base)
43957 , offset(address.offset)
43958 {
43959 }
43960
43961 RegisterID base;
43962 int32_t offset;
43963 };
43964
43965
43966
43967
43968 struct BaseIndex {
43969 BaseIndex(RegisterID base, RegisterID index, Scale scale, int32_t offset = 0)
43970 : base(base)
43971 , index(index)
43972 , scale(scale)
43973 , offset(offset)
43974 {
43975 }
43976
43977 RegisterID base;
43978 RegisterID index;
43979 Scale scale;
43980 int32_t offset;
43981 };
43982
43983
43984
43985
43986
43987 struct AbsoluteAddress {
43988 explicit AbsoluteAddress(void* ptr)
43989 : m_ptr(ptr)
43990 {
43991 }
43992
43993 void* m_ptr;
43994 };
43995
43996
43997
43998
43999
44000
44001 struct TrustedImmPtr {
44002 explicit TrustedImmPtr(const void* value)
44003 : m_value(value)
44004 {
44005 }
44006
44007 intptr_t asIntptr()
44008 {
44009 return reinterpret_cast<intptr_t>(m_value);
44010 }
44011
44012 const void* m_value;
44013 };
44014
44015 struct ImmPtr : public TrustedImmPtr {
44016 explicit ImmPtr(const void* value)
44017 : TrustedImmPtr(value)
44018 {
44019 }
44020 };
44021
44022
44023
44024
44025
44026
44027
44028 struct TrustedImm32 {
44029 explicit TrustedImm32(int32_t value)
44030 : m_value(value)
44031
44032 , m_isPointer(false)
44033
44034 {
44035 }
44036
44037
44038 explicit TrustedImm32(TrustedImmPtr ptr)
44039 : m_value(ptr.asIntptr())
44040
44041 , m_isPointer(true)
44042
44043 {
44044 }
44045
44046
44047 int32_t m_value;
44048 # 228 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/AbstractMacroAssembler.h"
44049 bool m_isPointer;
44050
44051 };
44052
44053
44054 struct Imm32 : public TrustedImm32 {
44055 explicit Imm32(int32_t value)
44056 : TrustedImm32(value)
44057 {
44058 }
44059
44060 explicit Imm32(TrustedImmPtr ptr)
44061 : TrustedImm32(ptr)
44062 {
44063 }
44064
44065 };
44066
44067 struct ImmDouble {
44068 union {
44069 struct {
44070
44071
44072
44073 uint32_t lsb, msb;
44074
44075 } s;
44076 uint64_t u64;
44077 double d;
44078 } u;
44079
44080 explicit ImmDouble(double d) {
44081 u.d = d;
44082 }
44083 };
44084 # 276 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/AbstractMacroAssembler.h"
44085 class Label {
44086 template<class TemplateAssemblerType>
44087 friend class AbstractMacroAssembler;
44088 friend class Jump;
44089 friend class MacroAssemblerCodeRef;
44090 friend class LinkBuffer;
44091
44092 public:
44093 Label()
44094 {
44095 }
44096
44097 Label(AbstractMacroAssembler<AssemblerType>* masm)
44098 : m_label(masm->m_assembler.label())
44099 {
44100 }
44101
44102 bool isUsed() const { return m_label.isUsed(); }
44103 void used() { m_label.used(); }
44104 bool isSet() const { return m_label.isValid(); }
44105 private:
44106 JmpDst m_label;
44107 };
44108
44109
44110
44111
44112
44113 class DataLabelPtr {
44114 template<class TemplateAssemblerType>
44115 friend class AbstractMacroAssembler;
44116 friend class LinkBuffer;
44117 public:
44118 DataLabelPtr()
44119 {
44120 }
44121
44122 DataLabelPtr(AbstractMacroAssembler<AssemblerType>* masm)
44123 : m_label(masm->m_assembler.label())
44124 {
44125 }
44126
44127 bool isSet() const { return m_label.isValid(); }
44128
44129 private:
44130 JmpDst m_label;
44131 };
44132
44133
44134
44135
44136
44137 class DataLabel32 {
44138 template<class TemplateAssemblerType>
44139 friend class AbstractMacroAssembler;
44140 friend class LinkBuffer;
44141 public:
44142 DataLabel32()
44143 {
44144 }
44145
44146 DataLabel32(AbstractMacroAssembler<AssemblerType>* masm)
44147 : m_label(masm->m_assembler.label())
44148 {
44149 }
44150
44151 private:
44152 JmpDst m_label;
44153 };
44154
44155
44156
44157
44158
44159
44160
44161 class Call {
44162 template<class TemplateAssemblerType>
44163 friend class AbstractMacroAssembler;
44164
44165 public:
44166 enum Flags {
44167 None = 0x0,
44168 Linkable = 0x1,
44169 Near = 0x2,
44170 LinkableNear = 0x3
44171 };
44172
44173 Call()
44174 : m_flags(None)
44175 {
44176 }
44177
44178 Call(JmpSrc jmp, Flags flags)
44179 : m_jmp(jmp)
44180 , m_flags(flags)
44181 {
44182 }
44183
44184 bool isFlagSet(Flags flag)
44185 {
44186 return !!(m_flags & flag);
44187 }
44188
44189 static Call fromTailJump(Jump jump)
44190 {
44191 return Call(jump.m_jmp, Linkable);
44192 }
44193
44194 JmpSrc m_jmp;
44195 private:
44196 Flags m_flags;
44197 };
44198
44199
44200
44201
44202
44203
44204
44205 class Jump {
44206 template<class TemplateAssemblerType>
44207 friend class AbstractMacroAssembler;
44208 friend class Call;
44209 friend class LinkBuffer;
44210 public:
44211 Jump()
44212 {
44213 }
44214
44215 Jump(JmpSrc jmp)
44216 : m_jmp(jmp)
44217 {
44218 }
44219
44220 void link(AbstractMacroAssembler<AssemblerType>* masm)
44221 {
44222 masm->m_assembler.linkJump(m_jmp, masm->m_assembler.label());
44223 }
44224
44225 void linkTo(Label label, AbstractMacroAssembler<AssemblerType>* masm)
44226 {
44227 masm->m_assembler.linkJump(m_jmp, label.m_label);
44228 }
44229
44230 private:
44231 JmpSrc m_jmp;
44232 };
44233
44234
44235
44236
44237
44238 class JumpList {
44239 friend class LinkBuffer;
44240
44241 public:
44242 typedef js::Vector<Jump, 16 ,js::SystemAllocPolicy > JumpVector;
44243
44244 JumpList() {}
44245
44246 JumpList(const JumpList &other)
44247 {
44248 m_jumps.append(other.m_jumps);
44249 }
44250
44251 JumpList &operator=(const JumpList &other)
44252 {
44253 m_jumps.clear();
44254 m_jumps.append(other.m_jumps);
44255 return *this;
44256 }
44257
44258 void link(AbstractMacroAssembler<AssemblerType>* masm)
44259 {
44260 size_t size = m_jumps.length();
44261 for (size_t i = 0; i < size; ++i)
44262 m_jumps[i].link(masm);
44263 m_jumps.clear();
44264 }
44265
44266 void linkTo(Label label, AbstractMacroAssembler<AssemblerType>* masm)
44267 {
44268 size_t size = m_jumps.length();
44269 for (size_t i = 0; i < size; ++i)
44270 m_jumps[i].linkTo(label, masm);
44271 m_jumps.clear();
44272 }
44273
44274 void append(Jump jump)
44275 {
44276 m_jumps.append(jump);
44277 }
44278
44279 void append(const JumpList& other)
44280 {
44281 m_jumps.append(other.m_jumps.begin(), other.m_jumps.length());
44282 }
44283
44284 void clear()
44285 {
44286 m_jumps.clear();
44287 }
44288
44289 bool empty()
44290 {
44291 return !m_jumps.length();
44292 }
44293
44294 const JumpVector& jumps() const { return m_jumps; }
44295
44296 private:
44297 JumpVector m_jumps;
44298 };
44299
44300
44301
44302
44303 static CodePtr trampolineAt(CodeRef ref, Label label)
44304 {
44305 return CodePtr(AssemblerType::getRelocatedAddress(ref.m_code.dataLocation(), label.m_label));
44306 }
44307
44308 size_t size()
44309 {
44310 return m_assembler.size();
44311 }
44312
44313 unsigned char *buffer()
44314 {
44315 return m_assembler.buffer();
44316 }
44317
44318 bool oom()
44319 {
44320 return m_assembler.oom();
44321 }
44322
44323 void executableCopy(void* buffer)
44324 {
44325 do { } while(0);
44326 m_assembler.executableCopy(buffer);
44327 }
44328
44329 Label label()
44330 {
44331 return Label(this);
44332 }
44333
44334 DataLabel32 dataLabel32()
44335 {
44336 return DataLabel32(this);
44337 }
44338
44339 Label align()
44340 {
44341 m_assembler.align(16);
44342 return Label(this);
44343 }
44344
44345 ptrdiff_t differenceBetween(Label from, Jump to)
44346 {
44347 return AssemblerType::getDifferenceBetweenLabels(from.m_label, to.m_jmp);
44348 }
44349
44350 ptrdiff_t differenceBetween(Label from, Call to)
44351 {
44352 return AssemblerType::getDifferenceBetweenLabels(from.m_label, to.m_jmp);
44353 }
44354
44355 ptrdiff_t differenceBetween(Label from, Label to)
44356 {
44357 return AssemblerType::getDifferenceBetweenLabels(from.m_label, to.m_label);
44358 }
44359
44360 ptrdiff_t differenceBetween(Label from, DataLabelPtr to)
44361 {
44362 return AssemblerType::getDifferenceBetweenLabels(from.m_label, to.m_label);
44363 }
44364
44365 ptrdiff_t differenceBetween(Label from, DataLabel32 to)
44366 {
44367 return AssemblerType::getDifferenceBetweenLabels(from.m_label, to.m_label);
44368 }
44369
44370 ptrdiff_t differenceBetween(DataLabel32 from, Label to)
44371 {
44372 return AssemblerType::getDifferenceBetweenLabels(from.m_label, to.m_label);
44373 }
44374
44375 ptrdiff_t differenceBetween(DataLabelPtr from, Label to)
44376 {
44377 return AssemblerType::getDifferenceBetweenLabels(from.m_label, to.m_label);
44378 }
44379
44380 ptrdiff_t differenceBetween(DataLabelPtr from, Jump to)
44381 {
44382 return AssemblerType::getDifferenceBetweenLabels(from.m_label, to.m_jmp);
44383 }
44384
44385 ptrdiff_t differenceBetween(DataLabelPtr from, DataLabelPtr to)
44386 {
44387 return AssemblerType::getDifferenceBetweenLabels(from.m_label, to.m_label);
44388 }
44389
44390 ptrdiff_t differenceBetween(DataLabelPtr from, Call to)
44391 {
44392 return AssemblerType::getDifferenceBetweenLabels(from.m_label, to.m_jmp);
44393 }
44394
44395 protected:
44396 AssemblerType m_assembler;
44397
44398 friend class LinkBuffer;
44399 friend class RepatchBuffer;
44400
44401 static void linkJump(void* code, Jump jump, CodeLocationLabel target)
44402 {
44403 AssemblerType::linkJump(code, jump.m_jmp, target.dataLocation());
44404 }
44405
44406 static void linkPointer(void* code, typename AssemblerType::JmpDst label, void* value)
44407 {
44408 AssemblerType::linkPointer(code, label, value);
44409 }
44410
44411 static void* getLinkerAddress(void* code, typename AssemblerType::JmpSrc label)
44412 {
44413 return AssemblerType::getRelocatedAddress(code, label);
44414 }
44415
44416 static void* getLinkerAddress(void* code, typename AssemblerType::JmpDst label)
44417 {
44418 return AssemblerType::getRelocatedAddress(code, label);
44419 }
44420
44421 static unsigned getLinkerCallReturnOffset(Call call)
44422 {
44423 return AssemblerType::getCallReturnOffset(call.m_jmp);
44424 }
44425
44426 static void repatchJump(CodeLocationJump jump, CodeLocationLabel destination)
44427 {
44428 AssemblerType::relinkJump(jump.dataLocation(), destination.dataLocation());
44429 }
44430
44431 static bool canRepatchJump(CodeLocationJump jump, CodeLocationLabel destination)
44432 {
44433 return AssemblerType::canRelinkJump(jump.dataLocation(), destination.dataLocation());
44434 }
44435
44436 static void repatchNearCall(CodeLocationNearCall nearCall, CodeLocationLabel destination)
44437 {
44438 AssemblerType::relinkCall(nearCall.dataLocation(), destination.executableAddress());
44439 }
44440
44441 static void repatchInt32(CodeLocationDataLabel32 dataLabel32, int32_t value)
44442 {
44443 AssemblerType::repatchInt32(dataLabel32.dataLocation(), value);
44444 }
44445
44446 static void repatchPointer(CodeLocationDataLabelPtr dataLabelPtr, void* value)
44447 {
44448 AssemblerType::repatchPointer(dataLabelPtr.dataLocation(), value);
44449 }
44450
44451 static void repatchLoadPtrToLEA(CodeLocationInstruction instruction)
44452 {
44453 AssemblerType::repatchLoadPtrToLEA(instruction.dataLocation());
44454 }
44455
44456 static void repatchLEAToLoadPtr(CodeLocationInstruction instruction)
44457 {
44458 AssemblerType::repatchLEAToLoadPtr(instruction.dataLocation());
44459 }
44460 };
44461
44462 }
44463 # 41 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/MacroAssemblerARM.h" 2
44464
44465 namespace JSC {
44466
44467 class MacroAssemblerARM : public AbstractMacroAssembler<ARMAssembler> {
44468 static const int DoubleConditionMask = 0x0f;
44469 static const int DoubleConditionBitSpecial = 0x8;
44470 public:
44471 enum Condition {
44472 Equal = ARMAssembler::EQ,
44473 NotEqual = ARMAssembler::NE,
44474 Above = ARMAssembler::HI,
44475 AboveOrEqual = ARMAssembler::CS,
44476 Below = ARMAssembler::CC,
44477 BelowOrEqual = ARMAssembler::LS,
44478 GreaterThan = ARMAssembler::GT,
44479 GreaterThanOrEqual = ARMAssembler::GE,
44480 LessThan = ARMAssembler::LT,
44481 LessThanOrEqual = ARMAssembler::LE,
44482 Overflow = ARMAssembler::VS,
44483 Signed = ARMAssembler::MI,
44484 Zero = ARMAssembler::EQ,
44485 NonZero = ARMAssembler::NE
44486 };
44487
44488 enum DoubleCondition {
44489
44490 DoubleEqual = ARMAssembler::EQ,
44491 DoubleNotEqual = ARMAssembler::NE | DoubleConditionBitSpecial,
44492 DoubleGreaterThan = ARMAssembler::GT,
44493 DoubleGreaterThanOrEqual = ARMAssembler::GE,
44494 DoubleLessThan = ARMAssembler::CC,
44495 DoubleLessThanOrEqual = ARMAssembler::LS,
44496
44497 DoubleEqualOrUnordered = ARMAssembler::EQ | DoubleConditionBitSpecial,
44498 DoubleNotEqualOrUnordered = ARMAssembler::NE,
44499 DoubleGreaterThanOrUnordered = ARMAssembler::HI,
44500 DoubleGreaterThanOrEqualOrUnordered = ARMAssembler::CS,
44501 DoubleLessThanOrUnordered = ARMAssembler::LT,
44502 DoubleLessThanOrEqualOrUnordered = ARMAssembler::LE
44503 };
44504
44505 static const RegisterID stackPointerRegister = ARMRegisters::sp;
44506 static const RegisterID linkRegister = ARMRegisters::lr;
44507
44508 static const Scale ScalePtr = TimesFour;
44509 static const unsigned int TotalRegisters = 16;
44510
44511 void add32(RegisterID src, RegisterID dest)
44512 {
44513 m_assembler.adds_r(dest, dest, src);
44514 }
44515
44516 void add32(TrustedImm32 imm, Address address)
44517 {
44518 load32(address, ARMRegisters::S1);
44519 add32(imm, ARMRegisters::S1);
44520 store32(ARMRegisters::S1, address);
44521 }
44522
44523 void add32(TrustedImm32 imm, RegisterID dest)
44524 {
44525 m_assembler.adds_r(dest, dest, m_assembler.getImm(imm.m_value, ARMRegisters::S0));
44526 }
44527
44528 void add32(Address src, RegisterID dest)
44529 {
44530 load32(src, ARMRegisters::S1);
44531 add32(ARMRegisters::S1, dest);
44532 }
44533
44534 void and32(Address src, RegisterID dest)
44535 {
44536 load32(src, ARMRegisters::S1);
44537 and32(ARMRegisters::S1, dest);
44538 }
44539
44540 void and32(RegisterID src, RegisterID dest)
44541 {
44542 m_assembler.ands_r(dest, dest, src);
44543 }
44544
44545 void and32(Imm32 imm, RegisterID dest)
44546 {
44547 ARMWord w = m_assembler.getImm(imm.m_value, ARMRegisters::S0, true);
44548 if (w & ARMAssembler::OP2_INV_IMM)
44549 m_assembler.bics_r(dest, dest, w & ~ARMAssembler::OP2_INV_IMM);
44550 else
44551 m_assembler.ands_r(dest, dest, w);
44552 }
44553
44554 void lshift32(RegisterID shift_amount, RegisterID dest)
44555 {
44556 ARMWord w = ARMAssembler::getOp2(0x1f);
44557 do { } while(0);
44558 m_assembler.and_r(ARMRegisters::S0, shift_amount, w);
44559
44560 m_assembler.movs_r(dest, m_assembler.lsl_r(dest, ARMRegisters::S0));
44561 }
44562
44563 void lshift32(Imm32 imm, RegisterID dest)
44564 {
44565 m_assembler.movs_r(dest, m_assembler.lsl(dest, imm.m_value & 0x1f));
44566 }
44567
44568 void mul32(RegisterID src, RegisterID dest)
44569 {
44570 if (src == dest) {
44571 move(src, ARMRegisters::S0);
44572 src = ARMRegisters::S0;
44573 }
44574 m_assembler.muls_r(dest, dest, src);
44575 }
44576
44577 void mul32(Imm32 imm, RegisterID src, RegisterID dest)
44578 {
44579 move(imm, ARMRegisters::S0);
44580 m_assembler.muls_r(dest, src, ARMRegisters::S0);
44581 }
44582
44583 void neg32(RegisterID srcDest)
44584 {
44585 m_assembler.rsbs_r(srcDest, srcDest, ARMAssembler::getOp2(0));
44586 }
44587
44588 void not32(RegisterID dest)
44589 {
44590 m_assembler.mvns_r(dest, dest);
44591 }
44592
44593 void or32(RegisterID src, RegisterID dest)
44594 {
44595 m_assembler.orrs_r(dest, dest, src);
44596 }
44597
44598 void or32(TrustedImm32 imm, RegisterID dest)
44599 {
44600 m_assembler.orrs_r(dest, dest, m_assembler.getImm(imm.m_value, ARMRegisters::S0));
44601 }
44602
44603 void rshift32(RegisterID shift_amount, RegisterID dest)
44604 {
44605 ARMWord w = ARMAssembler::getOp2(0x1f);
44606 do { } while(0);
44607 m_assembler.and_r(ARMRegisters::S0, shift_amount, w);
44608
44609 m_assembler.movs_r(dest, m_assembler.asr_r(dest, ARMRegisters::S0));
44610 }
44611
44612 void rshift32(Imm32 imm, RegisterID dest)
44613 {
44614 m_assembler.movs_r(dest, m_assembler.asr(dest, imm.m_value & 0x1f));
44615 }
44616
44617 void urshift32(RegisterID shift_amount, RegisterID dest)
44618 {
44619 ARMWord w = ARMAssembler::getOp2(0x1f);
44620 do { } while(0);
44621 m_assembler.and_r(ARMRegisters::S0, shift_amount, w);
44622
44623 m_assembler.movs_r(dest, m_assembler.lsr_r(dest, ARMRegisters::S0));
44624 }
44625
44626 void urshift32(Imm32 imm, RegisterID dest)
44627 {
44628 m_assembler.movs_r(dest, m_assembler.lsr(dest, imm.m_value & 0x1f));
44629 }
44630
44631 void sub32(RegisterID src, RegisterID dest)
44632 {
44633 m_assembler.subs_r(dest, dest, src);
44634 }
44635
44636 void sub32(TrustedImm32 imm, RegisterID dest)
44637 {
44638 m_assembler.subs_r(dest, dest, m_assembler.getImm(imm.m_value, ARMRegisters::S0));
44639 }
44640
44641 void sub32(TrustedImm32 imm, Address address)
44642 {
44643 load32(address, ARMRegisters::S1);
44644 sub32(imm, ARMRegisters::S1);
44645 store32(ARMRegisters::S1, address);
44646 }
44647
44648 void sub32(Address src, RegisterID dest)
44649 {
44650 load32(src, ARMRegisters::S1);
44651 sub32(ARMRegisters::S1, dest);
44652 }
44653
44654 void or32(Address address, RegisterID dest)
44655 {
44656 load32(address, ARMRegisters::S1);
44657 or32(ARMRegisters::S1, dest);
44658 }
44659
44660 void xor32(RegisterID src, RegisterID dest)
44661 {
44662 m_assembler.eors_r(dest, dest, src);
44663 }
44664
44665 void xor32(TrustedImm32 imm, RegisterID dest)
44666 {
44667 m_assembler.eors_r(dest, dest, m_assembler.getImm(imm.m_value, ARMRegisters::S0));
44668 }
44669
44670 void xor32(Address src, RegisterID dest)
44671 {
44672 load32(src, ARMRegisters::S1);
44673 m_assembler.eors_r(dest, dest, ARMRegisters::S1);
44674 }
44675
44676 void load8SignExtend(ImplicitAddress address, RegisterID dest)
44677 {
44678 m_assembler.dataTransferN(true, true, 8, dest, address.base, address.offset);
44679 }
44680
44681 void load8ZeroExtend(ImplicitAddress address, RegisterID dest)
44682 {
44683 m_assembler.dataTransferN(true, false, 8, dest, address.base, address.offset);
44684 }
44685
44686 void load8SignExtend(BaseIndex address, RegisterID dest)
44687 {
44688 m_assembler.baseIndexTransferN(true, true, 8, dest,
44689 address.base, address.index, address.scale, address.offset);
44690 }
44691
44692 void load8ZeroExtend(BaseIndex address, RegisterID dest)
44693 {
44694 m_assembler.baseIndexTransferN(true, false, 8, dest,
44695 address.base, address.index, address.scale, address.offset);
44696 }
44697
44698
44699 void load8(ImplicitAddress address, RegisterID dest)
44700 {
44701 load8ZeroExtend(address, dest);
44702 }
44703
44704 void load16SignExtend(ImplicitAddress address, RegisterID dest)
44705 {
44706 m_assembler.dataTransferN(true, true, 16, dest, address.base, address.offset);
44707 }
44708
44709 void load16ZeroExtend(ImplicitAddress address, RegisterID dest)
44710 {
44711 m_assembler.dataTransferN(true, false, 16, dest, address.base, address.offset);
44712 }
44713 void load16SignExtend(BaseIndex address, RegisterID dest)
44714 {
44715 m_assembler.baseIndexTransferN(true, true, 16, dest,
44716 address.base, address.index, address.scale, address.offset);
44717 }
44718 void load16ZeroExtend(BaseIndex address, RegisterID dest)
44719 {
44720 m_assembler.baseIndexTransferN(true, false, 16, dest,
44721 address.base, address.index, address.scale, address.offset);
44722 }
44723
44724 void load32(ImplicitAddress address, RegisterID dest)
44725 {
44726 m_assembler.dataTransfer32(true, dest, address.base, address.offset);
44727 }
44728
44729 void load32(BaseIndex address, RegisterID dest)
44730 {
44731 m_assembler.baseIndexTransfer32(true, dest, address.base, address.index, static_cast<int>(address.scale), address.offset);
44732 }
44733
44734
44735
44736
44737 void load32WithUnalignedHalfWords(BaseIndex address, RegisterID dest)
44738 {
44739 load32(address, dest);
44740 }
44741
44742
44743 DataLabel32 load32WithAddressOffsetPatch(Address address, RegisterID dest)
44744 {
44745 do { } while(0);
44746 DataLabel32 dataLabel(this);
44747 m_assembler.ldr_un_imm(ARMRegisters::S0, 0);
44748 m_assembler.dtr_ur(true, dest, address.base, ARMRegisters::S0);
44749 return dataLabel;
44750 }
44751
44752 DataLabel32 load64WithAddressOffsetPatch(Address address, RegisterID hi, RegisterID lo)
44753 {
44754 do { } while(0);
44755 do { } while(0);
44756 DataLabel32 dataLabel(this);
44757 m_assembler.ldr_un_imm(ARMRegisters::S0, 0);
44758 m_assembler.add_r(ARMRegisters::S0, ARMRegisters::S0, address.base);
44759 m_assembler.dtr_u(true, lo, ARMRegisters::S0, 0);
44760 m_assembler.dtr_u(true, hi, ARMRegisters::S0, 4);
44761 return dataLabel;
44762 }
44763
44764 Label loadPtrWithPatchToLEA(Address address, RegisterID dest)
44765 {
44766 Label label(this);
44767 load32(address, dest);
44768 return label;
44769 }
44770
44771 void load16(BaseIndex address, RegisterID dest)
44772 {
44773 m_assembler.add_r(ARMRegisters::S1, address.base, m_assembler.lsl(address.index, address.scale));
44774 load16(Address(ARMRegisters::S1, address.offset), dest);
44775 }
44776
44777 void load16(ImplicitAddress address, RegisterID dest)
44778 {
44779 if (address.offset >= 0)
44780 m_assembler.ldrh_u(dest, address.base, m_assembler.getOffsetForHalfwordDataTransfer(address.offset, ARMRegisters::S0));
44781 else
44782 m_assembler.ldrh_d(dest, address.base, m_assembler.getOffsetForHalfwordDataTransfer(-address.offset, ARMRegisters::S0));
44783 }
44784
44785 DataLabel32 store32WithAddressOffsetPatch(RegisterID src, Address address)
44786 {
44787 do { } while(0);
44788 DataLabel32 dataLabel(this);
44789 m_assembler.ldr_un_imm(ARMRegisters::S0, 0);
44790 m_assembler.dtr_ur(false, src, address.base, ARMRegisters::S0);
44791 return dataLabel;
44792 }
44793
44794 DataLabel32 store64WithAddressOffsetPatch(RegisterID hi, RegisterID lo, Address address)
44795 {
44796 do { } while(0);
44797 do { } while(0);
44798 do { } while(0);
44799 DataLabel32 dataLabel(this);
44800 m_assembler.ldr_un_imm(ARMRegisters::S0, address.offset);
44801 m_assembler.add_r(ARMRegisters::S0, ARMRegisters::S0, address.base);
44802 m_assembler.dtr_u(false, lo, ARMRegisters::S0, 0);
44803 m_assembler.dtr_u(false, hi, ARMRegisters::S0, 4);
44804 return dataLabel;
44805 }
44806
44807 DataLabel32 store64WithAddressOffsetPatch(Imm32 hi, RegisterID lo, Address address)
44808 {
44809 do { } while(0);
44810 do { } while(0);
44811 do { } while(0);
44812 do { } while(0);
44813 do { } while(0);
44814 DataLabel32 dataLabel(this);
44815 m_assembler.ldr_un_imm(ARMRegisters::S0, address.offset);
44816 m_assembler.moveImm(hi.m_value, ARMRegisters::S1);
44817 m_assembler.add_r(ARMRegisters::S0, ARMRegisters::S0, address.base);
44818 m_assembler.dtr_u(false, lo, ARMRegisters::S0, 0);
44819 m_assembler.dtr_u(false, ARMRegisters::S1, ARMRegisters::S0, 4);
44820 return dataLabel;
44821 }
44822
44823 DataLabel32 store64WithAddressOffsetPatch(Imm32 hi, Imm32 lo, Address address)
44824 {
44825 do { } while(0);
44826 do { } while(0);
44827 DataLabel32 dataLabel(this);
44828 m_assembler.ldr_un_imm(ARMRegisters::S0, address.offset);
44829 m_assembler.add_r(ARMRegisters::S0, ARMRegisters::S0, address.base);
44830 m_assembler.moveImm(lo.m_value, ARMRegisters::S1);
44831 m_assembler.dtr_u(false, ARMRegisters::S1, ARMRegisters::S0, 0);
44832
44833 m_assembler.moveImm(hi.m_value, ARMRegisters::S1);
44834 m_assembler.dtr_u(false, ARMRegisters::S1, ARMRegisters::S0, 4);
44835 return dataLabel;
44836 }
44837
44838 void store32(RegisterID src, ImplicitAddress address)
44839 {
44840 m_assembler.dataTransfer32(false, src, address.base, address.offset);
44841 }
44842
44843 void store32(RegisterID src, BaseIndex address)
44844 {
44845 m_assembler.baseIndexTransfer32(false, src, address.base, address.index, static_cast<int>(address.scale), address.offset);
44846 }
44847
44848 void store32(TrustedImm32 imm, BaseIndex address)
44849 {
44850 if (imm.m_isPointer)
44851 m_assembler.ldr_un_imm(ARMRegisters::S1, imm.m_value);
44852 else
44853 move(imm, ARMRegisters::S1);
44854 store32(ARMRegisters::S1, address);
44855 }
44856
44857 void store32(TrustedImm32 imm, ImplicitAddress address)
44858 {
44859 if (imm.m_isPointer)
44860 m_assembler.ldr_un_imm(ARMRegisters::S1, imm.m_value);
44861 else
44862 move(imm, ARMRegisters::S1);
44863 store32(ARMRegisters::S1, address);
44864 }
44865
44866 void store32(RegisterID src, void* address)
44867 {
44868 m_assembler.ldr_un_imm(ARMRegisters::S0, reinterpret_cast<ARMWord>(address));
44869 m_assembler.dtr_u(false, src, ARMRegisters::S0, 0);
44870 }
44871
44872 void store32(TrustedImm32 imm, void* address)
44873 {
44874 m_assembler.ldr_un_imm(ARMRegisters::S0, reinterpret_cast<ARMWord>(address));
44875 if (imm.m_isPointer)
44876 m_assembler.ldr_un_imm(ARMRegisters::S1, imm.m_value);
44877 else
44878 m_assembler.moveImm(imm.m_value, ARMRegisters::S1);
44879 m_assembler.dtr_u(false, ARMRegisters::S1, ARMRegisters::S0, 0);
44880 }
44881
44882 void store16(RegisterID src, ImplicitAddress address)
44883 {
44884 m_assembler.dataTransferN(false, false, 16, src, address.base, address.offset);
44885 }
44886 void store16(RegisterID src, BaseIndex address)
44887 {
44888 m_assembler.baseIndexTransferN(false, false, 16, src, address.base, address.index, static_cast<int>(address.scale), address.offset);
44889 }
44890
44891 void store16(TrustedImm32 imm, BaseIndex address)
44892 {
44893 if (imm.m_isPointer)
44894 do { } while(0);
44895 else
44896 move(imm, ARMRegisters::S1);
44897 store16(ARMRegisters::S1, address);
44898 }
44899 void store16(TrustedImm32 imm, ImplicitAddress address)
44900 {
44901 if (imm.m_isPointer)
44902 do { } while(0);
44903 else
44904 move(imm, ARMRegisters::S1);
44905 store16(ARMRegisters::S1, address);
44906 }
44907
44908 void store16(RegisterID src, void* address)
44909 {
44910 m_assembler.ldr_un_imm(ARMRegisters::S0, reinterpret_cast<ARMWord>(address));
44911 m_assembler.mem_imm_off(false, false, 16, true, src, ARMRegisters::S0, 0);
44912 }
44913
44914 void store16(TrustedImm32 imm, void* address)
44915 {
44916 m_assembler.ldr_un_imm(ARMRegisters::S0, reinterpret_cast<ARMWord>(address));
44917 if (imm.m_isPointer)
44918 do { } while(0);
44919 else
44920 m_assembler.moveImm(imm.m_value, ARMRegisters::S1);
44921 m_assembler.mem_imm_off(false, false, 16, true, ARMRegisters::S1, ARMRegisters::S0, 0);
44922 }
44923
44924 void store8(RegisterID src, ImplicitAddress address)
44925 {
44926 m_assembler.dataTransferN(false, false, 16, src, address.base, address.offset);
44927 }
44928
44929 void store8(RegisterID src, BaseIndex address)
44930 {
44931 m_assembler.baseIndexTransferN(false, false, 8, src, address.base, address.index, static_cast<int>(address.scale), address.offset);
44932 }
44933
44934 void store8(TrustedImm32 imm, BaseIndex address)
44935 {
44936 if (imm.m_isPointer)
44937 do { } while(0);
44938 else
44939 move(imm, ARMRegisters::S1);
44940 store8(ARMRegisters::S1, address);
44941 }
44942
44943 void store8(TrustedImm32 imm, ImplicitAddress address)
44944 {
44945 if (imm.m_isPointer)
44946 do { } while(0);
44947 else
44948 move(imm, ARMRegisters::S1);
44949 store8(ARMRegisters::S1, address);
44950 }
44951
44952 void store8(RegisterID src, void* address)
44953 {
44954 m_assembler.ldr_un_imm(ARMRegisters::S0, reinterpret_cast<ARMWord>(address));
44955 m_assembler.mem_imm_off(false, false, 8, true, src, ARMRegisters::S0, 0);
44956 }
44957
44958 void store8(TrustedImm32 imm, void* address)
44959 {
44960 m_assembler.ldr_un_imm(ARMRegisters::S0, reinterpret_cast<ARMWord>(address));
44961 if (imm.m_isPointer)
44962 do { } while(0);
44963 else
44964 m_assembler.moveImm(imm.m_value, ARMRegisters::S1);
44965 m_assembler.mem_imm_off(false, false, 8, true, ARMRegisters::S1, ARMRegisters::S0, 0);
44966 }
44967
44968 void pop(RegisterID dest)
44969 {
44970 m_assembler.pop_r(dest);
44971 }
44972
44973 void push(RegisterID src)
44974 {
44975 m_assembler.push_r(src);
44976 }
44977
44978 void push(Address address)
44979 {
44980 load32(address, ARMRegisters::S1);
44981 push(ARMRegisters::S1);
44982 }
44983
44984 void push(Imm32 imm)
44985 {
44986 move(imm, ARMRegisters::S0);
44987 push(ARMRegisters::S0);
44988 }
44989
44990 void move(TrustedImm32 imm, RegisterID dest)
44991 {
44992 if (imm.m_isPointer)
44993 m_assembler.ldr_un_imm(dest, imm.m_value);
44994 else
44995 m_assembler.moveImm(imm.m_value, dest);
44996 }
44997
44998 void move(RegisterID src, RegisterID dest)
44999 {
45000 m_assembler.mov_r(dest, src);
45001 }
45002
45003 void move(TrustedImmPtr imm, RegisterID dest)
45004 {
45005 move(Imm32(imm), dest);
45006 }
45007
45008 void swap(RegisterID reg1, RegisterID reg2)
45009 {
45010 m_assembler.mov_r(ARMRegisters::S0, reg1);
45011 m_assembler.mov_r(reg1, reg2);
45012 m_assembler.mov_r(reg2, ARMRegisters::S0);
45013 }
45014
45015 void signExtend32ToPtr(RegisterID src, RegisterID dest)
45016 {
45017 if (src != dest)
45018 move(src, dest);
45019 }
45020
45021 void zeroExtend32ToPtr(RegisterID src, RegisterID dest)
45022 {
45023 if (src != dest)
45024 move(src, dest);
45025 }
45026
45027 Jump branch8(Condition cond, Address left, Imm32 right)
45028 {
45029 load8(left, ARMRegisters::S1);
45030 return branch32(cond, ARMRegisters::S1, right);
45031 }
45032
45033 Jump branch32(Condition cond, RegisterID left, RegisterID right, int useConstantPool = 0)
45034 {
45035 m_assembler.cmp_r(left, right);
45036 return Jump(m_assembler.jmp(ARMCondition(cond), useConstantPool));
45037 }
45038
45039 Jump branch32(Condition cond, RegisterID left, TrustedImm32 right, int useConstantPool = 0)
45040 {
45041 do { } while(0);
45042 if (right.m_isPointer) {
45043 m_assembler.ldr_un_imm(ARMRegisters::S0, right.m_value);
45044 m_assembler.cmp_r(left, ARMRegisters::S0);
45045 } else {
45046
45047
45048
45049
45050
45051
45052 ARMWord arg = m_assembler.getOp2(right.m_value);
45053 if (arg != m_assembler.INVALID_IMM) {
45054 m_assembler.cmp_r(left, arg);
45055 } else {
45056
45057
45058 arg = m_assembler.getOp2(-right.m_value);
45059 if (arg != m_assembler.INVALID_IMM) {
45060 m_assembler.cmn_r(left, arg);
45061 } else {
45062
45063
45064
45065 m_assembler.cmp_r(left, m_assembler.getImm(right.m_value, ARMRegisters::S0));
45066 }
45067 }
45068 }
45069 return Jump(m_assembler.jmp(ARMCondition(cond), useConstantPool));
45070 }
45071
45072
45073
45074
45075
45076 Jump branch32FixedLength(Condition cond, RegisterID left, TrustedImm32 right)
45077 {
45078 m_assembler.ldr_un_imm(ARMRegisters::S1, right.m_value);
45079 return branch32(cond, left, ARMRegisters::S1, true);
45080 }
45081
45082
45083 Jump branch32WithPatch(Condition cond, RegisterID left, TrustedImm32 right, DataLabel32 &dataLabel)
45084 {
45085 do { } while(0);
45086 dataLabel = moveWithPatch(right, ARMRegisters::S1);
45087 return branch32(cond, left, ARMRegisters::S1, true);
45088 }
45089
45090 Jump branch32WithPatch(Condition cond, Address left, TrustedImm32 right, DataLabel32 &dataLabel)
45091 {
45092 do { } while(0);
45093 load32(left, ARMRegisters::S1);
45094 dataLabel = moveWithPatch(right, ARMRegisters::S0);
45095 return branch32(cond, ARMRegisters::S1, ARMRegisters::S0, true);
45096 }
45097
45098 Jump branch32(Condition cond, RegisterID left, Address right)
45099 {
45100
45101 load32(right, ARMRegisters::S1);
45102 return branch32(cond, left, ARMRegisters::S1);
45103 }
45104
45105 Jump branch32(Condition cond, Address left, RegisterID right)
45106 {
45107 load32(left, ARMRegisters::S1);
45108 return branch32(cond, ARMRegisters::S1, right);
45109 }
45110
45111 Jump branch32(Condition cond, Address left, TrustedImm32 right)
45112 {
45113 load32(left, ARMRegisters::S1);
45114 return branch32(cond, ARMRegisters::S1, right);
45115 }
45116
45117 Jump branch32(Condition cond, BaseIndex left, TrustedImm32 right)
45118 {
45119 load32(left, ARMRegisters::S1);
45120 return branch32(cond, ARMRegisters::S1, right);
45121 }
45122
45123 Jump branch32WithUnalignedHalfWords(Condition cond, BaseIndex left, TrustedImm32 right)
45124 {
45125 load32WithUnalignedHalfWords(left, ARMRegisters::S1);
45126 return branch32(cond, ARMRegisters::S1, right);
45127 }
45128
45129 Jump branch16(Condition cond, BaseIndex left, RegisterID right)
45130 {
45131 (void)(cond);
45132 (void)(left);
45133 (void)(right);
45134 __builtin_unreachable();
45135 return jump();
45136 }
45137
45138 Jump branch16(Condition cond, BaseIndex left, Imm32 right)
45139 {
45140 load16(left, ARMRegisters::S0);
45141 move(right, ARMRegisters::S1);
45142 m_assembler.cmp_r(ARMRegisters::S0, ARMRegisters::S1);
45143 return m_assembler.jmp(ARMCondition(cond));
45144 }
45145
45146 Jump branchTest8(Condition cond, Address address, Imm32 mask = Imm32(-1))
45147 {
45148 load8(address, ARMRegisters::S1);
45149 return branchTest32(cond, ARMRegisters::S1, mask);
45150 }
45151
45152 Jump branchTest32(Condition cond, RegisterID reg, RegisterID mask)
45153 {
45154 do { } while(0);
45155 m_assembler.tst_r(reg, mask);
45156 return Jump(m_assembler.jmp(ARMCondition(cond)));
45157 }
45158
45159 Jump branchTest32(Condition cond, RegisterID reg, Imm32 mask = Imm32(-1))
45160 {
45161 do { } while(0);
45162 ARMWord w = m_assembler.getImm(mask.m_value, ARMRegisters::S0, true);
45163 if (w & ARMAssembler::OP2_INV_IMM)
45164 m_assembler.bics_r(ARMRegisters::S0, reg, w & ~ARMAssembler::OP2_INV_IMM);
45165 else
45166 m_assembler.tst_r(reg, w);
45167 return Jump(m_assembler.jmp(ARMCondition(cond)));
45168 }
45169
45170 Jump branchTest32(Condition cond, Address address, Imm32 mask = Imm32(-1))
45171 {
45172 load32(address, ARMRegisters::S1);
45173 return branchTest32(cond, ARMRegisters::S1, mask);
45174 }
45175
45176 Jump branchTest32(Condition cond, BaseIndex address, Imm32 mask = Imm32(-1))
45177 {
45178 load32(address, ARMRegisters::S1);
45179 return branchTest32(cond, ARMRegisters::S1, mask);
45180 }
45181
45182 Jump jump()
45183 {
45184 return Jump(m_assembler.jmp());
45185 }
45186
45187 void jump(RegisterID target)
45188 {
45189 m_assembler.bx(target);
45190 }
45191
45192 void jump(Address address)
45193 {
45194 load32(address, ARMRegisters::pc);
45195 }
45196
45197 Jump branchAdd32(Condition cond, RegisterID src, RegisterID dest)
45198 {
45199 do { } while(0);
45200 add32(src, dest);
45201 return Jump(m_assembler.jmp(ARMCondition(cond)));
45202 }
45203
45204 Jump branchAdd32(Condition cond, Imm32 imm, RegisterID dest)
45205 {
45206 do { } while(0);
45207 add32(imm, dest);
45208 return Jump(m_assembler.jmp(ARMCondition(cond)));
45209 }
45210
45211 Jump branchAdd32(Condition cond, Address src, RegisterID dest)
45212 {
45213 do { } while(0);
45214 add32(src, dest);
45215 return Jump(m_assembler.jmp(ARMCondition(cond)));
45216 }
45217
45218 void mull32(RegisterID src1, RegisterID src2, RegisterID dest)
45219 {
45220 if (src1 == dest) {
45221 move(src1, ARMRegisters::S0);
45222 src1 = ARMRegisters::S0;
45223 }
45224 m_assembler.mull_r(ARMRegisters::S1, dest, src2, src1);
45225 m_assembler.cmp_r(ARMRegisters::S1, m_assembler.asr(dest, 31));
45226 }
45227
45228 Jump branchMul32(Condition cond, RegisterID src, RegisterID dest)
45229 {
45230 do { } while(0);
45231 if (cond == Overflow) {
45232 mull32(src, dest, dest);
45233 cond = NonZero;
45234 }
45235 else
45236 mul32(src, dest);
45237 return Jump(m_assembler.jmp(ARMCondition(cond)));
45238 }
45239
45240 Jump branchMul32(Condition cond, Imm32 imm, RegisterID src, RegisterID dest)
45241 {
45242 do { } while(0);
45243 if (cond == Overflow) {
45244 move(imm, ARMRegisters::S0);
45245 mull32(ARMRegisters::S0, src, dest);
45246 cond = NonZero;
45247 }
45248 else
45249 mul32(imm, src, dest);
45250 return Jump(m_assembler.jmp(ARMCondition(cond)));
45251 }
45252
45253 Jump branchSub32(Condition cond, RegisterID src, RegisterID dest)
45254 {
45255 do { } while(0);
45256 sub32(src, dest);
45257 return Jump(m_assembler.jmp(ARMCondition(cond)));
45258 }
45259
45260 Jump branchSub32(Condition cond, Imm32 imm, RegisterID dest)
45261 {
45262 do { } while(0);
45263 sub32(imm, dest);
45264 return Jump(m_assembler.jmp(ARMCondition(cond)));
45265 }
45266
45267 Jump branchSub32(Condition cond, Address src, RegisterID dest)
45268 {
45269 do { } while(0);
45270 sub32(src, dest);
45271 return Jump(m_assembler.jmp(ARMCondition(cond)));
45272 }
45273
45274 Jump branchSub32(Condition cond, Imm32 imm, Address dest)
45275 {
45276 do { } while(0);
45277 sub32(imm, dest);
45278 return Jump(m_assembler.jmp(ARMCondition(cond)));
45279 }
45280
45281 Jump branchNeg32(Condition cond, RegisterID srcDest)
45282 {
45283 do { } while(0);
45284 neg32(srcDest);
45285 return Jump(m_assembler.jmp(ARMCondition(cond)));
45286 }
45287
45288 Jump branchOr32(Condition cond, RegisterID src, RegisterID dest)
45289 {
45290 do { } while(0);
45291 or32(src, dest);
45292 return Jump(m_assembler.jmp(ARMCondition(cond)));
45293 }
45294
45295
45296
45297 void nop(int tag)
45298 {
45299 do { } while(0);
45300 m_assembler.mov_r(tag, tag);
45301 }
45302
45303 void breakpoint()
45304 {
45305 m_assembler.bkpt(0);
45306 }
45307
45308 Call nearCall()
45309 {
45310
45311 Call call(m_assembler.loadBranchTarget(ARMRegisters::S1, ARMAssembler::AL, true), Call::LinkableNear);
45312 m_assembler.blx(ARMRegisters::S1);
45313 return call;
45314
45315
45316
45317
45318 }
45319
45320 Call call(RegisterID target)
45321 {
45322 m_assembler.blx(target);
45323 JmpSrc jmpSrc;
45324 return Call(jmpSrc, Call::None);
45325 }
45326
45327 void call(Address address)
45328 {
45329 call32(address.base, address.offset);
45330 }
45331
45332 void ret()
45333 {
45334 m_assembler.bx(linkRegister);
45335 }
45336
45337 void set32(Condition cond, Address left, RegisterID right, RegisterID dest)
45338 {
45339 load32(left, ARMRegisters::S1);
45340 set32(cond, ARMRegisters::S1, right, dest);
45341 }
45342
45343 void set32(Condition cond, RegisterID left, Address right, RegisterID dest)
45344 {
45345 load32(right, ARMRegisters::S1);
45346 set32(cond, left, ARMRegisters::S1, dest);
45347 }
45348
45349 void set32(Condition cond, RegisterID left, RegisterID right, RegisterID dest)
45350 {
45351 m_assembler.cmp_r(left, right);
45352 m_assembler.mov_r(dest, ARMAssembler::getOp2(0));
45353 m_assembler.mov_r(dest, ARMAssembler::getOp2(1), ARMCondition(cond));
45354 }
45355
45356 void set32(Condition cond, RegisterID left, Imm32 right, RegisterID dest)
45357 {
45358 m_assembler.cmp_r(left, m_assembler.getImm(right.m_value, ARMRegisters::S0));
45359 m_assembler.mov_r(dest, ARMAssembler::getOp2(0));
45360 m_assembler.mov_r(dest, ARMAssembler::getOp2(1), ARMCondition(cond));
45361 }
45362
45363 void set32(Condition cond, Address left, Imm32 right, RegisterID dest)
45364 {
45365 load32(left, ARMRegisters::S1);
45366 set32(cond, ARMRegisters::S1, right, dest);
45367 }
45368
45369 void set8(Condition cond, RegisterID left, RegisterID right, RegisterID dest)
45370 {
45371
45372 set32(cond, left, right, dest);
45373 }
45374
45375 void set8(Condition cond, Address left, RegisterID right, RegisterID dest)
45376 {
45377
45378 load32(left, ARMRegisters::S1);
45379 set32(cond, ARMRegisters::S1, right, dest);
45380 }
45381
45382 void set8(Condition cond, RegisterID left, Imm32 right, RegisterID dest)
45383 {
45384
45385 set32(cond, left, right, dest);
45386 }
45387
45388 void setTest32(Condition cond, Address address, Imm32 mask, RegisterID dest)
45389 {
45390 load32(address, ARMRegisters::S1);
45391 if (mask.m_value == -1)
45392 m_assembler.cmp_r(0, ARMRegisters::S1);
45393 else
45394 m_assembler.tst_r(ARMRegisters::S1, m_assembler.getImm(mask.m_value, ARMRegisters::S0));
45395 m_assembler.mov_r(dest, ARMAssembler::getOp2(0));
45396 m_assembler.mov_r(dest, ARMAssembler::getOp2(1), ARMCondition(cond));
45397 }
45398
45399 void setTest8(Condition cond, Address address, Imm32 mask, RegisterID dest)
45400 {
45401
45402 setTest32(cond, address, mask, dest);
45403 }
45404
45405 void add32(TrustedImm32 imm, RegisterID src, RegisterID dest)
45406 {
45407 m_assembler.add_r(dest, src, m_assembler.getImm(imm.m_value, ARMRegisters::S0));
45408 }
45409
45410 void lea(Address address, RegisterID dest)
45411 {
45412 m_assembler.add_r(dest, address.base, m_assembler.getImm(address.offset, ARMRegisters::S0));
45413 }
45414
45415 void lea(BaseIndex address, RegisterID dest)
45416 {
45417
45418 move(address.index, ARMRegisters::S1);
45419 if (address.scale != 0)
45420 lshift32(Imm32(address.scale), ARMRegisters::S1);
45421 if (address.offset)
45422 add32(Imm32(address.offset), ARMRegisters::S1);
45423 add32(address.base, ARMRegisters::S1);
45424 move(ARMRegisters::S1, dest);
45425 }
45426
45427 void add32(TrustedImm32 imm, AbsoluteAddress address)
45428 {
45429 m_assembler.ldr_un_imm(ARMRegisters::S1, reinterpret_cast<ARMWord>(address.m_ptr));
45430 m_assembler.dtr_u(true, ARMRegisters::S1, ARMRegisters::S1, 0);
45431 add32(imm, ARMRegisters::S1);
45432 m_assembler.ldr_un_imm(ARMRegisters::S0, reinterpret_cast<ARMWord>(address.m_ptr));
45433 m_assembler.dtr_u(false, ARMRegisters::S1, ARMRegisters::S0, 0);
45434 }
45435
45436 void sub32(TrustedImm32 imm, AbsoluteAddress address)
45437 {
45438 m_assembler.ldr_un_imm(ARMRegisters::S1, reinterpret_cast<ARMWord>(address.m_ptr));
45439 m_assembler.dtr_u(true, ARMRegisters::S1, ARMRegisters::S1, 0);
45440 sub32(imm, ARMRegisters::S1);
45441 m_assembler.ldr_un_imm(ARMRegisters::S0, reinterpret_cast<ARMWord>(address.m_ptr));
45442 m_assembler.dtr_u(false, ARMRegisters::S1, ARMRegisters::S0, 0);
45443 }
45444
45445 void load32(void* address, RegisterID dest)
45446 {
45447 m_assembler.ldr_un_imm(ARMRegisters::S0, reinterpret_cast<ARMWord>(address));
45448 m_assembler.dtr_u(true, dest, ARMRegisters::S0, 0);
45449 }
45450
45451 Jump branch32(Condition cond, AbsoluteAddress left, RegisterID right)
45452 {
45453 load32(left.m_ptr, ARMRegisters::S1);
45454 return branch32(cond, ARMRegisters::S1, right);
45455 }
45456
45457 Jump branch32(Condition cond, AbsoluteAddress left, TrustedImm32 right)
45458 {
45459 load32(left.m_ptr, ARMRegisters::S1);
45460 return branch32(cond, ARMRegisters::S1, right);
45461 }
45462
45463 Call call()
45464 {
45465
45466 Call call(m_assembler.loadBranchTarget(ARMRegisters::S1, ARMAssembler::AL, true), Call::Linkable);
45467 m_assembler.blx(ARMRegisters::S1);
45468 return call;
45469
45470
45471
45472
45473 }
45474
45475 Call tailRecursiveCall()
45476 {
45477 return Call::fromTailJump(jump());
45478 }
45479
45480 Call makeTailRecursiveCall(Jump oldJump)
45481 {
45482 return Call::fromTailJump(oldJump);
45483 }
45484
45485 DataLabelPtr moveWithPatch(TrustedImmPtr initialValue, RegisterID dest)
45486 {
45487 DataLabelPtr dataLabel(this);
45488 m_assembler.ldr_un_imm(dest, reinterpret_cast<ARMWord>(initialValue.m_value));
45489 return dataLabel;
45490 }
45491
45492 DataLabel32 moveWithPatch(TrustedImm32 initialValue, RegisterID dest)
45493 {
45494 DataLabel32 dataLabel(this);
45495 m_assembler.ldr_un_imm(dest, initialValue.m_value);
45496 return dataLabel;
45497 }
45498
45499 Jump branchPtrWithPatch(Condition cond, RegisterID left, DataLabelPtr& dataLabel, ImmPtr initialRightValue = ImmPtr(0))
45500 {
45501 dataLabel = moveWithPatch(initialRightValue, ARMRegisters::S1);
45502 Jump jump = branch32(cond, left, ARMRegisters::S1, true);
45503 return jump;
45504 }
45505
45506 Jump branchPtrWithPatch(Condition cond, Address left, DataLabelPtr& dataLabel, ImmPtr initialRightValue = ImmPtr(0))
45507 {
45508 load32(left, ARMRegisters::S1);
45509 dataLabel = moveWithPatch(initialRightValue, ARMRegisters::S0);
45510 Jump jump = branch32(cond, ARMRegisters::S0, ARMRegisters::S1, true);
45511 return jump;
45512 }
45513
45514 DataLabelPtr storePtrWithPatch(TrustedImmPtr initialValue, ImplicitAddress address)
45515 {
45516 DataLabelPtr dataLabel = moveWithPatch(initialValue, ARMRegisters::S1);
45517 store32(ARMRegisters::S1, address);
45518 return dataLabel;
45519 }
45520
45521 DataLabelPtr storePtrWithPatch(ImplicitAddress address)
45522 {
45523 return storePtrWithPatch(ImmPtr(0), address);
45524 }
45525
45526
45527 bool supportsFloatingPoint() const
45528 {
45529 return s_isVFPPresent;
45530 }
45531
45532 bool supportsFloatingPointTruncate() const
45533 {
45534 return true;
45535 }
45536
45537 bool supportsFloatingPointSqrt() const
45538 {
45539 return s_isVFPPresent;
45540 }
45541
45542 void moveDouble(FPRegisterID src, FPRegisterID dest)
45543 {
45544 m_assembler.fcpyd_r(dest, src);
45545 }
45546
45547 void loadDouble(ImplicitAddress address, FPRegisterID dest)
45548 {
45549
45550 m_assembler.doubleTransfer(true, dest, address.base, address.offset);
45551 }
45552
45553 void loadDouble(BaseIndex address, FPRegisterID dest)
45554 {
45555 m_assembler.baseIndexFloatTransfer(true, true, dest,
45556 address.base, address.index,
45557 address.scale, address.offset);
45558 }
45559
45560 DataLabelPtr loadDouble(const void* address, FPRegisterID dest)
45561 {
45562 DataLabelPtr label = moveWithPatch(ImmPtr(address), ARMRegisters::S0);
45563 m_assembler.doubleTransfer(true, dest, ARMRegisters::S0, 0);
45564 return label;
45565 }
45566
45567 void fastLoadDouble(RegisterID lo, RegisterID hi, FPRegisterID fpReg) {
45568 m_assembler.vmov64(false, true, lo, hi, fpReg);
45569 }
45570
45571 void loadFloat(ImplicitAddress address, FPRegisterID dest)
45572 {
45573
45574 dest = (FPRegisterID) (dest * 2);
45575 do { } while(0);
45576 m_assembler.floatTransfer(true, dest, address.base, address.offset);
45577 m_assembler.vcvt(m_assembler.FloatReg32, m_assembler.FloatReg64, (FPRegisterID)(dest*2), dest);
45578 }
45579 void loadFloat(BaseIndex address, FPRegisterID dest)
45580 {
45581 m_assembler.baseIndexFloatTransfer(true, false, (FPRegisterID)(dest*2),
45582 address.base, address.index,
45583 address.scale, address.offset);
45584 m_assembler.vcvt(m_assembler.FloatReg32, m_assembler.FloatReg64, (FPRegisterID)(dest*2), dest);
45585 }
45586
45587 DataLabelPtr loadFloat(const void* address, FPRegisterID dest)
45588 {
45589 DataLabelPtr label = moveWithPatch(ImmPtr(address), ARMRegisters::S0);
45590 m_assembler.fmem_imm_off(true, false, true, (FPRegisterID)(dest*2), ARMRegisters::S0, 0);
45591 m_assembler.vcvt(m_assembler.FloatReg32, m_assembler.FloatReg64, (FPRegisterID)(dest*2), dest);
45592 return label;
45593 }
45594
45595 void storeDouble(FPRegisterID src, ImplicitAddress address)
45596 {
45597
45598 m_assembler.doubleTransfer(false, src, address.base, address.offset);
45599 }
45600
45601 void storeDouble(FPRegisterID src, BaseIndex address)
45602 {
45603 m_assembler.baseIndexFloatTransfer(false, true, src,
45604 address.base, address.index,
45605 address.scale, address.offset);
45606 }
45607
45608 void storeDouble(ImmDouble imm, Address address)
45609 {
45610 store32(Imm32(imm.u.s.lsb), address);
45611 store32(Imm32(imm.u.s.msb), Address(address.base, address.offset + 4));
45612 }
45613
45614 void storeDouble(ImmDouble imm, BaseIndex address)
45615 {
45616 store32(Imm32(imm.u.s.lsb), address);
45617 store32(Imm32(imm.u.s.msb),
45618 BaseIndex(address.base, address.index, address.scale, address.offset + 4));
45619 }
45620 void fastStoreDouble(FPRegisterID fpReg, RegisterID lo, RegisterID hi) {
45621 m_assembler.vmov64(true, true, lo, hi, fpReg);
45622 }
45623
45624 void storeFloat(FPRegisterID src, ImplicitAddress address)
45625 {
45626 m_assembler.floatTransfer(false, src, address.base, address.offset);
45627 }
45628
45629 void storeFloat(FPRegisterID src, BaseIndex address)
45630 {
45631 m_assembler.baseIndexFloatTransfer(false, false, src,
45632 address.base, address.index,
45633 address.scale, address.offset);
45634 }
45635 void storeFloat(ImmDouble imm, Address address)
45636 {
45637 union {
45638 float f;
45639 uint32_t u32;
45640 } u;
45641 u.f = imm.u.d;
45642 store32(Imm32(u.u32), address);
45643 }
45644
45645 void storeFloat(ImmDouble imm, BaseIndex address)
45646 {
45647 union {
45648 float f;
45649 uint32_t u32;
45650 } u;
45651 u.f = imm.u.d;
45652 store32(Imm32(u.u32), address);
45653 }
45654
45655 void addDouble(FPRegisterID src, FPRegisterID dest)
45656 {
45657 m_assembler.faddd_r(dest, dest, src);
45658 }
45659
45660 void addDouble(Address src, FPRegisterID dest)
45661 {
45662 loadDouble(src, ARMRegisters::SD0);
45663 addDouble(ARMRegisters::SD0, dest);
45664 }
45665
45666 void divDouble(FPRegisterID src, FPRegisterID dest)
45667 {
45668 m_assembler.fdivd_r(dest, dest, src);
45669 }
45670
45671 void divDouble(Address src, FPRegisterID dest)
45672 {
45673 __builtin_unreachable();
45674 loadDouble(src, ARMRegisters::SD0);
45675 divDouble(ARMRegisters::SD0, dest);
45676 }
45677
45678 void subDouble(FPRegisterID src, FPRegisterID dest)
45679 {
45680 m_assembler.fsubd_r(dest, dest, src);
45681 }
45682
45683 void subDouble(Address src, FPRegisterID dest)
45684 {
45685 loadDouble(src, ARMRegisters::SD0);
45686 subDouble(ARMRegisters::SD0, dest);
45687 }
45688
45689 void mulDouble(FPRegisterID src, FPRegisterID dest)
45690 {
45691 m_assembler.fmuld_r(dest, dest, src);
45692 }
45693
45694 void mulDouble(Address src, FPRegisterID dest)
45695 {
45696 loadDouble(src, ARMRegisters::SD0);
45697 mulDouble(ARMRegisters::SD0, dest);
45698 }
45699
45700 void negDouble(FPRegisterID src, FPRegisterID dest)
45701 {
45702 m_assembler.fnegd_r(dest, src);
45703 }
45704
45705 void absDouble(FPRegisterID src, FPRegisterID dest)
45706 {
45707 m_assembler.fabsd_r(dest, src);
45708 }
45709
45710 void sqrtDouble(FPRegisterID src, FPRegisterID dest)
45711 {
45712 m_assembler.fsqrtd_r(dest, src);
45713 }
45714
45715 void convertInt32ToDouble(RegisterID src, FPRegisterID dest)
45716 {
45717 m_assembler.fmsr_r(floatShadow(dest), src);
45718 m_assembler.fsitod_r(dest, floatShadow(dest));
45719 }
45720
45721 void convertUInt32ToDouble(RegisterID src, FPRegisterID dest)
45722 {
45723 m_assembler.fmsr_r(floatShadow(dest), src);
45724 m_assembler.fuitod_r(dest, floatShadow(dest));
45725 }
45726
45727 void convertInt32ToDouble(Address src, FPRegisterID dest)
45728 {
45729
45730 load32(src, ARMRegisters::S1);
45731 convertInt32ToDouble(ARMRegisters::S1, dest);
45732 }
45733
45734 void convertInt32ToDouble(AbsoluteAddress src, FPRegisterID dest)
45735 {
45736 __builtin_unreachable();
45737
45738 m_assembler.ldr_un_imm(ARMRegisters::S1, (ARMWord)src.m_ptr);
45739 m_assembler.dtr_u(true, ARMRegisters::S1, ARMRegisters::S1, 0);
45740 convertInt32ToDouble(ARMRegisters::S1, dest);
45741 }
45742
45743 void convertDoubleToFloat(FPRegisterID src, FPRegisterID dest)
45744 {
45745 m_assembler.vcvt(m_assembler.FloatReg64, m_assembler.FloatReg32, src, dest);
45746 }
45747
45748 Jump branchDouble(DoubleCondition cond, FPRegisterID left, FPRegisterID right)
45749 {
45750 m_assembler.fcmpd_r(left, right);
45751 m_assembler.fmstat();
45752 if (cond & DoubleConditionBitSpecial)
45753 m_assembler.cmp_r(ARMRegisters::S0, ARMRegisters::S0, ARMAssembler::VS);
45754 return Jump(m_assembler.jmp(static_cast<ARMAssembler::Condition>(cond & ~DoubleConditionMask)));
45755 }
45756
45757
45758
45759
45760 Jump branchTruncateDoubleToInt32(FPRegisterID src, RegisterID dest)
45761 {
45762 m_assembler.ftosizd_r(floatShadow(ARMRegisters::SD0), src);
45763
45764
45765
45766 m_assembler.fmrs_r(dest, floatShadow(ARMRegisters::SD0));
45767 m_assembler.cmn_r(dest, ARMAssembler::getOp2(-0x7fffffff));
45768 m_assembler.cmp_r(dest, ARMAssembler::getOp2(0x80000000), ARMCondition(NonZero));
45769 return Jump(m_assembler.jmp(ARMCondition(Zero)));
45770 }
45771
45772
45773
45774
45775
45776 void branchConvertDoubleToInt32(FPRegisterID src, RegisterID dest, JumpList& failureCases, FPRegisterID fpTemp)
45777 {
45778 m_assembler.ftosid_r(floatShadow(ARMRegisters::SD0), src);
45779 m_assembler.fmrs_r(dest, floatShadow(ARMRegisters::SD0));
45780
45781
45782 m_assembler.fsitod_r(ARMRegisters::SD0, floatShadow(ARMRegisters::SD0));
45783 failureCases.append(branchDouble(DoubleNotEqualOrUnordered, src, ARMRegisters::SD0));
45784
45785
45786 failureCases.append(branchTest32(Zero, dest));
45787 }
45788
45789 void zeroDouble(FPRegisterID srcDest)
45790 {
45791 m_assembler.mov_r(ARMRegisters::S0, ARMAssembler::getOp2(0));
45792 convertInt32ToDouble(ARMRegisters::S0, srcDest);
45793 }
45794
45795 void ensureSpace(int space)
45796 {
45797 m_assembler.ensureSpace(space);
45798 }
45799
45800 void forceFlushConstantPool()
45801 {
45802 m_assembler.forceFlushConstantPool();
45803 }
45804
45805 int flushCount()
45806 {
45807 return m_assembler.flushCount();
45808 }
45809
45810 protected:
45811 ARMAssembler::Condition ARMCondition(Condition cond)
45812 {
45813 return static_cast<ARMAssembler::Condition>(cond);
45814 }
45815
45816 void ensureSpace(int insnSpace, int constSpace)
45817 {
45818 m_assembler.ensureSpace(insnSpace, constSpace);
45819 }
45820
45821 int sizeOfConstantPool()
45822 {
45823 return m_assembler.sizeOfConstantPool();
45824 }
45825 # 1460 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/MacroAssemblerARM.h"
45826 void call32(RegisterID base, int32_t offset)
45827 {
45828
45829 if (base == ARMRegisters::sp)
45830 offset += 4;
45831 # 1480 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/MacroAssemblerARM.h"
45832 if (offset >= 0) {
45833 if (offset <= 0xfff) {
45834 m_assembler.dtr_u(true, ARMRegisters::S0, base, offset);
45835 } else if (offset <= 0xfffff) {
45836 m_assembler.add_r(ARMRegisters::S0, base, ARMAssembler::OP2_IMM | (offset >> 12) | (10 << 8));
45837 m_assembler.dtr_u(true, ARMRegisters::S0, ARMRegisters::S0, offset & 0xfff);
45838 } else {
45839 m_assembler.moveImm(offset, ARMRegisters::S0);
45840 m_assembler.dtr_ur(true, ARMRegisters::S0, base, ARMRegisters::S0);
45841 }
45842 } else {
45843 offset = -offset;
45844 if (offset <= 0xfff) {
45845 m_assembler.dtr_d(true, ARMRegisters::S0, base, offset);
45846 } else if (offset <= 0xfffff) {
45847 m_assembler.sub_r(ARMRegisters::S0, base, ARMAssembler::OP2_IMM | (offset >> 12) | (10 << 8));
45848 m_assembler.dtr_d(true, ARMRegisters::S0, ARMRegisters::S0, offset & 0xfff);
45849 } else {
45850 m_assembler.moveImm(offset, ARMRegisters::S0);
45851 m_assembler.dtr_dr(true, ARMRegisters::S0, base, ARMRegisters::S0);
45852 }
45853 }
45854 m_assembler.blx(ARMRegisters::S0);
45855 }
45856
45857
45858 private:
45859 friend class LinkBuffer;
45860 friend class RepatchBuffer;
45861
45862 static void linkCall(void* code, Call call, FunctionPtr function)
45863 {
45864 ARMAssembler::linkCall(code, call.m_jmp, function.value());
45865 }
45866
45867 static void repatchCall(CodeLocationCall call, CodeLocationLabel destination)
45868 {
45869 ARMAssembler::relinkCall(call.dataLocation(), destination.executableAddress());
45870 }
45871
45872 static void repatchCall(CodeLocationCall call, FunctionPtr destination)
45873 {
45874 ARMAssembler::relinkCall(call.dataLocation(), destination.executableAddress());
45875 }
45876
45877 static const bool s_isVFPPresent;
45878 };
45879
45880 }
45881 # 43 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/MacroAssembler.h" 2
45882 namespace JSC { typedef MacroAssemblerARM MacroAssemblerBase; }
45883 # 66 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/MacroAssembler.h"
45884 namespace JSC {
45885
45886 class MacroAssembler : public MacroAssemblerBase {
45887 public:
45888
45889 using MacroAssemblerBase::pop;
45890 using MacroAssemblerBase::jump;
45891 using MacroAssemblerBase::branch32;
45892 using MacroAssemblerBase::branch16;
45893 # 83 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/assembler/assembler/MacroAssembler.h"
45894 void pop()
45895 {
45896 addPtr(Imm32(sizeof(void*)), stackPointerRegister);
45897 }
45898
45899 void peek(RegisterID dest, int index = 0)
45900 {
45901 loadPtr(Address(stackPointerRegister, (index * sizeof(void*))), dest);
45902 }
45903
45904 void poke(RegisterID src, int index = 0)
45905 {
45906 storePtr(src, Address(stackPointerRegister, (index * sizeof(void*))));
45907 }
45908
45909 void poke(TrustedImm32 value, int index = 0)
45910 {
45911 store32(value, Address(stackPointerRegister, (index * sizeof(void*))));
45912 }
45913
45914 void poke(TrustedImmPtr imm, int index = 0)
45915 {
45916 storePtr(imm, Address(stackPointerRegister, (index * sizeof(void*))));
45917 }
45918
45919
45920
45921 void branchPtr(Condition cond, RegisterID op1, ImmPtr imm, Label target)
45922 {
45923 branchPtr(cond, op1, imm).linkTo(target, this);
45924 }
45925
45926 void branch32(Condition cond, RegisterID op1, RegisterID op2, Label target)
45927 {
45928 branch32(cond, op1, op2).linkTo(target, this);
45929 }
45930
45931 void branch32(Condition cond, RegisterID op1, TrustedImm32 imm, Label target)
45932 {
45933 branch32(cond, op1, imm).linkTo(target, this);
45934 }
45935
45936 void branch32(Condition cond, RegisterID left, Address right, Label target)
45937 {
45938 branch32(cond, left, right).linkTo(target, this);
45939 }
45940
45941 void branch16(Condition cond, BaseIndex left, RegisterID right, Label target)
45942 {
45943 branch16(cond, left, right).linkTo(target, this);
45944 }
45945
45946 void branchTestPtr(Condition cond, RegisterID reg, Label target)
45947 {
45948 branchTestPtr(cond, reg).linkTo(target, this);
45949 }
45950
45951 void jump(Label target)
45952 {
45953 jump().linkTo(target, this);
45954 }
45955
45956
45957
45958
45959
45960
45961 void addPtr(RegisterID src, RegisterID dest)
45962 {
45963 add32(src, dest);
45964 }
45965
45966 void addPtr(Imm32 imm32, Address address)
45967 {
45968 add32(imm32, address);
45969 }
45970
45971 void addPtr(Imm32 imm, RegisterID srcDest)
45972 {
45973 add32(imm, srcDest);
45974 }
45975
45976 void addPtr(ImmPtr imm, RegisterID dest)
45977 {
45978 add32(Imm32(imm), dest);
45979 }
45980
45981 void addPtr(Imm32 imm, RegisterID src, RegisterID dest)
45982 {
45983 add32(imm, src, dest);
45984 }
45985
45986 void andPtr(RegisterID src, RegisterID dest)
45987 {
45988 and32(src, dest);
45989 }
45990
45991 void andPtr(Imm32 imm, RegisterID srcDest)
45992 {
45993 and32(imm, srcDest);
45994 }
45995
45996 void andPtr(ImmPtr ptr, RegisterID srcDest)
45997 {
45998 and32(Imm32(ptr), srcDest);
45999 }
46000
46001 void negPtr(RegisterID srcDest)
46002 {
46003 neg32(srcDest);
46004 }
46005
46006 void notPtr(RegisterID srcDest)
46007 {
46008 not32(srcDest);
46009 }
46010
46011 void orPtr(RegisterID src, RegisterID dest)
46012 {
46013 or32(src, dest);
46014 }
46015
46016 void orPtr(ImmPtr imm, RegisterID dest)
46017 {
46018 or32(Imm32(imm), dest);
46019 }
46020
46021 void orPtr(Imm32 imm, RegisterID dest)
46022 {
46023 or32(imm, dest);
46024 }
46025
46026 void subPtr(RegisterID src, RegisterID dest)
46027 {
46028 sub32(src, dest);
46029 }
46030
46031 void subPtr(Imm32 imm, RegisterID dest)
46032 {
46033 sub32(imm, dest);
46034 }
46035
46036 void subPtr(ImmPtr imm, RegisterID dest)
46037 {
46038 sub32(Imm32(imm), dest);
46039 }
46040
46041 void subPtr(ImmPtr imm, Address address)
46042 {
46043 sub32(Imm32(imm), address);
46044 }
46045
46046 void xorPtr(RegisterID src, RegisterID dest)
46047 {
46048 xor32(src, dest);
46049 }
46050
46051 void xorPtr(Imm32 imm, RegisterID srcDest)
46052 {
46053 xor32(imm, srcDest);
46054 }
46055
46056
46057 void loadPtr(ImplicitAddress address, RegisterID dest)
46058 {
46059 load32(address, dest);
46060 }
46061
46062 void loadPtr(BaseIndex address, RegisterID dest)
46063 {
46064 load32(address, dest);
46065 }
46066
46067 void loadPtr(void* address, RegisterID dest)
46068 {
46069 load32(address, dest);
46070 }
46071
46072 DataLabel32 loadPtrWithAddressOffsetPatch(Address address, RegisterID dest)
46073 {
46074 return load32WithAddressOffsetPatch(address, dest);
46075 }
46076
46077 void setPtr(Condition cond, RegisterID left, Imm32 right, RegisterID dest)
46078 {
46079 set32(cond, left, right, dest);
46080 }
46081
46082 void storePtr(RegisterID src, ImplicitAddress address)
46083 {
46084 store32(src, address);
46085 }
46086
46087 void storePtr(RegisterID src, void* address)
46088 {
46089 store32(src, address);
46090 }
46091
46092 void storePtr(TrustedImmPtr imm, ImplicitAddress address)
46093 {
46094 store32(Imm32(imm), address);
46095 }
46096
46097 void storePtr(TrustedImmPtr imm, BaseIndex address)
46098 {
46099 store32(Imm32(imm), address);
46100 }
46101
46102 void storePtr(TrustedImmPtr imm, void* address)
46103 {
46104 store32(Imm32(imm), address);
46105 }
46106
46107 DataLabel32 storePtrWithAddressOffsetPatch(RegisterID src, Address address)
46108 {
46109 return store32WithAddressOffsetPatch(src, address);
46110 }
46111
46112
46113 Jump branchPtr(Condition cond, RegisterID left, RegisterID right)
46114 {
46115 return branch32(cond, left, right);
46116 }
46117
46118 Jump branchPtr(Condition cond, RegisterID left, ImmPtr right)
46119 {
46120 return branch32(cond, left, Imm32(right));
46121 }
46122
46123 Jump branchPtr(Condition cond, RegisterID left, Imm32 right)
46124 {
46125 return branch32(cond, left, right);
46126 }
46127
46128 Jump branchPtr(Condition cond, RegisterID left, Address right)
46129 {
46130 return branch32(cond, left, right);
46131 }
46132
46133 Jump branchPtr(Condition cond, Address left, RegisterID right)
46134 {
46135 return branch32(cond, left, right);
46136 }
46137
46138 Jump branchPtr(Condition cond, AbsoluteAddress left, RegisterID right)
46139 {
46140 return branch32(cond, left, right);
46141 }
46142
46143 Jump branchPtr(Condition cond, Address left, ImmPtr right)
46144 {
46145 return branch32(cond, left, Imm32(right));
46146 }
46147
46148 Jump branchPtr(Condition cond, AbsoluteAddress left, ImmPtr right, RegisterID scratch)
46149 {
46150 return branch32(cond, left, Imm32(right));
46151 }
46152
46153 Jump branchTestPtr(Condition cond, RegisterID reg, RegisterID mask)
46154 {
46155 return branchTest32(cond, reg, mask);
46156 }
46157
46158 Jump branchTestPtr(Condition cond, RegisterID reg, Imm32 mask = Imm32(-1))
46159 {
46160 return branchTest32(cond, reg, mask);
46161 }
46162
46163 Jump branchTestPtr(Condition cond, Address address, Imm32 mask = Imm32(-1))
46164 {
46165 return branchTest32(cond, address, mask);
46166 }
46167
46168 Jump branchTestPtr(Condition cond, BaseIndex address, Imm32 mask = Imm32(-1))
46169 {
46170 return branchTest32(cond, address, mask);
46171 }
46172
46173
46174 Jump branchAddPtr(Condition cond, RegisterID src, RegisterID dest)
46175 {
46176 return branchAdd32(cond, src, dest);
46177 }
46178
46179 Jump branchSubPtr(Condition cond, Imm32 imm, RegisterID dest)
46180 {
46181 return branchSub32(cond, imm, dest);
46182 }
46183
46184 using MacroAssemblerBase::branchTest8;
46185 Jump branchTest8(Condition cond, ExtendedAddress address, Imm32 mask = Imm32(-1))
46186 {
46187 return MacroAssemblerBase::branchTest8(cond, Address(address.base, address.offset), mask);
46188 }
46189
46190 void rshiftPtr(Imm32 imm, RegisterID dest)
46191 {
46192 rshift32(imm, dest);
46193 }
46194
46195 void lshiftPtr(Imm32 imm, RegisterID dest)
46196 {
46197 lshift32(imm, dest);
46198 }
46199
46200
46201 };
46202
46203 }
46204 # 38 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/YarrJIT.h" 2
46205
46206
46207
46208
46209
46210 #define YARR_CALL
46211
46212
46213 namespace JSC {
46214
46215 class JSGlobalData;
46216 class ExecutablePool;
46217
46218 namespace Yarr {
46219
46220 class YarrCodeBlock {
46221 typedef int (*YarrJITCode)(const UChar* input, unsigned start, unsigned length, int* output) ;
46222
46223 public:
46224 YarrCodeBlock()
46225 : m_needFallBack(false)
46226 {
46227 }
46228
46229 ~YarrCodeBlock()
46230 {
46231 }
46232
46233 void setFallBack(bool fallback) { m_needFallBack = fallback; }
46234 bool isFallBack() { return m_needFallBack; }
46235 void set(MacroAssembler::CodeRef ref) { m_ref = ref; }
46236
46237 int execute(const UChar* input, unsigned start, unsigned length, int* output)
46238 {
46239 return __extension__((reinterpret_cast<YarrJITCode>(m_ref.m_code.executableAddress()))(input, start, length, output));
46240 }
46241
46242
46243
46244
46245
46246 void release() { m_ref.release(); }
46247
46248 private:
46249 MacroAssembler::CodeRef m_ref;
46250 bool m_needFallBack;
46251 };
46252
46253 void jitCompile(YarrPattern&, JSGlobalData*, YarrCodeBlock& jitObject);
46254 int execute(YarrCodeBlock& jitObject, const UChar* input, unsigned start, unsigned length, int* output);
46255
46256 } }
46257 # 22 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/RegExpObject.h" 2
46258
46259 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/YarrSyntaxChecker.h" 1
46260 # 31 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/YarrSyntaxChecker.h"
46261 #define YarrSyntaxChecker_h
46262
46263
46264 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/YarrParser.h" 1
46265 # 31 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/YarrParser.h"
46266 #define YarrParser_h
46267
46268 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/Yarr.h" 1
46269 # 34 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/YarrParser.h" 2
46270
46271 namespace JSC { namespace Yarr {
46272
46273 #define REGEXP_ERROR_PREFIX "Invalid regular expression: "
46274
46275 enum BuiltInCharacterClassID {
46276 DigitClassID,
46277 SpaceClassID,
46278 WordClassID,
46279 NewlineClassID
46280 };
46281
46282
46283 template<class Delegate>
46284 class Parser {
46285 private:
46286 template<class FriendDelegate>
46287 friend ErrorCode parse(FriendDelegate& delegate, const UString& pattern, unsigned backReferenceLimit);
46288 # 62 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/YarrParser.h"
46289 class CharacterClassParserDelegate {
46290 public:
46291 CharacterClassParserDelegate(Delegate& delegate, ErrorCode& err)
46292 : m_delegate(delegate)
46293 , m_err(err)
46294 , m_state(Empty)
46295 , m_character(0)
46296 {
46297 }
46298
46299
46300
46301
46302
46303
46304 void begin(bool invert)
46305 {
46306 m_delegate.atomCharacterClassBegin(invert);
46307 }
46308 # 91 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/YarrParser.h"
46309 void atomPatternCharacter(UChar ch, bool hyphenIsRange = false)
46310 {
46311 switch (m_state) {
46312 case AfterCharacterClass:
46313
46314
46315
46316
46317
46318
46319
46320 if (hyphenIsRange && ch == '-') {
46321 m_delegate.atomCharacterClassAtom('-');
46322 m_state = AfterCharacterClassHyphen;
46323 return;
46324 }
46325
46326
46327 case Empty:
46328 m_character = ch;
46329 m_state = CachedCharacter;
46330 return;
46331
46332 case CachedCharacter:
46333 if (hyphenIsRange && ch == '-')
46334 m_state = CachedCharacterHyphen;
46335 else {
46336 m_delegate.atomCharacterClassAtom(m_character);
46337 m_character = ch;
46338 }
46339 return;
46340
46341 case CachedCharacterHyphen:
46342 if (ch < m_character) {
46343 m_err = CharacterClassOutOfOrder;
46344 return;
46345 }
46346 m_delegate.atomCharacterClassRange(m_character, ch);
46347 m_state = Empty;
46348 return;
46349
46350 case AfterCharacterClassHyphen:
46351 m_delegate.atomCharacterClassAtom(ch);
46352 m_state = Empty;
46353 return;
46354 }
46355 }
46356
46357
46358
46359
46360
46361
46362 void atomBuiltInCharacterClass(BuiltInCharacterClassID classID, bool invert)
46363 {
46364 switch (m_state) {
46365 case CachedCharacter:
46366
46367 m_delegate.atomCharacterClassAtom(m_character);
46368
46369 case Empty:
46370 case AfterCharacterClass:
46371 m_state = AfterCharacterClass;
46372 m_delegate.atomCharacterClassBuiltIn(classID, invert);
46373 return;
46374
46375 case CachedCharacterHyphen:
46376
46377
46378 m_err = CharacterClassInvalidRange;
46379 return;
46380
46381 case AfterCharacterClassHyphen:
46382 m_delegate.atomCharacterClassBuiltIn(classID, invert);
46383 m_state = Empty;
46384 return;
46385 }
46386 }
46387
46388
46389
46390
46391
46392
46393 void end()
46394 {
46395 if (m_state == CachedCharacter)
46396 m_delegate.atomCharacterClassAtom(m_character);
46397 else if (m_state == CachedCharacterHyphen) {
46398 m_delegate.atomCharacterClassAtom(m_character);
46399 m_delegate.atomCharacterClassAtom('-');
46400 }
46401 m_delegate.atomCharacterClassEnd();
46402 }
46403
46404
46405
46406 void assertionWordBoundary(bool) { __builtin_unreachable(); }
46407 void atomBackReference(unsigned) { __builtin_unreachable(); }
46408
46409 private:
46410 Delegate& m_delegate;
46411 ErrorCode& m_err;
46412 enum CharacterClassConstructionState {
46413 Empty,
46414 CachedCharacter,
46415 CachedCharacterHyphen,
46416 AfterCharacterClass,
46417 AfterCharacterClassHyphen
46418 } m_state;
46419 UChar m_character;
46420 };
46421
46422 Parser(Delegate& delegate, const UString& pattern, unsigned backReferenceLimit)
46423 : m_delegate(delegate)
46424 , m_backReferenceLimit(backReferenceLimit)
46425 , m_err(NoError)
46426 , m_data(pattern.chars())
46427 , m_size(pattern.length())
46428 , m_index(0)
46429 , m_parenthesesNestingDepth(0)
46430 {
46431 }
46432 # 235 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/YarrParser.h"
46433 template<bool inCharacterClass, class EscapeDelegate>
46434 bool parseEscape(EscapeDelegate& delegate)
46435 {
46436 do { } while(0);
46437 do { } while(0);
46438 consume();
46439
46440 if (atEndOfPattern()) {
46441 m_err = EscapeUnterminated;
46442 return false;
46443 }
46444
46445 switch (peek()) {
46446
46447 case 'b':
46448 consume();
46449 if (inCharacterClass)
46450 delegate.atomPatternCharacter('\b');
46451 else {
46452 delegate.assertionWordBoundary(false);
46453 return false;
46454 }
46455 break;
46456 case 'B':
46457 consume();
46458 if (inCharacterClass)
46459 delegate.atomPatternCharacter('B');
46460 else {
46461 delegate.assertionWordBoundary(true);
46462 return false;
46463 }
46464 break;
46465
46466
46467 case 'd':
46468 consume();
46469 delegate.atomBuiltInCharacterClass(DigitClassID, false);
46470 break;
46471 case 's':
46472 consume();
46473 delegate.atomBuiltInCharacterClass(SpaceClassID, false);
46474 break;
46475 case 'w':
46476 consume();
46477 delegate.atomBuiltInCharacterClass(WordClassID, false);
46478 break;
46479 case 'D':
46480 consume();
46481 delegate.atomBuiltInCharacterClass(DigitClassID, true);
46482 break;
46483 case 'S':
46484 consume();
46485 delegate.atomBuiltInCharacterClass(SpaceClassID, true);
46486 break;
46487 case 'W':
46488 consume();
46489 delegate.atomBuiltInCharacterClass(WordClassID, true);
46490 break;
46491
46492
46493 case '1':
46494 case '2':
46495 case '3':
46496 case '4':
46497 case '5':
46498 case '6':
46499 case '7':
46500 case '8':
46501 case '9': {
46502
46503
46504 if (!inCharacterClass) {
46505 ParseState state = saveState();
46506
46507 unsigned backReference;
46508 if (!consumeNumber(backReference))
46509 break;
46510 if (backReference <= m_backReferenceLimit) {
46511 delegate.atomBackReference(backReference);
46512 break;
46513 }
46514
46515 restoreState(state);
46516 }
46517
46518
46519 if (peek() >= '8') {
46520 delegate.atomPatternCharacter('\\');
46521 break;
46522 }
46523
46524
46525 }
46526
46527
46528 case '0':
46529 delegate.atomPatternCharacter(consumeOctal());
46530 break;
46531
46532
46533 case 'f':
46534 consume();
46535 delegate.atomPatternCharacter('\f');
46536 break;
46537 case 'n':
46538 consume();
46539 delegate.atomPatternCharacter('\n');
46540 break;
46541 case 'r':
46542 consume();
46543 delegate.atomPatternCharacter('\r');
46544 break;
46545 case 't':
46546 consume();
46547 delegate.atomPatternCharacter('\t');
46548 break;
46549 case 'v':
46550 consume();
46551 delegate.atomPatternCharacter('\v');
46552 break;
46553
46554
46555 case 'c': {
46556 ParseState state = saveState();
46557 consume();
46558 if (!atEndOfPattern()) {
46559 int control = consume();
46560
46561
46562 if (inCharacterClass ? WTF::isASCIIAlphanumeric(control) || (control == '_') : WTF::isASCIIAlpha(control)) {
46563 delegate.atomPatternCharacter(control & 0x1f);
46564 break;
46565 }
46566 }
46567 restoreState(state);
46568 delegate.atomPatternCharacter('\\');
46569 break;
46570 }
46571
46572
46573 case 'x': {
46574 consume();
46575 int x = tryConsumeHex(2);
46576 if (x == -1)
46577 delegate.atomPatternCharacter('x');
46578 else
46579 delegate.atomPatternCharacter(x);
46580 break;
46581 }
46582
46583
46584 case 'u': {
46585 consume();
46586 int u = tryConsumeHex(4);
46587 if (u == -1)
46588 delegate.atomPatternCharacter('u');
46589 else
46590 delegate.atomPatternCharacter(u);
46591 break;
46592 }
46593
46594
46595 default:
46596 delegate.atomPatternCharacter(consume());
46597 }
46598
46599 return true;
46600 }
46601
46602
46603
46604
46605
46606
46607 bool parseAtomEscape()
46608 {
46609 return parseEscape<false>(m_delegate);
46610 }
46611 void parseCharacterClassEscape(CharacterClassParserDelegate& delegate)
46612 {
46613 parseEscape<true>(delegate);
46614 }
46615 # 425 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/YarrParser.h"
46616 void parseCharacterClass()
46617 {
46618 do { } while(0);
46619 do { } while(0);
46620 consume();
46621
46622 CharacterClassParserDelegate characterClassConstructor(m_delegate, m_err);
46623
46624 characterClassConstructor.begin(tryConsume('^'));
46625
46626 while (!atEndOfPattern()) {
46627 switch (peek()) {
46628 case ']':
46629 consume();
46630 characterClassConstructor.end();
46631 return;
46632
46633 case '\\':
46634 parseCharacterClassEscape(characterClassConstructor);
46635 break;
46636
46637 default:
46638 characterClassConstructor.atomPatternCharacter(consume(), true);
46639 }
46640
46641 if (m_err)
46642 return;
46643 }
46644
46645 m_err = CharacterClassUnmatched;
46646 }
46647
46648
46649
46650
46651
46652
46653 void parseParenthesesBegin()
46654 {
46655 do { } while(0);
46656 do { } while(0);
46657 consume();
46658
46659 if (tryConsume('?')) {
46660 if (atEndOfPattern()) {
46661 m_err = ParenthesesTypeInvalid;
46662 return;
46663 }
46664
46665 switch (consume()) {
46666 case ':':
46667 m_delegate.atomParenthesesSubpatternBegin(false);
46668 break;
46669
46670 case '=':
46671 m_delegate.atomParentheticalAssertionBegin();
46672 break;
46673
46674 case '!':
46675 m_delegate.atomParentheticalAssertionBegin(true);
46676 break;
46677
46678 default:
46679 m_err = ParenthesesTypeInvalid;
46680 }
46681 } else
46682 m_delegate.atomParenthesesSubpatternBegin();
46683
46684 ++m_parenthesesNestingDepth;
46685 }
46686
46687
46688
46689
46690
46691
46692 void parseParenthesesEnd()
46693 {
46694 do { } while(0);
46695 do { } while(0);
46696 consume();
46697
46698 if (m_parenthesesNestingDepth > 0)
46699 m_delegate.atomParenthesesEnd();
46700 else
46701 m_err = ParenthesesUnmatched;
46702
46703 --m_parenthesesNestingDepth;
46704 }
46705
46706
46707
46708
46709
46710
46711 void parseQuantifier(bool lastTokenWasAnAtom, unsigned min, unsigned max)
46712 {
46713 do { } while(0);
46714 do { } while(0);
46715
46716 if (min == unsigned(-1)) {
46717 m_err = QuantifierTooLarge;
46718 return;
46719 }
46720
46721 if (lastTokenWasAnAtom)
46722 m_delegate.quantifyAtom(min, max, !tryConsume('?'));
46723 else
46724 m_err = QuantifierWithoutAtom;
46725 }
46726 # 545 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/YarrParser.h"
46727 void parseTokens()
46728 {
46729 bool lastTokenWasAnAtom = false;
46730
46731 while (!atEndOfPattern()) {
46732 switch (peek()) {
46733 case '|':
46734 consume();
46735 m_delegate.disjunction();
46736 lastTokenWasAnAtom = false;
46737 break;
46738
46739 case '(':
46740 parseParenthesesBegin();
46741 lastTokenWasAnAtom = false;
46742 break;
46743
46744 case ')':
46745 parseParenthesesEnd();
46746 lastTokenWasAnAtom = true;
46747 break;
46748
46749 case '^':
46750 consume();
46751 m_delegate.assertionBOL();
46752 lastTokenWasAnAtom = false;
46753 break;
46754
46755 case '$':
46756 consume();
46757 m_delegate.assertionEOL();
46758 lastTokenWasAnAtom = false;
46759 break;
46760
46761 case '.':
46762 consume();
46763 m_delegate.atomBuiltInCharacterClass(NewlineClassID, true);
46764 lastTokenWasAnAtom = true;
46765 break;
46766
46767 case '[':
46768 parseCharacterClass();
46769 lastTokenWasAnAtom = true;
46770 break;
46771
46772 case '\\':
46773 lastTokenWasAnAtom = parseAtomEscape();
46774 break;
46775
46776 case '*':
46777 consume();
46778 parseQuantifier(lastTokenWasAnAtom, 0, quantifyInfinite);
46779 lastTokenWasAnAtom = false;
46780 break;
46781
46782 case '+':
46783 consume();
46784 parseQuantifier(lastTokenWasAnAtom, 1, quantifyInfinite);
46785 lastTokenWasAnAtom = false;
46786 break;
46787
46788 case '?':
46789 consume();
46790 parseQuantifier(lastTokenWasAnAtom, 0, 1);
46791 lastTokenWasAnAtom = false;
46792 break;
46793
46794 case '{': {
46795 ParseState state = saveState();
46796
46797 consume();
46798 if (peekIsDigit()) {
46799 unsigned min;
46800 if (!consumeNumber(min))
46801 break;
46802 unsigned max = min;
46803
46804 if (tryConsume(',')) {
46805 if (peekIsDigit()) {
46806 if (!consumeNumber(max))
46807 break;
46808 } else {
46809 max = quantifyInfinite;
46810 }
46811 }
46812
46813 if (tryConsume('}')) {
46814 if (min <= max)
46815 parseQuantifier(lastTokenWasAnAtom, min, max);
46816 else
46817 m_err = QuantifierOutOfOrder;
46818 lastTokenWasAnAtom = false;
46819 break;
46820 }
46821 }
46822
46823 restoreState(state);
46824 }
46825
46826 default:
46827 m_delegate.atomPatternCharacter(consume());
46828 lastTokenWasAnAtom = true;
46829 }
46830
46831 if (m_err)
46832 return;
46833 }
46834
46835 if (m_parenthesesNestingDepth > 0)
46836 m_err = MissingParentheses;
46837 }
46838
46839
46840
46841
46842
46843
46844
46845 ErrorCode parse()
46846 {
46847 if (m_size > MAX_PATTERN_SIZE)
46848 m_err = PatternTooLarge;
46849 else
46850 parseTokens();
46851 do { } while(0);
46852
46853 return m_err;
46854 }
46855
46856
46857
46858
46859 typedef unsigned ParseState;
46860
46861 ParseState saveState()
46862 {
46863 return m_index;
46864 }
46865
46866 void restoreState(ParseState state)
46867 {
46868 m_index = state;
46869 }
46870
46871 bool atEndOfPattern()
46872 {
46873 do { } while(0);
46874 return m_index == m_size;
46875 }
46876
46877 int peek()
46878 {
46879 do { } while(0);
46880 return m_data[m_index];
46881 }
46882
46883 bool peekIsDigit()
46884 {
46885 return !atEndOfPattern() && WTF::isASCIIDigit(peek());
46886 }
46887
46888 unsigned peekDigit()
46889 {
46890 do { } while(0);
46891 return peek() - '0';
46892 }
46893
46894 int consume()
46895 {
46896 do { } while(0);
46897 return m_data[m_index++];
46898 }
46899
46900 unsigned consumeDigit()
46901 {
46902 do { } while(0);
46903 return consume() - '0';
46904 }
46905
46906 bool consumeNumber(unsigned &accum)
46907 {
46908 accum = consumeDigit();
46909 while (peekIsDigit()) {
46910 unsigned newValue = accum * 10 + peekDigit();
46911 if (newValue < accum) {
46912 m_err = QuantifierTooLarge;
46913 return false;
46914 }
46915 accum = newValue;
46916 consume();
46917 }
46918 return true;
46919 }
46920
46921 unsigned consumeOctal()
46922 {
46923 do { } while(0);
46924
46925 unsigned n = consumeDigit();
46926 while (n < 32 && !atEndOfPattern() && WTF::isASCIIOctalDigit(peek()))
46927 n = n * 8 + consumeDigit();
46928 return n;
46929 }
46930
46931 bool tryConsume(UChar ch)
46932 {
46933 if (atEndOfPattern() || (m_data[m_index] != ch))
46934 return false;
46935 ++m_index;
46936 return true;
46937 }
46938
46939 int tryConsumeHex(int count)
46940 {
46941 ParseState state = saveState();
46942
46943 int n = 0;
46944 while (count--) {
46945 if (atEndOfPattern() || !WTF::isASCIIHexDigit(peek())) {
46946 restoreState(state);
46947 return -1;
46948 }
46949 n = (n << 4) | WTF::toASCIIHexValue(consume());
46950 }
46951 return n;
46952 }
46953
46954 Delegate& m_delegate;
46955 unsigned m_backReferenceLimit;
46956 ErrorCode m_err;
46957 const UChar* m_data;
46958 unsigned m_size;
46959 unsigned m_index;
46960 unsigned m_parenthesesNestingDepth;
46961
46962
46963 static const unsigned MAX_PATTERN_SIZE = 1024 * 1024;
46964 };
46965 # 843 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/YarrParser.h"
46966 template<class Delegate>
46967 ErrorCode parse(Delegate& delegate, const UString& pattern, unsigned backReferenceLimit = quantifyInfinite)
46968 {
46969 return Parser<Delegate>(delegate, pattern, backReferenceLimit).parse();
46970 }
46971
46972 } }
46973 # 35 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/yarr/YarrSyntaxChecker.h" 2
46974
46975 namespace JSC { namespace Yarr {
46976
46977 ErrorCode checkSyntax(const UString& pattern);
46978
46979 }}
46980 # 24 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/RegExpObject.h" 2
46981 # 45 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/RegExpObject.h"
46982 namespace js {
46983
46984 enum RegExpRunStatus
46985 {
46986 RegExpRunStatus_Error,
46987 RegExpRunStatus_Success,
46988 RegExpRunStatus_Success_NotFound
46989 };
46990
46991 class RegExpObjectBuilder
46992 {
46993 JSContext *cx;
46994 Rooted<RegExpObject*> reobj_;
46995
46996 bool getOrCreate();
46997 bool getOrCreateClone(RegExpObject *proto);
46998
46999 public:
47000 RegExpObjectBuilder(JSContext *cx, RegExpObject *reobj = __null);
47001
47002 RegExpObject *reobj() { return reobj_; }
47003
47004 RegExpObject *build(HandleAtom source, RegExpFlag flags);
47005 RegExpObject *build(HandleAtom source, RegExpShared &shared);
47006
47007
47008 RegExpObject *clone(Handle<RegExpObject*> other, Handle<RegExpObject*> proto);
47009 };
47010
47011 JSObject *
47012 CloneRegExpObject(JSContext *cx, JSObject *obj, JSObject *proto);
47013
47014 namespace detail {
47015
47016 class RegExpCode
47017 {
47018 typedef JSC::Yarr::BytecodePattern BytecodePattern;
47019 typedef JSC::Yarr::ErrorCode ErrorCode;
47020 typedef JSC::Yarr::YarrPattern YarrPattern;
47021
47022 typedef JSC::Yarr::JSGlobalData JSGlobalData;
47023 typedef JSC::Yarr::YarrCodeBlock YarrCodeBlock;
47024
47025
47026 YarrCodeBlock codeBlock;
47027
47028 BytecodePattern *byteCode;
47029
47030 public:
47031 RegExpCode()
47032 :
47033
47034 codeBlock(),
47035
47036 byteCode(__null)
47037 { }
47038
47039 ~RegExpCode() {
47040
47041 codeBlock.release();
47042
47043 if (byteCode)
47044 Foreground::delete_<BytecodePattern>(byteCode);
47045 }
47046
47047 static bool checkSyntax(JSContext *cx, TokenStream *tokenStream, JSLinearString *source) {
47048 ErrorCode error = JSC::Yarr::checkSyntax(*source);
47049 if (error == JSC::Yarr::NoError)
47050 return true;
47051
47052 reportYarrError(cx, tokenStream, error);
47053 return false;
47054 }
47055
47056
47057 static inline bool isJITRuntimeEnabled(JSContext *cx);
47058
47059 static void reportYarrError(JSContext *cx, TokenStream *ts, JSC::Yarr::ErrorCode error);
47060
47061 static size_t getOutputSize(size_t pairCount) {
47062 return pairCount * 2;
47063 }
47064
47065 bool compile(JSContext *cx, JSLinearString &pattern, unsigned *parenCount, RegExpFlag flags);
47066
47067
47068 RegExpRunStatus
47069 execute(JSContext *cx, const jschar *chars, size_t length, size_t start,
47070 int *output, size_t outputCount);
47071 };
47072
47073 }
47074 # 161 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/RegExpObject.h"
47075 class RegExpShared
47076 {
47077 friend class RegExpCompartment;
47078 friend class RegExpGuard;
47079
47080 detail::RegExpCode code;
47081 unsigned parenCount;
47082 RegExpFlag flags;
47083 size_t activeUseCount;
47084 uint64_t gcNumberWhenUsed;
47085
47086 bool compile(JSContext *cx, JSAtom *source);
47087
47088 RegExpShared(JSRuntime *rt, RegExpFlag flags);
47089 friend class js::OffTheBooks; friend class js::Foreground; friend class js::UnwantedForeground; friend struct ::JSContext; friend struct ::JSRuntime;
47090
47091 public:
47092
47093
47094 inline void prepareForUse(JSContext *cx);
47095
47096
47097
47098 RegExpRunStatus
47099 execute(JSContext *cx, const jschar *chars, size_t length, size_t *lastIndex,
47100 MatchPairs **output);
47101
47102
47103
47104 size_t getParenCount() const { return parenCount; }
47105 void incRef() { activeUseCount++; }
47106 void decRef() { do { } while(0); activeUseCount--; }
47107
47108
47109 size_t pairCount() const { return parenCount + 1; }
47110
47111 RegExpFlag getFlags() const { return flags; }
47112 bool ignoreCase() const { return flags & IgnoreCaseFlag; }
47113 bool global() const { return flags & GlobalFlag; }
47114 bool multiline() const { return flags & MultilineFlag; }
47115 bool sticky() const { return flags & StickyFlag; }
47116 };
47117
47118
47119
47120
47121
47122 class RegExpGuard
47123 {
47124 RegExpShared *re_;
47125 RegExpGuard(const RegExpGuard &) ;
47126 void operator=(const RegExpGuard &) ;
47127 public:
47128 RegExpGuard() : re_(__null) {}
47129 RegExpGuard(RegExpShared &re) : re_(&re) {
47130 re_->incRef();
47131 }
47132 void init(RegExpShared &re) {
47133 do { } while(0);
47134 re_ = &re;
47135 re_->incRef();
47136 }
47137 ~RegExpGuard() {
47138 if (re_)
47139 re_->decRef();
47140 }
47141 bool initialized() const { return !!re_; }
47142 RegExpShared *re() const { do { } while(0); return re_; }
47143 RegExpShared *operator->() { return re(); }
47144 RegExpShared &operator*() { return *re(); }
47145 };
47146
47147 class RegExpCompartment
47148 {
47149 enum Type { Normal = 0x0, Hack = 0x1 };
47150
47151 struct Key {
47152 JSAtom *atom;
47153 uint16_t flag;
47154 uint16_t type;
47155 Key() {}
47156 Key(JSAtom *atom, RegExpFlag flag, Type type)
47157 : atom(atom), flag(flag), type(type) {}
47158 typedef Key Lookup;
47159 static HashNumber hash(const Lookup &l) {
47160 return DefaultHasher<JSAtom *>::hash(l.atom) ^ (l.flag << 1) ^ l.type;
47161 }
47162 static bool match(Key l, Key r) {
47163 return l.atom == r.atom && l.flag == r.flag && l.type == r.type;
47164 }
47165 };
47166
47167 typedef HashMap<Key, RegExpShared *, Key, RuntimeAllocPolicy> Map;
47168 Map map_;
47169
47170 bool get(JSContext *cx, JSAtom *key, JSAtom *source, RegExpFlag flags, Type type,
47171 RegExpGuard *g);
47172
47173 public:
47174 RegExpCompartment(JSRuntime *rt);
47175 ~RegExpCompartment();
47176
47177 bool init(JSContext *cx);
47178 void sweep(JSRuntime *rt);
47179
47180
47181 bool get(JSContext *cx, JSAtom *source, RegExpFlag flags, RegExpGuard *g);
47182
47183
47184 bool get(JSContext *cx, JSAtom *source, JSString *maybeOpt, RegExpGuard *g);
47185 # 283 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/RegExpObject.h"
47186 bool getHack(JSContext *cx, JSAtom *source, JSAtom *hackedSource, RegExpFlag flags,
47187 RegExpGuard *g);
47188
47189
47190
47191
47192
47193
47194 bool lookupHack(JSAtom *source, RegExpFlag flags, JSContext *cx, RegExpGuard *g);
47195 };
47196
47197 class RegExpObject : public JSObject
47198 {
47199 typedef detail::RegExpCode RegExpCode;
47200
47201 static const unsigned LAST_INDEX_SLOT = 0;
47202 static const unsigned SOURCE_SLOT = 1;
47203 static const unsigned GLOBAL_FLAG_SLOT = 2;
47204 static const unsigned IGNORE_CASE_FLAG_SLOT = 3;
47205 static const unsigned MULTILINE_FLAG_SLOT = 4;
47206 static const unsigned STICKY_FLAG_SLOT = 5;
47207
47208 public:
47209 static const unsigned RESERVED_SLOTS = 6;
47210
47211
47212
47213
47214
47215
47216 static RegExpObject *
47217 create(JSContext *cx, RegExpStatics *res, const jschar *chars, size_t length,
47218 RegExpFlag flags, TokenStream *ts);
47219
47220 static RegExpObject *
47221 createNoStatics(JSContext *cx, const jschar *chars, size_t length, RegExpFlag flags,
47222 TokenStream *ts);
47223
47224 static RegExpObject *
47225 createNoStatics(JSContext *cx, HandleAtom atom, RegExpFlag flags, TokenStream *ts);
47226 # 335 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/RegExpObject.h"
47227 RegExpRunStatus
47228 execute(JSContext *cx, const jschar *chars, size_t length, size_t *lastIndex,
47229 MatchPairs **output);
47230
47231
47232
47233 const Value &getLastIndex() const {
47234 return getSlot(LAST_INDEX_SLOT);
47235 }
47236 inline void setLastIndex(const Value &v);
47237 inline void setLastIndex(double d);
47238 inline void zeroLastIndex();
47239
47240 JSFlatString *toString(JSContext *cx) const;
47241
47242 JSAtom *getSource() const {
47243 return &getSlot(SOURCE_SLOT).toString()->asAtom();
47244 }
47245 inline void setSource(JSAtom *source);
47246
47247 RegExpFlag getFlags() const {
47248 unsigned flags = 0;
47249 flags |= global() ? GlobalFlag : 0;
47250 flags |= ignoreCase() ? IgnoreCaseFlag : 0;
47251 flags |= multiline() ? MultilineFlag : 0;
47252 flags |= sticky() ? StickyFlag : 0;
47253 return RegExpFlag(flags);
47254 }
47255
47256
47257
47258 inline void setIgnoreCase(bool enabled);
47259 inline void setGlobal(bool enabled);
47260 inline void setMultiline(bool enabled);
47261 inline void setSticky(bool enabled);
47262 bool ignoreCase() const { return getSlot(IGNORE_CASE_FLAG_SLOT).toBoolean(); }
47263 bool global() const { return getSlot(GLOBAL_FLAG_SLOT).toBoolean(); }
47264 bool multiline() const { return getSlot(MULTILINE_FLAG_SLOT).toBoolean(); }
47265 bool sticky() const { return getSlot(STICKY_FLAG_SLOT).toBoolean(); }
47266
47267 inline void shared(RegExpGuard *g) const;
47268 inline bool getShared(JSContext *cx, RegExpGuard *g);
47269 inline void setShared(JSContext *cx, RegExpShared &shared);
47270
47271 private:
47272 friend class RegExpObjectBuilder;
47273
47274
47275
47276
47277
47278
47279 Shape *assignInitialShape(JSContext *cx);
47280
47281 inline bool init(JSContext *cx, HandleAtom source, RegExpFlag flags);
47282
47283
47284
47285
47286
47287 bool createShared(JSContext *cx, RegExpGuard *g);
47288 RegExpShared *maybeShared() const;
47289
47290
47291 void setPrivate(void *priv) ;
47292 };
47293
47294
47295
47296
47297
47298
47299
47300 bool
47301 ParseRegExpFlags(JSContext *cx, JSString *flagStr, RegExpFlag *flagsOut);
47302 # 419 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/RegExpObject.h"
47303 inline bool
47304 RegExpToShared(JSContext *cx, JSObject &obj, RegExpGuard *g);
47305
47306 template<XDRMode mode>
47307 bool
47308 XDRScriptRegExpObject(XDRState<mode> *xdr, HeapPtrObject *objp);
47309
47310 extern JSObject *
47311 CloneScriptRegExpObject(JSContext *cx, RegExpObject &re);
47312
47313 }
47314 # 19 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscompartment.h" 2
47315
47316 namespace js {
47317
47318
47319 extern Class dummy_class;
47320 # 32 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscompartment.h"
47321 class DtoaCache {
47322 double d;
47323 int base;
47324 JSFixedString *s;
47325 public:
47326 DtoaCache() : s(__null) {}
47327 void purge() { s = __null; }
47328
47329 JSFixedString *lookup(int base, double d) {
47330 return this->s && base == this->base && d == this->d ? this->s : __null;
47331 }
47332
47333 void cache(int base, double d, JSFixedString *s) {
47334 this->base = base;
47335 this->d = d;
47336 this->s = s;
47337 }
47338
47339 };
47340
47341
47342 typedef int moz_static_assert103[(sizeof(HashNumber) == 4) ? 1 : -1];
47343
47344 struct WrapperHasher
47345 {
47346 typedef Value Lookup;
47347
47348 static HashNumber hash(Value key) {
47349 do { } while(0);
47350 uint64_t bits = JSVAL_TO_IMPL(key).asBits;
47351 return uint32_t(bits) ^ uint32_t(bits >> 32);
47352 }
47353
47354 static bool match(const Value &l, const Value &k) { return l == k; }
47355 };
47356
47357 typedef HashMap<Value, ReadBarrieredValue, WrapperHasher, SystemAllocPolicy> WrapperMap;
47358
47359 }
47360
47361 namespace JS {
47362 struct TypeInferenceSizes;
47363 }
47364
47365 namespace js {
47366 class AutoDebugModeGC;
47367 }
47368
47369 struct JSCompartment
47370 {
47371 JSRuntime *rt;
47372 JSPrincipals *principals;
47373
47374 js::gc::ArenaLists arenas;
47375
47376 private:
47377 bool needsBarrier_;
47378 public:
47379
47380 bool needsBarrier() const {
47381 return needsBarrier_;
47382 }
47383
47384 void setNeedsBarrier(bool needs);
47385
47386 js::GCMarker *barrierTracer() {
47387 do { } while(0);
47388 return &rt->gcMarker;
47389 }
47390
47391 private:
47392 enum CompartmentGCState {
47393 NoGCScheduled,
47394 GCScheduled,
47395 GCRunning
47396 };
47397
47398 CompartmentGCState gcState;
47399 bool gcPreserveCode;
47400
47401 public:
47402 bool isCollecting() const {
47403
47404 if (rt->gcRunning) {
47405 return gcState == GCRunning;
47406 } else {
47407 do { } while(0);
47408 return needsBarrier();
47409 }
47410 }
47411
47412 bool isPreservingCode() const {
47413 return gcPreserveCode;
47414 }
47415
47416
47417
47418
47419
47420 bool requireGCTracer() const {
47421 return gcState == GCRunning;
47422 }
47423
47424 void setCollecting(bool collecting) {
47425 do { } while(0);
47426 if (collecting)
47427 gcState = GCRunning;
47428 else
47429 gcState = NoGCScheduled;
47430 }
47431
47432 void scheduleGC() {
47433 do { } while(0);
47434 do { } while(0);
47435 gcState = GCScheduled;
47436 }
47437
47438 void unscheduleGC() {
47439 do { } while(0);
47440 do { } while(0);
47441 gcState = NoGCScheduled;
47442 }
47443
47444 bool isGCScheduled() const {
47445 return gcState == GCScheduled;
47446 }
47447
47448 void setPreservingCode(bool preserving) {
47449 gcPreserveCode = preserving;
47450 }
47451
47452 size_t gcBytes;
47453 size_t gcTriggerBytes;
47454 size_t gcMaxMallocBytes;
47455
47456 bool hold;
47457 bool isSystemCompartment;
47458
47459 int64_t lastCodeRelease;
47460
47461
47462
47463
47464
47465
47466 static const size_t TYPE_LIFO_ALLOC_PRIMARY_CHUNK_SIZE = 128 * 1024;
47467 js::LifoAlloc typeLifoAlloc;
47468 bool activeAnalysis;
47469 bool activeInference;
47470
47471
47472 js::types::TypeCompartment types;
47473
47474 void *data;
47475 bool active;
47476 js::WrapperMap crossCompartmentWrappers;
47477
47478
47479 int64_t lastAnimationTime;
47480
47481 js::RegExpCompartment regExps;
47482
47483 size_t sizeOfShapeTable(JSMallocSizeOfFun mallocSizeOf);
47484 void sizeOfTypeInferenceData(JS::TypeInferenceSizes *stats, JSMallocSizeOfFun mallocSizeOf);
47485
47486
47487
47488
47489 js::PropertyTree propertyTree;
47490
47491
47492 js::BaseShapeSet baseShapes;
47493 void sweepBaseShapeTable();
47494
47495
47496 js::InitialShapeSet initialShapes;
47497 void sweepInitialShapeTable();
47498
47499
47500 js::types::TypeObjectSet newTypeObjects;
47501 js::types::TypeObjectSet lazyTypeObjects;
47502 void sweepNewTypeObjectTable(js::types::TypeObjectSet &table);
47503
47504 js::ReadBarriered<js::types::TypeObject> emptyTypeObject;
47505
47506
47507 inline js::types::TypeObject *getEmptyType(JSContext *cx);
47508
47509 js::types::TypeObject *getLazyType(JSContext *cx, JSObject *proto);
47510
47511
47512
47513
47514
47515
47516
47517 size_t gcMallocAndFreeBytes;
47518 size_t gcTriggerMallocAndFreeBytes;
47519
47520 private:
47521
47522
47523
47524
47525
47526 ptrdiff_t gcMallocBytes;
47527
47528 enum { DebugFromC = 1, DebugFromJS = 2 };
47529
47530 unsigned debugModeBits;
47531
47532 public:
47533 JSCompartment(JSRuntime *rt);
47534 ~JSCompartment();
47535
47536 bool init(JSContext *cx);
47537
47538
47539 void markCrossCompartmentWrappers(JSTracer *trc);
47540
47541 bool wrap(JSContext *cx, js::Value *vp);
47542 bool wrap(JSContext *cx, JSString **strp);
47543 bool wrap(JSContext *cx, js::HeapPtrString *strp);
47544 bool wrap(JSContext *cx, JSObject **objp);
47545 bool wrapId(JSContext *cx, jsid *idp);
47546 bool wrap(JSContext *cx, js::PropertyOp *op);
47547 bool wrap(JSContext *cx, js::StrictPropertyOp *op);
47548 bool wrap(JSContext *cx, js::PropertyDescriptor *desc);
47549 bool wrap(JSContext *cx, js::AutoIdVector &props);
47550
47551 void markTypes(JSTracer *trc);
47552 void discardJitCode(js::FreeOp *fop);
47553 void sweep(js::FreeOp *fop, bool releaseTypes);
47554 void sweepCrossCompartmentWrappers();
47555 void purge();
47556
47557 void setGCLastBytes(size_t lastBytes, size_t lastMallocBytes, js::JSGCInvocationKind gckind);
47558 void reduceGCTriggerBytes(size_t amount);
47559
47560 void resetGCMallocBytes();
47561 void setGCMaxMallocBytes(size_t value);
47562 void updateMallocCounter(size_t nbytes) {
47563 ptrdiff_t oldCount = gcMallocBytes;
47564 ptrdiff_t newCount = oldCount - ptrdiff_t(nbytes);
47565 gcMallocBytes = newCount;
47566 if ((__builtin_expect((newCount <= 0 && oldCount > 0), 0)))
47567 onTooMuchMalloc();
47568 }
47569
47570 bool isTooMuchMalloc() const {
47571 return gcMallocBytes <= 0;
47572 }
47573
47574 void onTooMuchMalloc();
47575
47576 void mallocInCompartment(size_t nbytes) {
47577 gcMallocAndFreeBytes += nbytes;
47578 }
47579
47580 void freeInCompartment(size_t nbytes) {
47581 do { } while(0);
47582 gcMallocAndFreeBytes -= nbytes;
47583 }
47584
47585 js::DtoaCache dtoaCache;
47586
47587 private:
47588
47589
47590
47591
47592 js::GlobalObjectSet debuggees;
47593
47594 private:
47595 JSCompartment *thisForCtor() { return this; }
47596
47597 public:
47598
47599
47600
47601
47602
47603
47604
47605 bool debugMode() const { return !!debugModeBits; }
47606
47607
47608 bool hasScriptsOnStack();
47609
47610 private:
47611
47612 void updateForDebugMode(js::FreeOp *fop, js::AutoDebugModeGC &dmgc);
47613
47614 public:
47615 js::GlobalObjectSet &getDebuggees() { return debuggees; }
47616 bool addDebuggee(JSContext *cx, js::GlobalObject *global);
47617 void removeDebuggee(js::FreeOp *fop, js::GlobalObject *global,
47618 js::GlobalObjectSet::Enum *debuggeesEnum = __null);
47619 bool setDebugModeFromC(JSContext *cx, bool b, js::AutoDebugModeGC &dmgc);
47620
47621 void clearBreakpointsIn(js::FreeOp *fop, js::Debugger *dbg, JSObject *handler);
47622 void clearTraps(js::FreeOp *fop);
47623
47624 private:
47625 void sweepBreakpoints(js::FreeOp *fop);
47626
47627 public:
47628 js::WatchpointMap *watchpointMap;
47629
47630 js::ScriptCountsMap *scriptCountsMap;
47631
47632 js::SourceMapMap *sourceMapMap;
47633
47634 js::DebugScriptMap *debugScriptMap;
47635 };
47636
47637
47638
47639
47640
47641 class js::AutoDebugModeGC
47642 {
47643 JSRuntime *rt;
47644 bool needGC;
47645 public:
47646 explicit AutoDebugModeGC(JSRuntime *rt) : rt(rt), needGC(false) {}
47647
47648 ~AutoDebugModeGC() {
47649
47650
47651
47652
47653 if (needGC)
47654 GC(rt, GC_NORMAL, gcreason::DEBUG_MODE_GC);
47655 }
47656
47657 void scheduleGC(JSCompartment *compartment) {
47658 do { } while(0);
47659 PrepareCompartmentForGC(compartment);
47660 needGC = true;
47661 }
47662 };
47663
47664 inline void
47665 JSContext::setCompartment(JSCompartment *compartment)
47666 {
47667 this->compartment = compartment;
47668 this->inferenceEnabled = compartment ? compartment->types.inferenceEnabled : false;
47669 }
47670
47671 namespace js {
47672
47673 class PreserveCompartment {
47674 protected:
47675 JSContext *cx;
47676 private:
47677 JSCompartment *oldCompartment;
47678 bool oldInferenceEnabled;
47679
47680 public:
47681 PreserveCompartment(JSContext *cx ) : cx(cx) {
47682 do { } while (0);
47683 oldCompartment = cx->compartment;
47684 oldInferenceEnabled = cx->inferenceEnabled;
47685 }
47686
47687 ~PreserveCompartment() {
47688
47689 cx->compartment = oldCompartment;
47690 cx->inferenceEnabled = oldInferenceEnabled;
47691 }
47692 };
47693
47694 class SwitchToCompartment : public PreserveCompartment {
47695 public:
47696 SwitchToCompartment(JSContext *cx, JSCompartment *newCompartment
47697 )
47698 : PreserveCompartment(cx)
47699 {
47700 do { } while (0);
47701 cx->setCompartment(newCompartment);
47702 }
47703
47704 SwitchToCompartment(JSContext *cx, JSObject *target )
47705 : PreserveCompartment(cx)
47706 {
47707 do { } while (0);
47708 cx->setCompartment(target->compartment());
47709 }
47710
47711
47712 };
47713
47714 class AssertCompartmentUnchanged {
47715 protected:
47716 JSContext * const cx;
47717 JSCompartment * const oldCompartment;
47718
47719 public:
47720 AssertCompartmentUnchanged(JSContext *cx )
47721 : cx(cx), oldCompartment(cx->compartment) {
47722 do { } while (0);
47723 }
47724
47725 ~AssertCompartmentUnchanged() {
47726 do { } while(0);
47727 }
47728 };
47729
47730 class AutoCompartment
47731 {
47732 public:
47733 JSContext * const context;
47734 JSCompartment * const origin;
47735 JSObject * const target;
47736 JSCompartment * const destination;
47737 private:
47738 Maybe<DummyFrameGuard> frame;
47739 bool entered;
47740
47741 public:
47742 AutoCompartment(JSContext *cx, JSObject *target);
47743 ~AutoCompartment();
47744
47745 bool enter();
47746 void leave();
47747
47748 private:
47749 AutoCompartment(const AutoCompartment &) ;
47750 AutoCompartment & operator=(const AutoCompartment &) ;
47751 };
47752
47753
47754
47755
47756
47757
47758 class ErrorCopier
47759 {
47760 AutoCompartment &ac;
47761 RootedObject scope;
47762
47763 public:
47764 ErrorCopier(AutoCompartment &ac, JSObject *scope) : ac(ac), scope(ac.context, scope) {
47765 do { } while(0);
47766 }
47767 ~ErrorCopier();
47768 };
47769
47770 class CompartmentsIter {
47771 private:
47772 JSCompartment **it, **end;
47773
47774 public:
47775 CompartmentsIter(JSRuntime *rt) {
47776 it = rt->compartments.begin();
47777 end = rt->compartments.end();
47778 }
47779
47780 bool done() const { return it == end; }
47781
47782 void next() {
47783 do { } while(0);
47784 it++;
47785 }
47786
47787 JSCompartment *get() const {
47788 do { } while(0);
47789 return *it;
47790 }
47791
47792 operator JSCompartment *() const { return get(); }
47793 JSCompartment *operator->() const { return get(); }
47794 };
47795
47796 }
47797 # 17 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/methodjit/MethodJIT.h" 2
47798 # 33 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/methodjit/MethodJIT.h"
47799 namespace js {
47800
47801 namespace mjit {
47802 struct JITChunk;
47803 struct JITScript;
47804 }
47805
47806 struct VMFrame
47807 {
47808 # 82 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/methodjit/MethodJIT.h"
47809 union Arguments {
47810 struct {
47811 void *ptr;
47812 void *ptr2;
47813 } x;
47814 struct {
47815 uint32_t dynamicArgc;
47816 } call;
47817 } u;
47818
47819 static size_t offsetOfDynamicArgc() {
47820 return __builtin_offsetof (VMFrame, u.call.dynamicArgc);
47821 }
47822
47823 VMFrame *previous;
47824 void *scratch;
47825 FrameRegs regs;
47826
47827 static size_t offsetOfRegsSp() {
47828 return __builtin_offsetof (VMFrame, regs.sp);
47829 }
47830
47831 static size_t offsetOfRegsPc() {
47832 return __builtin_offsetof (VMFrame, regs.pc);
47833 }
47834
47835 JSContext *cx;
47836 Value *stackLimit;
47837 StackFrame *entryfp;
47838 FrameRegs *oldregs;
47839 JSRejoinState stubRejoin;
47840 # 162 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/methodjit/MethodJIT.h"
47841 void *savedR4;
47842 void *savedR5;
47843 void *savedR6;
47844 void *savedR7;
47845 void *savedR8;
47846 void *savedR9;
47847 void *savedR10;
47848 void *savedR11;
47849 void *savedLR;
47850
47851 inline void** returnAddressLocation() {
47852 return reinterpret_cast<void**>(this) - 1;
47853 }
47854 # 202 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/methodjit/MethodJIT.h"
47855 JSRuntime *runtime() { return cx->runtime; }
47856
47857
47858
47859
47860
47861
47862
47863 StackFrame *fp() { return regs.fp(); }
47864 mjit::JITScript *jit() { return fp()->jit(); }
47865
47866 inline mjit::JITChunk *chunk();
47867 inline unsigned chunkIndex();
47868
47869
47870 inline JSScript *script();
47871 inline jsbytecode *pc();
47872 # 227 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/methodjit/MethodJIT.h"
47873 static const size_t offsetOfFp = 4 * sizeof(void *) + FrameRegs::offsetOfFp;
47874 static const size_t offsetOfInlined = 4 * sizeof(void *) + FrameRegs::offsetOfInlined;
47875
47876
47877 static void staticAssert() {
47878 typedef int moz_static_assert104[(offsetOfFp == __builtin_offsetof (VMFrame, regs) + FrameRegs::offsetOfFp) ? 1 : -1];
47879 typedef int moz_static_assert105[(offsetOfInlined == __builtin_offsetof (VMFrame, regs) + FrameRegs::offsetOfInlined) ? 1 : -1];
47880 }
47881 };
47882
47883
47884
47885 extern "C" void JaegerStubVeneer(void);
47886
47887
47888 namespace mjit {
47889
47890
47891
47892
47893
47894
47895 enum RejoinState {
47896 # 259 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/methodjit/MethodJIT.h"
47897 REJOIN_SCRIPTED = 1,
47898
47899
47900 REJOIN_NONE,
47901
47902
47903 REJOIN_RESUME,
47904
47905
47906
47907
47908
47909 REJOIN_TRAP,
47910
47911
47912 REJOIN_FALLTHROUGH,
47913
47914
47915
47916
47917
47918
47919
47920 REJOIN_NATIVE,
47921 REJOIN_NATIVE_LOWERED,
47922 REJOIN_NATIVE_GETTER,
47923
47924
47925
47926
47927
47928
47929 REJOIN_NATIVE_PATCHED,
47930
47931
47932 REJOIN_PUSH_BOOLEAN,
47933 REJOIN_PUSH_OBJECT,
47934
47935
47936 REJOIN_DEFLOCALFUN,
47937
47938
47939
47940
47941
47942 REJOIN_THIS_PROTOTYPE,
47943
47944
47945
47946
47947
47948 REJOIN_CHECK_ARGUMENTS,
47949
47950
47951
47952
47953
47954 REJOIN_FUNCTION_PROLOGUE,
47955
47956
47957
47958
47959
47960 REJOIN_CALL_PROLOGUE,
47961 REJOIN_CALL_PROLOGUE_LOWERED_CALL,
47962 REJOIN_CALL_PROLOGUE_LOWERED_APPLY,
47963
47964
47965 REJOIN_CALL_SPLAT,
47966
47967
47968 REJOIN_GETTER,
47969 REJOIN_POS,
47970 REJOIN_BINARY,
47971
47972
47973
47974
47975
47976 REJOIN_BRANCH
47977 };
47978
47979
47980 static inline JSRejoinState
47981 ScriptedRejoin(uint32_t pcOffset)
47982 {
47983 return REJOIN_SCRIPTED | (pcOffset << 1);
47984 }
47985
47986
47987 static inline JSRejoinState
47988 StubRejoin(RejoinState rejoin)
47989 {
47990 return rejoin << 1;
47991 }
47992
47993
47994 struct RecompilationMonitor
47995 {
47996 JSContext *cx;
47997
47998
47999
48000
48001
48002
48003 unsigned recompilations;
48004 unsigned frameExpansions;
48005
48006
48007 uint64_t gcNumber;
48008
48009 RecompilationMonitor(JSContext *cx)
48010 : cx(cx),
48011 recompilations(cx->compartment->types.recompilations),
48012 frameExpansions(cx->compartment->types.frameExpansions),
48013 gcNumber(cx->runtime->gcNumber)
48014 {}
48015
48016 bool recompiled() {
48017 return cx->compartment->types.recompilations != recompilations
48018 || cx->compartment->types.frameExpansions != frameExpansions
48019 || cx->runtime->gcNumber != gcNumber;
48020 }
48021 };
48022
48023
48024
48025
48026
48027 struct Trampolines {
48028 typedef void (*TrampolinePtr)();
48029
48030 TrampolinePtr forceReturn;
48031 JSC::ExecutablePool *forceReturnPool;
48032
48033
48034
48035
48036
48037 };
48038
48039
48040 enum JaegerStatus
48041 {
48042
48043 Jaeger_Throwing = 0,
48044
48045
48046 Jaeger_Returned = 1,
48047
48048
48049
48050
48051
48052 Jaeger_Unfinished = 2,
48053
48054
48055
48056
48057
48058
48059 Jaeger_UnfinishedAtTrap = 3,
48060
48061
48062
48063
48064
48065 Jaeger_ThrowBeforeEnter = 4
48066 };
48067
48068 static inline bool
48069 JaegerStatusToSuccess(JaegerStatus status)
48070 {
48071 do { } while(0);
48072 do { } while(0);
48073 return status == Jaeger_Returned;
48074 }
48075
48076
48077 class JaegerRuntime
48078 {
48079 Trampolines trampolines;
48080 VMFrame *activeFrame_;
48081 JaegerStatus lastUnfinished_;
48082
48083
48084 void finish();
48085
48086 public:
48087 bool init(JSContext *cx);
48088
48089 JaegerRuntime();
48090 ~JaegerRuntime() { finish(); }
48091
48092 VMFrame *activeFrame() {
48093 return activeFrame_;
48094 }
48095
48096 void pushActiveFrame(VMFrame *f) {
48097 do { } while(0);
48098 f->previous = activeFrame_;
48099 f->scratch = __null;
48100 activeFrame_ = f;
48101 }
48102
48103 void popActiveFrame() {
48104 do { } while(0);
48105 activeFrame_ = activeFrame_->previous;
48106 }
48107
48108 void setLastUnfinished(JaegerStatus status) {
48109 do { } while(0);
48110 lastUnfinished_ = status;
48111 }
48112
48113 JaegerStatus lastUnfinished() {
48114 JaegerStatus result = lastUnfinished_;
48115 lastUnfinished_ = (JaegerStatus) 0;
48116 return result;
48117 }
48118
48119
48120
48121
48122
48123
48124
48125 void *forceReturnFromExternC() const {
48126 return (__extension__ (void *) (size_t) (trampolines.forceReturn));
48127 }
48128
48129
48130
48131
48132
48133
48134 void *forceReturnFromFastCall() const {
48135
48136
48137
48138 return (__extension__ (void *) (size_t) (trampolines.forceReturn));
48139
48140 }
48141
48142
48143
48144
48145
48146
48147 Vector<StackFrame *, 8, SystemAllocPolicy> orphanedNativeFrames;
48148 Vector<JSC::ExecutablePool *, 8, SystemAllocPolicy> orphanedNativePools;
48149 };
48150 # 520 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/methodjit/MethodJIT.h"
48151 class CompilerAllocPolicy : public TempAllocPolicy
48152 {
48153 bool *oomFlag;
48154
48155 void *checkAlloc(void *p) {
48156 if (!p)
48157 *oomFlag = true;
48158 return p;
48159 }
48160
48161 public:
48162 CompilerAllocPolicy(JSContext *cx, bool *oomFlag)
48163 : TempAllocPolicy(cx), oomFlag(oomFlag) {}
48164 CompilerAllocPolicy(JSContext *cx, Compiler &compiler);
48165
48166 void *malloc_(size_t bytes) { return checkAlloc(TempAllocPolicy::malloc_(bytes)); }
48167 void *realloc_(void *p, size_t oldBytes, size_t bytes) {
48168 return checkAlloc(TempAllocPolicy::realloc_(p, oldBytes, bytes));
48169 }
48170 };
48171
48172 namespace ic {
48173
48174 struct PICInfo;
48175 struct GetElementIC;
48176 struct SetElementIC;
48177
48178
48179 struct GetGlobalNameIC;
48180 struct SetGlobalNameIC;
48181 struct EqualityICInfo;
48182 struct CallICInfo;
48183
48184 }
48185 }
48186
48187 typedef void ( *VoidStub)(VMFrame &);
48188 typedef void ( *VoidVpStub)(VMFrame &, Value *);
48189 typedef void ( *VoidStubUInt32)(VMFrame &, uint32_t);
48190 typedef void ( *VoidStubInt32)(VMFrame &, int32_t);
48191 typedef JSBool ( *BoolStub)(VMFrame &);
48192 typedef void * ( *VoidPtrStub)(VMFrame &);
48193 typedef void * ( *VoidPtrStubPC)(VMFrame &, jsbytecode *);
48194 typedef void * ( *VoidPtrStubUInt32)(VMFrame &, uint32_t);
48195 typedef JSObject * ( *JSObjStub)(VMFrame &);
48196 typedef JSObject * ( *JSObjStubUInt32)(VMFrame &, uint32_t);
48197 typedef JSObject * ( *JSObjStubFun)(VMFrame &, JSFunction *);
48198 typedef void ( *VoidStubFun)(VMFrame &, JSFunction *);
48199 typedef JSObject * ( *JSObjStubJSObj)(VMFrame &, JSObject *);
48200 typedef void ( *VoidStubName)(VMFrame &, PropertyName *);
48201 typedef JSString * ( *JSStrStub)(VMFrame &);
48202 typedef JSString * ( *JSStrStubUInt32)(VMFrame &, uint32_t);
48203 typedef void ( *VoidStubJSObj)(VMFrame &, JSObject *);
48204 typedef void ( *VoidStubPC)(VMFrame &, jsbytecode *);
48205 typedef JSBool ( *BoolStubUInt32)(VMFrame &f, uint32_t);
48206
48207 typedef void ( *VoidStubCallIC)(VMFrame &, js::mjit::ic::CallICInfo *);
48208 typedef void * ( *VoidPtrStubCallIC)(VMFrame &, js::mjit::ic::CallICInfo *);
48209 typedef void ( *VoidStubGetGlobal)(VMFrame &, js::mjit::ic::GetGlobalNameIC *);
48210 typedef void ( *VoidStubSetGlobal)(VMFrame &, js::mjit::ic::SetGlobalNameIC *);
48211 typedef JSBool ( *BoolStubEqualityIC)(VMFrame &, js::mjit::ic::EqualityICInfo *);
48212
48213
48214 typedef void ( *VoidStubPIC)(VMFrame &, js::mjit::ic::PICInfo *);
48215 typedef void ( *VoidStubGetElemIC)(VMFrame &, js::mjit::ic::GetElementIC *);
48216 typedef void ( *VoidStubSetElemIC)(VMFrame &f, js::mjit::ic::SetElementIC *);
48217
48218
48219 namespace mjit {
48220
48221 struct InlineFrame;
48222 struct CallSite;
48223
48224 struct NativeMapEntry {
48225 size_t bcOff;
48226 void *ncode;
48227 };
48228
48229
48230 struct PCLengthEntry {
48231 double codeLength;
48232 double picsLength;
48233 };
48234
48235
48236
48237
48238
48239
48240 struct NativeCallStub {
48241
48242 jsbytecode *pc;
48243
48244
48245 JSC::ExecutablePool *pool;
48246 # 624 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/methodjit/MethodJIT.h"
48247 JSC::CodeLocationJump jump;
48248
48249 };
48250
48251 struct JITChunk
48252 {
48253 typedef JSC::MacroAssemblerCodeRef CodeRef;
48254 CodeRef code;
48255
48256 PCLengthEntry *pcLengths;
48257 # 643 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/methodjit/MethodJIT.h"
48258 uint32_t nNmapPairs : 31;
48259
48260 uint32_t nInlineFrames;
48261 uint32_t nCallSites;
48262 uint32_t nRootedTemplates;
48263 uint32_t nRootedRegExps;
48264
48265 uint32_t nGetGlobalNames;
48266 uint32_t nSetGlobalNames;
48267 uint32_t nCallICs;
48268 uint32_t nEqualityICs;
48269
48270
48271 uint32_t nGetElems;
48272 uint32_t nSetElems;
48273 uint32_t nPICs;
48274
48275
48276
48277
48278 typedef Vector<JSC::ExecutablePool *, 0, SystemAllocPolicy> ExecPoolVector;
48279 ExecPoolVector execPools;
48280
48281
48282
48283 Vector<NativeCallStub, 0, SystemAllocPolicy> nativeCallStubs;
48284
48285 NativeMapEntry *nmap() const;
48286 js::mjit::InlineFrame *inlineFrames() const;
48287 js::mjit::CallSite *callSites() const;
48288 JSObject **rootedTemplates() const;
48289 RegExpShared **rootedRegExps() const;
48290
48291 ic::GetGlobalNameIC *getGlobalNames() const;
48292 ic::SetGlobalNameIC *setGlobalNames() const;
48293 ic::CallICInfo *callICs() const;
48294 ic::EqualityICInfo *equalityICs() const;
48295
48296
48297 ic::GetElementIC *getElems() const;
48298 ic::SetElementIC *setElems() const;
48299 ic::PICInfo *pics() const;
48300
48301
48302 bool isValidCode(void *ptr) {
48303 char *jitcode = (char *)code.m_code.executableAddress();
48304 char *jcheck = (char *)ptr;
48305 return jcheck >= jitcode && jcheck < jitcode + code.m_size;
48306 }
48307
48308 size_t computedSizeOfIncludingThis();
48309 size_t sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf);
48310
48311 ~JITChunk();
48312
48313 void trace(JSTracer *trc);
48314 void purgeCaches();
48315
48316 private:
48317
48318 char *commonSectionLimit() const;
48319 char *monoICSectionsLimit() const;
48320 char *polyICSectionsLimit() const;
48321 };
48322
48323 void
48324 SetChunkLimit(uint32_t limit);
48325
48326
48327 struct ChunkDescriptor
48328 {
48329
48330 uint32_t begin;
48331 uint32_t end;
48332
48333
48334 uint32_t counter;
48335
48336
48337 JITChunk *chunk;
48338
48339 ChunkDescriptor() { PodZero(this); }
48340 };
48341
48342
48343 struct CrossChunkEdge
48344 {
48345
48346 uint32_t source;
48347 uint32_t target;
48348
48349
48350 void *sourceJump1;
48351 void *sourceJump2;
48352 # 747 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/methodjit/MethodJIT.h"
48353 typedef Vector<void**,4,SystemAllocPolicy> JumpTableEntryVector;
48354 JumpTableEntryVector *jumpTableEntries;
48355
48356
48357 void *targetLabel;
48358
48359
48360
48361
48362
48363
48364 void *shimLabel;
48365
48366 CrossChunkEdge() { PodZero(this); }
48367 };
48368
48369 struct JITScript
48370 {
48371 JSScript *script;
48372
48373 void *invokeEntry;
48374 void *fastEntry;
48375 void *arityCheckEntry;
48376 void *argsCheckEntry;
48377
48378
48379 JSCList callers;
48380
48381 uint32_t nchunks;
48382 uint32_t nedges;
48383
48384
48385
48386
48387
48388 JSC::ExecutablePool *shimPool;
48389
48390
48391
48392 JSC::CodeLocationLabel argsCheckStub;
48393 JSC::CodeLocationLabel argsCheckFallthrough;
48394 JSC::CodeLocationJump argsCheckJump;
48395 JSC::ExecutablePool *argsCheckPool;
48396 void resetArgsCheck();
48397
48398
48399 ChunkDescriptor &chunkDescriptor(unsigned i) {
48400 do { } while(0);
48401 ChunkDescriptor *descs = (ChunkDescriptor *) ((char *) this + sizeof(JITScript));
48402 return descs[i];
48403 }
48404
48405 unsigned chunkIndex(jsbytecode *pc) {
48406 unsigned offset = pc - script->code;
48407 do { } while(0);
48408 for (unsigned i = 0; i < nchunks; i++) {
48409 const ChunkDescriptor &desc = chunkDescriptor(i);
48410 do { } while(0);
48411 if (offset < desc.end)
48412 return i;
48413 }
48414 __builtin_unreachable();
48415 return 0;
48416 }
48417
48418 JITChunk *chunk(jsbytecode *pc) {
48419 return chunkDescriptor(chunkIndex(pc)).chunk;
48420 }
48421
48422 JITChunk *findCodeChunk(void *addr);
48423
48424 CrossChunkEdge *edges() {
48425 return (CrossChunkEdge *) (&chunkDescriptor(0) + nchunks);
48426 }
48427
48428
48429 void patchEdge(const CrossChunkEdge &edge, void *label);
48430
48431 jsbytecode *nativeToPC(void *returnAddress, CallSite **pinline);
48432
48433 size_t sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf);
48434
48435 void destroy(FreeOp *fop);
48436 void destroyChunk(FreeOp *fop, unsigned chunkIndex, bool resetUses = true);
48437
48438 void trace(JSTracer *trc);
48439 void purgeCaches();
48440 };
48441
48442
48443
48444
48445
48446 JaegerStatus EnterMethodJIT(JSContext *cx, StackFrame *fp, void *code, Value *stackLimit,
48447 bool partial);
48448
48449
48450 JaegerStatus JaegerShot(JSContext *cx, bool partial);
48451
48452
48453 JaegerStatus JaegerShotAtSafePoint(JSContext *cx, void *safePoint, bool partial);
48454
48455 enum CompileStatus
48456 {
48457 Compile_Okay,
48458 Compile_Abort,
48459 Compile_InlineAbort,
48460 Compile_Retry,
48461 Compile_Error,
48462 Compile_Skipped
48463 };
48464
48465 void
48466 ProfileStubCall(VMFrame &f);
48467
48468 enum CompileRequest
48469 {
48470 CompileRequest_Interpreter,
48471 CompileRequest_JIT
48472 };
48473
48474 CompileStatus
48475 CanMethodJIT(JSContext *cx, JSScript *script, jsbytecode *pc,
48476 bool construct, CompileRequest request);
48477
48478 inline void
48479 ReleaseScriptCode(FreeOp *fop, JSScript *script)
48480 {
48481 if (!script->hasJITInfo())
48482 return;
48483
48484 for (int constructing = 0; constructing <= 1; constructing++) {
48485 for (int barriers = 0; barriers <= 1; barriers++) {
48486 JSScript::JITScriptHandle *jith = script->jitHandle((bool) constructing, (bool) barriers);
48487 if (jith && jith->isValid())
48488 JSScript::ReleaseCode(fop, jith);
48489 }
48490 }
48491
48492 script->destroyJITInfo(fop);
48493 }
48494
48495
48496 void
48497 ExpandInlineFrames(JSCompartment *compartment);
48498
48499
48500
48501 void
48502 ClearAllFrames(JSCompartment *compartment);
48503
48504
48505 struct InlineFrame
48506 {
48507 InlineFrame *parent;
48508 jsbytecode *parentpc;
48509 HeapPtrFunction fun;
48510
48511
48512
48513 uint32_t depth;
48514 };
48515
48516 struct CallSite
48517 {
48518 uint32_t codeOffset;
48519 uint32_t inlineIndex;
48520 uint32_t pcOffset;
48521 RejoinState rejoin;
48522
48523 void initialize(uint32_t codeOffset, uint32_t inlineIndex, uint32_t pcOffset,
48524 RejoinState rejoin) {
48525 this->codeOffset = codeOffset;
48526 this->inlineIndex = inlineIndex;
48527 this->pcOffset = pcOffset;
48528 this->rejoin = rejoin;
48529 }
48530
48531 bool isTrap() const {
48532 return rejoin == REJOIN_TRAP;
48533 }
48534 };
48535
48536 void
48537 DumpAllProfiles(JSContext *cx);
48538
48539 inline void * bsearch_nmap(NativeMapEntry *nmap, size_t nPairs, size_t bcOff)
48540 {
48541 size_t lo = 1, hi = nPairs;
48542 while (1) {
48543
48544 if (lo > hi)
48545 return __null;
48546 size_t mid = (lo + hi) / 2;
48547 size_t bcOff_mid = nmap[mid-1].bcOff;
48548 if (bcOff < bcOff_mid) {
48549 hi = mid-1;
48550 continue;
48551 }
48552 if (bcOff > bcOff_mid) {
48553 lo = mid+1;
48554 continue;
48555 }
48556 return nmap[mid-1].ncode;
48557 }
48558 }
48559
48560 static inline bool
48561 IsLowerableFunCallOrApply(jsbytecode *pc)
48562 {
48563
48564 return (*pc == JSOP_FUNCALL && ((unsigned)(((pc)[1] << 8) | (pc)[2])) >= 1) ||
48565 (*pc == JSOP_FUNAPPLY && ((unsigned)(((pc)[1] << 8) | (pc)[2])) == 2);
48566
48567
48568
48569 }
48570
48571 }
48572
48573 inline mjit::JITChunk *
48574 VMFrame::chunk()
48575 {
48576 return jit()->chunk(regs.pc);
48577 }
48578
48579 inline unsigned
48580 VMFrame::chunkIndex()
48581 {
48582 return jit()->chunkIndex(regs.pc);
48583 }
48584
48585 inline JSScript *
48586 VMFrame::script()
48587 {
48588 if (regs.inlined())
48589 return chunk()->inlineFrames()[regs.inlined()->inlineIndex].fun->script();
48590 return fp()->script();
48591 }
48592
48593 inline jsbytecode *
48594 VMFrame::pc()
48595 {
48596 if (regs.inlined())
48597 return script()->code + regs.inlined()->pcOffset;
48598 return regs.pc;
48599 }
48600
48601 }
48602
48603 inline void *
48604 JSScript::nativeCodeForPC(bool constructing, jsbytecode *pc)
48605 {
48606 js::mjit::JITScript *jit = getJIT(constructing, compartment()->needsBarrier());
48607 if (!jit)
48608 return __null;
48609 js::mjit::JITChunk *chunk = jit->chunk(pc);
48610 if (!chunk)
48611 return __null;
48612 return bsearch_nmap(chunk->nmap(), chunk->nNmapPairs, (size_t)(pc - code));
48613 }
48614
48615 extern "C" void JaegerTrampolineReturn();
48616 extern "C" void JaegerInterpoline();
48617 extern "C" void JaegerInterpolineScripted();
48618
48619
48620
48621
48622 extern "C" void JaegerThrowpoline();
48623 # 21 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsprobes.h" 2
48624
48625
48626 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl-inl.h" 1
48627 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl-inl.h"
48628 #define ObjectImpl_inl_h___
48629
48630
48631
48632
48633 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsgc.h" 1
48634 # 15 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl-inl.h" 2
48635 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinterp.h" 1
48636 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinterp.h"
48637 #define jsinterp_h___
48638 # 19 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinterp.h"
48639 namespace js {
48640
48641
48642
48643
48644
48645
48646
48647 inline bool
48648 ScriptPrologue(JSContext *cx, StackFrame *fp, JSScript *script);
48649
48650 inline bool
48651 ScriptEpilogue(JSContext *cx, StackFrame *fp, bool ok);
48652 # 40 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinterp.h"
48653 inline bool
48654 ScriptPrologueOrGeneratorResume(JSContext *cx, StackFrame *fp);
48655
48656 inline bool
48657 ScriptEpilogueOrGeneratorYield(JSContext *cx, StackFrame *fp, bool ok);
48658 # 65 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinterp.h"
48659 extern JSTrapStatus
48660 ScriptDebugPrologue(JSContext *cx, StackFrame *fp);
48661 # 83 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinterp.h"
48662 extern bool
48663 ScriptDebugEpilogue(JSContext *cx, StackFrame *fp, bool ok);
48664
48665
48666
48667
48668
48669
48670
48671 extern bool
48672 BoxNonStrictThis(JSContext *cx, const CallReceiver &call);
48673
48674
48675
48676
48677
48678
48679
48680 inline bool
48681 ComputeThis(JSContext *cx, StackFrame *fp);
48682
48683 enum MaybeConstruct {
48684 NO_CONSTRUCT = INITIAL_NONE,
48685 CONSTRUCT = INITIAL_CONSTRUCT
48686 };
48687
48688
48689
48690
48691
48692
48693 extern bool
48694 InvokeKernel(JSContext *cx, CallArgs args, MaybeConstruct construct = NO_CONSTRUCT);
48695
48696
48697
48698
48699
48700 inline bool
48701 Invoke(JSContext *cx, InvokeArgsGuard &args, MaybeConstruct construct = NO_CONSTRUCT)
48702 {
48703 args.setActive();
48704 bool ok = InvokeKernel(cx, args, construct);
48705 args.setInactive();
48706 return ok;
48707 }
48708
48709
48710
48711
48712
48713
48714 extern bool
48715 Invoke(JSContext *cx, const Value &thisv, const Value &fval, unsigned argc, Value *argv,
48716 Value *rval);
48717
48718
48719
48720
48721
48722 extern bool
48723 InvokeGetterOrSetter(JSContext *cx, JSObject *obj, const Value &fval, unsigned argc, Value *argv,
48724 Value *rval);
48725
48726
48727
48728
48729
48730 extern bool
48731 InvokeConstructorKernel(JSContext *cx, const CallArgs &args);
48732
48733
48734 inline bool
48735 InvokeConstructor(JSContext *cx, InvokeArgsGuard &args)
48736 {
48737 args.setActive();
48738 bool ok = InvokeConstructorKernel(cx, ImplicitCast<CallArgs>(args));
48739 args.setInactive();
48740 return ok;
48741 }
48742
48743
48744 extern bool
48745 InvokeConstructor(JSContext *cx, const Value &fval, unsigned argc, Value *argv, Value *rval);
48746
48747
48748
48749
48750
48751
48752
48753 extern bool
48754 ExecuteKernel(JSContext *cx, JSScript *script, JSObject &scopeChain, const Value &thisv,
48755 ExecuteType type, StackFrame *evalInFrame, Value *result);
48756
48757
48758 extern bool
48759 Execute(JSContext *cx, JSScript *script, JSObject &scopeChain, Value *rval);
48760
48761
48762 enum InterpMode
48763 {
48764 JSINTERP_NORMAL = 0,
48765 JSINTERP_REJOIN = 1,
48766 JSINTERP_SKIP_TRAP = 2
48767 };
48768
48769
48770
48771
48772
48773 extern __attribute__((noinline)) bool
48774 Interpret(JSContext *cx, StackFrame *stopFp, InterpMode mode = JSINTERP_NORMAL);
48775
48776 extern bool
48777 RunScript(JSContext *cx, JSScript *script, StackFrame *fp);
48778
48779 extern bool
48780 StrictlyEqual(JSContext *cx, const Value &lval, const Value &rval, bool *equal);
48781
48782 extern bool
48783 LooselyEqual(JSContext *cx, const Value &lval, const Value &rval, bool *equal);
48784
48785
48786 extern bool
48787 SameValue(JSContext *cx, const Value &v1, const Value &v2, bool *same);
48788
48789 extern JSType
48790 TypeOfValue(JSContext *cx, const Value &v);
48791
48792 extern JSBool
48793 HasInstance(JSContext *cx, HandleObject obj, const js::Value *v, JSBool *bp);
48794 # 239 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinterp.h"
48795 class InterpreterFrames {
48796 public:
48797 class InterruptEnablerBase {
48798 public:
48799 virtual void enableInterrupts() const = 0;
48800 };
48801
48802 InterpreterFrames(JSContext *cx, FrameRegs *regs, const InterruptEnablerBase &enabler);
48803 ~InterpreterFrames();
48804
48805
48806 inline void enableInterruptsIfRunning(JSScript *script);
48807
48808 InterpreterFrames *older;
48809
48810 private:
48811 JSContext *context;
48812 FrameRegs *regs;
48813 const InterruptEnablerBase &enabler;
48814 };
48815
48816
48817
48818
48819
48820 extern void
48821 UnwindScope(JSContext *cx, uint32_t stackDepth);
48822
48823
48824
48825
48826
48827 extern void
48828 UnwindForUncatchableException(JSContext *cx, const FrameRegs &regs);
48829
48830 extern bool
48831 OnUnknownMethod(JSContext *cx, HandleObject obj, Value idval, Value *vp);
48832
48833 inline void
48834 AssertValidFunctionScopeChainAtExit(StackFrame *fp);
48835
48836 class TryNoteIter
48837 {
48838 const FrameRegs &regs;
48839 JSScript *script;
48840 uint32_t pcOffset;
48841 JSTryNote *tn, *tnEnd;
48842 void settle();
48843 public:
48844 TryNoteIter(const FrameRegs &regs);
48845 bool done() const;
48846 void operator++();
48847 JSTryNote *operator*() const { return tn; }
48848 };
48849 # 302 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinterp.h"
48850 static __attribute__((always_inline)) inline void
48851 Debug_SetValueRangeToCrashOnTouch(Value *beg, Value *end)
48852 {
48853
48854
48855
48856
48857 }
48858
48859 static __attribute__((always_inline)) inline void
48860 Debug_SetValueRangeToCrashOnTouch(Value *vec, size_t len)
48861 {
48862
48863
48864
48865 }
48866
48867 static __attribute__((always_inline)) inline void
48868 Debug_SetValueRangeToCrashOnTouch(HeapValue *vec, size_t len)
48869 {
48870
48871
48872
48873 }
48874
48875 }
48876 # 16 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl-inl.h" 2
48877
48878
48879 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Marking.h" 1
48880
48881
48882
48883
48884
48885
48886
48887 #define gc_marking_h___
48888
48889
48890
48891 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jslock.h" 1
48892 # 13 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Marking.h" 2
48893
48894
48895
48896
48897 extern "C" {
48898 struct JSContext;
48899 struct JSFunction;
48900 struct JSObject;
48901 struct JSScript;
48902 }
48903
48904 class JSAtom;
48905 class JSLinearString;
48906
48907 namespace js {
48908
48909 class ArgumentsObject;
48910 class BaseShape;
48911 class GlobalObject;
48912 class UnownedBaseShape;
48913 struct Shape;
48914
48915 template<class, typename> class HeapPtr;
48916
48917 namespace gc {
48918 # 65 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Marking.h"
48919 #define DeclMarker(base,type) void Mark ##base(JSTracer *trc, HeapPtr<type> *thing, const char *name); void Mark ##base ##Root(JSTracer *trc, type **thingp, const char *name); void Mark ##base ##Unbarriered(JSTracer *trc, type **thingp, const char *name); void Mark ##base ##Range(JSTracer *trc, size_t len, HeapPtr<type> *thing, const char *name); void Mark ##base ##RootRange(JSTracer *trc, size_t len, type **thing, const char *name); bool Is ##base ##Marked(type **thingp); bool Is ##base ##Marked(HeapPtr<type> *thingp);
48920 # 74 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Marking.h"
48921 void MarkBaseShape(JSTracer *trc, HeapPtr<BaseShape> *thing, const char *name); void MarkBaseShapeRoot(JSTracer *trc, BaseShape **thingp, const char *name); void MarkBaseShapeUnbarriered(JSTracer *trc, BaseShape **thingp, const char *name); void MarkBaseShapeRange(JSTracer *trc, size_t len, HeapPtr<BaseShape> *thing, const char *name); void MarkBaseShapeRootRange(JSTracer *trc, size_t len, BaseShape **thing, const char *name); bool IsBaseShapeMarked(BaseShape **thingp); bool IsBaseShapeMarked(HeapPtr<BaseShape> *thingp);
48922 void MarkBaseShape(JSTracer *trc, HeapPtr<UnownedBaseShape> *thing, const char *name); void MarkBaseShapeRoot(JSTracer *trc, UnownedBaseShape **thingp, const char *name); void MarkBaseShapeUnbarriered(JSTracer *trc, UnownedBaseShape **thingp, const char *name); void MarkBaseShapeRange(JSTracer *trc, size_t len, HeapPtr<UnownedBaseShape> *thing, const char *name); void MarkBaseShapeRootRange(JSTracer *trc, size_t len, UnownedBaseShape **thing, const char *name); bool IsBaseShapeMarked(UnownedBaseShape **thingp); bool IsBaseShapeMarked(HeapPtr<UnownedBaseShape> *thingp);
48923 void MarkObject(JSTracer *trc, HeapPtr<ArgumentsObject> *thing, const char *name); void MarkObjectRoot(JSTracer *trc, ArgumentsObject **thingp, const char *name); void MarkObjectUnbarriered(JSTracer *trc, ArgumentsObject **thingp, const char *name); void MarkObjectRange(JSTracer *trc, size_t len, HeapPtr<ArgumentsObject> *thing, const char *name); void MarkObjectRootRange(JSTracer *trc, size_t len, ArgumentsObject **thing, const char *name); bool IsObjectMarked(ArgumentsObject **thingp); bool IsObjectMarked(HeapPtr<ArgumentsObject> *thingp);
48924 void MarkObject(JSTracer *trc, HeapPtr<DebugScopeObject> *thing, const char *name); void MarkObjectRoot(JSTracer *trc, DebugScopeObject **thingp, const char *name); void MarkObjectUnbarriered(JSTracer *trc, DebugScopeObject **thingp, const char *name); void MarkObjectRange(JSTracer *trc, size_t len, HeapPtr<DebugScopeObject> *thing, const char *name); void MarkObjectRootRange(JSTracer *trc, size_t len, DebugScopeObject **thing, const char *name); bool IsObjectMarked(DebugScopeObject **thingp); bool IsObjectMarked(HeapPtr<DebugScopeObject> *thingp);
48925 void MarkObject(JSTracer *trc, HeapPtr<GlobalObject> *thing, const char *name); void MarkObjectRoot(JSTracer *trc, GlobalObject **thingp, const char *name); void MarkObjectUnbarriered(JSTracer *trc, GlobalObject **thingp, const char *name); void MarkObjectRange(JSTracer *trc, size_t len, HeapPtr<GlobalObject> *thing, const char *name); void MarkObjectRootRange(JSTracer *trc, size_t len, GlobalObject **thing, const char *name); bool IsObjectMarked(GlobalObject **thingp); bool IsObjectMarked(HeapPtr<GlobalObject> *thingp);
48926 void MarkObject(JSTracer *trc, HeapPtr<JSObject> *thing, const char *name); void MarkObjectRoot(JSTracer *trc, JSObject **thingp, const char *name); void MarkObjectUnbarriered(JSTracer *trc, JSObject **thingp, const char *name); void MarkObjectRange(JSTracer *trc, size_t len, HeapPtr<JSObject> *thing, const char *name); void MarkObjectRootRange(JSTracer *trc, size_t len, JSObject **thing, const char *name); bool IsObjectMarked(JSObject **thingp); bool IsObjectMarked(HeapPtr<JSObject> *thingp);
48927 void MarkObject(JSTracer *trc, HeapPtr<JSFunction> *thing, const char *name); void MarkObjectRoot(JSTracer *trc, JSFunction **thingp, const char *name); void MarkObjectUnbarriered(JSTracer *trc, JSFunction **thingp, const char *name); void MarkObjectRange(JSTracer *trc, size_t len, HeapPtr<JSFunction> *thing, const char *name); void MarkObjectRootRange(JSTracer *trc, size_t len, JSFunction **thing, const char *name); bool IsObjectMarked(JSFunction **thingp); bool IsObjectMarked(HeapPtr<JSFunction> *thingp);
48928 void MarkScript(JSTracer *trc, HeapPtr<JSScript> *thing, const char *name); void MarkScriptRoot(JSTracer *trc, JSScript **thingp, const char *name); void MarkScriptUnbarriered(JSTracer *trc, JSScript **thingp, const char *name); void MarkScriptRange(JSTracer *trc, size_t len, HeapPtr<JSScript> *thing, const char *name); void MarkScriptRootRange(JSTracer *trc, size_t len, JSScript **thing, const char *name); bool IsScriptMarked(JSScript **thingp); bool IsScriptMarked(HeapPtr<JSScript> *thingp);
48929 void MarkShape(JSTracer *trc, HeapPtr<Shape> *thing, const char *name); void MarkShapeRoot(JSTracer *trc, Shape **thingp, const char *name); void MarkShapeUnbarriered(JSTracer *trc, Shape **thingp, const char *name); void MarkShapeRange(JSTracer *trc, size_t len, HeapPtr<Shape> *thing, const char *name); void MarkShapeRootRange(JSTracer *trc, size_t len, Shape **thing, const char *name); bool IsShapeMarked(Shape **thingp); bool IsShapeMarked(HeapPtr<Shape> *thingp);
48930 void MarkString(JSTracer *trc, HeapPtr<JSAtom> *thing, const char *name); void MarkStringRoot(JSTracer *trc, JSAtom **thingp, const char *name); void MarkStringUnbarriered(JSTracer *trc, JSAtom **thingp, const char *name); void MarkStringRange(JSTracer *trc, size_t len, HeapPtr<JSAtom> *thing, const char *name); void MarkStringRootRange(JSTracer *trc, size_t len, JSAtom **thing, const char *name); bool IsStringMarked(JSAtom **thingp); bool IsStringMarked(HeapPtr<JSAtom> *thingp);
48931 void MarkString(JSTracer *trc, HeapPtr<JSString> *thing, const char *name); void MarkStringRoot(JSTracer *trc, JSString **thingp, const char *name); void MarkStringUnbarriered(JSTracer *trc, JSString **thingp, const char *name); void MarkStringRange(JSTracer *trc, size_t len, HeapPtr<JSString> *thing, const char *name); void MarkStringRootRange(JSTracer *trc, size_t len, JSString **thing, const char *name); bool IsStringMarked(JSString **thingp); bool IsStringMarked(HeapPtr<JSString> *thingp);
48932 void MarkString(JSTracer *trc, HeapPtr<JSFlatString> *thing, const char *name); void MarkStringRoot(JSTracer *trc, JSFlatString **thingp, const char *name); void MarkStringUnbarriered(JSTracer *trc, JSFlatString **thingp, const char *name); void MarkStringRange(JSTracer *trc, size_t len, HeapPtr<JSFlatString> *thing, const char *name); void MarkStringRootRange(JSTracer *trc, size_t len, JSFlatString **thing, const char *name); bool IsStringMarked(JSFlatString **thingp); bool IsStringMarked(HeapPtr<JSFlatString> *thingp);
48933 void MarkString(JSTracer *trc, HeapPtr<JSLinearString> *thing, const char *name); void MarkStringRoot(JSTracer *trc, JSLinearString **thingp, const char *name); void MarkStringUnbarriered(JSTracer *trc, JSLinearString **thingp, const char *name); void MarkStringRange(JSTracer *trc, size_t len, HeapPtr<JSLinearString> *thing, const char *name); void MarkStringRootRange(JSTracer *trc, size_t len, JSLinearString **thing, const char *name); bool IsStringMarked(JSLinearString **thingp); bool IsStringMarked(HeapPtr<JSLinearString> *thingp);
48934 void MarkTypeObject(JSTracer *trc, HeapPtr<types::TypeObject> *thing, const char *name); void MarkTypeObjectRoot(JSTracer *trc, types::TypeObject **thingp, const char *name); void MarkTypeObjectUnbarriered(JSTracer *trc, types::TypeObject **thingp, const char *name); void MarkTypeObjectRange(JSTracer *trc, size_t len, HeapPtr<types::TypeObject> *thing, const char *name); void MarkTypeObjectRootRange(JSTracer *trc, size_t len, types::TypeObject **thing, const char *name); bool IsTypeObjectMarked(types::TypeObject **thingp); bool IsTypeObjectMarked(HeapPtr<types::TypeObject> *thingp);
48935
48936 void MarkXML(JSTracer *trc, HeapPtr<JSXML> *thing, const char *name); void MarkXMLRoot(JSTracer *trc, JSXML **thingp, const char *name); void MarkXMLUnbarriered(JSTracer *trc, JSXML **thingp, const char *name); void MarkXMLRange(JSTracer *trc, size_t len, HeapPtr<JSXML> *thing, const char *name); void MarkXMLRootRange(JSTracer *trc, size_t len, JSXML **thing, const char *name); bool IsXMLMarked(JSXML **thingp); bool IsXMLMarked(HeapPtr<JSXML> *thingp);
48937
48938
48939 #undef DeclMarker
48940 # 101 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Marking.h"
48941 void
48942 MarkKind(JSTracer *trc, void **thingp, JSGCTraceKind kind);
48943
48944 void
48945 MarkGCThingRoot(JSTracer *trc, void **thingp, const char *name);
48946
48947
48948
48949 void
48950 MarkId(JSTracer *trc, EncapsulatedId *id, const char *name);
48951
48952 void
48953 MarkIdRoot(JSTracer *trc, jsid *id, const char *name);
48954
48955 void
48956 MarkIdUnbarriered(JSTracer *trc, jsid *id, const char *name);
48957
48958 void
48959 MarkIdRange(JSTracer *trc, size_t len, HeapId *vec, const char *name);
48960
48961 void
48962 MarkIdRootRange(JSTracer *trc, size_t len, jsid *vec, const char *name);
48963
48964
48965
48966 void
48967 MarkValue(JSTracer *trc, EncapsulatedValue *v, const char *name);
48968
48969 void
48970 MarkValueRange(JSTracer *trc, size_t len, EncapsulatedValue *vec, const char *name);
48971
48972 void
48973 MarkValueRoot(JSTracer *trc, Value *v, const char *name);
48974
48975 void
48976 MarkValueRootRange(JSTracer *trc, size_t len, Value *vec, const char *name);
48977
48978 inline void
48979 MarkValueRootRange(JSTracer *trc, Value *begin, Value *end, const char *name)
48980 {
48981 MarkValueRootRange(trc, end - begin, begin, name);
48982 }
48983
48984 bool
48985 IsValueMarked(Value *v);
48986
48987
48988
48989 void
48990 MarkSlot(JSTracer *trc, HeapSlot *s, const char *name);
48991
48992 void
48993 MarkArraySlots(JSTracer *trc, size_t len, HeapSlot *vec, const char *name);
48994
48995 void
48996 MarkObjectSlots(JSTracer *trc, JSObject *obj, uint32_t start, uint32_t nslots);
48997
48998 void
48999 MarkCrossCompartmentObjectUnbarriered(JSTracer *trc, JSObject **obj, const char *name);
49000
49001 void
49002 MarkCrossCompartmentScriptUnbarriered(JSTracer *trc, JSScript **script, const char *name);
49003
49004
49005
49006
49007
49008 void
49009 MarkCrossCompartmentSlot(JSTracer *trc, HeapSlot *s, const char *name);
49010 # 178 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Marking.h"
49011 void
49012 MarkObject(JSTracer *trc, HeapPtr<GlobalObject, JSScript *> *thingp, const char *name);
49013
49014
49015 void
49016 MarkValueUnbarriered(JSTracer *trc, Value *v, const char *name);
49017
49018
49019
49020
49021
49022 void
49023 MarkChildren(JSTracer *trc, JSObject *obj);
49024
49025
49026
49027
49028
49029
49030 void
49031 MarkCycleCollectorChildren(JSTracer *trc, Shape *shape);
49032
49033 void
49034 PushArena(GCMarker *gcmarker, ArenaHeader *aheader);
49035 # 210 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Marking.h"
49036 inline void
49037 Mark(JSTracer *trc, HeapValue *v, const char *name)
49038 {
49039 MarkValue(trc, v, name);
49040 }
49041
49042 inline void
49043 Mark(JSTracer *trc, HeapPtr<JSObject> *o, const char *name)
49044 {
49045 MarkObject(trc, o, name);
49046 }
49047
49048 inline void
49049 Mark(JSTracer *trc, HeapPtr<JSScript> *o, const char *name)
49050 {
49051 MarkScript(trc, o, name);
49052 }
49053
49054
49055 inline void
49056 Mark(JSTracer *trc, HeapPtr<JSXML> *xml, const char *name)
49057 {
49058 MarkXML(trc, xml, name);
49059 }
49060
49061
49062 bool
49063 IsCellMarked(Cell **thingp);
49064
49065 inline bool
49066 IsMarked(EncapsulatedValue *v)
49067 {
49068 if (!v->isMarkable())
49069 return true;
49070 return IsValueMarked(v->unsafeGet());
49071 }
49072
49073 inline bool
49074 IsMarked(HeapPtrObject *objp)
49075 {
49076 return IsObjectMarked(objp);
49077 }
49078
49079 inline bool
49080 IsMarked(HeapPtrScript *scriptp)
49081 {
49082 return IsScriptMarked(scriptp);
49083 }
49084
49085 inline Cell *
49086 ToMarkable(const Value &v)
49087 {
49088 if (v.isMarkable())
49089 return (Cell *)v.toGCThing();
49090 return __null;
49091 }
49092
49093 inline Cell *
49094 ToMarkable(Cell *cell)
49095 {
49096 return cell;
49097 }
49098
49099 inline JSGCTraceKind
49100 TraceKind(const Value &v)
49101 {
49102 do { } while(0);
49103 if (v.isObject())
49104 return JSTRACE_OBJECT;
49105 return JSTRACE_STRING;
49106 }
49107
49108 inline JSGCTraceKind
49109 TraceKind(JSObject *obj)
49110 {
49111 return JSTRACE_OBJECT;
49112 }
49113
49114 inline JSGCTraceKind
49115 TraceKind(JSScript *script)
49116 {
49117 return JSTRACE_SCRIPT;
49118 }
49119
49120 }
49121
49122 void
49123 TraceChildren(JSTracer *trc, void *thing, JSGCTraceKind kind);
49124
49125 void
49126 CallTracer(JSTracer *trc, void *thing, JSGCTraceKind kind);
49127
49128 }
49129 # 19 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl-inl.h" 2
49130
49131
49132 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl.h" 1
49133 # 22 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl-inl.h" 2
49134
49135 namespace js {
49136
49137 static __attribute__((always_inline)) inline void
49138 Debug_SetSlotRangeToCrashOnTouch(HeapSlot *vec, uint32_t len)
49139 {
49140
49141
49142
49143 }
49144
49145 static __attribute__((always_inline)) inline void
49146 Debug_SetSlotRangeToCrashOnTouch(HeapSlot *begin, HeapSlot *end)
49147 {
49148
49149
49150
49151 }
49152
49153 }
49154
49155 inline bool
49156 js::ObjectImpl::isExtensible() const
49157 {
49158 return !lastProperty()->hasObjectFlag(BaseShape::NOT_EXTENSIBLE);
49159 }
49160
49161 inline bool
49162 js::ObjectImpl::isDenseArray() const
49163 {
49164 bool result = hasClass(&ArrayClass);
49165 do { } while (0);
49166 return result;
49167 }
49168
49169 inline bool
49170 js::ObjectImpl::isSlowArray() const
49171 {
49172 bool result = hasClass(&SlowArrayClass);
49173 do { } while (0);
49174 return result;
49175 }
49176
49177 inline bool
49178 js::ObjectImpl::isArray() const
49179 {
49180 return isSlowArray() || isDenseArray();
49181 }
49182
49183 inline uint32_t
49184 js::ObjectImpl::getDenseArrayInitializedLength()
49185 {
49186 do { } while(0);
49187 return getElementsHeader()->initializedLength;
49188 }
49189
49190 inline js::HeapSlotArray
49191 js::ObjectImpl::getDenseArrayElements()
49192 {
49193 do { } while(0);
49194 return HeapSlotArray(elements);
49195 }
49196
49197 inline const js::Value &
49198 js::ObjectImpl::getDenseArrayElement(uint32_t idx)
49199 {
49200 do { } while(0);
49201 return elements[idx];
49202 }
49203
49204 inline void
49205 js::ObjectImpl::getSlotRangeUnchecked(uint32_t start, uint32_t length,
49206 HeapSlot **fixedStart, HeapSlot **fixedEnd,
49207 HeapSlot **slotsStart, HeapSlot **slotsEnd)
49208 {
49209 do { } while(0);
49210 do { } while(0);
49211
49212 uint32_t fixed = numFixedSlots();
49213 if (start < fixed) {
49214 if (start + length < fixed) {
49215 *fixedStart = &fixedSlots()[start];
49216 *fixedEnd = &fixedSlots()[start + length];
49217 *slotsStart = *slotsEnd = __null;
49218 } else {
49219 uint32_t localCopy = fixed - start;
49220 *fixedStart = &fixedSlots()[start];
49221 *fixedEnd = &fixedSlots()[start + localCopy];
49222 *slotsStart = &slots[0];
49223 *slotsEnd = &slots[length - localCopy];
49224 }
49225 } else {
49226 *fixedStart = *fixedEnd = __null;
49227 *slotsStart = &slots[start - fixed];
49228 *slotsEnd = &slots[start - fixed + length];
49229 }
49230 }
49231
49232 inline void
49233 js::ObjectImpl::getSlotRange(uint32_t start, uint32_t length,
49234 HeapSlot **fixedStart, HeapSlot **fixedEnd,
49235 HeapSlot **slotsStart, HeapSlot **slotsEnd)
49236 {
49237 do { } while(0);
49238 getSlotRangeUnchecked(start, length, fixedStart, fixedEnd, slotsStart, slotsEnd);
49239 }
49240
49241 inline bool
49242 js::ObjectImpl::hasContiguousSlots(uint32_t start, uint32_t count) const
49243 {
49244
49245
49246
49247
49248 do { } while(0);
49249 return start + count <= numFixedSlots() || start >= numFixedSlots();
49250 }
49251
49252 inline void
49253 js::ObjectImpl::invalidateSlotRange(uint32_t start, uint32_t length)
49254 {
49255 # 151 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl-inl.h"
49256 }
49257
49258 inline void
49259 js::ObjectImpl::initializeSlotRange(uint32_t start, uint32_t length)
49260 {
49261
49262
49263
49264
49265 HeapSlot *fixedStart, *fixedEnd, *slotsStart, *slotsEnd;
49266 getSlotRangeUnchecked(start, length, &fixedStart, &fixedEnd, &slotsStart, &slotsEnd);
49267
49268 JSCompartment *comp = compartment();
49269 uint32_t offset = start;
49270 for (HeapSlot *sp = fixedStart; sp < fixedEnd; sp++)
49271 sp->init(comp, this->asObjectPtr(), offset++, UndefinedValue());
49272 for (HeapSlot *sp = slotsStart; sp < slotsEnd; sp++)
49273 sp->init(comp, this->asObjectPtr(), offset++, UndefinedValue());
49274 }
49275
49276 inline bool
49277 js::ObjectImpl::isNative() const
49278 {
49279 return lastProperty()->isNative();
49280 }
49281
49282 inline js::HeapSlot &
49283 js::ObjectImpl::nativeGetSlotRef(uint32_t slot)
49284 {
49285 do { } while(0);
49286 do { } while(0);
49287 return getSlotRef(slot);
49288 }
49289
49290 inline const js::Value &
49291 js::ObjectImpl::nativeGetSlot(uint32_t slot) const
49292 {
49293 do { } while(0);
49294 do { } while(0);
49295 return getSlot(slot);
49296 }
49297
49298 inline void
49299 js::ObjectImpl::setSlot(uint32_t slot, const js::Value &value)
49300 {
49301 do { } while(0);
49302 getSlotRef(slot).set(this->asObjectPtr(), slot, value);
49303 }
49304
49305 inline void
49306 js::ObjectImpl::initSlot(uint32_t slot, const js::Value &value)
49307 {
49308 do { } while(0);
49309 do { } while(0);
49310 initSlotUnchecked(slot, value);
49311 }
49312
49313 inline void
49314 js::ObjectImpl::initSlotUnchecked(uint32_t slot, const js::Value &value)
49315 {
49316 getSlotAddressUnchecked(slot)->init(this->asObjectPtr(), slot, value);
49317 }
49318
49319 inline void
49320 js::ObjectImpl::setFixedSlot(uint32_t slot, const js::Value &value)
49321 {
49322 do { } while(0);
49323 fixedSlots()[slot].set(this->asObjectPtr(), slot, value);
49324 }
49325
49326 inline void
49327 js::ObjectImpl::initFixedSlot(uint32_t slot, const js::Value &value)
49328 {
49329 do { } while(0);
49330 fixedSlots()[slot].init(this->asObjectPtr(), slot, value);
49331 }
49332
49333 inline uint32_t
49334 js::ObjectImpl::slotSpan() const
49335 {
49336 if (inDictionaryMode())
49337 return lastProperty()->base()->slotSpan();
49338 return lastProperty()->slotSpan();
49339 }
49340
49341 inline uint32_t
49342 js::ObjectImpl::numDynamicSlots() const
49343 {
49344 return dynamicSlotsCount(numFixedSlots(), slotSpan());
49345 }
49346
49347 inline js::Class *
49348 js::ObjectImpl::getClass() const
49349 {
49350 return lastProperty()->getObjectClass();
49351 }
49352
49353 inline JSClass *
49354 js::ObjectImpl::getJSClass() const
49355 {
49356 return Jsvalify(getClass());
49357 }
49358
49359 inline bool
49360 js::ObjectImpl::hasClass(const Class *c) const
49361 {
49362 return getClass() == c;
49363 }
49364
49365 inline const js::ObjectOps *
49366 js::ObjectImpl::getOps() const
49367 {
49368 return &getClass()->ops;
49369 }
49370
49371 inline bool
49372 js::ObjectImpl::isDelegate() const
49373 {
49374 return lastProperty()->hasObjectFlag(BaseShape::DELEGATE);
49375 }
49376
49377 inline bool
49378 js::ObjectImpl::inDictionaryMode() const
49379 {
49380 return lastProperty()->inDictionary();
49381 }
49382
49383 inline uint32_t
49384 js::ObjectImpl::dynamicSlotsCount(uint32_t nfixed, uint32_t span)
49385 {
49386 if (span <= nfixed)
49387 return 0;
49388 span -= nfixed;
49389 if (span <= SLOT_CAPACITY_MIN)
49390 return SLOT_CAPACITY_MIN;
49391
49392 uint32_t slots = RoundUpPow2(span);
49393 do { } while(0);
49394 return slots;
49395 }
49396
49397 inline size_t
49398 js::ObjectImpl::sizeOfThis() const
49399 {
49400 return arenaHeader()->getThingSize();
49401 }
49402
49403 inline void
49404 js::ObjectImpl::readBarrier(ObjectImpl *obj)
49405 {
49406
49407 JSCompartment *comp = obj->compartment();
49408 if (comp->needsBarrier()) {
49409 do { } while(0);
49410 JSObject *tmp = obj->asObjectPtr();
49411 MarkObjectUnbarriered(comp->barrierTracer(), &tmp, "read barrier");
49412 do { } while(0);
49413 }
49414
49415 }
49416
49417 inline void
49418 js::ObjectImpl::privateWriteBarrierPre(void **old)
49419 {
49420
49421 JSCompartment *comp = compartment();
49422 if (comp->needsBarrier()) {
49423 if (*old && getClass()->trace)
49424 getClass()->trace(comp->barrierTracer(), this->asObjectPtr());
49425 }
49426
49427 }
49428
49429 inline void
49430 js::ObjectImpl::privateWriteBarrierPost(void **old)
49431 {
49432 }
49433
49434 inline void
49435 js::ObjectImpl::writeBarrierPre(ObjectImpl *obj)
49436 {
49437
49438
49439
49440
49441
49442 if (uintptr_t(obj) < 32)
49443 return;
49444
49445 JSCompartment *comp = obj->compartment();
49446 if (comp->needsBarrier()) {
49447 do { } while(0);
49448 JSObject *tmp = obj->asObjectPtr();
49449 MarkObjectUnbarriered(comp->barrierTracer(), &tmp, "write barrier");
49450 do { } while(0);
49451 }
49452
49453 }
49454
49455 inline void
49456 js::ObjectImpl::writeBarrierPost(ObjectImpl *obj, void *addr)
49457 {
49458 }
49459
49460 inline bool
49461 js::ObjectImpl::hasPrivate() const
49462 {
49463 return getClass()->hasPrivate();
49464 }
49465
49466 inline void *&
49467 js::ObjectImpl::privateRef(uint32_t nfixed) const
49468 {
49469
49470
49471
49472
49473
49474 do { } while(0);
49475 do { } while(0);
49476 HeapSlot *end = &fixedSlots()[nfixed];
49477 return *reinterpret_cast<void**>(end);
49478 }
49479
49480 inline void *
49481 js::ObjectImpl::getPrivate() const
49482 {
49483 return privateRef(numFixedSlots());
49484 }
49485
49486 inline void *
49487 js::ObjectImpl::getPrivate(uint32_t nfixed) const
49488 {
49489 return privateRef(nfixed);
49490 }
49491
49492 inline void
49493 js::ObjectImpl::setPrivate(void *data)
49494 {
49495 void **pprivate = &privateRef(numFixedSlots());
49496
49497 privateWriteBarrierPre(pprivate);
49498 *pprivate = data;
49499 privateWriteBarrierPost(pprivate);
49500 }
49501
49502 inline void
49503 js::ObjectImpl::setPrivateUnbarriered(void *data)
49504 {
49505 void **pprivate = &privateRef(numFixedSlots());
49506 *pprivate = data;
49507 }
49508
49509 inline void
49510 js::ObjectImpl::initPrivate(void *data)
49511 {
49512 privateRef(numFixedSlots()) = data;
49513 }
49514 # 24 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsprobes.h" 2
49515
49516 namespace js {
49517
49518 namespace mjit {
49519 struct NativeAddressInfo;
49520 struct JSActiveFrame;
49521 }
49522
49523 namespace Probes {
49524 # 64 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsprobes.h"
49525 extern bool ProfilingActive;
49526
49527 extern const char nullName[];
49528 extern const char anonymousName[];
49529
49530
49531 JSBool startEngine();
49532
49533
49534 bool createRuntime(JSRuntime *rt);
49535
49536
49537 bool destroyRuntime(JSRuntime *rt);
49538
49539
49540 bool shutdown();
49541
49542
49543
49544
49545
49546
49547 bool callTrackingActive(JSContext *);
49548
49549
49550
49551
49552
49553 bool wantNativeAddressInfo(JSContext *);
49554
49555
49556 bool enterJSFun(JSContext *, JSFunction *, JSScript *, int counter = 1);
49557
49558
49559 bool exitJSFun(JSContext *, JSFunction *, JSScript *, int counter = 0);
49560
49561
49562 bool startExecution(JSContext *cx, JSScript *script);
49563
49564
49565 bool stopExecution(JSContext *cx, JSScript *script);
49566
49567
49568 bool resizeHeap(JSCompartment *compartment, size_t oldSize, size_t newSize);
49569
49570
49571
49572
49573 bool createObject(JSContext *cx, JSObject *obj);
49574
49575
49576 bool objectResizeActive();
49577
49578
49579 bool resizeObject(JSContext *cx, JSObject *obj, size_t oldSize, size_t newSize);
49580
49581
49582
49583
49584
49585 bool finalizeObject(JSObject *obj);
49586 # 134 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsprobes.h"
49587 bool createString(JSContext *cx, JSString *string, size_t length);
49588
49589
49590
49591
49592
49593
49594 bool finalizeString(JSString *string);
49595
49596
49597 bool compileScriptBegin(const char *filename, int lineno);
49598
49599
49600 bool compileScriptEnd(const char *filename, int lineno);
49601
49602
49603 bool calloutBegin(JSContext *cx, JSFunction *fun);
49604
49605
49606 bool calloutEnd(JSContext *cx, JSFunction *fun);
49607
49608
49609 bool acquireMemory(JSContext *cx, void *address, size_t nbytes);
49610 bool releaseMemory(JSContext *cx, void *address, size_t nbytes);
49611 # 170 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsprobes.h"
49612 bool GCStart();
49613 bool GCEnd();
49614
49615 bool GCStartMarkPhase();
49616 bool GCEndMarkPhase();
49617
49618 bool GCStartSweepPhase();
49619 bool GCEndSweepPhase();
49620 # 187 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsprobes.h"
49621 bool CustomMark(JSString *string);
49622 bool CustomMark(const char *string);
49623 bool CustomMark(int marker);
49624
49625
49626
49627 enum JITReportGranularity {
49628 JITREPORT_GRANULARITY_NONE = 0,
49629 JITREPORT_GRANULARITY_FUNCTION = 1,
49630 JITREPORT_GRANULARITY_LINE = 2,
49631 JITREPORT_GRANULARITY_OP = 3
49632 };
49633
49634
49635
49636
49637
49638
49639 class JITWatcher {
49640 public:
49641 struct NativeRegion {
49642 mjit::JSActiveFrame *frame;
49643 JSScript *script;
49644 size_t inlinedOffset;
49645 jsbytecode *pc;
49646 jsbytecode *endpc;
49647 uintptr_t mainOffset;
49648 uintptr_t stubOffset;
49649 bool enter;
49650 };
49651
49652 typedef Vector<NativeRegion, 0, RuntimeAllocPolicy> RegionVector;
49653
49654 virtual JITReportGranularity granularityRequested() = 0;
49655
49656
49657 static bool CollectNativeRegions(RegionVector &regions,
49658 JSRuntime *rt,
49659 mjit::JITChunk *jit,
49660 mjit::JSActiveFrame *outerFrame,
49661 mjit::JSActiveFrame **inlineFrames);
49662
49663 virtual void registerMJITCode(JSContext *cx, js::mjit::JITChunk *chunk,
49664 mjit::JSActiveFrame *outerFrame,
49665 mjit::JSActiveFrame **inlineFrames,
49666 void *mainCodeAddress, size_t mainCodeSize,
49667 void *stubCodeAddress, size_t stubCodeSize) = 0;
49668
49669 virtual void discardMJITCode(FreeOp *fop, mjit::JITScript *jscr, mjit::JITChunk *chunk,
49670 void* address) = 0;
49671
49672 virtual void registerICCode(JSContext *cx,
49673 js::mjit::JITChunk *chunk, JSScript *script, jsbytecode* pc,
49674 void *start, size_t size) = 0;
49675
49676
49677 virtual void discardExecutableRegion(void *start, size_t size) = 0;
49678 };
49679
49680
49681
49682
49683
49684 bool
49685 addJITWatcher(JITWatcher *watcher);
49686
49687
49688
49689
49690
49691 bool
49692 removeJITWatcher(JSRuntime *rt, JITWatcher *watcher);
49693
49694
49695
49696
49697 void
49698 removeAllJITWatchers(JSRuntime *rt);
49699
49700
49701
49702
49703 JITReportGranularity
49704 JITGranularityRequested();
49705
49706
49707
49708
49709
49710 void
49711 registerMJITCode(JSContext *cx, js::mjit::JITChunk *chunk,
49712 mjit::JSActiveFrame *outerFrame,
49713 mjit::JSActiveFrame **inlineFrames,
49714 void *mainCodeAddress, size_t mainCodeSize,
49715 void *stubCodeAddress, size_t stubCodeSize);
49716
49717
49718
49719
49720 void
49721 discardMJITCode(FreeOp *fop, mjit::JITScript *jscr, mjit::JITChunk *chunk, void* address);
49722
49723
49724
49725
49726 void
49727 registerICCode(JSContext *cx,
49728 mjit::JITChunk *chunk, JSScript *script, jsbytecode* pc,
49729 void *start, size_t size);
49730
49731
49732
49733
49734
49735
49736 void
49737 discardExecutableRegion(void *start, size_t size);
49738
49739
49740
49741
49742
49743
49744
49745 void DTraceEnterJSFun(JSContext *cx, JSFunction *fun, JSScript *script);
49746 void DTraceExitJSFun(JSContext *cx, JSFunction *fun, JSScript *script);
49747 # 350 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsprobes.h"
49748 }
49749
49750
49751
49752
49753
49754
49755 inline bool
49756 Probes::callTrackingActive(JSContext *cx)
49757 {
49758 # 372 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsprobes.h"
49759 return false;
49760 }
49761
49762 inline bool
49763 Probes::wantNativeAddressInfo(JSContext *cx)
49764 {
49765 return (cx->reportGranularity >= JITREPORT_GRANULARITY_FUNCTION &&
49766 JITGranularityRequested() >= JITREPORT_GRANULARITY_FUNCTION);
49767 }
49768
49769 inline bool
49770 Probes::enterJSFun(JSContext *cx, JSFunction *fun, JSScript *script, int counter)
49771 {
49772 bool ok = true;
49773 # 398 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsprobes.h"
49774 return ok;
49775 }
49776
49777 inline bool
49778 Probes::exitJSFun(JSContext *cx, JSFunction *fun, JSScript *script, int counter)
49779 {
49780 bool ok = true;
49781 # 420 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsprobes.h"
49782 return ok;
49783 }
49784
49785 inline bool
49786 Probes::resizeHeap(JSCompartment *compartment, size_t oldSize, size_t newSize)
49787 {
49788 bool ok = true;
49789
49790
49791
49792
49793
49794
49795 return ok;
49796 }
49797 # 450 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsprobes.h"
49798 inline bool
49799 Probes::createObject(JSContext *cx, JSObject *obj)
49800 {
49801 bool ok = true;
49802 # 464 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsprobes.h"
49803 return ok;
49804 }
49805
49806 inline bool
49807 Probes::finalizeObject(JSObject *obj)
49808 {
49809 bool ok = true;
49810 # 485 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsprobes.h"
49811 return ok;
49812 }
49813
49814 inline bool
49815 Probes::objectResizeActive()
49816 {
49817
49818
49819
49820
49821
49822 return false;
49823 }
49824
49825 inline bool
49826 Probes::resizeObject(JSContext *cx, JSObject *obj, size_t oldSize, size_t newSize)
49827 {
49828 bool ok = true;
49829
49830
49831
49832
49833
49834
49835 return ok;
49836 }
49837
49838 inline bool
49839 Probes::createString(JSContext *cx, JSString *string, size_t length)
49840 {
49841 bool ok = true;
49842
49843
49844
49845
49846
49847
49848 return ok;
49849 }
49850
49851 inline bool
49852 Probes::finalizeString(JSString *string)
49853 {
49854 bool ok = true;
49855
49856
49857
49858
49859
49860
49861 return ok;
49862 }
49863
49864 inline bool
49865 Probes::compileScriptBegin(const char *filename, int lineno)
49866 {
49867 bool ok = true;
49868
49869
49870
49871
49872
49873
49874 return ok;
49875 }
49876
49877 inline bool
49878 Probes::compileScriptEnd(const char *filename, int lineno)
49879 {
49880 bool ok = true;
49881
49882
49883
49884
49885
49886
49887 return ok;
49888 }
49889
49890 inline bool
49891 Probes::calloutBegin(JSContext *cx, JSFunction *fun)
49892 {
49893 bool ok = true;
49894
49895
49896
49897
49898
49899
49900 return ok;
49901 }
49902
49903 inline bool
49904 Probes::calloutEnd(JSContext *cx, JSFunction *fun)
49905 {
49906 bool ok = true;
49907
49908
49909
49910
49911
49912
49913 return ok;
49914 }
49915
49916 inline bool
49917 Probes::acquireMemory(JSContext *cx, void *address, size_t nbytes)
49918 {
49919 bool ok = true;
49920
49921
49922
49923
49924
49925
49926 return ok;
49927 }
49928
49929 inline bool
49930 Probes::releaseMemory(JSContext *cx, void *address, size_t nbytes)
49931 {
49932 bool ok = true;
49933
49934
49935
49936
49937
49938
49939 return ok;
49940 }
49941
49942 inline bool
49943 Probes::GCStart()
49944 {
49945 bool ok = true;
49946
49947
49948
49949
49950
49951
49952 return ok;
49953 }
49954
49955 inline bool
49956 Probes::GCEnd()
49957 {
49958 bool ok = true;
49959
49960
49961
49962
49963
49964
49965 return ok;
49966 }
49967
49968 inline bool
49969 Probes::GCStartMarkPhase()
49970 {
49971 bool ok = true;
49972
49973
49974
49975
49976
49977
49978 return ok;
49979 }
49980
49981 inline bool
49982 Probes::GCEndMarkPhase()
49983 {
49984 bool ok = true;
49985
49986
49987
49988
49989
49990
49991 return ok;
49992 }
49993
49994 inline bool
49995 Probes::GCStartSweepPhase()
49996 {
49997 bool ok = true;
49998
49999
50000
50001
50002
50003
50004 return ok;
50005 }
50006
50007 inline bool
50008 Probes::GCEndSweepPhase()
50009 {
50010 bool ok = true;
50011
50012
50013
50014
50015
50016
50017 return ok;
50018 }
50019
50020 inline bool
50021 Probes::CustomMark(JSString *string)
50022 {
50023 bool ok = true;
50024
50025
50026
50027
50028
50029
50030 return ok;
50031 }
50032
50033 inline bool
50034 Probes::CustomMark(const char *string)
50035 {
50036 bool ok = true;
50037
50038
50039
50040
50041
50042
50043 return ok;
50044 }
50045
50046 inline bool
50047 Probes::CustomMark(int marker)
50048 {
50049 bool ok = true;
50050
50051
50052
50053
50054
50055
50056 return ok;
50057 }
50058
50059 inline bool
50060 Probes::startExecution(JSContext *cx, JSScript *script)
50061 {
50062 bool ok = true;
50063 # 748 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsprobes.h"
50064 return ok;
50065 }
50066
50067 inline bool
50068 Probes::stopExecution(JSContext *cx, JSScript *script)
50069 {
50070 bool ok = true;
50071 # 766 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsprobes.h"
50072 return ok;
50073 }
50074
50075 struct AutoFunctionCallProbe {
50076 JSContext * const cx;
50077 JSFunction *fun;
50078 JSScript *script;
50079
50080
50081 AutoFunctionCallProbe(JSContext *cx, JSFunction *fun, JSScript *script
50082 )
50083 : cx(cx), fun(fun), script(script)
50084 {
50085 do { } while (0);
50086 Probes::enterJSFun(cx, fun, script);
50087 }
50088
50089 ~AutoFunctionCallProbe() {
50090 Probes::exitJSFun(cx, fun, script);
50091 }
50092 };
50093
50094 }
50095 # 23 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobjinlines.h" 2
50096
50097 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsproxy.h" 1
50098 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsproxy.h"
50099 #define jsproxy_h___
50100
50101
50102
50103
50104 namespace js {
50105
50106
50107 class __attribute__((visibility("default"))) BaseProxyHandler {
50108 void *mFamily;
50109 public:
50110 explicit BaseProxyHandler(void *family);
50111 virtual ~BaseProxyHandler();
50112
50113
50114 virtual bool getPropertyDescriptor(JSContext *cx, JSObject *proxy, jsid id, bool set,
50115 PropertyDescriptor *desc) = 0;
50116 virtual bool getOwnPropertyDescriptor(JSContext *cx, JSObject *proxy, jsid id, bool set,
50117 PropertyDescriptor *desc) = 0;
50118 virtual bool defineProperty(JSContext *cx, JSObject *proxy, jsid id,
50119 PropertyDescriptor *desc) = 0;
50120 virtual bool getOwnPropertyNames(JSContext *cx, JSObject *proxy, AutoIdVector &props) = 0;
50121 virtual bool delete_(JSContext *cx, JSObject *proxy, jsid id, bool *bp) = 0;
50122 virtual bool enumerate(JSContext *cx, JSObject *proxy, AutoIdVector &props) = 0;
50123
50124
50125 virtual bool has(JSContext *cx, JSObject *proxy, jsid id, bool *bp);
50126 virtual bool hasOwn(JSContext *cx, JSObject *proxy, jsid id, bool *bp);
50127 virtual bool get(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, Value *vp);
50128 virtual bool set(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, bool strict,
50129 Value *vp);
50130 virtual bool keys(JSContext *cx, JSObject *proxy, AutoIdVector &props);
50131 virtual bool iterate(JSContext *cx, JSObject *proxy, unsigned flags, Value *vp);
50132
50133
50134 virtual bool call(JSContext *cx, JSObject *proxy, unsigned argc, Value *vp);
50135 virtual bool construct(JSContext *cx, JSObject *proxy, unsigned argc, Value *argv, Value *rval);
50136 virtual bool nativeCall(JSContext *cx, JSObject *proxy, Class *clasp, Native native, CallArgs args);
50137 virtual bool hasInstance(JSContext *cx, JSObject *proxy, const Value *vp, bool *bp);
50138 virtual JSType typeOf(JSContext *cx, JSObject *proxy);
50139 virtual bool objectClassIs(JSObject *obj, ESClassValue classValue, JSContext *cx);
50140 virtual JSString *obj_toString(JSContext *cx, JSObject *proxy);
50141 virtual JSString *fun_toString(JSContext *cx, JSObject *proxy, unsigned indent);
50142 virtual bool regexp_toShared(JSContext *cx, JSObject *proxy, RegExpGuard *g);
50143 virtual bool defaultValue(JSContext *cx, JSObject *obj, JSType hint, Value *vp);
50144 virtual bool iteratorNext(JSContext *cx, JSObject *proxy, Value *vp);
50145 virtual void finalize(JSFreeOp *fop, JSObject *proxy);
50146 virtual bool getElementIfPresent(JSContext *cx, JSObject *obj, JSObject *receiver,
50147 uint32_t index, Value *vp, bool *present);
50148
50149 virtual bool isOuterWindow() {
50150 return false;
50151 }
50152
50153 inline void *family() {
50154 return mFamily;
50155 }
50156 };
50157
50158 class __attribute__((visibility("default"))) IndirectProxyHandler : public BaseProxyHandler {
50159 public:
50160 explicit IndirectProxyHandler(void *family);
50161
50162
50163 virtual bool getPropertyDescriptor(JSContext *cx, JSObject *proxy, jsid id,
50164 bool set,
50165 PropertyDescriptor *desc) ;
50166 virtual bool getOwnPropertyDescriptor(JSContext *cx, JSObject *proxy,
50167 jsid id, bool set,
50168 PropertyDescriptor *desc) ;
50169 virtual bool defineProperty(JSContext *cx, JSObject *proxy, jsid id,
50170 PropertyDescriptor *desc) ;
50171 virtual bool getOwnPropertyNames(JSContext *cx, JSObject *proxy,
50172 AutoIdVector &props) ;
50173 virtual bool delete_(JSContext *cx, JSObject *proxy, jsid id,
50174 bool *bp) ;
50175 virtual bool enumerate(JSContext *cx, JSObject *proxy,
50176 AutoIdVector &props) ;
50177
50178
50179
50180
50181 virtual bool call(JSContext *cx, JSObject *proxy, unsigned argc,
50182 Value *vp) ;
50183 virtual bool construct(JSContext *cx, JSObject *proxy, unsigned argc,
50184 Value *argv, Value *rval) ;
50185 virtual bool nativeCall(JSContext *cx, JSObject *proxy, Class *clasp,
50186 Native native, CallArgs args) ;
50187 virtual bool hasInstance(JSContext *cx, JSObject *proxy, const Value *vp,
50188 bool *bp) ;
50189 virtual JSType typeOf(JSContext *cx, JSObject *proxy) ;
50190 virtual bool objectClassIs(JSObject *obj, ESClassValue classValue,
50191 JSContext *cx) ;
50192 virtual JSString *obj_toString(JSContext *cx, JSObject *proxy) ;
50193 virtual JSString *fun_toString(JSContext *cx, JSObject *proxy,
50194 unsigned indent) ;
50195 virtual bool regexp_toShared(JSContext *cx, JSObject *proxy,
50196 RegExpGuard *g) ;
50197 virtual bool defaultValue(JSContext *cx, JSObject *obj, JSType hint,
50198 Value *vp) ;
50199 virtual bool iteratorNext(JSContext *cx, JSObject *proxy,
50200 Value *vp) ;
50201 };
50202
50203 class __attribute__((visibility("default"))) DirectProxyHandler : public IndirectProxyHandler {
50204 public:
50205 explicit DirectProxyHandler(void *family);
50206
50207
50208 virtual bool has(JSContext *cx, JSObject *proxy, jsid id,
50209 bool *bp) ;
50210 virtual bool hasOwn(JSContext *cx, JSObject *proxy, jsid id,
50211 bool *bp) ;
50212 virtual bool get(JSContext *cx, JSObject *proxy, JSObject *receiver,
50213 jsid id, Value *vp) ;
50214 virtual bool set(JSContext *cx, JSObject *proxy, JSObject *receiver,
50215 jsid id, bool strict, Value *vp) ;
50216 virtual bool keys(JSContext *cx, JSObject *proxy,
50217 AutoIdVector &props) ;
50218 virtual bool iterate(JSContext *cx, JSObject *proxy, unsigned flags,
50219 Value *vp) ;
50220 };
50221
50222
50223 class Proxy {
50224 public:
50225
50226 static bool getPropertyDescriptor(JSContext *cx, JSObject *proxy, jsid id, bool set,
50227 PropertyDescriptor *desc);
50228 static bool getPropertyDescriptor(JSContext *cx, JSObject *proxy, jsid id, bool set, Value *vp);
50229 static bool getOwnPropertyDescriptor(JSContext *cx, JSObject *proxy, jsid id, bool set,
50230 PropertyDescriptor *desc);
50231 static bool getOwnPropertyDescriptor(JSContext *cx, JSObject *proxy, jsid id, bool set,
50232 Value *vp);
50233 static bool defineProperty(JSContext *cx, JSObject *proxy, jsid id, PropertyDescriptor *desc);
50234 static bool defineProperty(JSContext *cx, JSObject *proxy, jsid id, const Value &v);
50235 static bool getOwnPropertyNames(JSContext *cx, JSObject *proxy, AutoIdVector &props);
50236 static bool delete_(JSContext *cx, JSObject *proxy, jsid id, bool *bp);
50237 static bool enumerate(JSContext *cx, JSObject *proxy, AutoIdVector &props);
50238
50239
50240 static bool has(JSContext *cx, JSObject *proxy, jsid id, bool *bp);
50241 static bool hasOwn(JSContext *cx, JSObject *proxy, jsid id, bool *bp);
50242 static bool get(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, Value *vp);
50243 static bool getElementIfPresent(JSContext *cx, JSObject *proxy, JSObject *receiver,
50244 uint32_t index, Value *vp, bool *present);
50245 static bool set(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, bool strict,
50246 Value *vp);
50247 static bool keys(JSContext *cx, JSObject *proxy, AutoIdVector &props);
50248 static bool iterate(JSContext *cx, JSObject *proxy, unsigned flags, Value *vp);
50249
50250
50251 static bool call(JSContext *cx, JSObject *proxy, unsigned argc, Value *vp);
50252 static bool construct(JSContext *cx, JSObject *proxy, unsigned argc, Value *argv, Value *rval);
50253 static bool nativeCall(JSContext *cx, JSObject *proxy, Class *clasp, Native native, CallArgs args);
50254 static bool hasInstance(JSContext *cx, JSObject *proxy, const Value *vp, bool *bp);
50255 static JSType typeOf(JSContext *cx, JSObject *proxy);
50256 static bool objectClassIs(JSObject *obj, ESClassValue classValue, JSContext *cx);
50257 static JSString *obj_toString(JSContext *cx, JSObject *proxy);
50258 static JSString *fun_toString(JSContext *cx, JSObject *proxy, unsigned indent);
50259 static bool regexp_toShared(JSContext *cx, JSObject *proxy, RegExpGuard *g);
50260 static bool defaultValue(JSContext *cx, JSObject *obj, JSType hint, Value *vp);
50261 static bool iteratorNext(JSContext *cx, JSObject *proxy, Value *vp);
50262 };
50263
50264 inline bool IsObjectProxyClass(const Class *clasp)
50265 {
50266 return clasp == &js::ObjectProxyClass || clasp == &js::OuterWindowProxyClass;
50267 }
50268
50269 inline bool IsFunctionProxyClass(const Class *clasp)
50270 {
50271 return clasp == &js::FunctionProxyClass;
50272 }
50273
50274 inline bool IsObjectProxy(const JSObject *obj)
50275 {
50276 return IsObjectProxyClass(GetObjectClass(obj));
50277 }
50278
50279 inline bool IsFunctionProxy(const JSObject *obj)
50280 {
50281 return IsFunctionProxyClass(GetObjectClass(obj));
50282 }
50283
50284 inline bool IsProxy(const JSObject *obj)
50285 {
50286 Class *clasp = GetObjectClass(obj);
50287 return IsObjectProxyClass(clasp) || IsFunctionProxyClass(clasp);
50288 }
50289
50290
50291 const uint32_t JSSLOT_PROXY_HANDLER = 0;
50292 const uint32_t JSSLOT_PROXY_PRIVATE = 1;
50293 const uint32_t JSSLOT_PROXY_EXTRA = 2;
50294
50295 const uint32_t JSSLOT_PROXY_CALL = 4;
50296 const uint32_t JSSLOT_PROXY_CONSTRUCT = 5;
50297
50298 inline BaseProxyHandler *
50299 GetProxyHandler(const JSObject *obj)
50300 {
50301 do { } while(0);
50302 return (BaseProxyHandler *) GetReservedSlot(obj, JSSLOT_PROXY_HANDLER).toPrivate();
50303 }
50304
50305 inline const Value &
50306 GetProxyPrivate(const JSObject *obj)
50307 {
50308 do { } while(0);
50309 return GetReservedSlot(obj, JSSLOT_PROXY_PRIVATE);
50310 }
50311
50312 inline JSObject *
50313 GetProxyTargetObject(const JSObject *obj)
50314 {
50315 do { } while(0);
50316 return GetProxyPrivate(obj).toObjectOrNull();
50317 }
50318
50319 inline const Value &
50320 GetProxyCall(const JSObject *obj)
50321 {
50322 do { } while(0);
50323 return GetReservedSlot(obj, JSSLOT_PROXY_CALL);
50324 }
50325
50326 inline const Value &
50327 GetProxyExtra(const JSObject *obj, size_t n)
50328 {
50329 do { } while(0);
50330 return GetReservedSlot(obj, JSSLOT_PROXY_EXTRA + n);
50331 }
50332
50333 inline void
50334 SetProxyHandler(JSObject *obj, BaseProxyHandler *handler)
50335 {
50336 do { } while(0);
50337 SetReservedSlot(obj, JSSLOT_PROXY_HANDLER, PrivateValue(handler));
50338 }
50339
50340 inline void
50341 SetProxyPrivate(JSObject *obj, const Value &value)
50342 {
50343 do { } while(0);
50344 SetReservedSlot(obj, JSSLOT_PROXY_PRIVATE, value);
50345 }
50346
50347 inline void
50348 SetProxyExtra(JSObject *obj, size_t n, const Value &extra)
50349 {
50350 do { } while(0);
50351 do { } while(0);
50352 SetReservedSlot(obj, JSSLOT_PROXY_EXTRA + n, extra);
50353 }
50354
50355 __attribute__((visibility("default"))) JSObject *
50356 NewProxyObject(JSContext *cx, BaseProxyHandler *handler, const Value &priv,
50357 JSObject *proto, JSObject *parent,
50358 JSObject *call = __null, JSObject *construct = __null);
50359
50360 }
50361
50362 extern "C" {
50363
50364 extern __attribute__((visibility("default"))) JSObject *
50365 js_InitProxyClass(JSContext *cx, JSObject *obj);
50366
50367 }
50368 # 25 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobjinlines.h" 2
50369
50370
50371 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jstypedarray.h" 1
50372
50373
50374
50375
50376
50377
50378
50379 #define jstypedarray_h
50380
50381
50382
50383
50384
50385
50386
50387 typedef struct JSProperty JSProperty;
50388
50389 namespace js {
50390 # 28 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jstypedarray.h"
50391 class ArrayBufferObject : public JSObject
50392 {
50393 public:
50394 static Class protoClass;
50395 static JSPropertySpec jsprops[];
50396 static JSFunctionSpec jsfuncs[];
50397
50398 static JSBool prop_getByteLength(JSContext *cx, HandleObject obj, HandleId id, Value *vp);
50399
50400 static JSBool fun_slice(JSContext *cx, unsigned argc, Value *vp);
50401
50402 static JSBool class_constructor(JSContext *cx, unsigned argc, Value *vp);
50403
50404 static JSObject *create(JSContext *cx, uint32_t nbytes, uint8_t *contents = __null);
50405
50406 static JSObject *createSlice(JSContext *cx, ArrayBufferObject &arrayBuffer,
50407 uint32_t begin, uint32_t end);
50408
50409 static void
50410 obj_trace(JSTracer *trc, JSObject *obj);
50411
50412 static JSBool
50413 obj_lookupGeneric(JSContext *cx, HandleObject obj, HandleId id,
50414 JSObject **objp, JSProperty **propp);
50415 static JSBool
50416 obj_lookupProperty(JSContext *cx, HandleObject obj, HandlePropertyName name,
50417 JSObject **objp, JSProperty **propp);
50418 static JSBool
50419 obj_lookupElement(JSContext *cx, HandleObject obj, uint32_t index,
50420 JSObject **objp, JSProperty **propp);
50421 static JSBool
50422 obj_lookupSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, JSObject **objp,
50423 JSProperty **propp);
50424
50425 static JSBool
50426 obj_defineGeneric(JSContext *cx, HandleObject obj, HandleId id, const Value *v,
50427 PropertyOp getter, StrictPropertyOp setter, unsigned attrs);
50428 static JSBool
50429 obj_defineProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, const Value *v,
50430 PropertyOp getter, StrictPropertyOp setter, unsigned attrs);
50431 static JSBool
50432 obj_defineElement(JSContext *cx, HandleObject obj, uint32_t index, const Value *v,
50433 PropertyOp getter, StrictPropertyOp setter, unsigned attrs);
50434 static JSBool
50435 obj_defineSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, const Value *v,
50436 PropertyOp getter, StrictPropertyOp setter, unsigned attrs);
50437
50438 static JSBool
50439 obj_getGeneric(JSContext *cx, HandleObject obj, HandleObject receiver, HandleId id, Value *vp);
50440
50441 static JSBool
50442 obj_getProperty(JSContext *cx, HandleObject obj, HandleObject receiver, HandlePropertyName name,
50443 Value *vp);
50444
50445 static JSBool
50446 obj_getElement(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_t index, Value *vp);
50447 static JSBool
50448 obj_getElementIfPresent(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_t index,
50449 Value *vp, bool *present);
50450
50451 static JSBool
50452 obj_getSpecial(JSContext *cx, HandleObject obj, HandleObject receiver, HandleSpecialId sid, Value *vp);
50453
50454 static JSBool
50455 obj_setGeneric(JSContext *cx, HandleObject obj, HandleId id, Value *vp, JSBool strict);
50456 static JSBool
50457 obj_setProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, Value *vp, JSBool strict);
50458 static JSBool
50459 obj_setElement(JSContext *cx, HandleObject obj, uint32_t index, Value *vp, JSBool strict);
50460 static JSBool
50461 obj_setSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, Value *vp, JSBool strict);
50462
50463 static JSBool
50464 obj_getGenericAttributes(JSContext *cx, HandleObject obj, HandleId id, unsigned *attrsp);
50465 static JSBool
50466 obj_getPropertyAttributes(JSContext *cx, HandleObject obj, HandlePropertyName name, unsigned *attrsp);
50467 static JSBool
50468 obj_getElementAttributes(JSContext *cx, HandleObject obj, uint32_t index, unsigned *attrsp);
50469 static JSBool
50470 obj_getSpecialAttributes(JSContext *cx, HandleObject obj, HandleSpecialId sid, unsigned *attrsp);
50471
50472 static JSBool
50473 obj_setGenericAttributes(JSContext *cx, HandleObject obj, HandleId id, unsigned *attrsp);
50474 static JSBool
50475 obj_setPropertyAttributes(JSContext *cx, HandleObject obj, HandlePropertyName name, unsigned *attrsp);
50476 static JSBool
50477 obj_setElementAttributes(JSContext *cx, HandleObject obj, uint32_t index, unsigned *attrsp);
50478 static JSBool
50479 obj_setSpecialAttributes(JSContext *cx, HandleObject obj, HandleSpecialId sid, unsigned *attrsp);
50480
50481 static JSBool
50482 obj_deleteProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, Value *rval, JSBool strict);
50483 static JSBool
50484 obj_deleteElement(JSContext *cx, HandleObject obj, uint32_t index, Value *rval, JSBool strict);
50485 static JSBool
50486 obj_deleteSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, Value *rval, JSBool strict);
50487
50488 static JSBool
50489 obj_enumerate(JSContext *cx, HandleObject obj, JSIterateOp enum_op,
50490 Value *statep, jsid *idp);
50491
50492 static JSType
50493 obj_typeOf(JSContext *cx, HandleObject obj);
50494
50495 bool
50496 allocateSlots(JSContext *cx, uint32_t size, uint8_t *contents = __null);
50497
50498 inline uint32_t byteLength() const;
50499
50500 inline uint8_t * dataPointer() const;
50501
50502
50503
50504
50505
50506 inline bool hasData() const;
50507 };
50508 # 154 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jstypedarray.h"
50509 struct TypedArray {
50510 enum {
50511 TYPE_INT8 = 0,
50512 TYPE_UINT8,
50513 TYPE_INT16,
50514 TYPE_UINT16,
50515 TYPE_INT32,
50516 TYPE_UINT32,
50517 TYPE_FLOAT32,
50518 TYPE_FLOAT64,
50519
50520
50521
50522
50523
50524 TYPE_UINT8_CLAMPED,
50525
50526 TYPE_MAX
50527 };
50528
50529 enum {
50530
50531 FIELD_LENGTH = 0,
50532 FIELD_BYTEOFFSET,
50533 FIELD_BYTELENGTH,
50534 FIELD_TYPE,
50535 FIELD_BUFFER,
50536 FIELD_MAX,
50537 NUM_FIXED_SLOTS = 7
50538 };
50539
50540
50541 static Class classes[TYPE_MAX];
50542
50543
50544
50545 static Class protoClasses[TYPE_MAX];
50546
50547 static JSPropertySpec jsprops[];
50548
50549 static JSBool prop_getBuffer(JSContext *cx, HandleObject obj, HandleId id, Value *vp);
50550 static JSBool prop_getByteOffset(JSContext *cx, HandleObject obj, HandleId id, Value *vp);
50551 static JSBool prop_getByteLength(JSContext *cx, HandleObject obj, HandleId id, Value *vp);
50552 static JSBool prop_getLength(JSContext *cx, HandleObject obj, HandleId id, Value *vp);
50553
50554 static JSBool obj_lookupGeneric(JSContext *cx, HandleObject obj, HandleId id,
50555 JSObject **objp, JSProperty **propp);
50556 static JSBool obj_lookupProperty(JSContext *cx, HandleObject obj, HandlePropertyName name,
50557 JSObject **objp, JSProperty **propp);
50558 static JSBool obj_lookupElement(JSContext *cx, HandleObject obj, uint32_t index,
50559 JSObject **objp, JSProperty **propp);
50560 static JSBool obj_lookupSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid,
50561 JSObject **objp, JSProperty **propp);
50562
50563 static JSBool obj_getGenericAttributes(JSContext *cx, HandleObject obj, HandleId id, unsigned *attrsp);
50564 static JSBool obj_getPropertyAttributes(JSContext *cx, HandleObject obj, HandlePropertyName name, unsigned *attrsp);
50565 static JSBool obj_getElementAttributes(JSContext *cx, HandleObject obj, uint32_t index, unsigned *attrsp);
50566 static JSBool obj_getSpecialAttributes(JSContext *cx, HandleObject obj, HandleSpecialId sid, unsigned *attrsp);
50567
50568 static JSBool obj_setGenericAttributes(JSContext *cx, HandleObject obj, HandleId id, unsigned *attrsp);
50569 static JSBool obj_setPropertyAttributes(JSContext *cx, HandleObject obj, HandlePropertyName name, unsigned *attrsp);
50570 static JSBool obj_setElementAttributes(JSContext *cx, HandleObject obj, uint32_t index, unsigned *attrsp);
50571 static JSBool obj_setSpecialAttributes(JSContext *cx, HandleObject obj, HandleSpecialId sid, unsigned *attrsp);
50572
50573 static uint32_t getLength(JSObject *obj);
50574 static uint32_t getByteOffset(JSObject *obj);
50575 static uint32_t getByteLength(JSObject *obj);
50576 static uint32_t getType(JSObject *obj);
50577 static ArrayBufferObject * getBuffer(JSObject *obj);
50578 static void * getDataOffset(JSObject *obj);
50579
50580 public:
50581 static bool
50582 isArrayIndex(JSContext *cx, JSObject *obj, jsid id, uint32_t *ip = __null);
50583
50584 static inline uint32_t slotWidth(int atype) {
50585 switch (atype) {
50586 case js::TypedArray::TYPE_INT8:
50587 case js::TypedArray::TYPE_UINT8:
50588 case js::TypedArray::TYPE_UINT8_CLAMPED:
50589 return 1;
50590 case js::TypedArray::TYPE_INT16:
50591 case js::TypedArray::TYPE_UINT16:
50592 return 2;
50593 case js::TypedArray::TYPE_INT32:
50594 case js::TypedArray::TYPE_UINT32:
50595 case js::TypedArray::TYPE_FLOAT32:
50596 return 4;
50597 case js::TypedArray::TYPE_FLOAT64:
50598 return 8;
50599 default:
50600 __builtin_unreachable();
50601 return 0;
50602 }
50603 }
50604
50605 static inline int slotWidth(JSObject *obj) {
50606 return slotWidth(getType(obj));
50607 }
50608
50609 static int lengthOffset();
50610 static int dataOffset();
50611 };
50612
50613 inline bool
50614 IsTypedArrayClass(const Class *clasp)
50615 {
50616 return &TypedArray::classes[0] <= clasp &&
50617 clasp < &TypedArray::classes[TypedArray::TYPE_MAX];
50618 }
50619
50620 inline bool
50621 IsTypedArrayProtoClass(const Class *clasp)
50622 {
50623 return &TypedArray::protoClasses[0] <= clasp &&
50624 clasp < &TypedArray::protoClasses[TypedArray::TYPE_MAX];
50625 }
50626
50627 inline bool
50628 IsTypedArray(JSObject *obj)
50629 {
50630 return IsTypedArrayClass(obj->getClass());
50631 }
50632
50633 inline bool
50634 IsTypedArrayProto(JSObject *obj)
50635 {
50636 return IsTypedArrayProtoClass(obj->getClass());
50637 }
50638
50639 class DataViewObject : public JSObject
50640 {
50641 static Class protoClass;
50642
50643 static const size_t BYTEOFFSET_SLOT = 0;
50644 static const size_t BYTELENGTH_SLOT = 1;
50645 static const size_t BUFFER_SLOT = 2;
50646
50647 public:
50648 static const size_t RESERVED_SLOTS = 3;
50649
50650 static JSBool prop_getBuffer(JSContext *cx, HandleObject obj, HandleId id, Value *vp);
50651 static JSBool prop_getByteOffset(JSContext *cx, HandleObject obj, HandleId id, Value *vp);
50652 static JSBool prop_getByteLength(JSContext *cx, HandleObject obj, HandleId id, Value *vp);
50653
50654 static JSBool class_constructor(JSContext *cx, unsigned argc, Value *vp);
50655 static JSBool constructWithProto(JSContext *cx, unsigned argc, Value *vp);
50656 static JSBool construct(JSContext *cx, JSObject *bufobj, const CallArgs &args, JSObject *proto);
50657
50658 static inline DataViewObject *
50659 create(JSContext *cx, uint32_t byteOffset, uint32_t byteLength,
50660 Handle<ArrayBufferObject*> arrayBuffer, JSObject *proto);
50661
50662 static JSBool fun_getInt8(JSContext *cx, unsigned argc, Value *vp);
50663 static JSBool fun_getUint8(JSContext *cx, unsigned argc, Value *vp);
50664 static JSBool fun_getInt16(JSContext *cx, unsigned argc, Value *vp);
50665 static JSBool fun_getUint16(JSContext *cx, unsigned argc, Value *vp);
50666 static JSBool fun_getInt32(JSContext *cx, unsigned argc, Value *vp);
50667 static JSBool fun_getUint32(JSContext *cx, unsigned argc, Value *vp);
50668 static JSBool fun_getFloat32(JSContext *cx, unsigned argc, Value *vp);
50669 static JSBool fun_getFloat64(JSContext *cx, unsigned argc, Value *vp);
50670 static JSBool fun_setInt8(JSContext *cx, unsigned argc, Value *vp);
50671 static JSBool fun_setUint8(JSContext *cx, unsigned argc, Value *vp);
50672 static JSBool fun_setInt16(JSContext *cx, unsigned argc, Value *vp);
50673 static JSBool fun_setUint16(JSContext *cx, unsigned argc, Value *vp);
50674 static JSBool fun_setInt32(JSContext *cx, unsigned argc, Value *vp);
50675 static JSBool fun_setUint32(JSContext *cx, unsigned argc, Value *vp);
50676 static JSBool fun_setFloat32(JSContext *cx, unsigned argc, Value *vp);
50677 static JSBool fun_setFloat64(JSContext *cx, unsigned argc, Value *vp);
50678 inline uint32_t byteLength();
50679 inline uint32_t byteOffset();
50680 inline JSObject & arrayBuffer();
50681 inline void *dataPointer();
50682 inline bool hasBuffer() const;
50683 static JSObject *initClass(JSContext *cx, GlobalObject *global);
50684 bool getDataPointer(JSContext *cx, CallArgs args, size_t typeSize, uint8_t **data);
50685 template<typename NativeType>
50686 bool read(JSContext *cx, CallArgs &args, NativeType *val, const char *method);
50687 template<typename NativeType>
50688 bool write(JSContext *cx, CallArgs &args, const char *method);
50689 private:
50690 static JSPropertySpec jsprops[];
50691 static JSFunctionSpec jsfuncs[];
50692 };
50693
50694 bool
50695 IsDataView(JSObject *obj);
50696
50697 }
50698 # 28 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobjinlines.h" 2
50699 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsxml.h" 1
50700
50701
50702
50703
50704
50705
50706
50707 #define jsxml_h___
50708 # 18 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsxml.h"
50709 extern const char js_AnyName_str[];
50710 extern const char js_AttributeName_str[];
50711 extern const char js_isXMLName_str[];
50712 extern const char js_XMLList_str[];
50713
50714 extern const char js_amp_entity_str[];
50715 extern const char js_gt_entity_str[];
50716 extern const char js_lt_entity_str[];
50717 extern const char js_quot_entity_str[];
50718
50719 template<class T>
50720 struct JSXMLArrayCursor;
50721
50722 template<class T>
50723 struct JSXMLArray
50724 {
50725 uint32_t length;
50726 uint32_t capacity;
50727 js::HeapPtr<T> *vector;
50728 JSXMLArrayCursor<T> *cursors;
50729
50730 void init() {
50731 length = capacity = 0;
50732 vector = __null;
50733 cursors = __null;
50734 }
50735
50736 void finish(js::FreeOp *fop);
50737
50738 bool setCapacity(JSContext *cx, uint32_t capacity);
50739 void trim();
50740 };
50741
50742 template<class T>
50743 struct JSXMLArrayCursor
50744 {
50745 typedef js::HeapPtr<T> HeapPtrT;
50746
50747 JSXMLArray<T> *array;
50748 uint32_t index;
50749 JSXMLArrayCursor<T> *next;
50750 JSXMLArrayCursor<T> **prevp;
50751 HeapPtrT root;
50752
50753 JSXMLArrayCursor(JSXMLArray<T> *array)
50754 : array(array), index(0), next(array->cursors), prevp(&array->cursors),
50755 root(__null)
50756 {
50757 if (next)
50758 next->prevp = &next;
50759 array->cursors = this;
50760 }
50761
50762 ~JSXMLArrayCursor() { disconnect(); }
50763
50764 void disconnect() {
50765 if (!array)
50766 return;
50767 if (next)
50768 next->prevp = prevp;
50769 *prevp = next;
50770 array = __null;
50771 root.~HeapPtrT();
50772 }
50773
50774 T *getNext() {
50775 if (!array || index >= array->length)
50776 return __null;
50777 return root = array->vector[index++];
50778 }
50779
50780 T *getCurrent() {
50781 if (!array || index >= array->length)
50782 return __null;
50783 return root = array->vector[index];
50784 }
50785 };
50786
50787 void js_XMLArrayCursorTrace(JSTracer *trc, JSXMLArrayCursor<JSXML> *cursor);
50788 void js_XMLArrayCursorTrace(JSTracer *trc, JSXMLArrayCursor<JSObject> *cursor);
50789
50790 #define JSXML_PRESET_CAPACITY JS_BIT(31)
50791 #define JSXML_CAPACITY_MASK JS_BITMASK(31)
50792 #define JSXML_CAPACITY(array) ((array)->capacity & JSXML_CAPACITY_MASK)
50793
50794
50795
50796
50797
50798 typedef enum JSXMLClass {
50799 JSXML_CLASS_LIST,
50800 JSXML_CLASS_ELEMENT,
50801 JSXML_CLASS_ATTRIBUTE,
50802 JSXML_CLASS_PROCESSING_INSTRUCTION,
50803 JSXML_CLASS_TEXT,
50804 JSXML_CLASS_COMMENT,
50805 JSXML_CLASS_LIMIT
50806 } JSXMLClass;
50807
50808 #define JSXML_CLASS_HAS_KIDS(class_) ((class_) < JSXML_CLASS_ATTRIBUTE)
50809 #define JSXML_CLASS_HAS_VALUE(class_) ((class_) >= JSXML_CLASS_ATTRIBUTE)
50810 #define JSXML_CLASS_HAS_NAME(class_) ((unsigned)((class_) - JSXML_CLASS_ELEMENT) <= (unsigned)(JSXML_CLASS_PROCESSING_INSTRUCTION - JSXML_CLASS_ELEMENT))
50811
50812
50813
50814
50815
50816
50817
50818 typedef struct JSXMLListVar {
50819 JSXMLArray<JSXML> kids;
50820 js::HeapPtrXML target;
50821 js::HeapPtrObject targetprop;
50822 } JSXMLListVar;
50823
50824 typedef struct JSXMLElemVar {
50825 JSXMLArray<JSXML> kids;
50826 JSXMLArray<JSObject> namespaces;
50827 JSXMLArray<JSXML> attrs;
50828 } JSXMLElemVar;
50829
50830
50831 #define xml_kids list.kids
50832 #define xml_target list.target
50833 #define xml_targetprop list.targetprop
50834 #define xml_namespaces elem.namespaces
50835 #define xml_attrs elem.attrs
50836 #define xml_value value
50837
50838
50839 #define JSXML_HAS_KIDS(xml) JSXML_CLASS_HAS_KIDS((xml)->xml_class)
50840 #define JSXML_HAS_VALUE(xml) JSXML_CLASS_HAS_VALUE((xml)->xml_class)
50841 #define JSXML_HAS_NAME(xml) JSXML_CLASS_HAS_NAME((xml)->xml_class)
50842 #define JSXML_LENGTH(xml) (JSXML_CLASS_HAS_KIDS((xml)->xml_class) ? (xml)->xml_kids.length : 0)
50843
50844
50845
50846 struct JSXML : js::gc::Cell {
50847
50848
50849
50850
50851 js::HeapPtrObject object;
50852 void *domnode;
50853 js::HeapPtrXML parent;
50854 js::HeapPtrObject name;
50855 uint32_t xml_class;
50856 uint32_t xml_flags;
50857
50858 JSXMLListVar list;
50859 JSXMLElemVar elem;
50860 js::HeapPtrString value;
50861
50862
50863
50864 void *pad;
50865
50866
50867 void finalize(js::FreeOp *fop);
50868
50869 static void writeBarrierPre(JSXML *xml);
50870 static void writeBarrierPost(JSXML *xml, void *addr);
50871 };
50872
50873
50874 #define XMLF_WHITESPACE_TEXT 0x1
50875
50876 extern JSXML *
50877 js_NewXML(JSContext *cx, JSXMLClass xml_class);
50878
50879 extern void
50880 js_TraceXML(JSTracer *trc, JSXML *xml);
50881
50882 extern JSObject *
50883 js_NewXMLObject(JSContext *cx, JSXMLClass xml_class);
50884
50885 extern JSObject *
50886 js_GetXMLObject(JSContext *cx, JSXML *xml);
50887
50888 extern JSObject *
50889 js_InitNamespaceClass(JSContext *cx, JSObject *obj);
50890
50891 extern JSObject *
50892 js_InitQNameClass(JSContext *cx, JSObject *obj);
50893
50894 extern JSObject *
50895 js_InitXMLClass(JSContext *cx, JSObject *obj);
50896
50897 extern JSObject *
50898 js_InitXMLClasses(JSContext *cx, JSObject *obj);
50899
50900
50901
50902
50903
50904 extern bool
50905 js_GetLocalNameFromFunctionQName(JSObject *obj, jsid *funidp, JSContext *cx);
50906
50907 extern JSBool
50908 js_GetDefaultXMLNamespace(JSContext *cx, jsval *vp);
50909
50910 extern JSBool
50911 js_SetDefaultXMLNamespace(JSContext *cx, const js::Value &v);
50912
50913
50914
50915
50916
50917
50918 extern JSBool
50919 js_IsXMLName(JSContext *cx, jsval v);
50920
50921 extern JSBool
50922 js_ToAttributeName(JSContext *cx, js::Value *vp);
50923
50924 extern JSFlatString *
50925 js_EscapeAttributeValue(JSContext *cx, JSString *str, JSBool quote);
50926
50927 extern JSString *
50928 js_AddAttributePart(JSContext *cx, JSBool isName, JSString *str,
50929 JSString *str2);
50930
50931 extern JSFlatString *
50932 js_EscapeElementValue(JSContext *cx, JSString *str);
50933
50934 extern JSString *
50935 js_ValueToXMLString(JSContext *cx, const js::Value &v);
50936
50937 extern JSObject *
50938 js_ConstructXMLQNameObject(JSContext *cx, const js::Value & nsval,
50939 const js::Value & lnval);
50940
50941 extern JSBool
50942 js_GetAnyName(JSContext *cx, jsid *idp);
50943
50944
50945
50946
50947 extern JSBool
50948 js_FindXMLProperty(JSContext *cx, const js::Value &nameval, JSObject **objp, jsid *idp);
50949
50950 extern JSBool
50951 js_GetXMLMethod(JSContext *cx, js::HandleObject obj, jsid id, js::Value *vp);
50952
50953 extern JSBool
50954 js_GetXMLDescendants(JSContext *cx, JSObject *obj, jsval id, jsval *vp);
50955
50956 extern JSBool
50957 js_DeleteXMLListElements(JSContext *cx, JSObject *listobj);
50958
50959 extern JSBool
50960 js_StepXMLListFilter(JSContext *cx, JSBool initialized);
50961
50962 extern JSObject *
50963 js_ValueToXMLObject(JSContext *cx, const js::Value &v);
50964
50965 extern JSObject *
50966 js_ValueToXMLListObject(JSContext *cx, const js::Value &v);
50967
50968 extern JSObject *
50969 js_NewXMLSpecialObject(JSContext *cx, JSXMLClass xml_class, JSString *name,
50970 JSString *value);
50971
50972 extern JSString *
50973 js_MakeXMLCDATAString(JSContext *cx, JSString *str);
50974
50975 extern JSString *
50976 js_MakeXMLCommentString(JSContext *cx, JSString *str);
50977
50978 extern JSString *
50979 js_MakeXMLPIString(JSContext *cx, JSString *name, JSString *str);
50980
50981
50982 extern JSBool
50983 js_TestXMLEquality(JSContext *cx, const js::Value &v1, const js::Value &v2,
50984 JSBool *bp);
50985
50986 extern JSBool
50987 js_ConcatenateXML(JSContext *cx, JSObject *obj1, JSObject *obj2, js::Value *vp);
50988
50989 namespace js {
50990
50991 extern bool
50992 GetLocalNameFromFunctionQName(JSObject *qn, JSAtom **namep, JSContext *cx);
50993
50994 }
50995 # 29 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobjinlines.h" 2
50996 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jswrapper.h" 1
50997 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jswrapper.h"
50998 #define jswrapper_h___
50999
51000
51001
51002
51003
51004
51005 namespace js {
51006
51007 class DummyFrameGuard;
51008
51009
51010
51011
51012
51013
51014 class __attribute__((visibility("default"))) AbstractWrapper : public IndirectProxyHandler
51015 {
51016 unsigned mFlags;
51017 public:
51018 unsigned flags() const { return mFlags; }
51019
51020 explicit AbstractWrapper(unsigned flags);
51021
51022
51023 virtual bool getPropertyDescriptor(JSContext *cx, JSObject *wrapper, jsid id, bool set,
51024 PropertyDescriptor *desc) ;
51025 virtual bool getOwnPropertyDescriptor(JSContext *cx, JSObject *wrapper, jsid id, bool set,
51026 PropertyDescriptor *desc) ;
51027 virtual bool defineProperty(JSContext *cx, JSObject *wrapper, jsid id,
51028 PropertyDescriptor *desc) ;
51029 virtual bool getOwnPropertyNames(JSContext *cx, JSObject *wrapper, AutoIdVector &props) ;
51030 virtual bool delete_(JSContext *cx, JSObject *wrapper, jsid id, bool *bp) ;
51031 virtual bool enumerate(JSContext *cx, JSObject *wrapper, AutoIdVector &props) ;
51032 # 72 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jswrapper.h"
51033 enum Action { GET, SET, CALL, PUNCTURE };
51034 virtual bool enter(JSContext *cx, JSObject *wrapper, jsid id, Action act, bool *bp);
51035 virtual void leave(JSContext *cx, JSObject *wrapper);
51036
51037 static JSObject *wrappedObject(const JSObject *wrapper);
51038 static AbstractWrapper *wrapperHandler(const JSObject *wrapper);
51039 };
51040
51041
51042 class __attribute__((visibility("default"))) DirectWrapper : public AbstractWrapper
51043 {
51044 public:
51045 explicit DirectWrapper(unsigned flags);
51046
51047 typedef enum { PermitObjectAccess, PermitPropertyAccess, DenyAccess } Permission;
51048
51049 virtual ~DirectWrapper();
51050
51051
51052 virtual bool has(JSContext *cx, JSObject *wrapper, jsid id, bool *bp) ;
51053 virtual bool hasOwn(JSContext *cx, JSObject *wrapper, jsid id, bool *bp) ;
51054 virtual bool get(JSContext *cx, JSObject *wrapper, JSObject *receiver, jsid id, Value *vp) ;
51055 virtual bool set(JSContext *cx, JSObject *wrapper, JSObject *receiver, jsid id, bool strict,
51056 Value *vp) ;
51057 virtual bool keys(JSContext *cx, JSObject *wrapper, AutoIdVector &props) ;
51058 virtual bool iterate(JSContext *cx, JSObject *wrapper, unsigned flags, Value *vp) ;
51059
51060
51061 virtual bool call(JSContext *cx, JSObject *wrapper, unsigned argc, Value *vp) ;
51062 virtual bool construct(JSContext *cx, JSObject *wrapper, unsigned argc, Value *argv, Value *rval) ;
51063 virtual bool nativeCall(JSContext *cx, JSObject *wrapper, Class *clasp, Native native, CallArgs args) ;
51064 virtual bool hasInstance(JSContext *cx, JSObject *wrapper, const Value *vp, bool *bp) ;
51065 virtual JSString *obj_toString(JSContext *cx, JSObject *wrapper) ;
51066 virtual JSString *fun_toString(JSContext *cx, JSObject *wrapper, unsigned indent) ;
51067
51068 using AbstractWrapper::Action;
51069
51070 static DirectWrapper singleton;
51071
51072 static JSObject *New(JSContext *cx, JSObject *obj, JSObject *proto, JSObject *parent,
51073 DirectWrapper *handler);
51074
51075 using AbstractWrapper::wrappedObject;
51076 using AbstractWrapper::wrapperHandler;
51077
51078 enum {
51079 CROSS_COMPARTMENT = 1 << 0,
51080 LAST_USED_FLAG = CROSS_COMPARTMENT
51081 };
51082
51083 static void *getWrapperFamily();
51084 };
51085
51086
51087
51088
51089
51090 typedef DirectWrapper Wrapper;
51091
51092
51093 class __attribute__((visibility("default"))) CrossCompartmentWrapper : public DirectWrapper
51094 {
51095 public:
51096 CrossCompartmentWrapper(unsigned flags);
51097
51098 virtual ~CrossCompartmentWrapper();
51099
51100
51101 virtual bool getPropertyDescriptor(JSContext *cx, JSObject *wrapper, jsid id, bool set,
51102 PropertyDescriptor *desc) ;
51103 virtual bool getOwnPropertyDescriptor(JSContext *cx, JSObject *wrapper, jsid id, bool set,
51104 PropertyDescriptor *desc) ;
51105 virtual bool defineProperty(JSContext *cx, JSObject *wrapper, jsid id,
51106 PropertyDescriptor *desc) ;
51107 virtual bool getOwnPropertyNames(JSContext *cx, JSObject *wrapper, AutoIdVector &props) ;
51108 virtual bool delete_(JSContext *cx, JSObject *wrapper, jsid id, bool *bp) ;
51109 virtual bool enumerate(JSContext *cx, JSObject *wrapper, AutoIdVector &props) ;
51110
51111
51112 virtual bool has(JSContext *cx, JSObject *wrapper, jsid id, bool *bp) ;
51113 virtual bool hasOwn(JSContext *cx, JSObject *wrapper, jsid id, bool *bp) ;
51114 virtual bool get(JSContext *cx, JSObject *wrapper, JSObject *receiver, jsid id, Value *vp) ;
51115 virtual bool set(JSContext *cx, JSObject *wrapper, JSObject *receiver, jsid id, bool strict,
51116 Value *vp) ;
51117 virtual bool keys(JSContext *cx, JSObject *wrapper, AutoIdVector &props) ;
51118 virtual bool iterate(JSContext *cx, JSObject *wrapper, unsigned flags, Value *vp) ;
51119
51120
51121 virtual bool call(JSContext *cx, JSObject *wrapper, unsigned argc, Value *vp) ;
51122 virtual bool construct(JSContext *cx, JSObject *wrapper, unsigned argc, Value *argv, Value *rval) ;
51123 virtual bool nativeCall(JSContext *cx, JSObject *wrapper, Class *clasp, Native native, CallArgs args) ;
51124 virtual bool hasInstance(JSContext *cx, JSObject *wrapper, const Value *vp, bool *bp) ;
51125 virtual JSString *obj_toString(JSContext *cx, JSObject *wrapper) ;
51126 virtual JSString *fun_toString(JSContext *cx, JSObject *wrapper, unsigned indent) ;
51127 virtual bool regexp_toShared(JSContext *cx, JSObject *proxy, RegExpGuard *g) ;
51128 virtual bool defaultValue(JSContext *cx, JSObject *wrapper, JSType hint, Value *vp) ;
51129 virtual bool iteratorNext(JSContext *cx, JSObject *wrapper, Value *vp);
51130
51131 static CrossCompartmentWrapper singleton;
51132 };
51133 # 182 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jswrapper.h"
51134 template <class Base>
51135 class __attribute__((visibility("default"))) SecurityWrapper : public Base
51136 {
51137 public:
51138 SecurityWrapper(unsigned flags);
51139
51140 virtual bool nativeCall(JSContext *cx, JSObject *wrapper, Class *clasp, Native native, CallArgs args) ;
51141 virtual bool objectClassIs(JSObject *obj, ESClassValue classValue, JSContext *cx) ;
51142 virtual bool regexp_toShared(JSContext *cx, JSObject *proxy, RegExpGuard *g) ;
51143 };
51144
51145 typedef SecurityWrapper<DirectWrapper> SameCompartmentSecurityWrapper;
51146 typedef SecurityWrapper<CrossCompartmentWrapper> CrossCompartmentSecurityWrapper;
51147
51148
51149
51150
51151
51152 class __attribute__((visibility("default"))) ForceFrame
51153 {
51154 public:
51155 JSContext * const context;
51156 JSObject * const target;
51157 private:
51158 DummyFrameGuard *frame;
51159
51160 public:
51161 ForceFrame(JSContext *cx, JSObject *target);
51162 ~ForceFrame();
51163 bool enter();
51164 };
51165
51166
51167 class __attribute__((visibility("default"))) DeadObjectProxy : public BaseProxyHandler
51168 {
51169 public:
51170 static int sDeadObjectFamily;
51171
51172 explicit DeadObjectProxy();
51173
51174
51175 virtual bool getPropertyDescriptor(JSContext *cx, JSObject *wrapper, jsid id, bool set,
51176 PropertyDescriptor *desc) ;
51177 virtual bool getOwnPropertyDescriptor(JSContext *cx, JSObject *wrapper, jsid id, bool set,
51178 PropertyDescriptor *desc) ;
51179 virtual bool defineProperty(JSContext *cx, JSObject *wrapper, jsid id,
51180 PropertyDescriptor *desc) ;
51181 virtual bool getOwnPropertyNames(JSContext *cx, JSObject *wrapper, AutoIdVector &props) ;
51182 virtual bool delete_(JSContext *cx, JSObject *wrapper, jsid id, bool *bp) ;
51183 virtual bool enumerate(JSContext *cx, JSObject *wrapper, AutoIdVector &props) ;
51184
51185
51186 virtual bool call(JSContext *cx, JSObject *proxy, unsigned argc, Value *vp);
51187 virtual bool construct(JSContext *cx, JSObject *proxy, unsigned argc, Value *argv, Value *rval);
51188 virtual bool nativeCall(JSContext *cx, JSObject *proxy, Class *clasp, Native native, CallArgs args);
51189 virtual bool hasInstance(JSContext *cx, JSObject *proxy, const Value *vp, bool *bp);
51190 virtual bool objectClassIs(JSObject *obj, ESClassValue classValue, JSContext *cx);
51191 virtual JSString *obj_toString(JSContext *cx, JSObject *proxy);
51192 virtual JSString *fun_toString(JSContext *cx, JSObject *proxy, unsigned indent);
51193 virtual bool regexp_toShared(JSContext *cx, JSObject *proxy, RegExpGuard *g);
51194 virtual bool defaultValue(JSContext *cx, JSObject *obj, JSType hint, Value *vp);
51195 virtual bool iteratorNext(JSContext *cx, JSObject *proxy, Value *vp);
51196 virtual bool getElementIfPresent(JSContext *cx, JSObject *obj, JSObject *receiver,
51197 uint32_t index, Value *vp, bool *present);
51198
51199
51200 static DeadObjectProxy singleton;
51201 };
51202
51203 extern JSObject *
51204 TransparentObjectWrapper(JSContext *cx, JSObject *obj, JSObject *wrappedProto, JSObject *parent,
51205 unsigned flags);
51206
51207
51208
51209 extern __attribute__((visibility("default"))) int sWrapperFamily;
51210
51211 inline bool
51212 IsWrapper(const JSObject *obj)
51213 {
51214 return IsProxy(obj) && GetProxyHandler(obj)->family() == &sWrapperFamily;
51215 }
51216
51217
51218
51219
51220
51221 __attribute__((visibility("default"))) JSObject *
51222 UnwrapObject(JSObject *obj, bool stopAtOuter = true, unsigned *flagsp = __null);
51223
51224
51225
51226
51227
51228 __attribute__((visibility("default"))) JSObject *
51229 UnwrapObjectChecked(JSContext *cx, JSObject *obj);
51230
51231 __attribute__((visibility("default"))) bool
51232 IsCrossCompartmentWrapper(const JSObject *obj);
51233
51234 JSObject *
51235 NewDeadProxyObject(JSContext *cx, JSObject *parent);
51236
51237 void
51238 NukeCrossCompartmentWrapper(JSObject *wrapper);
51239
51240 }
51241 # 30 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobjinlines.h" 2
51242
51243
51244 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Marking.h" 1
51245 # 33 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobjinlines.h" 2
51246
51247 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/BooleanObject.h" 1
51248 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/BooleanObject.h"
51249 #define BooleanObject_h___
51250
51251
51252
51253 namespace js {
51254
51255 class BooleanObject : public JSObject
51256 {
51257
51258 static const unsigned PRIMITIVE_VALUE_SLOT = 0;
51259
51260 public:
51261 static const unsigned RESERVED_SLOTS = 1;
51262
51263
51264
51265
51266
51267 static inline BooleanObject *create(JSContext *cx, bool b);
51268
51269
51270
51271
51272
51273 static inline BooleanObject *createWithProto(JSContext *cx, bool b, JSObject &proto);
51274
51275 bool unbox() const {
51276 return getFixedSlot(PRIMITIVE_VALUE_SLOT).toBoolean();
51277 }
51278
51279 private:
51280 inline void setPrimitiveValue(bool b) {
51281 setFixedSlot(PRIMITIVE_VALUE_SLOT, BooleanValue(b));
51282 }
51283
51284
51285 friend JSObject *
51286 ::js_InitBooleanClass(JSContext *cx, JSObject *global);
51287 };
51288
51289 }
51290 # 35 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobjinlines.h" 2
51291
51292 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/NumberObject.h" 1
51293 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/NumberObject.h"
51294 #define NumberObject_h___
51295
51296
51297
51298 namespace js {
51299
51300 class NumberObject : public JSObject
51301 {
51302
51303 static const unsigned PRIMITIVE_VALUE_SLOT = 0;
51304
51305 public:
51306 static const unsigned RESERVED_SLOTS = 1;
51307
51308
51309
51310
51311
51312 static inline NumberObject *create(JSContext *cx, double d);
51313
51314
51315
51316
51317
51318 static inline NumberObject *createWithProto(JSContext *cx, double d, JSObject &proto);
51319
51320 double unbox() const {
51321 return getFixedSlot(PRIMITIVE_VALUE_SLOT).toNumber();
51322 }
51323
51324 private:
51325 inline void setPrimitiveValue(double d) {
51326 setFixedSlot(PRIMITIVE_VALUE_SLOT, NumberValue(d));
51327 }
51328
51329
51330 friend JSObject *
51331 ::js_InitNumberClass(JSContext *cx, JSObject *global);
51332 };
51333
51334 }
51335 # 37 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobjinlines.h" 2
51336 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/RegExpStatics.h" 1
51337 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/RegExpStatics.h"
51338 #define RegExpStatics_h__
51339
51340
51341
51342
51343
51344
51345
51346 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/MatchPairs.h" 1
51347 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/MatchPairs.h"
51348 #define MatchPairs_h__
51349 # 19 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/MatchPairs.h"
51350 namespace js {
51351
51352 struct MatchPair
51353 {
51354 int start;
51355 int limit;
51356
51357 MatchPair(int start, int limit) : start(start), limit(limit) {}
51358
51359 size_t length() const {
51360 do { } while(0);
51361 return limit - start;
51362 }
51363
51364 bool isUndefined() const {
51365 return start == -1;
51366 }
51367
51368 void check() const {
51369 do { } while(0);
51370 do { } while (0);
51371 }
51372 };
51373
51374 class MatchPairs
51375 {
51376 size_t pairCount_;
51377 int buffer_[1];
51378
51379 explicit MatchPairs(size_t pairCount) : pairCount_(pairCount) {
51380 initPairValues();
51381 }
51382
51383 void initPairValues() {
51384 for (int *it = buffer_; it < buffer_ + 2 * pairCount_; ++it)
51385 *it = -1;
51386 }
51387
51388 static size_t calculateSize(size_t backingPairCount) {
51389 return sizeof(MatchPairs) - sizeof(int) + sizeof(int) * backingPairCount;
51390 }
51391
51392 int *buffer() { return buffer_; }
51393
51394 friend class RegExpShared;
51395
51396 public:
51397
51398
51399
51400
51401 static MatchPairs *create(LifoAlloc &alloc, size_t pairCount, size_t backingPairCount);
51402
51403 size_t pairCount() const { return pairCount_; }
51404
51405 MatchPair pair(size_t i) {
51406 do { } while(0);
51407 return MatchPair(buffer_[2 * i], buffer_[2 * i + 1]);
51408 }
51409
51410 void displace(size_t amount) {
51411 if (!amount)
51412 return;
51413
51414 for (int *it = buffer_; it < buffer_ + 2 * pairCount_; ++it)
51415 *it = (*it < 0) ? -1 : *it + amount;
51416 }
51417
51418 inline void checkAgainst(size_t length);
51419 };
51420
51421 }
51422 # 18 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/RegExpStatics.h" 2
51423
51424 namespace js {
51425
51426 class RegExpStatics
51427 {
51428 typedef Vector<int, 20, SystemAllocPolicy> Pairs;
51429 Pairs matchPairs;
51430
51431 HeapPtr<JSLinearString> matchPairsInput;
51432
51433 HeapPtr<JSString> pendingInput;
51434 RegExpFlag flags;
51435 RegExpStatics *bufferLink;
51436 bool copied;
51437
51438 bool createDependent(JSContext *cx, size_t start, size_t end, Value *out) const;
51439
51440 inline void copyTo(RegExpStatics &dst);
51441
51442 inline void aboutToWrite();
51443
51444 bool save(JSContext *cx, RegExpStatics *buffer) {
51445 do { } while(0);
51446 buffer->bufferLink = bufferLink;
51447 bufferLink = buffer;
51448 if (!buffer->matchPairs.reserve(matchPairs.length())) {
51449 js_ReportOutOfMemory(cx);
51450 return false;
51451 }
51452 return true;
51453 }
51454
51455 inline void restore();
51456
51457 void checkInvariants() {
51458 # 76 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/RegExpStatics.h"
51459 }
51460
51461
51462
51463
51464
51465 void checkParenNum(size_t pairNum) const {
51466 do { } while(0);
51467 do { } while(0);
51468 }
51469
51470
51471 size_t getParenLength(size_t pairNum) const {
51472 checkParenNum(pairNum);
51473 do { } while(0);
51474 return get(pairNum, 1) - get(pairNum, 0);
51475 }
51476
51477 int get(size_t pairNum, bool which) const {
51478 do { } while(0);
51479 return matchPairs[2 * pairNum + which];
51480 }
51481
51482
51483
51484
51485
51486
51487 bool makeMatch(JSContext *cx, size_t checkValidIndex, size_t pairNum, Value *out) const;
51488
51489 void markFlagsSet(JSContext *cx);
51490
51491 struct InitBuffer {};
51492 explicit RegExpStatics(InitBuffer) : bufferLink(__null), copied(false) {}
51493
51494 friend class PreserveRegExpStatics;
51495
51496 public:
51497 inline RegExpStatics();
51498
51499 static JSObject *create(JSContext *cx, GlobalObject *parent);
51500
51501
51502
51503 inline bool updateFromMatchPairs(JSContext *cx, JSLinearString *input, MatchPairs *newPairs);
51504 inline void setMultiline(JSContext *cx, bool enabled);
51505
51506 inline void clear();
51507
51508
51509 inline void reset(JSContext *cx, JSString *newInput, bool newMultiline);
51510
51511 inline void setPendingInput(JSString *newInput);
51512 # 139 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/RegExpStatics.h"
51513 private:
51514 size_t pairCount() const {
51515 do { } while(0);
51516 return matchPairs.length() / 2;
51517 }
51518
51519 public:
51520 size_t parenCount() const {
51521 size_t pc = pairCount();
51522 do { } while(0);
51523 return pc - 1;
51524 }
51525
51526 JSString *getPendingInput() const { return pendingInput; }
51527 RegExpFlag getFlags() const { return flags; }
51528 bool multiline() const { return flags & MultilineFlag; }
51529
51530 size_t matchStart() const {
51531 int start = get(0, 0);
51532 do { } while(0);
51533 return size_t(start);
51534 }
51535
51536 size_t matchLimit() const {
51537 int limit = get(0, 1);
51538 do { } while(0);
51539 return size_t(limit);
51540 }
51541
51542
51543 bool matched() const {
51544 do { } while(0);
51545 do { } while (0);
51546 return get(0, 1) - get(0, 0) > 0;
51547 }
51548
51549 void mark(JSTracer *trc) {
51550 if (pendingInput)
51551 MarkString(trc, &pendingInput, "res->pendingInput");
51552 if (matchPairsInput)
51553 MarkString(trc, &matchPairsInput, "res->matchPairsInput");
51554 }
51555
51556 bool pairIsPresent(size_t pairNum) const {
51557 return get(pairNum, 0) >= 0;
51558 }
51559
51560
51561
51562 bool createPendingInput(JSContext *cx, Value *out) const;
51563 bool createLastMatch(JSContext *cx, Value *out) const { return makeMatch(cx, 0, 0, out); }
51564 bool createLastParen(JSContext *cx, Value *out) const;
51565 bool createLeftContext(JSContext *cx, Value *out) const;
51566 bool createRightContext(JSContext *cx, Value *out) const;
51567
51568
51569 bool createParen(JSContext *cx, size_t pairNum, Value *out) const {
51570 do { } while(0);
51571 if (pairNum >= pairCount()) {
51572 out->setString(cx->runtime->emptyString);
51573 return true;
51574 }
51575 return makeMatch(cx, pairNum * 2, pairNum, out);
51576 }
51577
51578
51579
51580 void getParen(size_t pairNum, JSSubString *out) const;
51581 void getLastMatch(JSSubString *out) const;
51582 void getLastParen(JSSubString *out) const;
51583 void getLeftContext(JSSubString *out) const;
51584 void getRightContext(JSSubString *out) const;
51585
51586 class AutoRooter : private AutoGCRooter
51587 {
51588 public:
51589 explicit AutoRooter(JSContext *cx, RegExpStatics *statics_
51590 )
51591 : AutoGCRooter(cx, REGEXPSTATICS), statics(statics_), skip(cx, statics_)
51592 {
51593 do { } while (0);
51594 }
51595
51596 friend void AutoGCRooter::trace(JSTracer *trc);
51597 void trace(JSTracer *trc);
51598
51599 private:
51600 RegExpStatics *statics;
51601 SkipRoot skip;
51602
51603 };
51604 };
51605
51606 class PreserveRegExpStatics
51607 {
51608 RegExpStatics * const original;
51609 RegExpStatics buffer;
51610 RegExpStatics::AutoRooter bufferRoot;
51611
51612 public:
51613 explicit PreserveRegExpStatics(JSContext *cx, RegExpStatics *original)
51614 : original(original),
51615 buffer(RegExpStatics::InitBuffer()),
51616 bufferRoot(cx, &buffer)
51617 {}
51618
51619 bool init(JSContext *cx) {
51620 return original->save(cx, &buffer);
51621 }
51622
51623 inline ~PreserveRegExpStatics();
51624 };
51625
51626 size_t SizeOfRegExpStaticsData(const JSObject *obj, JSMallocSizeOfFun mallocSizeOf);
51627
51628 }
51629 # 38 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobjinlines.h" 2
51630 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/StringObject.h" 1
51631 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/StringObject.h"
51632 #define StringObject_h___
51633
51634
51635
51636
51637 namespace js {
51638
51639 class StringObject : public JSObject
51640 {
51641 static const unsigned PRIMITIVE_VALUE_SLOT = 0;
51642 static const unsigned LENGTH_SLOT = 1;
51643
51644 public:
51645 static const unsigned RESERVED_SLOTS = 2;
51646
51647
51648
51649
51650
51651 static inline StringObject *create(JSContext *cx, HandleString str);
51652
51653
51654
51655
51656
51657 static inline StringObject *createWithProto(JSContext *cx, HandleString str, JSObject &proto);
51658
51659 JSString *unbox() const {
51660 return getFixedSlot(PRIMITIVE_VALUE_SLOT).toString();
51661 }
51662
51663 inline size_t length() const {
51664 return size_t(getFixedSlot(LENGTH_SLOT).toInt32());
51665 }
51666
51667 static size_t getPrimitiveValueOffset() {
51668 return getFixedSlotOffset(PRIMITIVE_VALUE_SLOT);
51669 }
51670
51671 private:
51672 inline bool init(JSContext *cx, HandleString str);
51673
51674 void setStringThis(JSString *str) {
51675 do { } while(0);
51676 setFixedSlot(PRIMITIVE_VALUE_SLOT, StringValue(str));
51677 setFixedSlot(LENGTH_SLOT, Int32Value(int32_t(str->length())));
51678 }
51679
51680
51681 friend JSObject *
51682 ::js_InitStringClass(JSContext *cx, JSObject *global);
51683
51684
51685
51686
51687
51688
51689 Shape *assignInitialShape(JSContext *cx);
51690 };
51691
51692 }
51693 # 39 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobjinlines.h" 2
51694
51695 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsatominlines.h" 1
51696
51697
51698
51699
51700
51701
51702
51703 #define jsatominlines_h___
51704
51705
51706
51707
51708
51709
51710 # 1 "./../../dist/include/mozilla/RangedPtr.h" 1
51711 # 14 "./../../dist/include/mozilla/RangedPtr.h"
51712 #define mozilla_RangedPtr_h_
51713
51714
51715
51716
51717
51718 namespace mozilla {
51719 # 41 "./../../dist/include/mozilla/RangedPtr.h"
51720 template <typename T>
51721 class RangedPtr
51722 {
51723 T* ptr;
51724
51725
51726
51727
51728
51729
51730 void checkSanity() {
51731 do { } while(0);
51732 do { } while(0);
51733 }
51734
51735
51736 RangedPtr<T> create(T *ptr) const {
51737
51738
51739
51740 return RangedPtr<T>(ptr, __null, size_t(0));
51741
51742 }
51743
51744 public:
51745 RangedPtr(T* p, T* start, T* end)
51746 : ptr(p)
51747
51748
51749
51750 {
51751 do { } while(0);
51752 checkSanity();
51753 }
51754 RangedPtr(T* p, T* start, size_t length)
51755 : ptr(p)
51756
51757
51758
51759 {
51760 do { } while(0);
51761 do { } while(0);
51762 checkSanity();
51763 }
51764
51765
51766 RangedPtr(T* p, size_t length)
51767 : ptr(p)
51768
51769
51770
51771 {
51772 do { } while(0);
51773 do { } while(0);
51774 checkSanity();
51775 }
51776
51777
51778 template<size_t N>
51779 RangedPtr(T arr[N])
51780 : ptr(arr)
51781
51782
51783
51784 {
51785 checkSanity();
51786 }
51787
51788 T* get() const {
51789 return ptr;
51790 }
51791 # 123 "./../../dist/include/mozilla/RangedPtr.h"
51792 RangedPtr<T>& operator=(const RangedPtr<T>& other) {
51793 do { } while(0);
51794 do { } while(0);
51795 ptr = other.ptr;
51796 checkSanity();
51797 return *this;
51798 }
51799
51800 RangedPtr<T> operator+(size_t inc) {
51801 do { } while(0);
51802 do { } while(0);
51803 return create(ptr + inc);
51804 }
51805
51806 RangedPtr<T> operator-(size_t dec) {
51807 do { } while(0);
51808 do { } while(0);
51809 return create(ptr - dec);
51810 }
51811
51812
51813
51814
51815
51816 template <typename U>
51817 RangedPtr<T>& operator=(U* p) {
51818 *this = create(p);
51819 return *this;
51820 }
51821
51822 template <typename U>
51823 RangedPtr<T>& operator=(const RangedPtr<U>& p) {
51824 do { } while(0);
51825 do { } while(0);
51826 ptr = p.ptr;
51827 checkSanity();
51828 return *this;
51829 }
51830
51831 RangedPtr<T>& operator++() {
51832 return (*this += 1);
51833 }
51834
51835 RangedPtr<T> operator++(int) {
51836 RangedPtr<T> rcp = *this;
51837 ++*this;
51838 return rcp;
51839 }
51840
51841 RangedPtr<T>& operator--() {
51842 return (*this -= 1);
51843 }
51844
51845 RangedPtr<T> operator--(int) {
51846 RangedPtr<T> rcp = *this;
51847 --*this;
51848 return rcp;
51849 }
51850
51851 RangedPtr<T>& operator+=(size_t inc) {
51852 this->operator=<T>(*this + inc);
51853 return *this;
51854 }
51855
51856 RangedPtr<T>& operator-=(size_t dec) {
51857 this->operator=<T>(*this - dec);
51858 return *this;
51859 }
51860
51861 T& operator[](int index) const {
51862 do { } while(0);
51863 return *create(ptr + index);
51864 }
51865
51866 T& operator*() const {
51867 return *ptr;
51868 }
51869
51870 template <typename U>
51871 bool operator==(const RangedPtr<U>& other) const {
51872 return ptr == other.ptr;
51873 }
51874 template <typename U>
51875 bool operator!=(const RangedPtr<U>& other) const {
51876 return !(*this == other);
51877 }
51878
51879 template<typename U>
51880 bool operator==(const U* u) const {
51881 return ptr == u;
51882 }
51883 template<typename U>
51884 bool operator!=(const U* u) const {
51885 return !(*this == u);
51886 }
51887
51888 template <typename U>
51889 bool operator<(const RangedPtr<U>& other) const {
51890 return ptr < other.ptr;
51891 }
51892 template <typename U>
51893 bool operator<=(const RangedPtr<U>& other) const {
51894 return ptr <= other.ptr;
51895 }
51896
51897 template <typename U>
51898 bool operator>(const RangedPtr<U>& other) const {
51899 return ptr > other.ptr;
51900 }
51901 template <typename U>
51902 bool operator>=(const RangedPtr<U>& other) const {
51903 return ptr >= other.ptr;
51904 }
51905
51906 size_t operator-(const RangedPtr<T>& other) const {
51907 do { } while(0);
51908 return PointerRangeSize(other.ptr, ptr);
51909 }
51910
51911 private:
51912 RangedPtr() ;
51913 T* operator&() ;
51914 operator T*() const ;
51915 };
51916
51917 }
51918 # 16 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsatominlines.h" 2
51919
51920
51921 inline JSAtom *
51922 js::AtomStateEntry::asPtr() const
51923 {
51924 do { } while(0);
51925 JSAtom *atom = reinterpret_cast<JSAtom *>(bits & NO_TAG_MASK);
51926 JSString::readBarrier(atom);
51927 return atom;
51928 }
51929
51930 inline bool
51931 js_ValueToAtom(JSContext *cx, const js::Value &v, JSAtom **atomp)
51932 {
51933 if (!v.isString()) {
51934 JSString *str = js::ToStringSlow(cx, v);
51935 if (!str)
51936 return false;
51937 JS::Anchor<JSString *> anchor(str);
51938 *atomp = js_AtomizeString(cx, str);
51939 return !!*atomp;
51940 }
51941
51942 JSString *str = v.toString();
51943 if (str->isAtom()) {
51944 *atomp = &str->asAtom();
51945 return true;
51946 }
51947
51948 *atomp = js_AtomizeString(cx, str);
51949 return !!*atomp;
51950 }
51951
51952 namespace js {
51953
51954 inline bool
51955 ValueToId(JSContext* cx, JSObject *obj, const Value &v, jsid *idp)
51956 {
51957 int32_t i;
51958 if (ValueFitsInInt32(v, &i) && INT_FITS_IN_JSID(i)) {
51959 *idp = INT_TO_JSID(i);
51960 return true;
51961 }
51962
51963 return InternNonIntElementId(cx, obj, v, idp);
51964 }
51965
51966 inline bool
51967 ValueToId(JSContext* cx, const Value &v, jsid *idp)
51968 {
51969 return ValueToId(cx, __null, v, idp);
51970 }
51971 # 76 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsatominlines.h"
51972 template <typename T>
51973 inline mozilla::RangedPtr<T>
51974 BackfillIndexInCharBuffer(uint32_t index, mozilla::RangedPtr<T> end)
51975 {
51976 # 89 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsatominlines.h"
51977 do {
51978 uint32_t next = index / 10, digit = index % 10;
51979 *--end = '0' + digit;
51980 index = next;
51981 } while (index > 0);
51982
51983 return end;
51984 }
51985
51986 inline bool
51987 IndexToId(JSContext *cx, uint32_t index, jsid *idp)
51988 {
51989 MaybeCheckStackRoots(cx);
51990
51991 if (index <= (2147483647)) {
51992 *idp = INT_TO_JSID(index);
51993 return true;
51994 }
51995
51996 extern bool IndexToIdSlow(JSContext *cx, uint32_t index, jsid *idp);
51997 return IndexToIdSlow(cx, index, idp);
51998 }
51999
52000 inline jsid
52001 AtomToId(JSAtom *atom)
52002 {
52003 typedef int moz_static_assert106[(0 == 0) ? 1 : -1];
52004
52005 uint32_t index;
52006 if (atom->isIndex(&index) && index <= (2147483647))
52007 return INT_TO_JSID((int32_t) index);
52008
52009 return JSID_FROM_BITS((size_t)atom);
52010 }
52011
52012 static __attribute__((always_inline)) inline JSFlatString *
52013 IdToString(JSContext *cx, jsid id)
52014 {
52015 if (JSID_IS_STRING(id))
52016 return JSID_TO_ATOM(id);
52017
52018 if ((__builtin_expect((JSID_IS_INT(id)), 1)))
52019 return Int32ToString(cx, JSID_TO_INT(id));
52020
52021 JSString *str = ToStringSlow(cx, IdToValue(id));
52022 if (!str)
52023 return __null;
52024
52025 return str->ensureFlat(cx);
52026 }
52027
52028 inline
52029 AtomHasher::Lookup::Lookup(const JSAtom *atom)
52030 : chars(atom->chars()), length(atom->length()), atom(atom)
52031 {}
52032
52033 inline bool
52034 AtomHasher::match(const AtomStateEntry &entry, const Lookup &lookup)
52035 {
52036 JSAtom *key = entry.asPtr();
52037 if (lookup.atom)
52038 return lookup.atom == key;
52039 if (key->length() != lookup.length)
52040 return false;
52041 return PodEqual(key->chars(), lookup.chars, lookup.length);
52042 }
52043
52044 }
52045 # 41 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobjinlines.h" 2
52046 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsfuninlines.h" 1
52047 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsfuninlines.h"
52048 #define jsfuninlines_h___
52049
52050
52051
52052
52053
52054
52055 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ScopeObject-inl.h" 1
52056 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ScopeObject-inl.h"
52057 #define ScopeObject_inl_h___
52058
52059 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ScopeObject.h" 1
52060 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ScopeObject.h"
52061 #define ScopeObject_h___
52062
52063
52064
52065 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsweakmap.h" 1
52066 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsweakmap.h"
52067 #define jsweakmap_h___
52068 # 19 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsweakmap.h"
52069 namespace js {
52070 # 68 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsweakmap.h"
52071 static WeakMapBase * const WeakMapNotInList = reinterpret_cast<WeakMapBase *>(1);
52072
52073 typedef Vector<WeakMapBase *, 0, SystemAllocPolicy> WeakMapVector;
52074
52075
52076
52077 class WeakMapBase {
52078 public:
52079 WeakMapBase(JSObject *memOf) : memberOf(memOf), next(WeakMapNotInList) { }
52080 virtual ~WeakMapBase() { }
52081
52082 void trace(JSTracer *tracer) {
52083 if (((tracer)->callback == __null || (tracer)->callback == GCMarker::GrayCallback)) {
52084
52085
52086
52087
52088 do { } while(0);
52089
52090
52091
52092 if (next == WeakMapNotInList) {
52093 JSRuntime *rt = tracer->runtime;
52094 next = rt->gcWeakMapList;
52095 rt->gcWeakMapList = this;
52096 }
52097 } else {
52098
52099
52100
52101
52102 if (tracer->eagerlyTraceWeakMaps)
52103 nonMarkingTrace(tracer);
52104 }
52105 }
52106
52107
52108
52109
52110
52111
52112
52113 static bool markAllIteratively(JSTracer *tracer);
52114
52115
52116
52117 static void sweepAll(JSTracer *tracer);
52118
52119
52120 static void traceAllMappings(WeakMapTracer *tracer);
52121
52122 void check() { do { } while(0); }
52123
52124
52125 static void resetWeakMapList(JSRuntime *rt);
52126
52127
52128 static bool saveWeakMapList(JSRuntime *rt, WeakMapVector &vector);
52129 static void restoreWeakMapList(JSRuntime *rt, WeakMapVector &vector);
52130
52131 protected:
52132
52133
52134 virtual void nonMarkingTrace(JSTracer *tracer) = 0;
52135 virtual bool markIteratively(JSTracer *tracer) = 0;
52136 virtual void sweep(JSTracer *tracer) = 0;
52137 virtual void traceMappings(WeakMapTracer *tracer) = 0;
52138
52139
52140 JSObject *memberOf;
52141
52142 private:
52143
52144
52145
52146
52147
52148 WeakMapBase *next;
52149 };
52150
52151 template <class Key, class Value,
52152 class HashPolicy = DefaultHasher<Key> >
52153 class WeakMap : public HashMap<Key, Value, HashPolicy, RuntimeAllocPolicy>, public WeakMapBase {
52154 private:
52155 typedef HashMap<Key, Value, HashPolicy, RuntimeAllocPolicy> Base;
52156 typedef typename Base::Enum Enum;
52157
52158 public:
52159 typedef typename Base::Range Range;
52160
52161 explicit WeakMap(JSRuntime *rt, JSObject *memOf=__null) : Base(rt), WeakMapBase(memOf) { }
52162 explicit WeakMap(JSContext *cx, JSObject *memOf=__null) : Base(cx), WeakMapBase(memOf) { }
52163
52164
52165 Range nondeterministicAll() {
52166 return Base::all();
52167 }
52168
52169 private:
52170 bool markValue(JSTracer *trc, Value *x) {
52171 if (gc::IsMarked(x))
52172 return false;
52173 gc::Mark(trc, x, "WeakMap entry");
52174 return true;
52175 }
52176
52177 void nonMarkingTrace(JSTracer *trc) {
52178 for (Range r = Base::all(); !r.empty(); r.popFront())
52179 markValue(trc, &r.front().value);
52180 }
52181
52182 bool markIteratively(JSTracer *trc) {
52183 bool markedAny = false;
52184 for (Enum e(*this); !e.empty(); e.popFront()) {
52185
52186 Key k(e.front().key);
52187 bool keyIsMarked = gc::IsMarked(&k);
52188 if (keyIsMarked) {
52189 if (markValue(trc, &e.front().value))
52190 markedAny = true;
52191 e.rekeyFront(k);
52192 }
52193 }
52194 return markedAny;
52195 }
52196
52197 void sweep(JSTracer *trc) {
52198
52199 for (Enum e(*this); !e.empty(); e.popFront()) {
52200 Key k(e.front().key);
52201 if (!gc::IsMarked(&k))
52202 e.removeFront();
52203 }
52204 # 216 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsweakmap.h"
52205 }
52206
52207
52208 void traceMappings(WeakMapTracer *tracer) {
52209 for (Range r = Base::all(); !r.empty(); r.popFront()) {
52210 gc::Cell *key = gc::ToMarkable(r.front().key);
52211 gc::Cell *value = gc::ToMarkable(r.front().value);
52212 if (key && value) {
52213 tracer->callback(tracer, memberOf,
52214 key, gc::TraceKind(r.front().key),
52215 value, gc::TraceKind(r.front().value));
52216 }
52217 }
52218 }
52219 };
52220
52221 }
52222
52223 extern JSObject *
52224 js_InitWeakMapClass(JSContext *cx, JSObject *obj);
52225 # 14 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ScopeObject.h" 2
52226
52227 namespace js {
52228 # 33 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ScopeObject.h"
52229 struct ScopeCoordinate
52230 {
52231 uint16_t hops;
52232 uint16_t binding;
52233 inline ScopeCoordinate(jsbytecode *pc);
52234 };
52235
52236 inline JSAtom *
52237 ScopeCoordinateAtom(JSScript *script, jsbytecode *pc);
52238 # 83 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ScopeObject.h"
52239 class ScopeObject : public JSObject
52240 {
52241
52242 void *getPrivate() const;
52243
52244 protected:
52245 static const uint32_t SCOPE_CHAIN_SLOT = 0;
52246
52247 public:
52248
52249
52250
52251
52252
52253 inline JSObject &enclosingScope() const;
52254 inline bool setEnclosingScope(JSContext *cx, HandleObject obj);
52255
52256
52257
52258
52259
52260
52261 inline StackFrame *maybeStackFrame() const;
52262 inline void setStackFrame(StackFrame *frame);
52263
52264
52265 static inline size_t offsetOfEnclosingScope();
52266 };
52267
52268 class CallObject : public ScopeObject
52269 {
52270 static const uint32_t CALLEE_SLOT = 1;
52271
52272 static CallObject *
52273 create(JSContext *cx, JSScript *script, HandleObject enclosing, HandleObject callee);
52274
52275 public:
52276 static const uint32_t RESERVED_SLOTS = 3;
52277
52278 static CallObject *createForFunction(JSContext *cx, StackFrame *fp);
52279 static CallObject *createForStrictEval(JSContext *cx, StackFrame *fp);
52280
52281
52282 inline bool isForEval() const;
52283
52284
52285
52286
52287
52288 inline JSObject *getCallee() const;
52289 inline JSFunction *getCalleeFunction() const;
52290 inline void setCallee(JSObject *callee);
52291
52292
52293 inline const Value &arg(unsigned i) const;
52294 inline void setArg(unsigned i, const Value &v);
52295 inline void initArgUnchecked(unsigned i, const Value &v);
52296
52297
52298 inline const Value &var(unsigned i) const;
52299 inline void setVar(unsigned i, const Value &v);
52300 inline void initVarUnchecked(unsigned i, const Value &v);
52301
52302
52303
52304
52305
52306
52307 inline HeapSlotArray argArray();
52308 inline HeapSlotArray varArray();
52309
52310 inline void copyValues(unsigned nargs, Value *argv, unsigned nvars, Value *slots);
52311
52312 static JSBool getArgOp(JSContext *cx, HandleObject obj, HandleId id, Value *vp);
52313 static JSBool getVarOp(JSContext *cx, HandleObject obj, HandleId id, Value *vp);
52314 static JSBool setArgOp(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, Value *vp);
52315 static JSBool setVarOp(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, Value *vp);
52316
52317
52318 bool containsVarOrArg(PropertyName *name, Value *vp, JSContext *cx);
52319 };
52320
52321 class DeclEnvObject : public ScopeObject
52322 {
52323 public:
52324 static const uint32_t RESERVED_SLOTS = 1;
52325 static const gc::AllocKind FINALIZE_KIND = gc::FINALIZE_OBJECT2;
52326
52327 static DeclEnvObject *create(JSContext *cx, StackFrame *fp);
52328
52329 };
52330
52331 class NestedScopeObject : public ScopeObject
52332 {
52333 protected:
52334 static const unsigned DEPTH_SLOT = 1;
52335
52336 public:
52337
52338 uint32_t stackDepth() const;
52339 };
52340
52341 class WithObject : public NestedScopeObject
52342 {
52343
52344 js::StackFrame *maybeStackFrame() const;
52345 void setStackFrame(StackFrame *frame);
52346
52347 static const unsigned THIS_SLOT = 2;
52348
52349
52350 JSObject *getProto() const;
52351
52352 public:
52353 static const unsigned RESERVED_SLOTS = 3;
52354 static const gc::AllocKind FINALIZE_KIND = gc::FINALIZE_OBJECT4;
52355
52356 static WithObject *
52357 create(JSContext *cx, HandleObject proto, HandleObject enclosing, uint32_t depth);
52358
52359
52360 JSObject &withThis() const;
52361
52362
52363 JSObject &object() const;
52364 };
52365
52366 class BlockObject : public NestedScopeObject
52367 {
52368 public:
52369 static const unsigned RESERVED_SLOTS = 2;
52370 static const gc::AllocKind FINALIZE_KIND = gc::FINALIZE_OBJECT4;
52371
52372
52373 inline uint32_t slotCount() const;
52374
52375 protected:
52376
52377 inline HeapSlot &slotValue(unsigned i);
52378 };
52379
52380 class StaticBlockObject : public BlockObject
52381 {
52382
52383 StackFrame *maybeStackFrame() const;
52384 void setStackFrame(StackFrame *frame);
52385
52386 public:
52387 static StaticBlockObject *create(JSContext *cx);
52388
52389 inline StaticBlockObject *enclosingBlock() const;
52390 inline void setEnclosingBlock(StaticBlockObject *blockObj);
52391
52392 void setStackDepth(uint32_t depth);
52393 bool containsVarAtDepth(uint32_t depth);
52394
52395
52396
52397
52398
52399 void setDefinitionParseNode(unsigned i, Definition *def);
52400 Definition *maybeDefinitionParseNode(unsigned i);
52401
52402
52403
52404
52405
52406 void setAliased(unsigned i, bool aliased);
52407 bool isAliased(unsigned i);
52408
52409
52410
52411
52412
52413 bool needsClone() const;
52414
52415 const Shape *addVar(JSContext *cx, jsid id, int index, bool *redeclared);
52416 };
52417
52418 class ClonedBlockObject : public BlockObject
52419 {
52420 public:
52421 static ClonedBlockObject *create(JSContext *cx, Handle<StaticBlockObject *> block,
52422 StackFrame *fp);
52423
52424
52425 StaticBlockObject &staticBlock() const;
52426
52427
52428
52429
52430
52431 void put(StackFrame *fp);
52432
52433
52434 const Value &closedSlot(unsigned i);
52435
52436
52437 bool containsVar(PropertyName *name, Value *vp, JSContext *cx);
52438 };
52439
52440 template<XDRMode mode>
52441 bool
52442 XDRStaticBlockObject(XDRState<mode> *xdr, JSScript *script, StaticBlockObject **objp);
52443
52444 extern JSObject *
52445 CloneStaticBlockObject(JSContext *cx, StaticBlockObject &srcBlock,
52446 const AutoObjectVector &objects, JSScript *src);
52447 # 307 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ScopeObject.h"
52448 class ScopeIter
52449 {
52450 public:
52451 enum Type { Call, Block, With, StrictEvalScope };
52452
52453 private:
52454 StackFrame *fp_;
52455 JSObject *cur_;
52456 StaticBlockObject *block_;
52457 Type type_;
52458 bool hasScopeObject_;
52459
52460 void settle();
52461
52462 public:
52463
52464 explicit ScopeIter();
52465
52466
52467 explicit ScopeIter(StackFrame *fp);
52468
52469
52470
52471
52472
52473 explicit ScopeIter(JSObject &enclosingScope);
52474
52475
52476
52477
52478
52479 ScopeIter(ScopeIter si, StackFrame *fp);
52480
52481
52482 ScopeIter(StackFrame *fp, ScopeObject &scope);
52483
52484 bool done() const { return !fp_; }
52485
52486
52487
52488 JSObject &enclosingScope() const { do { } while(0); return *cur_; }
52489
52490
52491
52492 ScopeIter enclosing() const;
52493
52494 StackFrame *fp() const { do { } while(0); return fp_; }
52495 Type type() const { do { } while(0); return type_; }
52496 bool hasScopeObject() const { do { } while(0); return hasScopeObject_; }
52497 ScopeObject &scope() const;
52498
52499 StaticBlockObject &staticBlock() const { do { } while(0); return *block_; }
52500
52501
52502 typedef ScopeIter Lookup;
52503 static HashNumber hash(ScopeIter si);
52504 static bool match(ScopeIter si1, ScopeIter si2);
52505 };
52506 # 393 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ScopeObject.h"
52507 extern JSObject *
52508 GetDebugScopeForFunction(JSContext *cx, JSFunction *fun);
52509
52510 extern JSObject *
52511 GetDebugScopeForFrame(JSContext *cx, StackFrame *fp);
52512
52513
52514 class DebugScopeObject : public JSObject
52515 {
52516 static const unsigned ENCLOSING_EXTRA = 0;
52517
52518 public:
52519 static DebugScopeObject *create(JSContext *cx, ScopeObject &scope, JSObject &enclosing);
52520
52521 ScopeObject &scope() const;
52522 JSObject &enclosingScope() const;
52523
52524
52525 bool isForDeclarative() const;
52526 };
52527
52528
52529 class DebugScopes
52530 {
52531
52532 typedef WeakMap<HeapPtrObject, HeapPtrObject> ObjectWeakMap;
52533 ObjectWeakMap proxiedScopes;
52534
52535
52536
52537
52538
52539 typedef HashMap<ScopeIter, DebugScopeObject *, ScopeIter, RuntimeAllocPolicy> MissingScopeMap;
52540 MissingScopeMap missingScopes;
52541
52542 public:
52543 DebugScopes(JSRuntime *rt);
52544 ~DebugScopes();
52545 bool init();
52546
52547 void mark(JSTracer *trc);
52548 void sweep();
52549
52550 DebugScopeObject *hasDebugScope(JSContext *cx, ScopeObject &scope) const;
52551 bool addDebugScope(JSContext *cx, ScopeObject &scope, DebugScopeObject &debugScope);
52552
52553 DebugScopeObject *hasDebugScope(JSContext *cx, ScopeIter si) const;
52554 bool addDebugScope(JSContext *cx, ScopeIter si, DebugScopeObject &debugScope);
52555
52556
52557
52558
52559
52560 void onPopCall(StackFrame *fp);
52561 void onPopBlock(JSContext *cx, StackFrame *fp);
52562 void onGeneratorFrameChange(StackFrame *from, StackFrame *to);
52563 void onCompartmentLeaveDebugMode(JSCompartment *c);
52564 };
52565
52566 }
52567 # 12 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ScopeObject-inl.h" 2
52568
52569 namespace js {
52570
52571 inline
52572 ScopeCoordinate::ScopeCoordinate(jsbytecode *pc)
52573 : hops(((unsigned)(((pc)[1] << 8) | (pc)[2]))), binding(((unsigned)(((pc + 2)[1] << 8) | (pc + 2)[2])))
52574 {
52575 do { } while(0);
52576 }
52577
52578 inline JSAtom *
52579 ScopeCoordinateAtom(JSScript *script, jsbytecode *pc)
52580 {
52581 do { } while(0);
52582 return script->getAtom(GET_UINT32_INDEX(pc + 2 * sizeof(uint16_t)));
52583 }
52584
52585 inline JSObject &
52586 ScopeObject::enclosingScope() const
52587 {
52588 return getReservedSlot(SCOPE_CHAIN_SLOT).toObject();
52589 }
52590
52591 inline bool
52592 ScopeObject::setEnclosingScope(JSContext *cx, HandleObject obj)
52593 {
52594 RootedObject self(cx, this);
52595 if (!obj->setDelegate(cx))
52596 return false;
52597 self->setFixedSlot(SCOPE_CHAIN_SLOT, ObjectValue(*obj));
52598 return true;
52599 }
52600
52601 inline StackFrame *
52602 ScopeObject::maybeStackFrame() const
52603 {
52604 do { } while(0);
52605 return reinterpret_cast<StackFrame *>(JSObject::getPrivate());
52606 }
52607
52608 inline void
52609 ScopeObject::setStackFrame(StackFrame *frame)
52610 {
52611 return setPrivate(frame);
52612 }
52613
52614 inline size_t
52615 ScopeObject::offsetOfEnclosingScope()
52616 {
52617 return getFixedSlotOffset(SCOPE_CHAIN_SLOT);
52618 }
52619
52620 inline bool
52621 CallObject::isForEval() const
52622 {
52623 do { } while(0);
52624 do { } while (0)
52625 ;
52626 return getReservedSlot(CALLEE_SLOT).isNull();
52627 }
52628
52629 inline void
52630 CallObject::setCallee(JSObject *callee)
52631 {
52632 do { } while (0);
52633 setFixedSlot(CALLEE_SLOT, ObjectOrNullValue(callee));
52634 }
52635
52636 inline JSObject *
52637 CallObject::getCallee() const
52638 {
52639 return getReservedSlot(CALLEE_SLOT).toObjectOrNull();
52640 }
52641
52642 inline JSFunction *
52643 CallObject::getCalleeFunction() const
52644 {
52645 return getReservedSlot(CALLEE_SLOT).toObject().toFunction();
52646 }
52647
52648 inline const Value &
52649 CallObject::arg(unsigned i) const
52650 {
52651 do { } while(0);
52652 return getSlot(RESERVED_SLOTS + i);
52653 }
52654
52655 inline void
52656 CallObject::setArg(unsigned i, const Value &v)
52657 {
52658 do { } while(0);
52659 setSlot(RESERVED_SLOTS + i, v);
52660 }
52661
52662 inline void
52663 CallObject::initArgUnchecked(unsigned i, const Value &v)
52664 {
52665 do { } while(0);
52666 initSlotUnchecked(RESERVED_SLOTS + i, v);
52667 }
52668
52669 inline const Value &
52670 CallObject::var(unsigned i) const
52671 {
52672 JSFunction *fun = getCalleeFunction();
52673 do { } while(0);
52674 do { } while(0);
52675 return getSlot(RESERVED_SLOTS + fun->nargs + i);
52676 }
52677
52678 inline void
52679 CallObject::setVar(unsigned i, const Value &v)
52680 {
52681 JSFunction *fun = getCalleeFunction();
52682 do { } while(0);
52683 do { } while(0);
52684 setSlot(RESERVED_SLOTS + fun->nargs + i, v);
52685 }
52686
52687 inline void
52688 CallObject::initVarUnchecked(unsigned i, const Value &v)
52689 {
52690 JSFunction *fun = getCalleeFunction();
52691 do { } while(0);
52692 do { } while(0);
52693 initSlotUnchecked(RESERVED_SLOTS + fun->nargs + i, v);
52694 }
52695
52696 inline void
52697 CallObject::copyValues(unsigned nargs, Value *argv, unsigned nvars, Value *slots)
52698 {
52699 do { } while(0);
52700 copySlotRange(RESERVED_SLOTS, argv, nargs);
52701 copySlotRange(RESERVED_SLOTS + nargs, slots, nvars);
52702 }
52703
52704 inline HeapSlotArray
52705 CallObject::argArray()
52706 {
52707 DebugOnly<JSFunction*> fun = getCalleeFunction();
52708 do { } while(0);
52709 return HeapSlotArray(getSlotAddress(RESERVED_SLOTS));
52710 }
52711
52712 inline HeapSlotArray
52713 CallObject::varArray()
52714 {
52715 JSFunction *fun = getCalleeFunction();
52716 do { } while(0)
52717 ;
52718 return HeapSlotArray(getSlotAddress(RESERVED_SLOTS + fun->nargs));
52719 }
52720
52721 inline uint32_t
52722 NestedScopeObject::stackDepth() const
52723 {
52724 return getReservedSlot(DEPTH_SLOT).toPrivateUint32();
52725 }
52726
52727 inline JSObject &
52728 WithObject::withThis() const
52729 {
52730 return getReservedSlot(THIS_SLOT).toObject();
52731 }
52732
52733 inline JSObject &
52734 WithObject::object() const
52735 {
52736 return *JSObject::getProto();
52737 }
52738
52739 inline uint32_t
52740 BlockObject::slotCount() const
52741 {
52742 return propertyCount();
52743 }
52744
52745 inline HeapSlot &
52746 BlockObject::slotValue(unsigned i)
52747 {
52748 do { } while(0);
52749 return getSlotRef(RESERVED_SLOTS + i);
52750 }
52751
52752 inline StaticBlockObject *
52753 StaticBlockObject::enclosingBlock() const
52754 {
52755 JSObject *obj = getReservedSlot(SCOPE_CHAIN_SLOT).toObjectOrNull();
52756 return obj ? &obj->asStaticBlock() : __null;
52757 }
52758
52759 inline void
52760 StaticBlockObject::setEnclosingBlock(StaticBlockObject *blockObj)
52761 {
52762 setFixedSlot(SCOPE_CHAIN_SLOT, ObjectOrNullValue(blockObj));
52763 }
52764
52765 inline void
52766 StaticBlockObject::setStackDepth(uint32_t depth)
52767 {
52768 do { } while(0);
52769 initReservedSlot(DEPTH_SLOT, PrivateUint32Value(depth));
52770 }
52771
52772 inline void
52773 StaticBlockObject::setDefinitionParseNode(unsigned i, Definition *def)
52774 {
52775 do { } while(0);
52776 slotValue(i).init(this, i, PrivateValue(def));
52777 }
52778
52779 inline Definition *
52780 StaticBlockObject::maybeDefinitionParseNode(unsigned i)
52781 {
52782 Value v = slotValue(i);
52783 return v.isUndefined() ? __null : reinterpret_cast<Definition *>(v.toPrivate());
52784 }
52785
52786 inline void
52787 StaticBlockObject::setAliased(unsigned i, bool aliased)
52788 {
52789 slotValue(i).init(this, i, BooleanValue(aliased));
52790 if (aliased)
52791 JSObject::setPrivate(reinterpret_cast<void *>(1));
52792 }
52793
52794 inline bool
52795 StaticBlockObject::isAliased(unsigned i)
52796 {
52797 return slotValue(i).isTrue();
52798 }
52799
52800 inline bool
52801 StaticBlockObject::needsClone() const
52802 {
52803 return JSObject::getPrivate() != __null;
52804 }
52805
52806 inline bool
52807 StaticBlockObject::containsVarAtDepth(uint32_t depth)
52808 {
52809 return depth >= stackDepth() && depth < stackDepth() + slotCount();
52810 }
52811
52812 inline StaticBlockObject &
52813 ClonedBlockObject::staticBlock() const
52814 {
52815 return getProto()->asStaticBlock();
52816 }
52817
52818 inline const Value &
52819 ClonedBlockObject::closedSlot(unsigned i)
52820 {
52821 do { } while(0);
52822 return slotValue(i);
52823 }
52824
52825 }
52826
52827 inline js::ScopeObject &
52828 JSObject::asScope()
52829 {
52830 do { } while(0);
52831 return *static_cast<js::ScopeObject *>(this);
52832 }
52833
52834 inline js::CallObject &
52835 JSObject::asCall()
52836 {
52837 do { } while(0);
52838 return *static_cast<js::CallObject *>(this);
52839 }
52840
52841 inline js::DeclEnvObject &
52842 JSObject::asDeclEnv()
52843 {
52844 do { } while(0);
52845 return *static_cast<js::DeclEnvObject *>(this);
52846 }
52847
52848 inline js::NestedScopeObject &
52849 JSObject::asNestedScope()
52850 {
52851 do { } while(0);
52852 return *static_cast<js::NestedScopeObject *>(this);
52853 }
52854
52855 inline js::WithObject &
52856 JSObject::asWith()
52857 {
52858 do { } while(0);
52859 return *static_cast<js::WithObject *>(this);
52860 }
52861
52862 inline js::BlockObject &
52863 JSObject::asBlock()
52864 {
52865 do { } while(0);
52866 return *static_cast<js::BlockObject *>(this);
52867 }
52868
52869 inline js::StaticBlockObject &
52870 JSObject::asStaticBlock()
52871 {
52872 do { } while(0);
52873 return *static_cast<js::StaticBlockObject *>(this);
52874 }
52875
52876 inline js::ClonedBlockObject &
52877 JSObject::asClonedBlock()
52878 {
52879 do { } while(0);
52880 return *static_cast<js::ClonedBlockObject *>(this);
52881 }
52882
52883 inline js::DebugScopeObject &
52884 JSObject::asDebugScope()
52885 {
52886 do { } while(0);
52887 return *static_cast<js::DebugScopeObject *>(this);
52888 }
52889 # 17 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsfuninlines.h" 2
52890
52891 inline bool
52892 JSFunction::inStrictMode() const
52893 {
52894 return script()->strictModeCode;
52895 }
52896
52897 inline JSObject *
52898 JSFunction::environment() const
52899 {
52900 do { } while(0);
52901 return u.i.env_;
52902 }
52903
52904 inline void
52905 JSFunction::setEnvironment(JSObject *obj)
52906 {
52907 do { } while(0);
52908 *(js::HeapPtrObject *)&u.i.env_ = obj;
52909 }
52910
52911 inline void
52912 JSFunction::initEnvironment(JSObject *obj)
52913 {
52914 do { } while(0);
52915 ((js::HeapPtrObject *)&u.i.env_)->init(obj);
52916 }
52917
52918 inline void
52919 JSFunction::initializeExtended()
52920 {
52921 do { } while(0);
52922
52923 do { } while(0);
52924 toExtended()->extendedSlots[0].init(js::UndefinedValue());
52925 toExtended()->extendedSlots[1].init(js::UndefinedValue());
52926 }
52927
52928 inline void
52929 JSFunction::setExtendedSlot(size_t which, const js::Value &val)
52930 {
52931 do { } while(0);
52932 toExtended()->extendedSlots[which] = val;
52933 }
52934
52935 inline const js::Value &
52936 JSFunction::getExtendedSlot(size_t which) const
52937 {
52938 do { } while(0);
52939 return toExtended()->extendedSlots[which];
52940 }
52941
52942 namespace js {
52943
52944 static __attribute__((always_inline)) inline bool
52945 IsFunctionObject(const js::Value &v)
52946 {
52947 return v.isObject() && v.toObject().isFunction();
52948 }
52949
52950 static __attribute__((always_inline)) inline bool
52951 IsFunctionObject(const js::Value &v, JSFunction **fun)
52952 {
52953 if (v.isObject() && v.toObject().isFunction()) {
52954 *fun = v.toObject().toFunction();
52955 return true;
52956 }
52957 return false;
52958 }
52959
52960 static __attribute__((always_inline)) inline bool
52961 IsNativeFunction(const js::Value &v)
52962 {
52963 JSFunction *fun;
52964 return IsFunctionObject(v, &fun) && fun->isNative();
52965 }
52966
52967 static __attribute__((always_inline)) inline bool
52968 IsNativeFunction(const js::Value &v, JSFunction **fun)
52969 {
52970 return IsFunctionObject(v, fun) && (*fun)->isNative();
52971 }
52972
52973 static __attribute__((always_inline)) inline bool
52974 IsNativeFunction(const js::Value &v, JSNative native)
52975 {
52976 JSFunction *fun;
52977 return IsFunctionObject(v, &fun) && fun->maybeNative() == native;
52978 }
52979 # 115 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsfuninlines.h"
52980 static __attribute__((always_inline)) inline bool
52981 ClassMethodIsNative(JSContext *cx, HandleObject obj, Class *clasp, HandleId methodid, JSNative native)
52982 {
52983 do { } while(0);
52984
52985 Value v;
52986 if (!HasDataProperty(cx, obj, methodid, &v)) {
52987 RootedObject proto(cx, obj->getProto());
52988 if (!proto || proto->getClass() != clasp || !HasDataProperty(cx, proto, methodid, &v))
52989 return false;
52990 }
52991
52992 return js::IsNativeFunction(v, native);
52993 }
52994
52995 extern __attribute__((always_inline)) inline bool
52996 SameTraceType(const Value &lhs, const Value &rhs)
52997 {
52998 return SameType(lhs, rhs) &&
52999 (lhs.isPrimitive() ||
53000 lhs.toObject().isFunction() == rhs.toObject().isFunction());
53001 }
53002
53003
53004 static __attribute__((always_inline)) inline bool
53005 IsConstructing(const Value *vp)
53006 {
53007 # 151 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsfuninlines.h"
53008 return vp[1].isMagic();
53009 }
53010
53011 inline bool
53012 IsConstructing(CallReceiver call)
53013 {
53014 return IsConstructing(call.base());
53015 }
53016
53017 inline const char *
53018 GetFunctionNameBytes(JSContext *cx, JSFunction *fun, JSAutoByteString *bytes)
53019 {
53020 if (fun->atom)
53021 return bytes->encode(cx, fun->atom);
53022 return js_anonymous_str;
53023 }
53024
53025 extern JSFunctionSpec function_methods[];
53026
53027 extern JSBool
53028 Function(JSContext *cx, unsigned argc, Value *vp);
53029
53030 extern bool
53031 IsBuiltinFunctionConstructor(JSFunction *fun);
53032
53033 static inline JSObject *
53034 SkipScopeParent(JSObject *parent)
53035 {
53036 if (!parent)
53037 return __null;
53038 while (parent->isScope())
53039 parent = &parent->asScope().enclosingScope();
53040 return parent;
53041 }
53042
53043 inline JSFunction *
53044 CloneFunctionObject(JSContext *cx, HandleFunction fun, HandleObject parent,
53045 gc::AllocKind kind = JSFunction::FinalizeKind)
53046 {
53047 do { } while(0);
53048 RootedObject proto(cx, parent->global().getOrCreateFunctionPrototype(cx));
53049 if (!proto)
53050 return __null;
53051
53052 return js_CloneFunctionObject(cx, fun, parent, proto, kind);
53053 }
53054
53055 inline JSFunction *
53056 CloneFunctionObjectIfNotSingleton(JSContext *cx, HandleFunction fun, HandleObject parent)
53057 {
53058
53059
53060
53061
53062
53063
53064
53065 if (fun->hasSingletonType()) {
53066 if (!JSObject::setParent(cx, fun, RootedObject(cx, SkipScopeParent(parent))))
53067 return __null;
53068 fun->setEnvironment(parent);
53069 return fun;
53070 }
53071
53072 return CloneFunctionObject(cx, fun, parent);
53073 }
53074
53075 inline JSFunction *
53076 CloneFunctionObject(JSContext *cx, HandleFunction fun)
53077 {
53078
53079
53080
53081
53082
53083
53084
53085 do { } while(0);
53086
53087 if (fun->hasSingletonType())
53088 return fun;
53089
53090 return js_CloneFunctionObject(cx, fun,
53091 RootedObject(cx, fun->environment()),
53092 RootedObject(cx, fun->getProto()),
53093 JSFunction::ExtendedFinalizeKind);
53094 }
53095
53096 }
53097
53098 inline void
53099 JSFunction::setScript(JSScript *script_)
53100 {
53101 do { } while(0);
53102 mutableScript() = script_;
53103 }
53104
53105 inline void
53106 JSFunction::initScript(JSScript *script_)
53107 {
53108 do { } while(0);
53109 mutableScript().init(script_);
53110 }
53111 # 42 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobjinlines.h" 2
53112 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsgcinlines.h" 1
53113
53114
53115
53116
53117
53118
53119
53120 #define jsgcinlines_h___
53121
53122
53123
53124 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscompartment.h" 1
53125 # 13 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsgcinlines.h" 2
53126
53127
53128
53129
53130
53131
53132 namespace js {
53133
53134 struct Shape;
53135
53136 namespace gc {
53137
53138 inline JSGCTraceKind
53139 GetGCThingTraceKind(const void *thing)
53140 {
53141 do { } while(0);
53142 const Cell *cell = reinterpret_cast<const Cell *>(thing);
53143 return MapAllocToTraceKind(cell->getAllocKind());
53144 }
53145
53146
53147 const size_t SLOTS_TO_THING_KIND_LIMIT = 17;
53148
53149
53150 static inline AllocKind
53151 GetGCObjectKind(size_t numSlots)
53152 {
53153 extern AllocKind slotsToThingKind[];
53154
53155 if (numSlots >= SLOTS_TO_THING_KIND_LIMIT)
53156 return FINALIZE_OBJECT16;
53157 return slotsToThingKind[numSlots];
53158 }
53159
53160 static inline AllocKind
53161 GetGCObjectKind(Class *clasp)
53162 {
53163 if (clasp == &FunctionClass)
53164 return JSFunction::FinalizeKind;
53165 uint32_t nslots = (((clasp)->flags >> 8) & (((uint32_t)1 << (8)) - 1));
53166 if (clasp->flags & (1<<0))
53167 nslots++;
53168 return GetGCObjectKind(nslots);
53169 }
53170
53171
53172 static inline AllocKind
53173 GetGCArrayKind(size_t numSlots)
53174 {
53175 extern AllocKind slotsToThingKind[];
53176
53177
53178
53179
53180
53181
53182
53183 typedef int moz_static_assert107[(ObjectElements::VALUES_PER_HEADER == 2) ? 1 : -1];
53184 if (numSlots > JSObject::NELEMENTS_LIMIT || numSlots + 2 >= SLOTS_TO_THING_KIND_LIMIT)
53185 return FINALIZE_OBJECT2;
53186 return slotsToThingKind[numSlots + 2];
53187 }
53188
53189 static inline AllocKind
53190 GetGCObjectFixedSlotsKind(size_t numFixedSlots)
53191 {
53192 extern AllocKind slotsToThingKind[];
53193
53194 do { } while(0);
53195 return slotsToThingKind[numFixedSlots];
53196 }
53197
53198 static inline bool
53199 IsBackgroundAllocKind(AllocKind kind)
53200 {
53201 do { } while(0);
53202 return kind <= FINALIZE_OBJECT_LAST && kind % 2 == 1;
53203 }
53204
53205 static inline AllocKind
53206 GetBackgroundAllocKind(AllocKind kind)
53207 {
53208 do { } while(0);
53209 return (AllocKind) (kind + 1);
53210 }
53211
53212
53213
53214
53215
53216 static inline bool
53217 TryIncrementAllocKind(AllocKind *kindp)
53218 {
53219 size_t next = size_t(*kindp) + 2;
53220 if (next >= size_t(FINALIZE_OBJECT_LIMIT))
53221 return false;
53222 *kindp = AllocKind(next);
53223 return true;
53224 }
53225
53226
53227 static inline size_t
53228 GetGCKindSlots(AllocKind thingKind)
53229 {
53230
53231 switch (thingKind) {
53232 case FINALIZE_OBJECT0:
53233 case FINALIZE_OBJECT0_BACKGROUND:
53234 return 0;
53235 case FINALIZE_OBJECT2:
53236 case FINALIZE_OBJECT2_BACKGROUND:
53237 return 2;
53238 case FINALIZE_OBJECT4:
53239 case FINALIZE_OBJECT4_BACKGROUND:
53240 return 4;
53241 case FINALIZE_OBJECT8:
53242 case FINALIZE_OBJECT8_BACKGROUND:
53243 return 8;
53244 case FINALIZE_OBJECT12:
53245 case FINALIZE_OBJECT12_BACKGROUND:
53246 return 12;
53247 case FINALIZE_OBJECT16:
53248 case FINALIZE_OBJECT16_BACKGROUND:
53249 return 16;
53250 default:
53251 __builtin_unreachable();
53252 return 0;
53253 }
53254 }
53255
53256 static inline size_t
53257 GetGCKindSlots(AllocKind thingKind, Class *clasp)
53258 {
53259 size_t nslots = GetGCKindSlots(thingKind);
53260
53261
53262 if (clasp->flags & (1<<0)) {
53263 do { } while(0);
53264 nslots--;
53265 }
53266
53267
53268
53269
53270
53271 if (clasp == &FunctionClass)
53272 nslots = 0;
53273
53274 return nslots;
53275 }
53276
53277 static inline void
53278 GCPoke(JSRuntime *rt, Value oldval)
53279 {
53280
53281
53282
53283
53284
53285
53286 rt->gcPoke = true;
53287 # 183 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsgcinlines.h"
53288 }
53289
53290
53291
53292
53293
53294 template <class ArenaOp, class CellOp>
53295 void
53296 ForEachArenaAndCell(JSCompartment *compartment, AllocKind thingKind,
53297 ArenaOp arenaOp, CellOp cellOp)
53298 {
53299 size_t thingSize = Arena::thingSize(thingKind);
53300 ArenaHeader *aheader = compartment->arenas.getFirstArena(thingKind);
53301
53302 for (; aheader; aheader = aheader->next) {
53303 Arena *arena = aheader->getArena();
53304 arenaOp(arena);
53305 FreeSpan firstSpan(aheader->getFirstFreeSpan());
53306 const FreeSpan *span = &firstSpan;
53307
53308 for (uintptr_t thing = arena->thingsStart(thingKind); ; thing += thingSize) {
53309 do { } while(0);
53310 if (thing == span->first) {
53311 if (!span->hasNext())
53312 break;
53313 thing = span->last;
53314 span = span->nextSpan();
53315 } else {
53316 Cell *t = reinterpret_cast<Cell *>(thing);
53317 cellOp(t);
53318 }
53319 }
53320 }
53321 }
53322
53323 class CellIterImpl
53324 {
53325 size_t firstThingOffset;
53326 size_t thingSize;
53327 ArenaHeader *aheader;
53328 FreeSpan firstSpan;
53329 const FreeSpan *span;
53330 uintptr_t thing;
53331 Cell *cell;
53332
53333 protected:
53334 CellIterImpl() {
53335 }
53336
53337 void initSpan(JSCompartment *comp, AllocKind kind) {
53338 do { } while(0);
53339 firstThingOffset = Arena::firstThingOffset(kind);
53340 thingSize = Arena::thingSize(kind);
53341 firstSpan.initAsEmpty();
53342 span = &firstSpan;
53343 thing = span->first;
53344 }
53345
53346 void init(ArenaHeader *singleAheader) {
53347 aheader = singleAheader;
53348 initSpan(aheader->compartment, aheader->getAllocKind());
53349 next();
53350 aheader = __null;
53351 }
53352
53353 void init(JSCompartment *comp, AllocKind kind) {
53354 initSpan(comp, kind);
53355 aheader = comp->arenas.getFirstArena(kind);
53356 next();
53357 }
53358
53359 public:
53360 bool done() const {
53361 return !cell;
53362 }
53363
53364 template<typename T> T *get() const {
53365 do { } while(0);
53366 return static_cast<T *>(cell);
53367 }
53368
53369 Cell *getCell() const {
53370 do { } while(0);
53371 return cell;
53372 }
53373
53374 void next() {
53375 for (;;) {
53376 if (thing != span->first)
53377 break;
53378 if ((__builtin_expect((span->hasNext()), 1))) {
53379 thing = span->last + thingSize;
53380 span = span->nextSpan();
53381 break;
53382 }
53383 if (!aheader) {
53384 cell = __null;
53385 return;
53386 }
53387 firstSpan = aheader->getFirstFreeSpan();
53388 span = &firstSpan;
53389 thing = aheader->arenaAddress() | firstThingOffset;
53390 aheader = aheader->next;
53391 }
53392 cell = reinterpret_cast<Cell *>(thing);
53393 thing += thingSize;
53394 }
53395 };
53396
53397 class CellIterUnderGC : public CellIterImpl
53398 {
53399 public:
53400 CellIterUnderGC(JSCompartment *comp, AllocKind kind) {
53401 do { } while(0);
53402 init(comp, kind);
53403 }
53404
53405 CellIterUnderGC(ArenaHeader *aheader) {
53406 do { } while(0);
53407 init(aheader);
53408 }
53409 };
53410
53411
53412
53413
53414
53415
53416 class CellIter : public CellIterImpl
53417 {
53418 ArenaLists *lists;
53419 AllocKind kind;
53420
53421
53422
53423 public:
53424 CellIter(JSCompartment *comp, AllocKind kind)
53425 : lists(&comp->arenas),
53426 kind(kind)
53427 {
53428
53429
53430
53431
53432
53433
53434 do { } while(0);
53435 if (lists->isSynchronizedFreeList(kind)) {
53436 lists = __null;
53437 } else {
53438 do { } while(0);
53439 lists->copyFreeListToArena(kind);
53440 }
53441
53442
53443
53444
53445 init(comp, kind);
53446 }
53447
53448 ~CellIter() {
53449
53450
53451
53452
53453 if (lists)
53454 lists->clearFreeListInArena(kind);
53455 }
53456 };
53457
53458
53459
53460 inline void EmptyArenaOp(Arena *arena) {}
53461 inline void EmptyCellOp(Cell *t) {}
53462
53463 class GCCompartmentsIter {
53464 private:
53465 JSCompartment **it, **end;
53466
53467 public:
53468 GCCompartmentsIter(JSRuntime *rt) {
53469 do { } while(0);
53470 it = rt->compartments.begin();
53471 end = rt->compartments.end();
53472 if (!(*it)->isCollecting())
53473 next();
53474 }
53475
53476 bool done() const { return it == end; }
53477
53478 void next() {
53479 do { } while(0);
53480 do {
53481 it++;
53482 } while (it != end && !(*it)->isCollecting());
53483 }
53484
53485 JSCompartment *get() const {
53486 do { } while(0);
53487 return *it;
53488 }
53489
53490 operator JSCompartment *() const { return get(); }
53491 JSCompartment *operator->() const { return get(); }
53492 };
53493 # 396 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsgcinlines.h"
53494 template <typename T>
53495 inline T *
53496 NewGCThing(JSContext *cx, js::gc::AllocKind kind, size_t thingSize)
53497 {
53498 do { } while(0);
53499
53500 do { } while (0)
53501 ;
53502
53503 do { } while(0);
53504 do { } while(0);
53505
53506
53507 do {} while(0);
53508
53509
53510
53511
53512
53513
53514 MaybeCheckStackRoots(cx);
53515
53516 JSCompartment *comp = cx->compartment;
53517 void *t = comp->arenas.allocateFromFreeList(kind, thingSize);
53518 if (!t)
53519 t = js::gc::ArenaLists::refillFreeList(cx, kind);
53520
53521 do { } while (0)
53522 ;
53523 return static_cast<T *>(t);
53524 }
53525
53526
53527 template <typename T>
53528 inline T *
53529 TryNewGCThing(JSContext *cx, js::gc::AllocKind kind, size_t thingSize)
53530 {
53531 do { } while(0);
53532
53533 do { } while (0)
53534 ;
53535
53536 do { } while(0);
53537 do { } while(0);
53538
53539
53540
53541
53542
53543
53544 void *t = cx->compartment->arenas.allocateFromFreeList(kind, thingSize);
53545 do { } while (0)
53546 ;
53547 return static_cast<T *>(t);
53548 }
53549
53550 }
53551 }
53552
53553 inline JSObject *
53554 js_NewGCObject(JSContext *cx, js::gc::AllocKind kind)
53555 {
53556 do { } while(0);
53557 return js::gc::NewGCThing<JSObject>(cx, kind, js::gc::Arena::thingSize(kind));
53558 }
53559
53560 inline JSObject *
53561 js_TryNewGCObject(JSContext *cx, js::gc::AllocKind kind)
53562 {
53563 do { } while(0);
53564 return js::gc::TryNewGCThing<JSObject>(cx, kind, js::gc::Arena::thingSize(kind));
53565 }
53566
53567 inline JSString *
53568 js_NewGCString(JSContext *cx)
53569 {
53570 return js::gc::NewGCThing<JSString>(cx, js::gc::FINALIZE_STRING, sizeof(JSString));
53571 }
53572
53573 inline JSShortString *
53574 js_NewGCShortString(JSContext *cx)
53575 {
53576 return js::gc::NewGCThing<JSShortString>(cx, js::gc::FINALIZE_SHORT_STRING, sizeof(JSShortString));
53577 }
53578
53579 inline JSExternalString *
53580 js_NewGCExternalString(JSContext *cx)
53581 {
53582 return js::gc::NewGCThing<JSExternalString>(cx, js::gc::FINALIZE_EXTERNAL_STRING,
53583 sizeof(JSExternalString));
53584 }
53585
53586 inline JSScript *
53587 js_NewGCScript(JSContext *cx)
53588 {
53589 return js::gc::NewGCThing<JSScript>(cx, js::gc::FINALIZE_SCRIPT, sizeof(JSScript));
53590 }
53591
53592 inline js::Shape *
53593 js_NewGCShape(JSContext *cx)
53594 {
53595 return js::gc::NewGCThing<js::Shape>(cx, js::gc::FINALIZE_SHAPE, sizeof(js::Shape));
53596 }
53597
53598 inline js::BaseShape *
53599 js_NewGCBaseShape(JSContext *cx)
53600 {
53601 return js::gc::NewGCThing<js::BaseShape>(cx, js::gc::FINALIZE_BASE_SHAPE, sizeof(js::BaseShape));
53602 }
53603
53604
53605 extern JSXML *
53606 js_NewGCXML(JSContext *cx);
53607 # 43 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobjinlines.h" 2
53608 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinferinlines.h" 1
53609 # 10 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinferinlines.h"
53610 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsanalyze.h" 1
53611 # 10 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsanalyze.h"
53612 #define jsanalyze_h___
53613
53614 # 1 "./jsautooplen.h" 1
53615
53616
53617
53618
53619
53620 #define JSOP_NOP_LENGTH 1
53621 #define JSOP_UNDEFINED_LENGTH 1
53622 #define JSOP_POPV_LENGTH 1
53623 #define JSOP_ENTERWITH_LENGTH 1
53624 #define JSOP_LEAVEWITH_LENGTH 1
53625 #define JSOP_RETURN_LENGTH 1
53626 #define JSOP_GOTO_LENGTH 5
53627 #define JSOP_IFEQ_LENGTH 5
53628 #define JSOP_IFNE_LENGTH 5
53629 #define JSOP_ARGUMENTS_LENGTH 1
53630 #define JSOP_SWAP_LENGTH 1
53631 #define JSOP_POPN_LENGTH 3
53632 #define JSOP_DUP_LENGTH 1
53633 #define JSOP_DUP2_LENGTH 1
53634 #define JSOP_SETCONST_LENGTH 5
53635 #define JSOP_BITOR_LENGTH 1
53636 #define JSOP_BITXOR_LENGTH 1
53637 #define JSOP_BITAND_LENGTH 1
53638 #define JSOP_EQ_LENGTH 1
53639 #define JSOP_NE_LENGTH 1
53640 #define JSOP_LT_LENGTH 1
53641 #define JSOP_LE_LENGTH 1
53642 #define JSOP_GT_LENGTH 1
53643 #define JSOP_GE_LENGTH 1
53644 #define JSOP_LSH_LENGTH 1
53645 #define JSOP_RSH_LENGTH 1
53646 #define JSOP_URSH_LENGTH 1
53647 #define JSOP_ADD_LENGTH 1
53648 #define JSOP_SUB_LENGTH 1
53649 #define JSOP_MUL_LENGTH 1
53650 #define JSOP_DIV_LENGTH 1
53651 #define JSOP_MOD_LENGTH 1
53652 #define JSOP_NOT_LENGTH 1
53653 #define JSOP_BITNOT_LENGTH 1
53654 #define JSOP_NEG_LENGTH 1
53655 #define JSOP_POS_LENGTH 1
53656 #define JSOP_DELNAME_LENGTH 5
53657 #define JSOP_DELPROP_LENGTH 5
53658 #define JSOP_DELELEM_LENGTH 1
53659 #define JSOP_TYPEOF_LENGTH 1
53660 #define JSOP_VOID_LENGTH 1
53661 #define JSOP_INCNAME_LENGTH 6
53662 #define JSOP_INCPROP_LENGTH 6
53663 #define JSOP_INCELEM_LENGTH 2
53664 #define JSOP_DECNAME_LENGTH 6
53665 #define JSOP_DECPROP_LENGTH 6
53666 #define JSOP_DECELEM_LENGTH 2
53667 #define JSOP_NAMEINC_LENGTH 6
53668 #define JSOP_PROPINC_LENGTH 6
53669 #define JSOP_ELEMINC_LENGTH 2
53670 #define JSOP_NAMEDEC_LENGTH 6
53671 #define JSOP_PROPDEC_LENGTH 6
53672 #define JSOP_ELEMDEC_LENGTH 2
53673 #define JSOP_GETPROP_LENGTH 5
53674 #define JSOP_SETPROP_LENGTH 5
53675 #define JSOP_GETELEM_LENGTH 1
53676 #define JSOP_SETELEM_LENGTH 1
53677 #define JSOP_CALLNAME_LENGTH 5
53678 #define JSOP_CALL_LENGTH 3
53679 #define JSOP_NAME_LENGTH 5
53680 #define JSOP_DOUBLE_LENGTH 5
53681 #define JSOP_STRING_LENGTH 5
53682 #define JSOP_ZERO_LENGTH 1
53683 #define JSOP_ONE_LENGTH 1
53684 #define JSOP_NULL_LENGTH 1
53685 #define JSOP_THIS_LENGTH 1
53686 #define JSOP_FALSE_LENGTH 1
53687 #define JSOP_TRUE_LENGTH 1
53688 #define JSOP_OR_LENGTH 5
53689 #define JSOP_AND_LENGTH 5
53690 #define JSOP_TABLESWITCH_LENGTH -1
53691 #define JSOP_LOOKUPSWITCH_LENGTH -1
53692 #define JSOP_STRICTEQ_LENGTH 1
53693 #define JSOP_STRICTNE_LENGTH 1
53694 #define JSOP_SETCALL_LENGTH 1
53695 #define JSOP_ITER_LENGTH 2
53696 #define JSOP_MOREITER_LENGTH 1
53697 #define JSOP_ITERNEXT_LENGTH 2
53698 #define JSOP_ENDITER_LENGTH 1
53699 #define JSOP_FUNAPPLY_LENGTH 3
53700 #define JSOP_OBJECT_LENGTH 5
53701 #define JSOP_POP_LENGTH 1
53702 #define JSOP_NEW_LENGTH 3
53703 #define JSOP_UNUSED0_LENGTH 1
53704 #define JSOP_GETARG_LENGTH 3
53705 #define JSOP_SETARG_LENGTH 3
53706 #define JSOP_GETLOCAL_LENGTH 3
53707 #define JSOP_SETLOCAL_LENGTH 3
53708 #define JSOP_UINT16_LENGTH 3
53709 #define JSOP_NEWINIT_LENGTH 5
53710 #define JSOP_NEWARRAY_LENGTH 4
53711 #define JSOP_NEWOBJECT_LENGTH 5
53712 #define JSOP_ENDINIT_LENGTH 1
53713 #define JSOP_INITPROP_LENGTH 5
53714 #define JSOP_INITELEM_LENGTH 1
53715 #define JSOP_UNUSED14_LENGTH 1
53716 #define JSOP_UNUSED15_LENGTH 1
53717 #define JSOP_INCARG_LENGTH 3
53718 #define JSOP_DECARG_LENGTH 3
53719 #define JSOP_ARGINC_LENGTH 3
53720 #define JSOP_ARGDEC_LENGTH 3
53721 #define JSOP_INCLOCAL_LENGTH 3
53722 #define JSOP_DECLOCAL_LENGTH 3
53723 #define JSOP_LOCALINC_LENGTH 3
53724 #define JSOP_LOCALDEC_LENGTH 3
53725 #define JSOP_LEAVEFORLETIN_LENGTH 1
53726 #define JSOP_LABEL_LENGTH 5
53727 #define JSOP_UNUSED3_LENGTH 1
53728 #define JSOP_FUNCALL_LENGTH 3
53729 #define JSOP_LOOPHEAD_LENGTH 1
53730 #define JSOP_BINDNAME_LENGTH 5
53731 #define JSOP_SETNAME_LENGTH 5
53732 #define JSOP_THROW_LENGTH 1
53733 #define JSOP_IN_LENGTH 1
53734 #define JSOP_INSTANCEOF_LENGTH 1
53735 #define JSOP_DEBUGGER_LENGTH 1
53736 #define JSOP_GOSUB_LENGTH 5
53737 #define JSOP_RETSUB_LENGTH 1
53738 #define JSOP_EXCEPTION_LENGTH 1
53739 #define JSOP_LINENO_LENGTH 3
53740 #define JSOP_CONDSWITCH_LENGTH 1
53741 #define JSOP_CASE_LENGTH 5
53742 #define JSOP_DEFAULT_LENGTH 5
53743 #define JSOP_EVAL_LENGTH 3
53744 #define JSOP_ENUMELEM_LENGTH 1
53745 #define JSOP_GETTER_LENGTH 1
53746 #define JSOP_SETTER_LENGTH 1
53747 #define JSOP_DEFFUN_LENGTH 5
53748 #define JSOP_DEFCONST_LENGTH 5
53749 #define JSOP_DEFVAR_LENGTH 5
53750 #define JSOP_LAMBDA_LENGTH 5
53751 #define JSOP_CALLEE_LENGTH 1
53752 #define JSOP_UNUSED31_LENGTH 1
53753 #define JSOP_PICK_LENGTH 2
53754 #define JSOP_TRY_LENGTH 1
53755 #define JSOP_FINALLY_LENGTH 1
53756 #define JSOP_GETALIASEDVAR_LENGTH 9
53757 #define JSOP_CALLALIASEDVAR_LENGTH 9
53758 #define JSOP_SETALIASEDVAR_LENGTH 9
53759 #define JSOP_INCALIASEDVAR_LENGTH 10
53760 #define JSOP_DECALIASEDVAR_LENGTH 10
53761 #define JSOP_ALIASEDVARINC_LENGTH 10
53762 #define JSOP_ALIASEDVARDEC_LENGTH 10
53763 #define JSOP_UNUSED8_LENGTH 1
53764 #define JSOP_UNUSED9_LENGTH 1
53765 #define JSOP_UNUSED10_LENGTH 1
53766 #define JSOP_UNUSED11_LENGTH 1
53767 #define JSOP_UNUSED12_LENGTH 1
53768 #define JSOP_UNUSED13_LENGTH 1
53769 #define JSOP_BACKPATCH_LENGTH 5
53770 #define JSOP_BACKPATCH_POP_LENGTH 5
53771 #define JSOP_THROWING_LENGTH 1
53772 #define JSOP_SETRVAL_LENGTH 1
53773 #define JSOP_RETRVAL_LENGTH 1
53774 #define JSOP_GETGNAME_LENGTH 5
53775 #define JSOP_SETGNAME_LENGTH 5
53776 #define JSOP_INCGNAME_LENGTH 6
53777 #define JSOP_DECGNAME_LENGTH 6
53778 #define JSOP_GNAMEINC_LENGTH 6
53779 #define JSOP_GNAMEDEC_LENGTH 6
53780 #define JSOP_REGEXP_LENGTH 5
53781 #define JSOP_DEFXMLNS_LENGTH 1
53782 #define JSOP_ANYNAME_LENGTH 1
53783 #define JSOP_QNAMEPART_LENGTH 5
53784 #define JSOP_QNAMECONST_LENGTH 5
53785 #define JSOP_QNAME_LENGTH 1
53786 #define JSOP_TOATTRNAME_LENGTH 1
53787 #define JSOP_TOATTRVAL_LENGTH 1
53788 #define JSOP_ADDATTRNAME_LENGTH 1
53789 #define JSOP_ADDATTRVAL_LENGTH 1
53790 #define JSOP_BINDXMLNAME_LENGTH 1
53791 #define JSOP_SETXMLNAME_LENGTH 1
53792 #define JSOP_XMLNAME_LENGTH 1
53793 #define JSOP_DESCENDANTS_LENGTH 1
53794 #define JSOP_FILTER_LENGTH 5
53795 #define JSOP_ENDFILTER_LENGTH 5
53796 #define JSOP_TOXML_LENGTH 1
53797 #define JSOP_TOXMLLIST_LENGTH 1
53798 #define JSOP_XMLTAGEXPR_LENGTH 1
53799 #define JSOP_XMLELTEXPR_LENGTH 1
53800 #define JSOP_XMLCDATA_LENGTH 5
53801 #define JSOP_XMLCOMMENT_LENGTH 5
53802 #define JSOP_XMLPI_LENGTH 5
53803 #define JSOP_DELDESC_LENGTH 1
53804 #define JSOP_CALLPROP_LENGTH 5
53805 #define JSOP_ENTERLET0_LENGTH 5
53806 #define JSOP_ENTERLET1_LENGTH 5
53807 #define JSOP_UINT24_LENGTH 4
53808 #define JSOP_UNUSED18_LENGTH 1
53809 #define JSOP_UNUSED19_LENGTH 1
53810 #define JSOP_UNUSED20_LENGTH 1
53811 #define JSOP_STARTXML_LENGTH 1
53812 #define JSOP_STARTXMLEXPR_LENGTH 1
53813 #define JSOP_CALLELEM_LENGTH 1
53814 #define JSOP_STOP_LENGTH 1
53815 #define JSOP_GETXPROP_LENGTH 5
53816 #define JSOP_CALLXMLNAME_LENGTH 1
53817 #define JSOP_TYPEOFEXPR_LENGTH 1
53818 #define JSOP_ENTERBLOCK_LENGTH 5
53819 #define JSOP_LEAVEBLOCK_LENGTH 3
53820 #define JSOP_UNUSED1_LENGTH 1
53821 #define JSOP_UNUSED2_LENGTH 1
53822 #define JSOP_GENERATOR_LENGTH 1
53823 #define JSOP_YIELD_LENGTH 1
53824 #define JSOP_ARRAYPUSH_LENGTH 3
53825 #define JSOP_GETFUNNS_LENGTH 1
53826 #define JSOP_ENUMCONSTELEM_LENGTH 1
53827 #define JSOP_LEAVEBLOCKEXPR_LENGTH 3
53828 #define JSOP_UNUSED21_LENGTH 1
53829 #define JSOP_UNUSED22_LENGTH 1
53830 #define JSOP_UNUSED23_LENGTH 1
53831 #define JSOP_CALLGNAME_LENGTH 5
53832 #define JSOP_CALLLOCAL_LENGTH 3
53833 #define JSOP_CALLARG_LENGTH 3
53834 #define JSOP_BINDGNAME_LENGTH 5
53835 #define JSOP_INT8_LENGTH 2
53836 #define JSOP_INT32_LENGTH 5
53837 #define JSOP_LENGTH_LENGTH 5
53838 #define JSOP_HOLE_LENGTH 1
53839 #define JSOP_UNUSED17_LENGTH 1
53840 #define JSOP_UNUSED24_LENGTH 1
53841 #define JSOP_UNUSED25_LENGTH 1
53842 #define JSOP_UNUSED29_LENGTH 1
53843 #define JSOP_UNUSED30_LENGTH 1
53844 #define JSOP_REST_LENGTH 1
53845 #define JSOP_TOID_LENGTH 1
53846 #define JSOP_IMPLICITTHIS_LENGTH 5
53847 #define JSOP_LOOPENTRY_LENGTH 1
53848 #define JSOP_ACTUALSFILLED_LENGTH 3
53849 # 13 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsanalyze.h" 2
53850
53851
53852
53853
53854
53855
53856
53857 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ScopeObject.h" 1
53858 # 21 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsanalyze.h" 2
53859
53860 struct JSScript;
53861
53862
53863 namespace js { namespace mjit { struct RegisterAllocation; } }
53864
53865 namespace js {
53866 namespace analyze {
53867 # 59 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsanalyze.h"
53868 class Bytecode
53869 {
53870 friend class ScriptAnalysis;
53871
53872 public:
53873 Bytecode() { PodZero(this); }
53874
53875
53876
53877
53878 bool jumpTarget : 1;
53879
53880
53881 bool fallthrough : 1;
53882
53883
53884 bool jumpFallthrough : 1;
53885
53886
53887 bool switchTarget : 1;
53888
53889
53890
53891
53892
53893 bool unconditional : 1;
53894
53895
53896 bool analyzed : 1;
53897
53898
53899 bool exceptionEntry : 1;
53900
53901
53902 bool inTryBlock : 1;
53903
53904
53905 bool inLoop : 1;
53906
53907
53908 bool safePoint : 1;
53909
53910
53911
53912
53913
53914 bool monitoredTypes : 1;
53915
53916
53917 bool monitoredTypesReturn : 1;
53918
53919
53920
53921
53922
53923 bool arrayWriteHole: 1;
53924 bool getStringElement:1;
53925 bool accessGetter: 1;
53926
53927
53928 uint32_t stackDepth;
53929
53930 private:
53931
53932 union {
53933
53934 types::TypeSet *observedTypes;
53935
53936
53937 LoopAnalysis *loop;
53938 };
53939
53940
53941
53942
53943 mjit::RegisterAllocation *allocation;
53944
53945
53946
53947
53948 SSAValue *poppedValues;
53949
53950
53951 SSAUseChain **pushedUses;
53952
53953 union {
53954
53955
53956
53957
53958
53959
53960 SlotValue *newValues;
53961 # 161 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsanalyze.h"
53962 Vector<SlotValue> *pendingValues;
53963 };
53964
53965
53966
53967
53968 types::TypeSet *pushedTypes;
53969
53970
53971 types::TypeBarrier *typeBarriers;
53972 };
53973
53974 static inline unsigned
53975 GetDefCount(JSScript *script, unsigned offset)
53976 {
53977 do { } while(0);
53978 jsbytecode *pc = script->code + offset;
53979
53980
53981
53982
53983
53984 switch (JSOp(*pc)) {
53985 case JSOP_OR:
53986 case JSOP_AND:
53987 return 1;
53988 case JSOP_FILTER:
53989 return 2;
53990 case JSOP_PICK:
53991
53992
53993
53994
53995
53996
53997 return (pc[1] + 1);
53998 default:
53999 return StackDefs(script, pc);
54000 }
54001 }
54002
54003 static inline unsigned
54004 GetUseCount(JSScript *script, unsigned offset)
54005 {
54006 do { } while(0);
54007 jsbytecode *pc = script->code + offset;
54008
54009 if (JSOp(*pc) == JSOP_PICK)
54010 return (pc[1] + 1);
54011 if (js_CodeSpec[*pc].nuses == -1)
54012 return StackUses(script, pc);
54013 return js_CodeSpec[*pc].nuses;
54014 }
54015
54016
54017
54018
54019
54020 static inline bool
54021 ExtendedDef(jsbytecode *pc)
54022 {
54023 switch ((JSOp)*pc) {
54024 case JSOP_SETARG:
54025 case JSOP_INCARG:
54026 case JSOP_DECARG:
54027 case JSOP_ARGINC:
54028 case JSOP_ARGDEC:
54029 case JSOP_SETLOCAL:
54030 case JSOP_INCLOCAL:
54031 case JSOP_DECLOCAL:
54032 case JSOP_LOCALINC:
54033 case JSOP_LOCALDEC:
54034 return true;
54035 default:
54036 return false;
54037 }
54038 }
54039
54040
54041 static inline bool
54042 BytecodeNoFallThrough(JSOp op)
54043 {
54044 switch (op) {
54045 case JSOP_GOTO:
54046 case JSOP_DEFAULT:
54047 case JSOP_RETURN:
54048 case JSOP_STOP:
54049 case JSOP_RETRVAL:
54050 case JSOP_THROW:
54051 case JSOP_TABLESWITCH:
54052 case JSOP_LOOKUPSWITCH:
54053 case JSOP_FILTER:
54054 return true;
54055 case JSOP_GOSUB:
54056
54057 return false;
54058 default:
54059 return false;
54060 }
54061 }
54062
54063
54064
54065
54066
54067 static inline bool
54068 ExtendedUse(jsbytecode *pc)
54069 {
54070 if (ExtendedDef(pc))
54071 return true;
54072 switch ((JSOp)*pc) {
54073 case JSOP_GETARG:
54074 case JSOP_CALLARG:
54075 case JSOP_GETLOCAL:
54076 case JSOP_CALLLOCAL:
54077 return true;
54078 default:
54079 return false;
54080 }
54081 }
54082
54083 static inline JSOp
54084 ReverseCompareOp(JSOp op)
54085 {
54086 switch (op) {
54087 case JSOP_GT:
54088 return JSOP_LT;
54089 case JSOP_GE:
54090 return JSOP_LE;
54091 case JSOP_LT:
54092 return JSOP_GT;
54093 case JSOP_LE:
54094 return JSOP_GE;
54095 default:
54096 __builtin_unreachable();
54097 return op;
54098 }
54099 }
54100
54101 static inline unsigned
54102 FollowBranch(JSContext *cx, JSScript *script, unsigned offset)
54103 {
54104
54105
54106
54107
54108
54109 jsbytecode *pc = script->code + offset;
54110 unsigned targetOffset = offset + GET_JUMP_OFFSET(pc);
54111 if (targetOffset < offset) {
54112 jsbytecode *target = script->code + targetOffset;
54113 JSOp nop = JSOp(*target);
54114 if (nop == JSOP_GOTO)
54115 return targetOffset + GET_JUMP_OFFSET(target);
54116 }
54117 return targetOffset;
54118 }
54119
54120
54121 static inline uint32_t CalleeSlot() {
54122 return 0;
54123 }
54124 static inline uint32_t ThisSlot() {
54125 return 1;
54126 }
54127 static inline uint32_t ArgSlot(uint32_t arg) {
54128 return 2 + arg;
54129 }
54130 static inline uint32_t LocalSlot(JSScript *script, uint32_t local) {
54131 return 2 + (script->function() ? script->function()->nargs : 0) + local;
54132 }
54133 static inline uint32_t TotalSlots(JSScript *script) {
54134 return LocalSlot(script, 0) + script->nfixed;
54135 }
54136
54137 static inline uint32_t StackSlot(JSScript *script, uint32_t index) {
54138 return TotalSlots(script) + index;
54139 }
54140
54141 static inline uint32_t GetBytecodeSlot(JSScript *script, jsbytecode *pc)
54142 {
54143 switch (JSOp(*pc)) {
54144
54145 case JSOP_GETARG:
54146 case JSOP_CALLARG:
54147 case JSOP_SETARG:
54148 case JSOP_INCARG:
54149 case JSOP_DECARG:
54150 case JSOP_ARGINC:
54151 case JSOP_ARGDEC:
54152 return ArgSlot(((unsigned)(((pc)[1] << 8) | (pc)[2])));
54153
54154 case JSOP_GETLOCAL:
54155 case JSOP_CALLLOCAL:
54156 case JSOP_SETLOCAL:
54157 case JSOP_INCLOCAL:
54158 case JSOP_DECLOCAL:
54159 case JSOP_LOCALINC:
54160 case JSOP_LOCALDEC:
54161 return LocalSlot(script, ((unsigned)(((pc)[1] << 8) | (pc)[2])));
54162
54163 case JSOP_GETALIASEDVAR:
54164 case JSOP_CALLALIASEDVAR:
54165 case JSOP_SETALIASEDVAR:
54166 {
54167 ScopeCoordinate sc = ScopeCoordinate(pc);
54168 return script->bindings.bindingIsArg(sc.binding)
54169 ? ArgSlot(script->bindings.bindingToArg(sc.binding))
54170 : LocalSlot(script, script->bindings.bindingToLocal(sc.binding));
54171 }
54172
54173
54174 case JSOP_THIS:
54175 return ThisSlot();
54176
54177 default:
54178 __builtin_unreachable();
54179 return 0;
54180 }
54181 }
54182
54183
54184 static inline bool
54185 BytecodeUpdatesSlot(JSOp op)
54186 {
54187 switch (op) {
54188 case JSOP_SETARG:
54189 case JSOP_SETLOCAL:
54190 case JSOP_INCARG:
54191 case JSOP_DECARG:
54192 case JSOP_ARGINC:
54193 case JSOP_ARGDEC:
54194 case JSOP_INCLOCAL:
54195 case JSOP_DECLOCAL:
54196 case JSOP_LOCALINC:
54197 case JSOP_LOCALDEC:
54198 return true;
54199 default:
54200 return false;
54201 }
54202 }
54203
54204 static inline int32_t
54205 GetBytecodeInteger(jsbytecode *pc)
54206 {
54207 switch (JSOp(*pc)) {
54208 case JSOP_ZERO: return 0;
54209 case JSOP_ONE: return 1;
54210 case JSOP_UINT16: return ((unsigned)(((pc)[1] << 8) | (pc)[2]));
54211 case JSOP_UINT24: return ((jsatomid)(((pc)[1] << 16) | ((pc)[2] << 8) | (pc)[3]));
54212 case JSOP_INT8: return (int8_t((pc)[1]));
54213 case JSOP_INT32: return (((uint32_t((pc)[1]) << 24) | (uint32_t((pc)[2]) << 16) | (uint32_t((pc)[3]) << 8) | uint32_t((pc)[4])));
54214 default:
54215 __builtin_unreachable();
54216 return 0;
54217 }
54218 }
54219 # 426 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsanalyze.h"
54220 struct Lifetime
54221 {
54222
54223
54224
54225
54226 uint32_t start;
54227 uint32_t end;
54228
54229
54230
54231
54232
54233 uint32_t savedEnd;
54234
54235
54236
54237
54238
54239
54240 bool loopTail;
54241
54242
54243
54244
54245
54246 bool write;
54247
54248
54249 Lifetime *next;
54250
54251 Lifetime(uint32_t offset, uint32_t savedEnd, Lifetime *next)
54252 : start(offset), end(offset), savedEnd(savedEnd),
54253 loopTail(false), write(false), next(next)
54254 {}
54255 };
54256
54257
54258 class LoopAnalysis
54259 {
54260 public:
54261
54262 LoopAnalysis *parent;
54263
54264
54265 uint32_t head;
54266
54267
54268
54269
54270
54271 uint32_t backedge;
54272
54273
54274 uint32_t entry;
54275
54276
54277
54278
54279
54280
54281
54282 uint32_t lastBlock;
54283
54284
54285
54286
54287
54288 bool hasSafePoints;
54289
54290
54291 bool hasCallsLoops;
54292 };
54293
54294
54295 struct LifetimeVariable
54296 {
54297
54298 Lifetime *lifetime;
54299
54300
54301 Lifetime *saved;
54302
54303
54304 uint32_t savedEnd : 31;
54305
54306
54307 bool ensured : 1;
54308
54309
54310 Lifetime * live(uint32_t offset) const {
54311 if (lifetime && lifetime->end >= offset)
54312 return lifetime;
54313 Lifetime *segment = lifetime ? lifetime : saved;
54314 while (segment && segment->start <= offset) {
54315 if (segment->end >= offset)
54316 return segment;
54317 segment = segment->next;
54318 }
54319 return __null;
54320 }
54321
54322
54323
54324
54325
54326 uint32_t firstWrite(uint32_t start, uint32_t end) const {
54327 Lifetime *segment = lifetime ? lifetime : saved;
54328 while (segment && segment->start <= end) {
54329 if (segment->start >= start && segment->write)
54330 return segment->start;
54331 segment = segment->next;
54332 }
54333 return (4294967295U);
54334 }
54335 uint32_t firstWrite(LoopAnalysis *loop) const {
54336 return firstWrite(loop->head, loop->backedge);
54337 }
54338
54339
54340 bool nonDecreasing(JSScript *script, LoopAnalysis *loop) const {
54341 Lifetime *segment = lifetime ? lifetime : saved;
54342 while (segment && segment->start <= loop->backedge) {
54343 if (segment->start >= loop->head && segment->write) {
54344 switch (JSOp(script->code[segment->start])) {
54345 case JSOP_INCLOCAL:
54346 case JSOP_LOCALINC:
54347 case JSOP_INCARG:
54348 case JSOP_ARGINC:
54349 break;
54350 default:
54351 return false;
54352 }
54353 }
54354 segment = segment->next;
54355 }
54356 return true;
54357 }
54358
54359
54360
54361
54362
54363 uint32_t onlyWrite(LoopAnalysis *loop) const {
54364 uint32_t offset = (4294967295U);
54365 Lifetime *segment = lifetime ? lifetime : saved;
54366 while (segment && segment->start <= loop->backedge) {
54367 if (segment->start >= loop->head && segment->write) {
54368 if (offset != (4294967295U))
54369 return (4294967295U);
54370 offset = segment->start;
54371 }
54372 segment = segment->next;
54373 }
54374 return offset;
54375 }
54376
54377
54378
54379
54380 };
54381
54382 struct SSAPhiNode;
54383
54384
54385
54386
54387
54388
54389
54390 class SSAValue
54391 {
54392 friend class ScriptAnalysis;
54393
54394 public:
54395 enum Kind {
54396 EMPTY = 0,
54397 PUSHED = 1,
54398 VAR = 2,
54399 PHI = 3
54400 };
54401
54402 Kind kind() const {
54403 do { } while(0);
54404
54405
54406 return (Kind) (u.pushed.kind & 0x3);
54407 }
54408
54409 bool operator==(const SSAValue &o) const {
54410 return !memcmp(this, &o, sizeof(SSAValue));
54411 }
54412
54413
54414
54415 uint32_t pushedOffset() const {
54416 do { } while(0);
54417 return u.pushed.offset;
54418 }
54419
54420 uint32_t pushedIndex() const {
54421 do { } while(0);
54422 return u.pushed.index;
54423 }
54424
54425
54426
54427 bool varInitial() const {
54428 do { } while(0);
54429 return u.var.initial;
54430 }
54431
54432 uint32_t varSlot() const {
54433 do { } while(0);
54434 return u.var.slot;
54435 }
54436
54437 uint32_t varOffset() const {
54438 do { } while(0);
54439 return u.var.offset;
54440 }
54441
54442
54443
54444 uint32_t phiSlot() const;
54445 uint32_t phiLength() const;
54446 const SSAValue &phiValue(uint32_t i) const;
54447 types::TypeSet *phiTypes() const;
54448
54449
54450 uint32_t phiOffset() const {
54451 do { } while(0);
54452 return u.phi.offset;
54453 }
54454
54455 SSAPhiNode *phiNode() const {
54456 do { } while(0);
54457 return u.phi.node;
54458 }
54459
54460
54461
54462
54463
54464
54465
54466 void clear() {
54467 PodZero(this);
54468 do { } while(0);
54469 }
54470
54471 void initPushed(uint32_t offset, uint32_t index) {
54472 clear();
54473 u.pushed.kind = PUSHED;
54474 u.pushed.offset = offset;
54475 u.pushed.index = index;
54476 }
54477
54478 static SSAValue PushedValue(uint32_t offset, uint32_t index) {
54479 SSAValue v;
54480 v.initPushed(offset, index);
54481 return v;
54482 }
54483
54484 void initInitial(uint32_t slot) {
54485 clear();
54486 u.var.kind = VAR;
54487 u.var.initial = true;
54488 u.var.slot = slot;
54489 }
54490
54491 void initWritten(uint32_t slot, uint32_t offset) {
54492 clear();
54493 u.var.kind = VAR;
54494 u.var.initial = false;
54495 u.var.slot = slot;
54496 u.var.offset = offset;
54497 }
54498
54499 static SSAValue WrittenVar(uint32_t slot, uint32_t offset) {
54500 SSAValue v;
54501 v.initWritten(slot, offset);
54502 return v;
54503 }
54504
54505 void initPhi(uint32_t offset, SSAPhiNode *node) {
54506 clear();
54507 u.phi.kind = PHI;
54508 u.phi.offset = offset;
54509 u.phi.node = node;
54510 }
54511
54512 static SSAValue PhiValue(uint32_t offset, SSAPhiNode *node) {
54513 SSAValue v;
54514 v.initPhi(offset, node);
54515 return v;
54516 }
54517
54518 private:
54519 union {
54520 struct {
54521 Kind kind : 2;
54522 uint32_t offset : 30;
54523 uint32_t index;
54524 } pushed;
54525 struct {
54526 Kind kind : 2;
54527 bool initial : 1;
54528 uint32_t slot : 29;
54529 uint32_t offset;
54530 } var;
54531 struct {
54532 Kind kind : 2;
54533 uint32_t offset : 30;
54534 SSAPhiNode *node;
54535 } phi;
54536 } u;
54537 };
54538
54539
54540
54541
54542
54543
54544
54545 struct SSAPhiNode
54546 {
54547 types::TypeSet types;
54548 uint32_t slot;
54549 uint32_t length;
54550 SSAValue *options;
54551 SSAUseChain *uses;
54552 SSAPhiNode() { PodZero(this); }
54553 };
54554
54555 inline uint32_t
54556 SSAValue::phiSlot() const
54557 {
54558 return u.phi.node->slot;
54559 }
54560
54561 inline uint32_t
54562 SSAValue::phiLength() const
54563 {
54564 do { } while(0);
54565 return u.phi.node->length;
54566 }
54567
54568 inline const SSAValue &
54569 SSAValue::phiValue(uint32_t i) const
54570 {
54571 do { } while(0);
54572 return u.phi.node->options[i];
54573 }
54574
54575 inline types::TypeSet *
54576 SSAValue::phiTypes() const
54577 {
54578 do { } while(0);
54579 return &u.phi.node->types;
54580 }
54581
54582 class SSAUseChain
54583 {
54584 public:
54585 bool popped : 1;
54586 uint32_t offset : 31;
54587
54588 union {
54589 uint32_t which;
54590 SSAPhiNode *phi;
54591 } u;
54592 SSAUseChain *next;
54593
54594 SSAUseChain() { PodZero(this); }
54595 };
54596
54597 class SlotValue
54598 {
54599 public:
54600 uint32_t slot;
54601 SSAValue value;
54602 SlotValue(uint32_t slot, const SSAValue &value) : slot(slot), value(value) {}
54603 };
54604
54605 struct NeedsArgsObjState;
54606
54607
54608 class ScriptAnalysis
54609 {
54610 friend class Bytecode;
54611
54612 JSScript *script;
54613
54614 Bytecode **codeArray;
54615
54616 uint32_t numSlots;
54617
54618 bool outOfMemory;
54619 bool hadFailure;
54620
54621 bool *escapedSlots;
54622
54623
54624 bool ranBytecode_;
54625 bool ranSSA_;
54626 bool ranLifetimes_;
54627 bool ranInference_;
54628 # 842 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsanalyze.h"
54629 bool usesReturnValue_:1;
54630 bool usesScopeChain_:1;
54631 bool usesThisValue_:1;
54632 bool hasFunctionCalls_:1;
54633 bool modifiesArguments_:1;
54634 bool extendsScope_:1;
54635 bool addsScopeObjects_:1;
54636 bool localsAliasStack_:1;
54637 bool isInlineable:1;
54638 bool isJaegerCompileable:1;
54639 bool canTrackVars:1;
54640
54641 uint32_t numReturnSites_;
54642
54643
54644
54645 LifetimeVariable *lifetimes;
54646
54647 public:
54648
54649 ScriptAnalysis(JSScript *script) {
54650 PodZero(this);
54651 this->script = script;
54652
54653
54654
54655 }
54656
54657 bool ranBytecode() { return ranBytecode_; }
54658 bool ranSSA() { return ranSSA_; }
54659 bool ranLifetimes() { return ranLifetimes_; }
54660 bool ranInference() { return ranInference_; }
54661
54662 void analyzeBytecode(JSContext *cx);
54663 void analyzeSSA(JSContext *cx);
54664 void analyzeLifetimes(JSContext *cx);
54665 void analyzeTypes(JSContext *cx);
54666
54667
54668 void analyzeTypesNew(JSContext *cx);
54669
54670 bool OOM() { return outOfMemory; }
54671 bool failed() { return hadFailure; }
54672 bool inlineable(uint32_t argc) { return isInlineable && argc == script->function()->nargs; }
54673 bool jaegerCompileable() { return isJaegerCompileable; }
54674
54675
54676 bool usesReturnValue() const { return usesReturnValue_; }
54677
54678
54679 bool usesScopeChain() const { return usesScopeChain_; }
54680
54681 bool usesThisValue() const { return usesThisValue_; }
54682 bool hasFunctionCalls() const { return hasFunctionCalls_; }
54683 uint32_t numReturnSites() const { return numReturnSites_; }
54684
54685
54686
54687
54688
54689 bool modifiesArguments() { return modifiesArguments_; }
54690
54691
54692
54693
54694
54695 bool extendsScope() { return extendsScope_; }
54696
54697
54698 bool addsScopeObjects() { return addsScopeObjects_; }
54699
54700
54701
54702
54703
54704 bool localsAliasStack() { return localsAliasStack_; }
54705
54706
54707
54708 Bytecode& getCode(uint32_t offset) {
54709 do { } while(0);
54710 do { } while(0);
54711 return *codeArray[offset];
54712 }
54713 Bytecode& getCode(const jsbytecode *pc) { return getCode(pc - script->code); }
54714
54715 Bytecode* maybeCode(uint32_t offset) {
54716 do { } while(0);
54717 return codeArray[offset];
54718 }
54719 Bytecode* maybeCode(const jsbytecode *pc) { return maybeCode(pc - script->code); }
54720
54721 bool jumpTarget(uint32_t offset) {
54722 do { } while(0);
54723 return codeArray[offset] && codeArray[offset]->jumpTarget;
54724 }
54725 bool jumpTarget(const jsbytecode *pc) { return jumpTarget(pc - script->code); }
54726
54727 bool popGuaranteed(jsbytecode *pc) {
54728 jsbytecode *next = pc + GetBytecodeLength(pc);
54729 return JSOp(*next) == JSOP_POP && !jumpTarget(next);
54730 }
54731
54732 bool incrementInitialValueObserved(jsbytecode *pc) {
54733 const JSCodeSpec *cs = &js_CodeSpec[*pc];
54734 return (cs->format & (1U<<12)) && !popGuaranteed(pc);
54735 }
54736
54737 types::TypeSet *bytecodeTypes(const jsbytecode *pc) {
54738 do { } while(0);
54739 return getCode(pc).observedTypes;
54740 }
54741
54742 const SSAValue &poppedValue(uint32_t offset, uint32_t which) {
54743 do { } while(0);
54744 do { } while(0)
54745 ;
54746 return getCode(offset).poppedValues[which];
54747 }
54748 const SSAValue &poppedValue(const jsbytecode *pc, uint32_t which) {
54749 return poppedValue(pc - script->code, which);
54750 }
54751
54752 const SlotValue *newValues(uint32_t offset) {
54753 do { } while(0);
54754 return getCode(offset).newValues;
54755 }
54756 const SlotValue *newValues(const jsbytecode *pc) { return newValues(pc - script->code); }
54757
54758 types::TypeSet *pushedTypes(uint32_t offset, uint32_t which = 0) {
54759 do { } while(0);
54760 do { } while(0)
54761 ;
54762 types::TypeSet *array = getCode(offset).pushedTypes;
54763 do { } while(0);
54764 return array + which;
54765 }
54766 types::TypeSet *pushedTypes(const jsbytecode *pc, uint32_t which) {
54767 return pushedTypes(pc - script->code, which);
54768 }
54769
54770 bool hasPushedTypes(const jsbytecode *pc) { return getCode(pc).pushedTypes != __null; }
54771
54772 types::TypeBarrier *typeBarriers(JSContext *cx, uint32_t offset) {
54773 if (getCode(offset).typeBarriers)
54774 pruneTypeBarriers(cx, offset);
54775 return getCode(offset).typeBarriers;
54776 }
54777 types::TypeBarrier *typeBarriers(JSContext *cx, const jsbytecode *pc) {
54778 return typeBarriers(cx, pc - script->code);
54779 }
54780 void addTypeBarrier(JSContext *cx, const jsbytecode *pc,
54781 types::TypeSet *target, types::Type type);
54782 void addSingletonTypeBarrier(JSContext *cx, const jsbytecode *pc,
54783 types::TypeSet *target, JSObject *singleton, jsid singletonId);
54784
54785
54786 void pruneTypeBarriers(JSContext *cx, uint32_t offset);
54787
54788
54789
54790
54791
54792
54793 void breakTypeBarriers(JSContext *cx, uint32_t offset, bool all);
54794
54795
54796 void breakTypeBarriersSSA(JSContext *cx, const SSAValue &v);
54797
54798 inline void addPushedType(JSContext *cx, uint32_t offset, uint32_t which, types::Type type);
54799
54800 types::TypeSet *getValueTypes(const SSAValue &v) {
54801 switch (v.kind()) {
54802 case SSAValue::PUSHED:
54803 return pushedTypes(v.pushedOffset(), v.pushedIndex());
54804 case SSAValue::VAR:
54805 do { } while(0);
54806 if (v.varInitial()) {
54807 return types::TypeScript::SlotTypes(script, v.varSlot());
54808 } else {
54809
54810
54811
54812
54813
54814
54815 return pushedTypes(v.varOffset(), 0);
54816 }
54817 case SSAValue::PHI:
54818 return &v.phiNode()->types;
54819 default:
54820
54821 __builtin_unreachable();
54822 return __null;
54823 }
54824 }
54825
54826 types::TypeSet *poppedTypes(uint32_t offset, uint32_t which) {
54827 return getValueTypes(poppedValue(offset, which));
54828 }
54829 types::TypeSet *poppedTypes(const jsbytecode *pc, uint32_t which) {
54830 return getValueTypes(poppedValue(pc, which));
54831 }
54832
54833
54834 bool integerOperation(JSContext *cx, jsbytecode *pc);
54835
54836 bool trackUseChain(const SSAValue &v) {
54837 do { } while (0);
54838 return v.kind() != SSAValue::EMPTY &&
54839 (v.kind() != SSAValue::VAR || !v.varInitial());
54840 }
54841
54842
54843
54844
54845
54846 SSAUseChain *& useChain(const SSAValue &v) {
54847 do { } while(0);
54848 if (v.kind() == SSAValue::PUSHED)
54849 return getCode(v.pushedOffset()).pushedUses[v.pushedIndex()];
54850 if (v.kind() == SSAValue::VAR)
54851 return getCode(v.varOffset()).pushedUses[GetDefCount(script, v.varOffset())];
54852 return v.phiNode()->uses;
54853 }
54854
54855 mjit::RegisterAllocation *&getAllocation(uint32_t offset) {
54856 do { } while(0);
54857 return getCode(offset).allocation;
54858 }
54859 mjit::RegisterAllocation *&getAllocation(const jsbytecode *pc) {
54860 return getAllocation(pc - script->code);
54861 }
54862
54863 LoopAnalysis *getLoop(uint32_t offset) {
54864 do { } while(0);
54865 return getCode(offset).loop;
54866 }
54867 LoopAnalysis *getLoop(const jsbytecode *pc) { return getLoop(pc - script->code); }
54868
54869
54870 jsbytecode *getCallPC(jsbytecode *pc)
54871 {
54872 SSAUseChain *uses = useChain(SSAValue::PushedValue(pc - script->code, 0));
54873 do { } while(0);
54874 do { } while(0);
54875 return script->code + uses->offset;
54876 }
54877 # 1100 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsanalyze.h"
54878 bool slotEscapes(uint32_t slot) {
54879 do { } while(0);
54880 if (slot >= numSlots)
54881 return true;
54882 return escapedSlots[slot];
54883 }
54884
54885
54886
54887
54888
54889
54890
54891 bool trackSlot(uint32_t slot) { return !slotEscapes(slot) && canTrackVars && slot < 1000; }
54892
54893 const LifetimeVariable & liveness(uint32_t slot) {
54894 do { } while(0);
54895 do { } while(0);
54896 return lifetimes[slot];
54897 }
54898
54899
54900
54901
54902
54903 struct NameAccess {
54904 JSScript *script;
54905 types::TypeScriptNesting *nesting;
54906 uint32_t slot;
54907
54908
54909 bool arg;
54910 uint32_t index;
54911
54912 const Value **basePointer() const {
54913 return arg ? &nesting->argArray : &nesting->varArray;
54914 }
54915 };
54916 NameAccess resolveNameAccess(JSContext *cx, jsid id, bool addDependency = false);
54917
54918 void printSSA(JSContext *cx);
54919 void printTypes(JSContext *cx);
54920
54921 void clearAllocations();
54922
54923 private:
54924 void setOOM(JSContext *cx) {
54925 if (!outOfMemory)
54926 js_ReportOutOfMemory(cx);
54927 outOfMemory = true;
54928 hadFailure = true;
54929 }
54930
54931
54932 inline bool addJump(JSContext *cx, unsigned offset,
54933 unsigned *currentOffset, unsigned *forwardJump, unsigned *forwardLoop,
54934 unsigned stackDepth);
54935
54936
54937 inline void addVariable(JSContext *cx, LifetimeVariable &var, unsigned offset,
54938 LifetimeVariable **&saved, unsigned &savedCount);
54939 inline void killVariable(JSContext *cx, LifetimeVariable &var, unsigned offset,
54940 LifetimeVariable **&saved, unsigned &savedCount);
54941 inline void extendVariable(JSContext *cx, LifetimeVariable &var, unsigned start, unsigned end);
54942 inline void ensureVariable(LifetimeVariable &var, unsigned until);
54943
54944
54945 struct SSAValueInfo
54946 {
54947 SSAValue v;
54948
54949
54950
54951
54952
54953
54954 int32_t branchSize;
54955 };
54956
54957
54958 bool makePhi(JSContext *cx, uint32_t slot, uint32_t offset, SSAValue *pv);
54959 void insertPhi(JSContext *cx, SSAValue &phi, const SSAValue &v);
54960 void mergeValue(JSContext *cx, uint32_t offset, const SSAValue &v, SlotValue *pv);
54961 void checkPendingValue(JSContext *cx, const SSAValue &v, uint32_t slot,
54962 Vector<SlotValue> *pending);
54963 void checkBranchTarget(JSContext *cx, uint32_t targetOffset, Vector<uint32_t> &branchTargets,
54964 SSAValueInfo *values, uint32_t stackDepth);
54965 void checkExceptionTarget(JSContext *cx, uint32_t catchOffset,
54966 Vector<uint32_t> &exceptionTargets);
54967 void mergeBranchTarget(JSContext *cx, SSAValueInfo &value, uint32_t slot,
54968 const Vector<uint32_t> &branchTargets, uint32_t currentOffset);
54969 void mergeExceptionTarget(JSContext *cx, const SSAValue &value, uint32_t slot,
54970 const Vector<uint32_t> &exceptionTargets);
54971 void mergeAllExceptionTargets(JSContext *cx, SSAValueInfo *values,
54972 const Vector<uint32_t> &exceptionTargets);
54973 void freezeNewValues(JSContext *cx, uint32_t offset);
54974
54975 struct TypeInferenceState {
54976 Vector<SSAPhiNode *> phiNodes;
54977 bool hasGetSet;
54978 bool hasHole;
54979 types::TypeSet *forTypes;
54980 TypeInferenceState(JSContext *cx)
54981 : phiNodes(cx), hasGetSet(false), hasHole(false), forTypes(__null)
54982 {}
54983 };
54984
54985
54986 bool analyzeTypesBytecode(JSContext *cx, unsigned offset, TypeInferenceState &state);
54987 bool needsArgsObj(NeedsArgsObjState &state, const SSAValue &v);
54988 bool needsArgsObj(NeedsArgsObjState &state, SSAUseChain *use);
54989 bool needsArgsObj(JSContext *cx);
54990
54991 public:
54992
54993
54994
54995 void assertMatchingDebugMode() { }
54996
54997 };
54998
54999
55000 class AutoEnterAnalysis
55001 {
55002 JSCompartment *compartment;
55003 bool oldActiveAnalysis;
55004 bool left;
55005
55006 void construct(JSCompartment *compartment)
55007 {
55008 this->compartment = compartment;
55009 oldActiveAnalysis = compartment->activeAnalysis;
55010 compartment->activeAnalysis = true;
55011 left = false;
55012 }
55013
55014 public:
55015 AutoEnterAnalysis(JSContext *cx) { construct(cx->compartment); }
55016 AutoEnterAnalysis(JSCompartment *compartment) { construct(compartment); }
55017
55018 void leave()
55019 {
55020 if (!left) {
55021 left = true;
55022 compartment->activeAnalysis = oldActiveAnalysis;
55023 }
55024 }
55025
55026 ~AutoEnterAnalysis()
55027 {
55028 leave();
55029 }
55030 };
55031
55032
55033 struct CrossSSAValue
55034 {
55035 unsigned frame;
55036 SSAValue v;
55037 CrossSSAValue(unsigned frame, const SSAValue &v) : frame(frame), v(v) {}
55038 };
55039
55040
55041
55042
55043
55044
55045 class CrossScriptSSA
55046 {
55047 public:
55048
55049 static const uint32_t OUTER_FRAME = (4294967295U);
55050 static const unsigned INVALID_FRAME = uint32_t(-2);
55051
55052 struct Frame {
55053 uint32_t index;
55054 JSScript *script;
55055 uint32_t depth;
55056 uint32_t parent;
55057 jsbytecode *parentpc;
55058
55059 Frame(uint32_t index, JSScript *script, uint32_t depth, uint32_t parent, jsbytecode *parentpc)
55060 : index(index), script(script), depth(depth), parent(parent), parentpc(parentpc)
55061 {}
55062 };
55063
55064 const Frame &getFrame(uint32_t index) {
55065 if (index == OUTER_FRAME)
55066 return outerFrame;
55067 return inlineFrames[index];
55068 }
55069
55070 unsigned numFrames() { return 1 + inlineFrames.length(); }
55071 const Frame &iterFrame(unsigned i) {
55072 if (i == 0)
55073 return outerFrame;
55074 return inlineFrames[i - 1];
55075 }
55076
55077 JSScript *outerScript() { return outerFrame.script; }
55078
55079
55080 size_t frameLength(uint32_t index) {
55081 if (index == OUTER_FRAME)
55082 return 0;
55083 size_t res = outerFrame.script->length;
55084 for (unsigned i = 0; i < index; i++)
55085 res += inlineFrames[i].script->length;
55086 return res;
55087 }
55088
55089 types::TypeSet *getValueTypes(const CrossSSAValue &cv) {
55090 return getFrame(cv.frame).script->analysis()->getValueTypes(cv.v);
55091 }
55092
55093 bool addInlineFrame(JSScript *script, uint32_t depth, uint32_t parent, jsbytecode *parentpc)
55094 {
55095 uint32_t index = inlineFrames.length();
55096 return inlineFrames.append(Frame(index, script, depth, parent, parentpc));
55097 }
55098
55099 CrossScriptSSA(JSContext *cx, JSScript *outer)
55100 : cx(cx), outerFrame(OUTER_FRAME, outer, 0, INVALID_FRAME, __null), inlineFrames(cx)
55101 {}
55102
55103 CrossSSAValue foldValue(const CrossSSAValue &cv);
55104
55105 private:
55106 JSContext *cx;
55107
55108 Frame outerFrame;
55109 Vector<Frame> inlineFrames;
55110 };
55111
55112
55113
55114
55115
55116 }
55117 }
55118
55119 namespace js {
55120 namespace tl {
55121
55122 template <> struct IsPodType<js::analyze::LifetimeVariable> { static const bool result = true; };
55123 template <> struct IsPodType<js::analyze::LoopAnalysis> { static const bool result = true; };
55124 template <> struct IsPodType<js::analyze::SlotValue> { static const bool result = true; };
55125 template <> struct IsPodType<js::analyze::SSAValue> { static const bool result = true; };
55126 template <> struct IsPodType<js::analyze::SSAUseChain> { static const bool result = true; };
55127
55128 }
55129 }
55130 # 11 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinferinlines.h" 2
55131
55132
55133 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsprf.h" 1
55134
55135
55136
55137
55138
55139
55140 #define jsprf_h___
55141 # 29 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsprf.h"
55142 # 1 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stdarg.h" 1 3 4
55143 # 31 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stdarg.h" 3 4
55144 #define _STDARG_H
55145 #define _ANSI_STDARG_H_
55146
55147 #undef __need___va_list
55148 # 47 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stdarg.h" 3 4
55149 #define va_start(v,l) __builtin_va_start(v,l)
55150 #define va_end(v) __builtin_va_end(v)
55151 #define va_arg(v,l) __builtin_va_arg(v,l)
55152
55153 #define va_copy(d,s) __builtin_va_copy(d,s)
55154
55155 #define __va_copy(d,s) __builtin_va_copy(d,s)
55156 # 108 "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.5.4/include/stdarg.h" 3 4
55157 #define _VA_LIST_
55158
55159
55160 #define _VA_LIST
55161
55162
55163
55164
55165
55166 #define _VA_LIST_T_H
55167
55168
55169 #define __va_list__
55170 # 30 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsprf.h" 2
55171
55172 extern "C" {
55173
55174
55175
55176
55177
55178
55179 extern __attribute__((visibility("default"))) uint32_t JS_snprintf(char *out, uint32_t outlen, const char *fmt, ...);
55180
55181
55182
55183
55184
55185
55186 extern __attribute__((visibility("default"))) char* JS_smprintf(const char *fmt, ...);
55187
55188
55189
55190
55191 extern __attribute__((visibility("default"))) void JS_smprintf_free(char *mem);
55192 # 59 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsprf.h"
55193 extern __attribute__((visibility("default"))) char* JS_sprintf_append(char *last, const char *fmt, ...);
55194 # 68 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsprf.h"
55195 typedef int (*JSStuffFunc)(void *arg, const char *s, uint32_t slen);
55196
55197 extern __attribute__((visibility("default"))) uint32_t JS_sxprintf(JSStuffFunc f, void *arg, const char *fmt, ...);
55198
55199
55200
55201
55202 extern __attribute__((visibility("default"))) uint32_t JS_vsnprintf(char *out, uint32_t outlen, const char *fmt, va_list ap);
55203 extern __attribute__((visibility("default"))) char* JS_vsmprintf(const char *fmt, va_list ap);
55204 extern __attribute__((visibility("default"))) char* JS_vsprintf_append(char *last, const char *fmt, va_list ap);
55205 extern __attribute__((visibility("default"))) uint32_t JS_vsxprintf(JSStuffFunc f, void *arg, const char *fmt, va_list ap);
55206
55207 }
55208 # 14 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinferinlines.h" 2
55209
55210
55211
55212
55213 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack-inl.h" 1
55214 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack-inl.h"
55215 #define Stack_inl_h__
55216
55217
55218
55219
55220 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/methodjit/MethodJIT.h" 1
55221 # 15 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack-inl.h" 2
55222 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack.h" 1
55223 # 16 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack-inl.h" 2
55224
55225 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscriptinlines.h" 1
55226 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscriptinlines.h"
55227 #define jsscriptinlines_h___
55228
55229 # 1 "./jsautooplen.h" 1
55230
55231
55232
55233
55234
55235 #define JSOP_NOP_LENGTH 1
55236 #define JSOP_UNDEFINED_LENGTH 1
55237 #define JSOP_POPV_LENGTH 1
55238 #define JSOP_ENTERWITH_LENGTH 1
55239 #define JSOP_LEAVEWITH_LENGTH 1
55240 #define JSOP_RETURN_LENGTH 1
55241 #define JSOP_GOTO_LENGTH 5
55242 #define JSOP_IFEQ_LENGTH 5
55243 #define JSOP_IFNE_LENGTH 5
55244 #define JSOP_ARGUMENTS_LENGTH 1
55245 #define JSOP_SWAP_LENGTH 1
55246 #define JSOP_POPN_LENGTH 3
55247 #define JSOP_DUP_LENGTH 1
55248 #define JSOP_DUP2_LENGTH 1
55249 #define JSOP_SETCONST_LENGTH 5
55250 #define JSOP_BITOR_LENGTH 1
55251 #define JSOP_BITXOR_LENGTH 1
55252 #define JSOP_BITAND_LENGTH 1
55253 #define JSOP_EQ_LENGTH 1
55254 #define JSOP_NE_LENGTH 1
55255 #define JSOP_LT_LENGTH 1
55256 #define JSOP_LE_LENGTH 1
55257 #define JSOP_GT_LENGTH 1
55258 #define JSOP_GE_LENGTH 1
55259 #define JSOP_LSH_LENGTH 1
55260 #define JSOP_RSH_LENGTH 1
55261 #define JSOP_URSH_LENGTH 1
55262 #define JSOP_ADD_LENGTH 1
55263 #define JSOP_SUB_LENGTH 1
55264 #define JSOP_MUL_LENGTH 1
55265 #define JSOP_DIV_LENGTH 1
55266 #define JSOP_MOD_LENGTH 1
55267 #define JSOP_NOT_LENGTH 1
55268 #define JSOP_BITNOT_LENGTH 1
55269 #define JSOP_NEG_LENGTH 1
55270 #define JSOP_POS_LENGTH 1
55271 #define JSOP_DELNAME_LENGTH 5
55272 #define JSOP_DELPROP_LENGTH 5
55273 #define JSOP_DELELEM_LENGTH 1
55274 #define JSOP_TYPEOF_LENGTH 1
55275 #define JSOP_VOID_LENGTH 1
55276 #define JSOP_INCNAME_LENGTH 6
55277 #define JSOP_INCPROP_LENGTH 6
55278 #define JSOP_INCELEM_LENGTH 2
55279 #define JSOP_DECNAME_LENGTH 6
55280 #define JSOP_DECPROP_LENGTH 6
55281 #define JSOP_DECELEM_LENGTH 2
55282 #define JSOP_NAMEINC_LENGTH 6
55283 #define JSOP_PROPINC_LENGTH 6
55284 #define JSOP_ELEMINC_LENGTH 2
55285 #define JSOP_NAMEDEC_LENGTH 6
55286 #define JSOP_PROPDEC_LENGTH 6
55287 #define JSOP_ELEMDEC_LENGTH 2
55288 #define JSOP_GETPROP_LENGTH 5
55289 #define JSOP_SETPROP_LENGTH 5
55290 #define JSOP_GETELEM_LENGTH 1
55291 #define JSOP_SETELEM_LENGTH 1
55292 #define JSOP_CALLNAME_LENGTH 5
55293 #define JSOP_CALL_LENGTH 3
55294 #define JSOP_NAME_LENGTH 5
55295 #define JSOP_DOUBLE_LENGTH 5
55296 #define JSOP_STRING_LENGTH 5
55297 #define JSOP_ZERO_LENGTH 1
55298 #define JSOP_ONE_LENGTH 1
55299 #define JSOP_NULL_LENGTH 1
55300 #define JSOP_THIS_LENGTH 1
55301 #define JSOP_FALSE_LENGTH 1
55302 #define JSOP_TRUE_LENGTH 1
55303 #define JSOP_OR_LENGTH 5
55304 #define JSOP_AND_LENGTH 5
55305 #define JSOP_TABLESWITCH_LENGTH -1
55306 #define JSOP_LOOKUPSWITCH_LENGTH -1
55307 #define JSOP_STRICTEQ_LENGTH 1
55308 #define JSOP_STRICTNE_LENGTH 1
55309 #define JSOP_SETCALL_LENGTH 1
55310 #define JSOP_ITER_LENGTH 2
55311 #define JSOP_MOREITER_LENGTH 1
55312 #define JSOP_ITERNEXT_LENGTH 2
55313 #define JSOP_ENDITER_LENGTH 1
55314 #define JSOP_FUNAPPLY_LENGTH 3
55315 #define JSOP_OBJECT_LENGTH 5
55316 #define JSOP_POP_LENGTH 1
55317 #define JSOP_NEW_LENGTH 3
55318 #define JSOP_UNUSED0_LENGTH 1
55319 #define JSOP_GETARG_LENGTH 3
55320 #define JSOP_SETARG_LENGTH 3
55321 #define JSOP_GETLOCAL_LENGTH 3
55322 #define JSOP_SETLOCAL_LENGTH 3
55323 #define JSOP_UINT16_LENGTH 3
55324 #define JSOP_NEWINIT_LENGTH 5
55325 #define JSOP_NEWARRAY_LENGTH 4
55326 #define JSOP_NEWOBJECT_LENGTH 5
55327 #define JSOP_ENDINIT_LENGTH 1
55328 #define JSOP_INITPROP_LENGTH 5
55329 #define JSOP_INITELEM_LENGTH 1
55330 #define JSOP_UNUSED14_LENGTH 1
55331 #define JSOP_UNUSED15_LENGTH 1
55332 #define JSOP_INCARG_LENGTH 3
55333 #define JSOP_DECARG_LENGTH 3
55334 #define JSOP_ARGINC_LENGTH 3
55335 #define JSOP_ARGDEC_LENGTH 3
55336 #define JSOP_INCLOCAL_LENGTH 3
55337 #define JSOP_DECLOCAL_LENGTH 3
55338 #define JSOP_LOCALINC_LENGTH 3
55339 #define JSOP_LOCALDEC_LENGTH 3
55340 #define JSOP_LEAVEFORLETIN_LENGTH 1
55341 #define JSOP_LABEL_LENGTH 5
55342 #define JSOP_UNUSED3_LENGTH 1
55343 #define JSOP_FUNCALL_LENGTH 3
55344 #define JSOP_LOOPHEAD_LENGTH 1
55345 #define JSOP_BINDNAME_LENGTH 5
55346 #define JSOP_SETNAME_LENGTH 5
55347 #define JSOP_THROW_LENGTH 1
55348 #define JSOP_IN_LENGTH 1
55349 #define JSOP_INSTANCEOF_LENGTH 1
55350 #define JSOP_DEBUGGER_LENGTH 1
55351 #define JSOP_GOSUB_LENGTH 5
55352 #define JSOP_RETSUB_LENGTH 1
55353 #define JSOP_EXCEPTION_LENGTH 1
55354 #define JSOP_LINENO_LENGTH 3
55355 #define JSOP_CONDSWITCH_LENGTH 1
55356 #define JSOP_CASE_LENGTH 5
55357 #define JSOP_DEFAULT_LENGTH 5
55358 #define JSOP_EVAL_LENGTH 3
55359 #define JSOP_ENUMELEM_LENGTH 1
55360 #define JSOP_GETTER_LENGTH 1
55361 #define JSOP_SETTER_LENGTH 1
55362 #define JSOP_DEFFUN_LENGTH 5
55363 #define JSOP_DEFCONST_LENGTH 5
55364 #define JSOP_DEFVAR_LENGTH 5
55365 #define JSOP_LAMBDA_LENGTH 5
55366 #define JSOP_CALLEE_LENGTH 1
55367 #define JSOP_UNUSED31_LENGTH 1
55368 #define JSOP_PICK_LENGTH 2
55369 #define JSOP_TRY_LENGTH 1
55370 #define JSOP_FINALLY_LENGTH 1
55371 #define JSOP_GETALIASEDVAR_LENGTH 9
55372 #define JSOP_CALLALIASEDVAR_LENGTH 9
55373 #define JSOP_SETALIASEDVAR_LENGTH 9
55374 #define JSOP_INCALIASEDVAR_LENGTH 10
55375 #define JSOP_DECALIASEDVAR_LENGTH 10
55376 #define JSOP_ALIASEDVARINC_LENGTH 10
55377 #define JSOP_ALIASEDVARDEC_LENGTH 10
55378 #define JSOP_UNUSED8_LENGTH 1
55379 #define JSOP_UNUSED9_LENGTH 1
55380 #define JSOP_UNUSED10_LENGTH 1
55381 #define JSOP_UNUSED11_LENGTH 1
55382 #define JSOP_UNUSED12_LENGTH 1
55383 #define JSOP_UNUSED13_LENGTH 1
55384 #define JSOP_BACKPATCH_LENGTH 5
55385 #define JSOP_BACKPATCH_POP_LENGTH 5
55386 #define JSOP_THROWING_LENGTH 1
55387 #define JSOP_SETRVAL_LENGTH 1
55388 #define JSOP_RETRVAL_LENGTH 1
55389 #define JSOP_GETGNAME_LENGTH 5
55390 #define JSOP_SETGNAME_LENGTH 5
55391 #define JSOP_INCGNAME_LENGTH 6
55392 #define JSOP_DECGNAME_LENGTH 6
55393 #define JSOP_GNAMEINC_LENGTH 6
55394 #define JSOP_GNAMEDEC_LENGTH 6
55395 #define JSOP_REGEXP_LENGTH 5
55396 #define JSOP_DEFXMLNS_LENGTH 1
55397 #define JSOP_ANYNAME_LENGTH 1
55398 #define JSOP_QNAMEPART_LENGTH 5
55399 #define JSOP_QNAMECONST_LENGTH 5
55400 #define JSOP_QNAME_LENGTH 1
55401 #define JSOP_TOATTRNAME_LENGTH 1
55402 #define JSOP_TOATTRVAL_LENGTH 1
55403 #define JSOP_ADDATTRNAME_LENGTH 1
55404 #define JSOP_ADDATTRVAL_LENGTH 1
55405 #define JSOP_BINDXMLNAME_LENGTH 1
55406 #define JSOP_SETXMLNAME_LENGTH 1
55407 #define JSOP_XMLNAME_LENGTH 1
55408 #define JSOP_DESCENDANTS_LENGTH 1
55409 #define JSOP_FILTER_LENGTH 5
55410 #define JSOP_ENDFILTER_LENGTH 5
55411 #define JSOP_TOXML_LENGTH 1
55412 #define JSOP_TOXMLLIST_LENGTH 1
55413 #define JSOP_XMLTAGEXPR_LENGTH 1
55414 #define JSOP_XMLELTEXPR_LENGTH 1
55415 #define JSOP_XMLCDATA_LENGTH 5
55416 #define JSOP_XMLCOMMENT_LENGTH 5
55417 #define JSOP_XMLPI_LENGTH 5
55418 #define JSOP_DELDESC_LENGTH 1
55419 #define JSOP_CALLPROP_LENGTH 5
55420 #define JSOP_ENTERLET0_LENGTH 5
55421 #define JSOP_ENTERLET1_LENGTH 5
55422 #define JSOP_UINT24_LENGTH 4
55423 #define JSOP_UNUSED18_LENGTH 1
55424 #define JSOP_UNUSED19_LENGTH 1
55425 #define JSOP_UNUSED20_LENGTH 1
55426 #define JSOP_STARTXML_LENGTH 1
55427 #define JSOP_STARTXMLEXPR_LENGTH 1
55428 #define JSOP_CALLELEM_LENGTH 1
55429 #define JSOP_STOP_LENGTH 1
55430 #define JSOP_GETXPROP_LENGTH 5
55431 #define JSOP_CALLXMLNAME_LENGTH 1
55432 #define JSOP_TYPEOFEXPR_LENGTH 1
55433 #define JSOP_ENTERBLOCK_LENGTH 5
55434 #define JSOP_LEAVEBLOCK_LENGTH 3
55435 #define JSOP_UNUSED1_LENGTH 1
55436 #define JSOP_UNUSED2_LENGTH 1
55437 #define JSOP_GENERATOR_LENGTH 1
55438 #define JSOP_YIELD_LENGTH 1
55439 #define JSOP_ARRAYPUSH_LENGTH 3
55440 #define JSOP_GETFUNNS_LENGTH 1
55441 #define JSOP_ENUMCONSTELEM_LENGTH 1
55442 #define JSOP_LEAVEBLOCKEXPR_LENGTH 3
55443 #define JSOP_UNUSED21_LENGTH 1
55444 #define JSOP_UNUSED22_LENGTH 1
55445 #define JSOP_UNUSED23_LENGTH 1
55446 #define JSOP_CALLGNAME_LENGTH 5
55447 #define JSOP_CALLLOCAL_LENGTH 3
55448 #define JSOP_CALLARG_LENGTH 3
55449 #define JSOP_BINDGNAME_LENGTH 5
55450 #define JSOP_INT8_LENGTH 2
55451 #define JSOP_INT32_LENGTH 5
55452 #define JSOP_LENGTH_LENGTH 5
55453 #define JSOP_HOLE_LENGTH 1
55454 #define JSOP_UNUSED17_LENGTH 1
55455 #define JSOP_UNUSED24_LENGTH 1
55456 #define JSOP_UNUSED25_LENGTH 1
55457 #define JSOP_UNUSED29_LENGTH 1
55458 #define JSOP_UNUSED30_LENGTH 1
55459 #define JSOP_REST_LENGTH 1
55460 #define JSOP_TOID_LENGTH 1
55461 #define JSOP_IMPLICITTHIS_LENGTH 5
55462 #define JSOP_LOOPENTRY_LENGTH 1
55463 #define JSOP_ACTUALSFILLED_LENGTH 3
55464 # 12 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscriptinlines.h" 2
55465 # 22 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscriptinlines.h"
55466 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscopeinlines.h" 1
55467
55468
55469
55470
55471
55472
55473
55474 #define jsscopeinlines_h___
55475 # 22 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscopeinlines.h"
55476 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ArgumentsObject.h" 1
55477 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ArgumentsObject.h"
55478 #define ArgumentsObject_h___
55479
55480
55481
55482 namespace js {
55483 # 22 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ArgumentsObject.h"
55484 struct ArgumentsData
55485 {
55486
55487
55488
55489
55490 HeapValue callee;
55491
55492
55493
55494
55495
55496 size_t *deletedBits;
55497
55498
55499
55500
55501
55502 HeapValue slots[1];
55503 };
55504 # 95 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ArgumentsObject.h"
55505 class ArgumentsObject : public JSObject
55506 {
55507 static const uint32_t INITIAL_LENGTH_SLOT = 0;
55508 static const uint32_t DATA_SLOT = 1;
55509 static const uint32_t STACK_FRAME_SLOT = 2;
55510
55511
55512 static const uint32_t LENGTH_OVERRIDDEN_BIT = 0x1;
55513 static const uint32_t PACKED_BITS_COUNT = 1;
55514
55515 void initInitialLength(uint32_t length);
55516 void initData(ArgumentsData *data);
55517 static ArgumentsObject *create(JSContext *cx, uint32_t argc, HandleObject callee);
55518
55519 public:
55520 static const uint32_t RESERVED_SLOTS = 3;
55521 static const gc::AllocKind FINALIZE_KIND = gc::FINALIZE_OBJECT4;
55522
55523
55524 static ArgumentsObject *create(JSContext *cx, StackFrame *fp);
55525
55526
55527
55528
55529
55530
55531
55532 static ArgumentsObject *createUnexpected(JSContext *cx, StackFrame *fp);
55533
55534
55535
55536
55537
55538 inline uint32_t initialLength() const;
55539
55540
55541 inline bool hasOverriddenLength() const;
55542 inline void markLengthOverridden();
55543 # 142 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ArgumentsObject.h"
55544 inline bool getElement(uint32_t i, js::Value *vp);
55545 # 153 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ArgumentsObject.h"
55546 inline bool getElements(uint32_t start, uint32_t count, js::Value *vp);
55547
55548 inline js::ArgumentsData *data() const;
55549 # 171 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ArgumentsObject.h"
55550 inline bool isElementDeleted(uint32_t i) const;
55551 inline bool isAnyElementDeleted() const;
55552 inline void markElementDeleted(uint32_t i);
55553
55554 inline const js::Value &element(uint32_t i) const;
55555 inline void setElement(uint32_t i, const js::Value &v);
55556
55557
55558 inline js::StackFrame *maybeStackFrame() const;
55559 inline void setStackFrame(js::StackFrame *frame);
55560
55561
55562
55563
55564
55565 inline size_t sizeOfMisc(JSMallocSizeOfFun mallocSizeOf) const;
55566 };
55567
55568 class NormalArgumentsObject : public ArgumentsObject
55569 {
55570 public:
55571
55572
55573
55574
55575 inline const js::Value &callee() const;
55576
55577
55578 inline void clearCallee();
55579
55580
55581
55582
55583
55584
55585 static bool optimizedGetElem(JSContext *cx, StackFrame *fp, const Value &elem, Value *vp);
55586 };
55587
55588 class StrictArgumentsObject : public ArgumentsObject
55589 {};
55590
55591 }
55592
55593 js::NormalArgumentsObject &
55594 JSObject::asNormalArguments()
55595 {
55596 do { } while(0);
55597 return *static_cast<js::NormalArgumentsObject *>(this);
55598 }
55599
55600 js::StrictArgumentsObject &
55601 JSObject::asStrictArguments()
55602 {
55603 do { } while(0);
55604 return *static_cast<js::StrictArgumentsObject *>(this);
55605 }
55606
55607 js::ArgumentsObject &
55608 JSObject::asArguments()
55609 {
55610 do { } while(0);
55611 return *static_cast<js::ArgumentsObject *>(this);
55612 }
55613
55614 const js::ArgumentsObject &
55615 JSObject::asArguments() const
55616 {
55617 do { } while(0);
55618 return *static_cast<const js::ArgumentsObject *>(this);
55619 }
55620 # 23 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscopeinlines.h" 2
55621
55622
55623
55624 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscntxtinlines.h" 1
55625 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscntxtinlines.h"
55626 #define jscntxtinlines_h___
55627
55628
55629
55630
55631 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinterp.h" 1
55632 # 15 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscntxtinlines.h" 2
55633
55634
55635
55636
55637 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/frontend/ParseMaps.h" 1
55638 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/frontend/ParseMaps.h"
55639 #define ParseMaps_h__
55640
55641
55642
55643 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/ds/InlineMap.h" 1
55644 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/ds/InlineMap.h"
55645 #define InlineMap_h__
55646
55647
55648
55649 namespace js {
55650
55651
55652
55653
55654
55655 template <typename T> struct ZeroIsReserved { static const bool result = false; };
55656 template <typename T> struct ZeroIsReserved<T *> { static const bool result = true; };
55657
55658 template <typename K, typename V, size_t InlineElems>
55659 class InlineMap
55660 {
55661 public:
55662 typedef HashMap<K, V, DefaultHasher<K>, TempAllocPolicy> WordMap;
55663
55664 struct InlineElem
55665 {
55666 K key;
55667 V value;
55668 };
55669
55670 private:
55671 typedef typename WordMap::Ptr WordMapPtr;
55672 typedef typename WordMap::AddPtr WordMapAddPtr;
55673 typedef typename WordMap::Range WordMapRange;
55674
55675 size_t inlNext;
55676 size_t inlCount;
55677 InlineElem inl[InlineElems];
55678 WordMap map;
55679
55680 void checkStaticInvariants() {
55681 typedef int moz_static_assert108[(ZeroIsReserved<K>::result) ? 1 : -1];
55682 }
55683
55684 bool usingMap() const {
55685 return inlNext > InlineElems;
55686 }
55687
55688 bool switchToMap() {
55689 do { } while(0);
55690
55691 if (map.initialized()) {
55692 map.clear();
55693 } else {
55694 if (!map.init(count()))
55695 return false;
55696 do { } while(0);
55697 }
55698
55699 for (InlineElem *it = inl, *end = inl + inlNext; it != end; ++it) {
55700 if (it->key && !map.putNew(it->key, it->value))
55701 return false;
55702 }
55703
55704 inlNext = InlineElems + 1;
55705 do { } while(0);
55706 do { } while(0);
55707 return true;
55708 }
55709
55710 __attribute__((noinline))
55711 bool switchAndAdd(const K &key, const V &value) {
55712 if (!switchToMap())
55713 return false;
55714
55715 return map.putNew(key, value);
55716 }
55717
55718 public:
55719 explicit InlineMap(JSContext *cx)
55720 : inlNext(0), inlCount(0), map(cx) {
55721 checkStaticInvariants();
55722 }
55723
55724 class Entry
55725 {
55726 friend class InlineMap;
55727 const K &key_;
55728 const V &value_;
55729
55730 Entry(const K &key, const V &value) : key_(key), value_(value) {}
55731
55732 public:
55733 const K &key() { return key_; }
55734 const V &value() { return value_; }
55735 };
55736
55737 class Ptr
55738 {
55739 friend class InlineMap;
55740
55741 WordMapPtr mapPtr;
55742 InlineElem *inlPtr;
55743 bool isInlinePtr;
55744
55745 typedef Ptr ******* ConvertibleToBool;
55746
55747 explicit Ptr(WordMapPtr p) : mapPtr(p), isInlinePtr(false) {}
55748 explicit Ptr(InlineElem *ie) : inlPtr(ie), isInlinePtr(true) {}
55749 void operator==(const Ptr &other);
55750
55751 public:
55752
55753 Ptr() {
55754
55755
55756
55757
55758 }
55759
55760
55761
55762 bool found() const {
55763 return isInlinePtr ? bool(inlPtr) : mapPtr.found();
55764 }
55765
55766 operator ConvertibleToBool() const {
55767 return ConvertibleToBool(found());
55768 }
55769
55770 K &key() {
55771 do { } while(0);
55772 return isInlinePtr ? inlPtr->key : mapPtr->key;
55773 }
55774
55775 V &value() {
55776 do { } while(0);
55777 return isInlinePtr ? inlPtr->value : mapPtr->value;
55778 }
55779 };
55780
55781 class AddPtr
55782 {
55783 friend class InlineMap;
55784
55785 WordMapAddPtr mapAddPtr;
55786 InlineElem *inlAddPtr;
55787 bool isInlinePtr;
55788
55789 bool inlPtrFound;
55790
55791 AddPtr(InlineElem *ptr, bool found)
55792 : inlAddPtr(ptr), isInlinePtr(true), inlPtrFound(found)
55793 {}
55794
55795 AddPtr(const WordMapAddPtr &p) : mapAddPtr(p), isInlinePtr(false) {}
55796
55797 void operator==(const AddPtr &other);
55798
55799 typedef AddPtr ******* ConvertibleToBool;
55800
55801 public:
55802 AddPtr() {}
55803
55804 bool found() const {
55805 return isInlinePtr ? inlPtrFound : mapAddPtr.found();
55806 }
55807
55808 operator ConvertibleToBool() const {
55809 return found() ? ConvertibleToBool(1) : ConvertibleToBool(0);
55810 }
55811
55812 V &value() {
55813 do { } while(0);
55814 if (isInlinePtr)
55815 return inlAddPtr->value;
55816 return mapAddPtr->value;
55817 }
55818 };
55819
55820 size_t count() {
55821 return usingMap() ? map.count() : inlCount;
55822 }
55823
55824 bool empty() const {
55825 return usingMap() ? map.empty() : !inlCount;
55826 }
55827
55828 void clear() {
55829 inlNext = 0;
55830 inlCount = 0;
55831 }
55832
55833 bool isMap() const {
55834 return usingMap();
55835 }
55836
55837 const WordMap &asMap() const {
55838 do { } while(0);
55839 return map;
55840 }
55841
55842 const InlineElem *asInline() const {
55843 do { } while(0);
55844 return inl;
55845 }
55846
55847 const InlineElem *inlineEnd() const {
55848 do { } while(0);
55849 return inl + inlNext;
55850 }
55851
55852 __attribute__((always_inline)) inline
55853 Ptr lookup(const K &key) {
55854 if (usingMap())
55855 return Ptr(map.lookup(key));
55856
55857 for (InlineElem *it = inl, *end = inl + inlNext; it != end; ++it) {
55858 if (it->key == key)
55859 return Ptr(it);
55860 }
55861
55862 return Ptr(__null);
55863 }
55864
55865 __attribute__((always_inline)) inline
55866 AddPtr lookupForAdd(const K &key) {
55867 if (usingMap())
55868 return AddPtr(map.lookupForAdd(key));
55869
55870 for (InlineElem *it = inl, *end = inl + inlNext; it != end; ++it) {
55871 if (it->key == key)
55872 return AddPtr(it, true);
55873 }
55874
55875
55876
55877
55878
55879
55880 return AddPtr(inl + inlNext, false);
55881 }
55882
55883 __attribute__((always_inline)) inline
55884 bool add(AddPtr &p, const K &key, const V &value) {
55885 do { } while(0);
55886
55887 if (p.isInlinePtr) {
55888 InlineElem *addPtr = p.inlAddPtr;
55889 do { } while(0);
55890
55891
55892 if (addPtr == inl + InlineElems)
55893 return switchAndAdd(key, value);
55894
55895 do { } while(0);
55896 do { } while(0);
55897 p.inlAddPtr->key = key;
55898 p.inlAddPtr->value = value;
55899 ++inlCount;
55900 ++inlNext;
55901 return true;
55902 }
55903
55904 return map.add(p.mapAddPtr, key, value);
55905 }
55906
55907 __attribute__((always_inline)) inline
55908 bool put(const K &key, const V &value) {
55909 AddPtr p = lookupForAdd(key);
55910 if (p) {
55911 p.value() = value;
55912 return true;
55913 }
55914 return add(p, key, value);
55915 }
55916
55917 void remove(Ptr p) {
55918 do { } while(0);
55919 if (p.isInlinePtr) {
55920 do { } while(0);
55921 do { } while(0);
55922 p.inlPtr->key = __null;
55923 --inlCount;
55924 return;
55925 }
55926 do { } while(0);
55927 map.remove(p.mapPtr);
55928 }
55929
55930 void remove(const K &key) {
55931 if (Ptr p = lookup(key))
55932 remove(p);
55933 }
55934
55935 class Range
55936 {
55937 friend class InlineMap;
55938
55939 WordMapRange mapRange;
55940 InlineElem *cur;
55941 InlineElem *end;
55942 bool isInline;
55943
55944 explicit Range(WordMapRange r)
55945 : cur(__null), end(__null),
55946 isInline(false) {
55947 mapRange = r;
55948 do { } while(0);
55949 }
55950
55951 Range(const InlineElem *begin, const InlineElem *end_)
55952 : cur(const_cast<InlineElem *>(begin)),
55953 end(const_cast<InlineElem *>(end_)),
55954 isInline(true) {
55955 advancePastNulls(cur);
55956 do { } while(0);
55957 }
55958
55959 bool checkInlineRangeInvariants() const {
55960 do { } while(0);
55961 do { } while (0);
55962 return true;
55963 }
55964
55965 bool isInlineRange() const {
55966 do { } while (0);
55967 return isInline;
55968 }
55969
55970 void advancePastNulls(InlineElem *begin) {
55971 InlineElem *newCur = begin;
55972 while (newCur < end && __null == newCur->key)
55973 ++newCur;
55974 do { } while(0);
55975 cur = newCur;
55976 }
55977
55978 void bumpCurPtr() {
55979 do { } while(0);
55980 advancePastNulls(cur + 1);
55981 }
55982
55983 void operator==(const Range &other);
55984
55985 public:
55986 bool empty() const {
55987 return isInlineRange() ? cur == end : mapRange.empty();
55988 }
55989
55990 Entry front() {
55991 do { } while(0);
55992 if (isInlineRange())
55993 return Entry(cur->key, cur->value);
55994 return Entry(mapRange.front().key, mapRange.front().value);
55995 }
55996
55997 void popFront() {
55998 do { } while(0);
55999 if (isInlineRange())
56000 bumpCurPtr();
56001 else
56002 mapRange.popFront();
56003 }
56004 };
56005
56006 Range all() const {
56007 return usingMap() ? Range(map.all()) : Range(inl, inl + inlNext);
56008 }
56009 };
56010
56011 }
56012 # 14 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/frontend/ParseMaps.h" 2
56013
56014
56015
56016 namespace js {
56017
56018 struct Definition;
56019 # 28 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/frontend/ParseMaps.h"
56020 class ParseMapPool
56021 {
56022 typedef Vector<void *, 32, SystemAllocPolicy> RecyclableMaps;
56023
56024 RecyclableMaps all;
56025 RecyclableMaps recyclable;
56026 JSContext *cx;
56027
56028 void checkInvariants();
56029
56030 void recycle(void *map) {
56031 do { } while(0);
56032 # 53 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/frontend/ParseMaps.h"
56033 do { } while(0);
56034 recyclable.infallibleAppend(map);
56035 }
56036
56037 void *allocateFresh();
56038 void *allocate();
56039
56040
56041 typedef AtomIndexMap AtomMapT;
56042
56043 static AtomMapT *asAtomMap(void *ptr) {
56044 return reinterpret_cast<AtomMapT *>(ptr);
56045 }
56046
56047 public:
56048 explicit ParseMapPool(JSContext *cx) : cx(cx) {}
56049
56050 ~ParseMapPool() {
56051 purgeAll();
56052 }
56053
56054 void purgeAll();
56055
56056 bool empty() const {
56057 return all.empty();
56058 }
56059
56060
56061 template <typename T>
56062 T *acquire();
56063
56064
56065
56066 void release(AtomIndexMap *map) {
56067 recycle((void *) map);
56068 }
56069
56070 void release(AtomDefnMap *map) {
56071 recycle((void *) map);
56072 }
56073
56074 void release(AtomDOHMap *map) {
56075 recycle((void *) map);
56076 }
56077 };
56078
56079
56080
56081
56082
56083 template <class Map>
56084 struct AtomThingMapPtr
56085 {
56086 Map *map_;
56087
56088 void init() { clearMap(); }
56089
56090 bool ensureMap(JSContext *cx);
56091 void releaseMap(JSContext *cx);
56092
56093 bool hasMap() const { return map_; }
56094 Map *getMap() { return map_; }
56095 void setMap(Map *newMap) { do { } while(0); map_ = newMap; }
56096 void clearMap() { map_ = __null; }
56097
56098 Map *operator->() { return map_; }
56099 const Map *operator->() const { return map_; }
56100 Map &operator*() const { return *map_; }
56101 };
56102
56103 struct AtomDefnMapPtr : public AtomThingMapPtr<AtomDefnMap>
56104 {
56105 __attribute__((always_inline)) inline
56106 Definition *lookupDefn(JSAtom *atom) {
56107 AtomDefnMap::Ptr p = map_->lookup(atom);
56108 return p ? p.value() : __null;
56109 }
56110 };
56111
56112 typedef AtomThingMapPtr<AtomIndexMap> AtomIndexMapPtr;
56113
56114
56115
56116
56117
56118 template <typename AtomThingMapPtrT>
56119 class OwnedAtomThingMapPtr : public AtomThingMapPtrT
56120 {
56121 JSContext *cx;
56122
56123 public:
56124 explicit OwnedAtomThingMapPtr(JSContext *cx) : cx(cx) {
56125 AtomThingMapPtrT::init();
56126 }
56127
56128 ~OwnedAtomThingMapPtr() {
56129 AtomThingMapPtrT::releaseMap(cx);
56130 }
56131 };
56132
56133 typedef OwnedAtomThingMapPtr<AtomDefnMapPtr> OwnedAtomDefnMapPtr;
56134 typedef OwnedAtomThingMapPtr<AtomIndexMapPtr> OwnedAtomIndexMapPtr;
56135
56136
56137 struct AtomDeclNode
56138 {
56139 Definition *defn;
56140 AtomDeclNode *next;
56141
56142 explicit AtomDeclNode(Definition *defn)
56143 : defn(defn), next(__null)
56144 {}
56145 };
56146
56147
56148
56149
56150
56151 class DefnOrHeader
56152 {
56153 union {
56154 Definition *defn;
56155 AtomDeclNode *head;
56156 uintptr_t bits;
56157 } u;
56158
56159 public:
56160 DefnOrHeader() {
56161 u.bits = 0;
56162 }
56163
56164 explicit DefnOrHeader(Definition *defn) {
56165 u.defn = defn;
56166 do { } while(0);
56167 }
56168
56169 explicit DefnOrHeader(AtomDeclNode *node) {
56170 u.head = node;
56171 u.bits |= 0x1;
56172 do { } while(0);
56173 }
56174
56175 bool isHeader() const {
56176 return u.bits & 0x1;
56177 }
56178
56179 Definition *defn() const {
56180 do { } while(0);
56181 return u.defn;
56182 }
56183
56184 AtomDeclNode *header() const {
56185 do { } while(0);
56186 return (AtomDeclNode *) (u.bits & ~0x1);
56187 }
56188
56189
56190
56191
56192 };
56193
56194 namespace tl {
56195
56196 template <> struct IsPodType<DefnOrHeader> {
56197 static const bool result = true;
56198 };
56199
56200 }
56201 # 231 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/frontend/ParseMaps.h"
56202 class AtomDecls
56203 {
56204
56205 friend class AtomDeclsIter;
56206
56207 JSContext *cx;
56208 AtomDOHMap *map;
56209
56210 AtomDecls(const AtomDecls &other) ;
56211 void operator=(const AtomDecls &other) ;
56212
56213 AtomDeclNode *allocNode(Definition *defn);
56214
56215
56216
56217
56218
56219 AtomDeclNode *lastAsNode(DefnOrHeader *doh);
56220
56221 public:
56222 explicit AtomDecls(JSContext *cx)
56223 : cx(cx), map(__null)
56224 {}
56225
56226 ~AtomDecls();
56227
56228 bool init();
56229
56230 void clear() {
56231 map->clear();
56232 }
56233
56234
56235 inline Definition *lookupFirst(JSAtom *atom);
56236
56237
56238 inline MultiDeclRange lookupMulti(JSAtom *atom);
56239
56240
56241 inline bool addUnique(JSAtom *atom, Definition *defn);
56242 bool addShadow(JSAtom *atom, Definition *defn);
56243 bool addHoist(JSAtom *atom, Definition *defn);
56244
56245
56246 void updateFirst(JSAtom *atom, Definition *defn) {
56247 do { } while(0);
56248 AtomDOHMap::Ptr p = map->lookup(atom);
56249 do { } while(0);
56250 if (p.value().isHeader())
56251 p.value().header()->defn = defn;
56252 else
56253 p.value() = DefnOrHeader(defn);
56254 }
56255
56256
56257 void remove(JSAtom *atom) {
56258 do { } while(0);
56259 AtomDOHMap::Ptr p = map->lookup(atom);
56260 if (!p)
56261 return;
56262
56263 DefnOrHeader &doh = p.value();
56264 if (!doh.isHeader()) {
56265 map->remove(p);
56266 return;
56267 }
56268
56269 AtomDeclNode *node = doh.header();
56270 AtomDeclNode *newHead = node->next;
56271 if (newHead)
56272 p.value() = DefnOrHeader(newHead);
56273 else
56274 map->remove(p);
56275 }
56276
56277 AtomDOHMap::Range all() {
56278 do { } while(0);
56279 return map->all();
56280 }
56281
56282
56283
56284
56285 };
56286
56287
56288
56289
56290
56291
56292 class MultiDeclRange
56293 {
56294 friend class AtomDecls;
56295
56296 AtomDeclNode *node;
56297 Definition *defn;
56298
56299 explicit MultiDeclRange(Definition *defn) : node(__null), defn(defn) {}
56300 explicit MultiDeclRange(AtomDeclNode *node) : node(node), defn(node->defn) {}
56301
56302 public:
56303 void popFront() {
56304 do { } while(0);
56305 if (!node) {
56306 defn = __null;
56307 return;
56308 }
56309 node = node->next;
56310 defn = node ? node->defn : __null;
56311 }
56312
56313 Definition *front() {
56314 do { } while(0);
56315 return defn;
56316 }
56317
56318 bool empty() const {
56319 do { } while (0);
56320 return !defn;
56321 }
56322 };
56323
56324
56325 class AtomDeclsIter
56326 {
56327 AtomDOHMap::Range r;
56328 AtomDeclNode *link;
56329
56330 public:
56331 explicit AtomDeclsIter(AtomDecls *decls) : r(decls->all()), link(__null) {}
56332
56333 Definition *next() {
56334 if (link) {
56335 do { } while(0);
56336 Definition *result = link->defn;
56337 link = link->next;
56338 do { } while(0);
56339 return result;
56340 }
56341
56342 if (r.empty())
56343 return __null;
56344
56345 const DefnOrHeader &doh = r.front().value();
56346 r.popFront();
56347
56348 if (!doh.isHeader())
56349 return doh.defn();
56350
56351 do { } while(0);
56352 AtomDeclNode *node = doh.header();
56353 link = node->next;
56354 return node->defn;
56355 }
56356 };
56357
56358 typedef AtomDefnMap::Range AtomDefnRange;
56359 typedef AtomDefnMap::AddPtr AtomDefnAddPtr;
56360 typedef AtomDefnMap::Ptr AtomDefnPtr;
56361 typedef AtomIndexMap::AddPtr AtomIndexAddPtr;
56362 typedef AtomIndexMap::Ptr AtomIndexPtr;
56363 typedef AtomDOHMap::Ptr AtomDOHPtr;
56364 typedef AtomDOHMap::AddPtr AtomDOHAddPtr;
56365 typedef AtomDOHMap::Range AtomDOHRange;
56366
56367 }
56368 # 20 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscntxtinlines.h" 2
56369
56370
56371
56372
56373 namespace js {
56374
56375 inline void
56376 NewObjectCache::staticAsserts()
56377 {
56378 typedef int moz_static_assert109[(NewObjectCache::MAX_OBJ_SIZE == sizeof(JSObject_Slots16)) ? 1 : -1];
56379 typedef int moz_static_assert110[(gc::FINALIZE_OBJECT_LAST == gc::FINALIZE_OBJECT16_BACKGROUND) ? 1 : -1];
56380 }
56381
56382 inline bool
56383 NewObjectCache::lookup(Class *clasp, gc::Cell *key, gc::AllocKind kind, EntryIndex *pentry)
56384 {
56385 uintptr_t hash = (uintptr_t(clasp) ^ uintptr_t(key)) + kind;
56386 *pentry = hash % js::ArrayLength(entries);
56387
56388 Entry *entry = &entries[*pentry];
56389
56390
56391 return (entry->clasp == clasp && entry->key == key);
56392 }
56393
56394 inline bool
56395 NewObjectCache::lookupProto(Class *clasp, JSObject *proto, gc::AllocKind kind, EntryIndex *pentry)
56396 {
56397 do { } while(0);
56398 return lookup(clasp, proto, kind, pentry);
56399 }
56400
56401 inline bool
56402 NewObjectCache::lookupGlobal(Class *clasp, js::GlobalObject *global, gc::AllocKind kind, EntryIndex *pentry)
56403 {
56404 return lookup(clasp, global, kind, pentry);
56405 }
56406
56407 inline bool
56408 NewObjectCache::lookupType(Class *clasp, js::types::TypeObject *type, gc::AllocKind kind, EntryIndex *pentry)
56409 {
56410 return lookup(clasp, type, kind, pentry);
56411 }
56412
56413 inline void
56414 NewObjectCache::fill(EntryIndex entry_, Class *clasp, gc::Cell *key, gc::AllocKind kind, JSObject *obj)
56415 {
56416 do { } while(0);
56417 Entry *entry = &entries[entry_];
56418
56419 do { } while(0);
56420
56421 entry->clasp = clasp;
56422 entry->key = key;
56423 entry->kind = kind;
56424
56425 entry->nbytes = obj->sizeOfThis();
56426 js_memcpy(&entry->templateObject, obj, entry->nbytes);
56427 }
56428
56429 inline void
56430 NewObjectCache::fillProto(EntryIndex entry, Class *clasp, JSObject *proto, gc::AllocKind kind, JSObject *obj)
56431 {
56432 do { } while(0);
56433 do { } while(0);
56434 return fill(entry, clasp, proto, kind, obj);
56435 }
56436
56437 inline void
56438 NewObjectCache::fillGlobal(EntryIndex entry, Class *clasp, js::GlobalObject *global, gc::AllocKind kind, JSObject *obj)
56439 {
56440
56441 return fill(entry, clasp, global, kind, obj);
56442 }
56443
56444 inline void
56445 NewObjectCache::fillType(EntryIndex entry, Class *clasp, js::types::TypeObject *type, gc::AllocKind kind, JSObject *obj)
56446 {
56447 do { } while(0);
56448 return fill(entry, clasp, type, kind, obj);
56449 }
56450
56451 inline JSObject *
56452 NewObjectCache::newObjectFromHit(JSContext *cx, EntryIndex entry_)
56453 {
56454 do { } while(0);
56455 Entry *entry = &entries[entry_];
56456
56457 JSObject *obj = js_TryNewGCObject(cx, entry->kind);
56458 if (obj) {
56459 copyCachedToObject(obj, reinterpret_cast<JSObject *>(&entry->templateObject));
56460 Probes::createObject(cx, obj);
56461 return obj;
56462 }
56463
56464
56465 size_t nbytes = entry->nbytes;
56466 char stackObject[sizeof(JSObject_Slots16)];
56467 do { } while(0);
56468 js_memcpy(&stackObject, &entry->templateObject, nbytes);
56469
56470 JSObject *baseobj = (JSObject *) stackObject;
56471
56472 obj = js_NewGCObject(cx, entry->kind);
56473 if (obj) {
56474 copyCachedToObject(obj, baseobj);
56475 Probes::createObject(cx, obj);
56476 return obj;
56477 }
56478
56479 return __null;
56480 }
56481
56482 struct PreserveRegsGuard
56483 {
56484 PreserveRegsGuard(JSContext *cx, FrameRegs &regs)
56485 : prevContextRegs(cx->maybeRegs()), cx(cx), regs_(regs) {
56486 cx->stack.repointRegs(&regs_);
56487 }
56488 ~PreserveRegsGuard() {
56489 do { } while(0);
56490 *prevContextRegs = regs_;
56491 cx->stack.repointRegs(prevContextRegs);
56492 }
56493
56494 FrameRegs *prevContextRegs;
56495
56496 private:
56497 JSContext *cx;
56498 FrameRegs &regs_;
56499 };
56500
56501 static inline GlobalObject *
56502 GetGlobalForScopeChain(JSContext *cx)
56503 {
56504 if (cx->hasfp())
56505 return &cx->fp()->global();
56506
56507 JSObject *scope = JS_ObjectToInnerObject(cx, cx->globalObject);
56508 if (!scope)
56509 return __null;
56510 return &scope->asGlobal();
56511 }
56512
56513 inline GSNCache *
56514 GetGSNCache(JSContext *cx)
56515 {
56516 return &cx->runtime->gsnCache;
56517 }
56518
56519
56520
56521 class AutoNamespaceArray : protected AutoGCRooter {
56522 public:
56523 AutoNamespaceArray(JSContext *cx)
56524 : AutoGCRooter(cx, NAMESPACES), context(cx) {
56525 array.init();
56526 }
56527
56528 ~AutoNamespaceArray() {
56529 array.finish(context->runtime->defaultFreeOp());
56530 }
56531
56532 uint32_t length() const { return array.length; }
56533
56534 private:
56535 JSContext *context;
56536 friend void AutoGCRooter::trace(JSTracer *trc);
56537
56538 public:
56539 JSXMLArray<JSObject> array;
56540 };
56541
56542
56543
56544 template <typename T>
56545 class AutoPtr
56546 {
56547 JSContext *cx;
56548 T *value;
56549
56550 AutoPtr(const AutoPtr &other) ;
56551
56552 public:
56553 explicit AutoPtr(JSContext *cx) : cx(cx), value(__null) {}
56554 ~AutoPtr() {
56555 cx->delete_<T>(value);
56556 }
56557
56558 void operator=(T *ptr) { value = ptr; }
56559
56560 typedef void ***** ConvertibleToBool;
56561 operator ConvertibleToBool() const { return (ConvertibleToBool) value; }
56562
56563 const T *operator->() const { return value; }
56564 T *operator->() { return value; }
56565
56566 T *get() { return value; }
56567 };
56568 # 325 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscntxtinlines.h"
56569 #define START_ASSERT_SAME_COMPARTMENT() if (cx->runtime->gcRunning) return; CompartmentChecker c(cx)
56570
56571
56572
56573
56574 template <class T1> inline void
56575 assertSameCompartment(JSContext *cx, const T1 &t1)
56576 {
56577
56578
56579
56580
56581 }
56582
56583 template <class T1, class T2> inline void
56584 assertSameCompartment(JSContext *cx, const T1 &t1, const T2 &t2)
56585 {
56586
56587
56588
56589
56590
56591 }
56592
56593 template <class T1, class T2, class T3> inline void
56594 assertSameCompartment(JSContext *cx, const T1 &t1, const T2 &t2, const T3 &t3)
56595 {
56596
56597
56598
56599
56600
56601
56602 }
56603
56604 template <class T1, class T2, class T3, class T4> inline void
56605 assertSameCompartment(JSContext *cx, const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4)
56606 {
56607
56608
56609
56610
56611
56612
56613
56614 }
56615
56616 template <class T1, class T2, class T3, class T4, class T5> inline void
56617 assertSameCompartment(JSContext *cx, const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, const T5 &t5)
56618 {
56619 # 383 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscntxtinlines.h"
56620 }
56621
56622 #undef START_ASSERT_SAME_COMPARTMENT
56623
56624
56625 __attribute__((always_inline)) inline bool
56626 CallJSNative(JSContext *cx, Native native, const CallArgs &args)
56627 {
56628
56629
56630
56631 assertSameCompartment(cx, args);
56632 bool ok = native(cx, args.length(), args.base());
56633 if (ok) {
56634 assertSameCompartment(cx, args.rval());
56635 do { } while (0);
56636 }
56637 return ok;
56638 }
56639
56640 extern JSBool CallOrConstructBoundFunction(JSContext *, unsigned, js::Value *);
56641
56642
56643 __attribute__((always_inline)) inline bool
56644 CallJSNativeConstructor(JSContext *cx, Native native, const CallArgs &args)
56645 {
56646
56647
56648
56649
56650 do { } while(0);
56651 if (!CallJSNative(cx, native, args))
56652 return false;
56653 # 432 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jscntxtinlines.h"
56654 do { } while (0)
56655
56656
56657 ;
56658
56659 return true;
56660 }
56661
56662 __attribute__((always_inline)) inline bool
56663 CallJSPropertyOp(JSContext *cx, PropertyOp op, HandleObject receiver, HandleId id, Value *vp)
56664 {
56665 assertSameCompartment(cx, receiver, id, *vp);
56666 JSBool ok = op(cx, receiver, id, vp);
56667 if (ok)
56668 assertSameCompartment(cx, *vp);
56669 return ok;
56670 }
56671
56672 __attribute__((always_inline)) inline bool
56673 CallJSPropertyOpSetter(JSContext *cx, StrictPropertyOp op, HandleObject obj, HandleId id,
56674 JSBool strict, Value *vp)
56675 {
56676 assertSameCompartment(cx, obj, id, *vp);
56677 return op(cx, obj, id, strict, vp);
56678 }
56679
56680 inline bool
56681 CallSetter(JSContext *cx, HandleObject obj, HandleId id, StrictPropertyOp op, unsigned attrs,
56682 unsigned shortid, JSBool strict, Value *vp)
56683 {
56684 if (attrs & 0x20)
56685 return InvokeGetterOrSetter(cx, obj, CastAsObjectJsval(op), 1, vp, vp);
56686
56687 if (attrs & 0x10)
56688 return js_ReportGetterOnlyAssignment(cx);
56689
56690 if (!(attrs & 0x100))
56691 return CallJSPropertyOpSetter(cx, op, obj, id, strict, vp);
56692
56693 RootedId nid(cx, INT_TO_JSID(shortid));
56694
56695 return CallJSPropertyOpSetter(cx, op, obj, nid, strict, vp);
56696 }
56697
56698 static inline HeapPtrAtom *
56699 FrameAtomBase(JSContext *cx, js::StackFrame *fp)
56700 {
56701 return fp->script()->atoms;
56702 }
56703
56704 }
56705
56706 inline JSVersion
56707 JSContext::findVersion() const
56708 {
56709 if (hasVersionOverride)
56710 return versionOverride;
56711
56712 if (stack.hasfp()) {
56713
56714 js::StackFrame *f = fp();
56715 while (f && !f->isScriptFrame())
56716 f = f->prev();
56717 if (f)
56718 return f->script()->getVersion();
56719 }
56720
56721 return defaultVersion;
56722 }
56723
56724 inline bool
56725 JSContext::canSetDefaultVersion() const
56726 {
56727 return !stack.hasfp() && !hasVersionOverride;
56728 }
56729
56730 inline void
56731 JSContext::overrideVersion(JSVersion newVersion)
56732 {
56733 do { } while(0);
56734 versionOverride = newVersion;
56735 hasVersionOverride = true;
56736 }
56737
56738 inline bool
56739 JSContext::maybeOverrideVersion(JSVersion newVersion)
56740 {
56741 if (canSetDefaultVersion()) {
56742 setDefaultVersion(newVersion);
56743 return false;
56744 }
56745 overrideVersion(newVersion);
56746 return true;
56747 }
56748
56749 inline unsigned
56750 JSContext::getCompileOptions() const { return js::VersionFlagsToOptions(findVersion()); }
56751
56752 inline unsigned
56753 JSContext::allOptions() const { return getRunOptions() | getCompileOptions(); }
56754
56755 inline void
56756 JSContext::setCompileOptions(unsigned newcopts)
56757 {
56758 do { } while(0);
56759 if ((__builtin_expect((getCompileOptions() == newcopts), 1)))
56760 return;
56761 JSVersion version = findVersion();
56762 JSVersion newVersion = js::OptionFlagsToVersion(newcopts, version);
56763 maybeOverrideVersion(newVersion);
56764 }
56765
56766 inline void
56767 JSContext::assertValidStackDepth(unsigned depth)
56768 {
56769
56770
56771
56772
56773 }
56774
56775 inline js::LifoAlloc &
56776 JSContext::typeLifoAlloc()
56777 {
56778 return compartment->typeLifoAlloc;
56779 }
56780
56781 inline bool
56782 JSContext::ensureGeneratorStackSpace()
56783 {
56784 bool ok = genStack.reserve(genStack.length() + 1);
56785 if (!ok)
56786 js_ReportOutOfMemory(this);
56787 return ok;
56788 }
56789
56790 inline void
56791 JSContext::setPendingException(js::Value v) {
56792 do { } while(0);
56793 this->throwing = true;
56794 this->exception = v;
56795 js::assertSameCompartment(this, v);
56796 }
56797
56798 inline bool
56799 JSContext::ensureParseMapPool()
56800 {
56801 if (parseMapPool_)
56802 return true;
56803 parseMapPool_ = js::OffTheBooks::new_<js::ParseMapPool>(this);
56804 return parseMapPool_;
56805 }
56806
56807 inline js::PropertyTree&
56808 JSContext::propertyTree()
56809 {
56810 return compartment->propertyTree;
56811 }
56812
56813
56814 static inline js::StackFrame *
56815 js_GetTopStackFrame(JSContext *cx, FrameExpandKind expand)
56816 {
56817
56818 if (expand)
56819 js::mjit::ExpandInlineFrames(cx->compartment);
56820
56821
56822 return cx->maybefp();
56823 }
56824 # 27 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscopeinlines.h" 2
56825
56826 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobjinlines.h" 1
56827 # 29 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscopeinlines.h" 2
56828
56829
56830
56831 namespace js {
56832
56833 inline
56834 BaseShape::BaseShape(Class *clasp, JSObject *parent, uint32_t objectFlags)
56835 {
56836 do { } while(0);
56837 PodZero(this);
56838 this->clasp = clasp;
56839 this->parent = parent;
56840 this->flags = objectFlags;
56841 }
56842
56843 inline
56844 BaseShape::BaseShape(Class *clasp, JSObject *parent, uint32_t objectFlags,
56845 uint8_t attrs, js::PropertyOp rawGetter, js::StrictPropertyOp rawSetter)
56846 {
56847 do { } while(0);
56848 PodZero(this);
56849 this->clasp = clasp;
56850 this->parent = parent;
56851 this->flags = objectFlags;
56852 this->rawGetter = rawGetter;
56853 this->rawSetter = rawSetter;
56854 if ((attrs & 0x10) && rawGetter) {
56855 this->flags |= HAS_GETTER_OBJECT;
56856 JSObject::writeBarrierPost(this->getterObj, &this->getterObj);
56857 }
56858 if ((attrs & 0x20) && rawSetter) {
56859 this->flags |= HAS_SETTER_OBJECT;
56860 JSObject::writeBarrierPost(this->setterObj, &this->setterObj);
56861 }
56862 }
56863
56864 inline
56865 BaseShape::BaseShape(const StackBaseShape &base)
56866 {
56867 PodZero(this);
56868 this->clasp = base.clasp;
56869 this->parent = base.parent;
56870 this->flags = base.flags;
56871 this->rawGetter = base.rawGetter;
56872 this->rawSetter = base.rawSetter;
56873 if ((base.flags & HAS_GETTER_OBJECT) && base.rawGetter) {
56874 JSObject::writeBarrierPost(this->getterObj, &this->getterObj);
56875 }
56876 if ((base.flags & HAS_SETTER_OBJECT) && base.rawSetter) {
56877 JSObject::writeBarrierPost(this->setterObj, &this->setterObj);
56878 }
56879 }
56880
56881 inline BaseShape &
56882 BaseShape::operator=(const BaseShape &other)
56883 {
56884 clasp = other.clasp;
56885 parent = other.parent;
56886 flags = other.flags;
56887 slotSpan_ = other.slotSpan_;
56888 if (flags & HAS_GETTER_OBJECT) {
56889 getterObj = other.getterObj;
56890 JSObject::writeBarrierPost(getterObj, &getterObj);
56891 } else {
56892 rawGetter = other.rawGetter;
56893 }
56894 if (flags & HAS_SETTER_OBJECT) {
56895 setterObj = other.setterObj;
56896 JSObject::writeBarrierPost(setterObj, &setterObj);
56897 } else {
56898 rawSetter = other.rawSetter;
56899 }
56900 return *this;
56901 }
56902
56903 inline bool
56904 BaseShape::matchesGetterSetter(PropertyOp rawGetter, StrictPropertyOp rawSetter) const
56905 {
56906 return rawGetter == this->rawGetter && rawSetter == this->rawSetter;
56907 }
56908
56909 inline
56910 StackBaseShape::StackBaseShape(Shape *shape)
56911 : flags(shape->getObjectFlags()),
56912 clasp(shape->getObjectClass()),
56913 parent(shape->getObjectParent())
56914 {
56915 updateGetterSetter(shape->attrs, shape->getter(), shape->setter());
56916 }
56917
56918 inline void
56919 StackBaseShape::updateGetterSetter(uint8_t attrs,
56920 PropertyOp rawGetter,
56921 StrictPropertyOp rawSetter)
56922 {
56923 flags &= ~(BaseShape::HAS_GETTER_OBJECT | BaseShape::HAS_SETTER_OBJECT);
56924 if ((attrs & 0x10) && rawGetter)
56925 flags |= BaseShape::HAS_GETTER_OBJECT;
56926 if ((attrs & 0x20) && rawSetter)
56927 flags |= BaseShape::HAS_SETTER_OBJECT;
56928
56929 this->rawGetter = rawGetter;
56930 this->rawSetter = rawSetter;
56931 }
56932
56933 inline void
56934 BaseShape::adoptUnowned(UnownedBaseShape *other)
56935 {
56936
56937
56938
56939
56940 do { } while(0);
56941 DebugOnly<uint32_t> flags = getObjectFlags();
56942 do { } while(0);
56943
56944 uint32_t span = slotSpan();
56945 ShapeTable *table = &this->table();
56946
56947 *this = *other;
56948 setOwned(other);
56949 setTable(table);
56950 setSlotSpan(span);
56951
56952 assertConsistency();
56953 }
56954
56955 inline void
56956 BaseShape::setOwned(UnownedBaseShape *unowned)
56957 {
56958 flags |= OWNED_SHAPE;
56959 this->unowned_ = unowned;
56960 }
56961
56962 inline void
56963 BaseShape::assertConsistency()
56964 {
56965 # 177 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscopeinlines.h"
56966 }
56967
56968 inline
56969 Shape::Shape(const StackShape &other, uint32_t nfixed)
56970 : base_(other.base),
56971 propid_(other.propid),
56972 slotInfo(other.maybeSlot() | (nfixed << FIXED_SLOTS_SHIFT)),
56973 attrs(other.attrs),
56974 flags(other.flags),
56975 shortid_(other.shortid),
56976 parent(__null)
56977 {
56978 kids.setNull();
56979 }
56980
56981 inline
56982 Shape::Shape(UnownedBaseShape *base, uint32_t nfixed)
56983 : base_(base),
56984 propid_(((jsid)0x4)),
56985 slotInfo(SHAPE_INVALID_SLOT | (nfixed << FIXED_SLOTS_SHIFT)),
56986 attrs(0x40),
56987 flags(0),
56988 shortid_(0),
56989 parent(__null)
56990 {
56991 do { } while(0);
56992 kids.setNull();
56993 }
56994
56995 inline HashNumber
56996 StackShape::hash() const
56997 {
56998 HashNumber hash = uintptr_t(base);
56999
57000
57001 hash = (((hash) << (4)) | ((hash) >> (32 - (4)))) ^ (flags & Shape::PUBLIC_FLAGS);
57002 hash = (((hash) << (4)) | ((hash) >> (32 - (4)))) ^ attrs;
57003 hash = (((hash) << (4)) | ((hash) >> (32 - (4)))) ^ shortid;
57004 hash = (((hash) << (4)) | ((hash) >> (32 - (4)))) ^ slot_;
57005 hash = (((hash) << (4)) | ((hash) >> (32 - (4)))) ^ (propid);
57006 return hash;
57007 }
57008
57009 inline bool
57010 Shape::matches(const js::Shape *other) const
57011 {
57012 return propid_.get() == other->propid_.get() &&
57013 matchesParamsAfterId(other->base(), other->maybeSlot(), other->attrs,
57014 other->flags, other->shortid_);
57015 }
57016
57017 inline bool
57018 Shape::matches(const StackShape &other) const
57019 {
57020 return propid_.get() == other.propid &&
57021 matchesParamsAfterId(other.base, other.slot_, other.attrs, other.flags, other.shortid);
57022 }
57023
57024 inline bool
57025 Shape::matchesParamsAfterId(BaseShape *base, uint32_t aslot,
57026 unsigned aattrs, unsigned aflags, int ashortid) const
57027 {
57028 return base->unowned() == this->base()->unowned() &&
57029 maybeSlot() == aslot &&
57030 attrs == aattrs &&
57031 ((flags ^ aflags) & PUBLIC_FLAGS) == 0 &&
57032 shortid_ == ashortid;
57033 }
57034
57035 inline bool
57036 Shape::getUserId(JSContext *cx, jsid *idp) const
57037 {
57038 const Shape *self = this;
57039
57040
57041
57042
57043
57044
57045 if (self->hasShortID()) {
57046 int16_t id = self->shortid();
57047 if (id < 0)
57048 return ValueToId(cx, Int32Value(id), idp);
57049 *idp = INT_TO_JSID(id);
57050 } else {
57051 *idp = propid();
57052 }
57053 return true;
57054 }
57055
57056 inline bool
57057 Shape::get(JSContext* cx, HandleObject receiver, JSObject* obj, JSObject *pobj, Value* vp) const
57058 {
57059 do { } while(0);
57060
57061 if (hasGetterValue()) {
57062 Value fval = getterValue();
57063 return InvokeGetterOrSetter(cx, receiver, fval, 0, 0, vp);
57064 }
57065
57066 RootedId id(cx);
57067 if (!getUserId(cx, id.address()))
57068 return false;
57069
57070 return CallJSPropertyOp(cx, getterOp(), receiver, id, vp);
57071 }
57072
57073 inline bool
57074 Shape::set(JSContext* cx, HandleObject obj, bool strict, Value* vp) const
57075 {
57076 do { } while (0);
57077
57078 if (attrs & 0x20) {
57079 Value fval = setterValue();
57080 return InvokeGetterOrSetter(cx, obj, fval, 1, vp, vp);
57081 }
57082
57083 if (attrs & 0x10)
57084 return js_ReportGetterOnlyAssignment(cx);
57085
57086 RootedId id(cx);
57087 if (!getUserId(cx, id.address()))
57088 return false;
57089
57090
57091
57092
57093
57094 if (obj->isWith()) {
57095 RootedObject nobj(cx, &obj->asWith().object());
57096 return CallJSPropertyOpSetter(cx, setterOp(), nobj, id, strict, vp);
57097 }
57098
57099 return CallJSPropertyOpSetter(cx, setterOp(), obj, id, strict, vp);
57100 }
57101
57102 inline void
57103 Shape::setParent(js::Shape *p)
57104 {
57105 do { } while (0)
57106 ;
57107 do { } while (0)
57108 ;
57109 parent = p;
57110 }
57111
57112 inline void
57113 Shape::removeFromDictionary(JSObject *obj)
57114 {
57115 do { } while(0);
57116 do { } while(0);
57117 do { } while(0);
57118
57119 do { } while(0);
57120 do { } while(0);
57121
57122 if (parent)
57123 parent->listp = listp;
57124 *listp = parent;
57125 listp = __null;
57126 }
57127
57128 inline void
57129 Shape::insertIntoDictionary(HeapPtrShape *dictp)
57130 {
57131
57132
57133
57134
57135 do { } while(0);
57136 do { } while(0);
57137
57138 do { } while (0);
57139 do { } while (0);
57140 do { } while (0);
57141
57142 setParent(*dictp);
57143 if (parent)
57144 parent->listp = &parent;
57145 listp = (HeapPtrShape *) dictp;
57146 *dictp = this;
57147 }
57148
57149 void
57150 Shape::initDictionaryShape(const StackShape &child, uint32_t nfixed, HeapPtrShape *dictp)
57151 {
57152 new (this) Shape(child, nfixed);
57153 this->flags |= IN_DICTIONARY;
57154
57155 this->listp = __null;
57156 insertIntoDictionary(dictp);
57157 }
57158
57159 inline
57160 EmptyShape::EmptyShape(UnownedBaseShape *base, uint32_t nfixed)
57161 : js::Shape(base, nfixed)
57162 {
57163
57164 if (!getObjectClass()->isNative())
57165 flags |= NON_NATIVE;
57166 }
57167
57168 inline void
57169 Shape::writeBarrierPre(const js::Shape *shape)
57170 {
57171
57172 if (!shape)
57173 return;
57174
57175 JSCompartment *comp = shape->compartment();
57176 if (comp->needsBarrier()) {
57177 Shape *tmp = const_cast<Shape *>(shape);
57178 MarkShapeUnbarriered(comp->barrierTracer(), &tmp, "write barrier");
57179 do { } while(0);
57180 }
57181
57182 }
57183
57184 inline void
57185 Shape::writeBarrierPost(const js::Shape *shape, void *addr)
57186 {
57187 }
57188
57189 inline void
57190 Shape::readBarrier(const Shape *shape)
57191 {
57192
57193 JSCompartment *comp = shape->compartment();
57194 if (comp->needsBarrier()) {
57195 Shape *tmp = const_cast<Shape *>(shape);
57196 MarkShapeUnbarriered(comp->barrierTracer(), &tmp, "read barrier");
57197 do { } while(0);
57198 }
57199
57200 }
57201
57202 inline void
57203 Shape::markChildren(JSTracer *trc)
57204 {
57205 MarkBaseShape(trc, &base_, "base");
57206 gc::MarkId(trc, &propidRef(), "propid");
57207 if (parent)
57208 MarkShape(trc, &parent, "parent");
57209 }
57210
57211 inline void
57212 BaseShape::writeBarrierPre(BaseShape *base)
57213 {
57214
57215 if (!base)
57216 return;
57217
57218 JSCompartment *comp = base->compartment();
57219 if (comp->needsBarrier()) {
57220 BaseShape *tmp = base;
57221 MarkBaseShapeUnbarriered(comp->barrierTracer(), &tmp, "write barrier");
57222 do { } while(0);
57223 }
57224
57225 }
57226
57227 inline void
57228 BaseShape::writeBarrierPost(BaseShape *shape, void *addr)
57229 {
57230 }
57231
57232 inline void
57233 BaseShape::readBarrier(BaseShape *base)
57234 {
57235
57236 JSCompartment *comp = base->compartment();
57237 if (comp->needsBarrier()) {
57238 BaseShape *tmp = base;
57239 MarkBaseShapeUnbarriered(comp->barrierTracer(), &tmp, "read barrier");
57240 do { } while(0);
57241 }
57242
57243 }
57244
57245 inline void
57246 BaseShape::markChildren(JSTracer *trc)
57247 {
57248 if (hasGetterObject())
57249 MarkObjectUnbarriered(trc, &getterObj, "getter");
57250
57251 if (hasSetterObject())
57252 MarkObjectUnbarriered(trc, &setterObj, "setter");
57253
57254 if (isOwned())
57255 MarkBaseShape(trc, &unowned_, "base");
57256
57257 if (parent)
57258 MarkObject(trc, &parent, "parent");
57259 }
57260
57261 }
57262 # 23 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscriptinlines.h" 2
57263
57264 namespace js {
57265
57266 inline
57267 Bindings::Bindings(JSContext *cx)
57268 : lastBinding(__null), nargs(0), nvars(0), hasDup_(false)
57269 {}
57270
57271 inline void
57272 Bindings::transfer(JSContext *cx, Bindings *bindings)
57273 {
57274 do { } while(0);
57275 do { } while(0);
57276
57277 *this = *bindings;
57278
57279
57280
57281 }
57282
57283 inline void
57284 Bindings::clone(JSContext *cx, Bindings *bindings)
57285 {
57286 do { } while(0);
57287 do { } while(0);
57288
57289 *this = *bindings;
57290 }
57291
57292 Shape *
57293 Bindings::lastShape() const
57294 {
57295 do { } while(0);
57296 do { } while(0);
57297 return lastBinding;
57298 }
57299
57300 Shape *
57301 Bindings::initialShape(JSContext *cx) const
57302 {
57303
57304 gc::AllocKind kind = gc::FINALIZE_OBJECT4;
57305 do { } while(0);
57306
57307 return EmptyShape::getInitialShape(cx, &CallClass, __null, __null, kind,
57308 BaseShape::VAROBJ);
57309 }
57310
57311 bool
57312 Bindings::ensureShape(JSContext *cx)
57313 {
57314 if (!lastBinding) {
57315 lastBinding = initialShape(cx);
57316 if (!lastBinding)
57317 return false;
57318 }
57319 return true;
57320 }
57321
57322 bool
57323 Bindings::extensibleParents()
57324 {
57325 return lastBinding && lastBinding->extensibleParents();
57326 }
57327
57328 extern void
57329 CurrentScriptFileLineOriginSlow(JSContext *cx, const char **file, unsigned *linenop, JSPrincipals **origin);
57330
57331 inline void
57332 CurrentScriptFileLineOrigin(JSContext *cx, const char **file, unsigned *linenop, JSPrincipals **origin,
57333 LineOption opt = NOT_CALLED_FROM_JSOP_EVAL)
57334 {
57335 if (opt == CALLED_FROM_JSOP_EVAL) {
57336 do { } while(0);
57337 do { } while(0);
57338 JSScript *script = cx->fp()->script();
57339 *file = script->filename;
57340 *linenop = ((unsigned)(((cx->regs().pc + 3)[1] << 8) | (cx->regs().pc + 3)[2]));
57341 *origin = script->originPrincipals;
57342 return;
57343 }
57344
57345 CurrentScriptFileLineOriginSlow(cx, file, linenop, origin);
57346 }
57347
57348 inline void
57349 ScriptCounts::destroy(FreeOp *fop)
57350 {
57351 fop->free_(pcCountsVector);
57352 }
57353
57354 inline void
57355 MarkScriptFilename(JSRuntime *rt, const char *filename)
57356 {
57357
57358
57359
57360
57361
57362 if (rt->gcIsFull)
57363 ScriptFilenameEntry::fromFilename(filename)->marked = true;
57364 }
57365
57366 }
57367
57368 inline void
57369 JSScript::setFunction(JSFunction *fun)
57370 {
57371 function_ = fun;
57372 }
57373
57374 inline JSFunction *
57375 JSScript::getFunction(size_t index)
57376 {
57377 JSObject *funobj = getObject(index);
57378 do { } while(0);
57379 return funobj->toFunction();
57380 }
57381
57382 inline JSFunction *
57383 JSScript::getCallerFunction()
57384 {
57385 do { } while(0);
57386 return getFunction(0);
57387 }
57388
57389 inline JSObject *
57390 JSScript::getRegExp(size_t index)
57391 {
57392 js::ObjectArray *arr = regexps();
57393 do { } while(0);
57394 JSObject *obj = arr->vector[index];
57395 do { } while(0);
57396 return obj;
57397 }
57398
57399 inline bool
57400 JSScript::isEmpty() const
57401 {
57402 if (length > 3)
57403 return false;
57404
57405 jsbytecode *pc = code;
57406 if (noScriptRval && JSOp(*pc) == JSOP_FALSE)
57407 ++pc;
57408 return JSOp(*pc) == JSOP_STOP;
57409 }
57410
57411 inline bool
57412 JSScript::hasGlobal() const
57413 {
57414
57415
57416
57417
57418
57419 do { } while(0);
57420 js::GlobalObject *obj = types->global;
57421 return obj && !obj->isCleared();
57422 }
57423
57424 inline js::GlobalObject *
57425 JSScript::global() const
57426 {
57427 do { } while(0);
57428 return types->global;
57429 }
57430
57431 inline bool
57432 JSScript::hasClearedGlobal() const
57433 {
57434 do { } while(0);
57435 js::GlobalObject *obj = types->global;
57436 return obj && obj->isCleared();
57437 }
57438
57439 inline js::types::TypeScriptNesting *
57440 JSScript::nesting() const
57441 {
57442 do { } while(0);
57443 return types->nesting;
57444 }
57445
57446 inline void
57447 JSScript::clearNesting()
57448 {
57449 js::types::TypeScriptNesting *nesting = this->nesting();
57450 if (nesting) {
57451 js::Foreground::delete_(nesting);
57452 types->nesting = __null;
57453 }
57454 }
57455
57456
57457 inline bool
57458 JSScript::ensureHasJITInfo(JSContext *cx)
57459 {
57460 if (jitInfo)
57461 return true;
57462 jitInfo = cx->new_<JITScriptSet>();
57463 return jitInfo != __null;
57464 }
57465
57466 inline void
57467 JSScript::destroyJITInfo(js::FreeOp *fop)
57468 {
57469 fop->delete_(jitInfo);
57470 jitInfo = __null;
57471 }
57472
57473
57474 inline void
57475 JSScript::writeBarrierPre(JSScript *script)
57476 {
57477
57478 if (!script)
57479 return;
57480
57481 JSCompartment *comp = script->compartment();
57482 if (comp->needsBarrier()) {
57483 do { } while(0);
57484 JSScript *tmp = script;
57485 MarkScriptUnbarriered(comp->barrierTracer(), &tmp, "write barrier");
57486 do { } while(0);
57487 }
57488
57489 }
57490
57491 inline void
57492 JSScript::writeBarrierPost(JSScript *script, void *addr)
57493 {
57494 }
57495 # 18 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack-inl.h" 2
57496
57497 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ArgumentsObject-inl.h" 1
57498 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ArgumentsObject-inl.h"
57499 #define ArgumentsObject_inl_h___
57500
57501 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ArgumentsObject.h" 1
57502 # 12 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ArgumentsObject-inl.h" 2
57503
57504 namespace js {
57505
57506 inline void
57507 ArgumentsObject::initInitialLength(uint32_t length)
57508 {
57509 do { } while(0);
57510 initFixedSlot(INITIAL_LENGTH_SLOT, Int32Value(length << PACKED_BITS_COUNT));
57511 do { } while(0);
57512 do { } while(0);
57513 }
57514
57515 inline uint32_t
57516 ArgumentsObject::initialLength() const
57517 {
57518 uint32_t argc = uint32_t(getFixedSlot(INITIAL_LENGTH_SLOT).toInt32()) >> PACKED_BITS_COUNT;
57519 do { } while(0);
57520 return argc;
57521 }
57522
57523 inline void
57524 ArgumentsObject::markLengthOverridden()
57525 {
57526 uint32_t v = getFixedSlot(INITIAL_LENGTH_SLOT).toInt32() | LENGTH_OVERRIDDEN_BIT;
57527 setFixedSlot(INITIAL_LENGTH_SLOT, Int32Value(v));
57528 }
57529
57530 inline bool
57531 ArgumentsObject::hasOverriddenLength() const
57532 {
57533 const js::Value &v = getFixedSlot(INITIAL_LENGTH_SLOT);
57534 return v.toInt32() & LENGTH_OVERRIDDEN_BIT;
57535 }
57536
57537 inline void
57538 ArgumentsObject::initData(ArgumentsData *data)
57539 {
57540 do { } while(0);
57541 initFixedSlot(DATA_SLOT, PrivateValue(data));
57542 }
57543
57544 inline ArgumentsData *
57545 ArgumentsObject::data() const
57546 {
57547 return reinterpret_cast<js::ArgumentsData *>(getFixedSlot(DATA_SLOT).toPrivate());
57548 }
57549
57550 inline bool
57551 ArgumentsObject::isElementDeleted(uint32_t i) const
57552 {
57553 return IsBitArrayElementSet(data()->deletedBits, initialLength(), i);
57554 }
57555
57556 inline bool
57557 ArgumentsObject::isAnyElementDeleted() const
57558 {
57559 return IsAnyBitArrayElementSet(data()->deletedBits, initialLength());
57560 }
57561
57562 inline void
57563 ArgumentsObject::markElementDeleted(uint32_t i)
57564 {
57565 SetBitArrayElement(data()->deletedBits, initialLength(), i);
57566 }
57567
57568 inline const js::Value &
57569 ArgumentsObject::element(uint32_t i) const
57570 {
57571 do { } while(0);
57572 return data()->slots[i];
57573 }
57574
57575 inline void
57576 ArgumentsObject::setElement(uint32_t i, const js::Value &v)
57577 {
57578 do { } while(0);
57579 data()->slots[i] = v;
57580 }
57581
57582 inline bool
57583 ArgumentsObject::getElement(uint32_t i, Value *vp)
57584 {
57585 if (i >= initialLength() || isElementDeleted(i))
57586 return false;
57587
57588
57589
57590
57591
57592
57593 StackFrame *fp = maybeStackFrame();
57594 do { } while (0);
57595 if (fp)
57596 *vp = fp->canonicalActualArg(i);
57597 else
57598 *vp = element(i);
57599 return true;
57600 }
57601
57602 namespace detail {
57603
57604 struct CopyNonHoleArgsTo
57605 {
57606 CopyNonHoleArgsTo(ArgumentsObject *argsobj, Value *dst) : argsobj(*argsobj), dst(dst) {}
57607 ArgumentsObject &argsobj;
57608 Value *dst;
57609 bool operator()(uint32_t argi, Value *src) {
57610 *dst++ = *src;
57611 return true;
57612 }
57613 };
57614
57615 }
57616
57617 inline bool
57618 ArgumentsObject::getElements(uint32_t start, uint32_t count, Value *vp)
57619 {
57620 do { } while(0);
57621
57622 uint32_t length = initialLength();
57623 if (start > length || start + count > length || isAnyElementDeleted())
57624 return false;
57625
57626 StackFrame *fp = maybeStackFrame();
57627
57628
57629 if (!fp) {
57630 const Value *srcbeg = Valueify(data()->slots) + start;
57631 const Value *srcend = srcbeg + count;
57632 const Value *src = srcbeg;
57633 for (Value *dst = vp; src < srcend; ++dst, ++src)
57634 *dst = *src;
57635 return true;
57636 }
57637
57638
57639 do { } while(0);
57640 return fp->forEachCanonicalActualArg(detail::CopyNonHoleArgsTo(this, vp), start, count);
57641 }
57642
57643 inline js::StackFrame *
57644 ArgumentsObject::maybeStackFrame() const
57645 {
57646 return reinterpret_cast<js::StackFrame *>(getFixedSlot(STACK_FRAME_SLOT).toPrivate());
57647 }
57648
57649 inline void
57650 ArgumentsObject::setStackFrame(StackFrame *frame)
57651 {
57652 setFixedSlot(STACK_FRAME_SLOT, PrivateValue(frame));
57653 }
57654
57655 inline size_t
57656 ArgumentsObject::sizeOfMisc(JSMallocSizeOfFun mallocSizeOf) const
57657 {
57658 return mallocSizeOf(data());
57659 }
57660
57661 inline const js::Value &
57662 NormalArgumentsObject::callee() const
57663 {
57664 return data()->callee;
57665 }
57666
57667 inline void
57668 NormalArgumentsObject::clearCallee()
57669 {
57670 data()->callee.set(compartment(), MagicValue(JS_OVERWRITTEN_CALLEE));
57671 }
57672
57673 }
57674 # 20 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack-inl.h" 2
57675 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ScopeObject-inl.h" 1
57676 # 21 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack-inl.h" 2
57677
57678
57679 namespace js {
57680
57681
57682
57683
57684
57685
57686 static inline bool
57687 IsCacheableNonGlobalScope(JSObject *obj)
57688 {
57689 bool cacheable = (obj->isCall() || obj->isBlock() || obj->isDeclEnv());
57690
57691 do { } while (0);
57692 return cacheable;
57693 }
57694
57695 inline HandleObject
57696 StackFrame::scopeChain() const
57697 {
57698 do { } while (0);
57699 if (!(flags_ & HAS_SCOPECHAIN)) {
57700 scopeChain_ = callee().environment();
57701 flags_ |= HAS_SCOPECHAIN;
57702 }
57703 return HandleObject::fromMarkedLocation(&scopeChain_);
57704 }
57705
57706 inline GlobalObject &
57707 StackFrame::global() const
57708 {
57709 return scopeChain()->global();
57710 }
57711
57712 inline JSObject &
57713 StackFrame::varObj()
57714 {
57715 JSObject *obj = scopeChain();
57716 while (!obj->isVarObj())
57717 obj = obj->enclosingScope();
57718 return *obj;
57719 }
57720
57721 inline JSCompartment *
57722 StackFrame::compartment() const
57723 {
57724 do { } while (0);
57725 return scopeChain()->compartment();
57726 }
57727
57728
57729 inline mjit::JITScript *
57730 StackFrame::jit()
57731 {
57732 JSScript *script_ = script();
57733 return script_->getJIT(isConstructing(), script_->compartment()->needsBarrier());
57734 }
57735
57736
57737 inline void
57738 StackFrame::initPrev(JSContext *cx)
57739 {
57740 do { } while(0);
57741 if (FrameRegs *regs = cx->maybeRegs()) {
57742 prev_ = regs->fp();
57743 prevpc_ = regs->pc;
57744 prevInline_ = regs->inlined();
57745 do { } while (0)
57746 ;
57747 } else {
57748 prev_ = __null;
57749
57750
57751
57752
57753 }
57754 }
57755
57756 inline void
57757 StackFrame::resetGeneratorPrev(JSContext *cx)
57758 {
57759 flags_ |= HAS_PREVPC;
57760 initPrev(cx);
57761 }
57762
57763 inline void
57764 StackFrame::initInlineFrame(JSFunction *fun, StackFrame *prevfp, jsbytecode *prevpc)
57765 {
57766
57767
57768
57769
57770 flags_ = StackFrame::FUNCTION;
57771 exec.fun = fun;
57772 resetInlinePrev(prevfp, prevpc);
57773 }
57774
57775 inline void
57776 StackFrame::resetInlinePrev(StackFrame *prevfp, jsbytecode *prevpc)
57777 {
57778 do { } while (0);
57779 flags_ |= StackFrame::HAS_PREVPC;
57780 prev_ = prevfp;
57781 prevpc_ = prevpc;
57782 prevInline_ = __null;
57783 }
57784
57785 inline void
57786 StackFrame::initCallFrame(JSContext *cx, JSFunction &callee,
57787 JSScript *script, uint32_t nactual, StackFrame::Flags flagsArg)
57788 {
57789 do { } while(0)
57790
57791
57792 ;
57793 do { } while(0);
57794
57795
57796 flags_ = FUNCTION | HAS_PREVPC | HAS_SCOPECHAIN | HAS_BLOCKCHAIN | flagsArg;
57797 exec.fun = &callee;
57798 u.nactual = nactual;
57799 scopeChain_ = callee.environment();
57800 ncode_ = __null;
57801 initPrev(cx);
57802 blockChain_= __null;
57803 do { } while(0);
57804 do { } while(0);
57805 do { } while(0);
57806 do { } while(0);
57807
57808 SetValueRangeToUndefined(slots(), script->nfixed);
57809 }
57810
57811
57812
57813
57814
57815 inline void
57816 StackFrame::initFixupFrame(StackFrame *prev, StackFrame::Flags flags, void *ncode, unsigned nactual)
57817 {
57818 do { } while(0)
57819
57820
57821
57822 ;
57823
57824 flags_ = FUNCTION | flags;
57825 prev_ = prev;
57826 ncode_ = ncode;
57827 u.nactual = nactual;
57828 }
57829
57830 inline JSObject *
57831 StackFrame::createRestParameter(JSContext *cx)
57832 {
57833 do { } while(0);
57834 unsigned nformal = fun()->nargs - 1, nactual = numActualArgs();
57835 unsigned nrest = (nactual > nformal) ? nactual - nformal : 0;
57836 return NewDenseCopiedArray(cx, nrest, actualArgs() + nformal);
57837 }
57838
57839 inline Value &
57840 StackFrame::canonicalActualArg(unsigned i) const
57841 {
57842 if (i < numFormalArgs())
57843 return formalArg(i);
57844 do { } while(0);
57845 return actualArgs()[i];
57846 }
57847
57848 template <class Op>
57849 inline bool
57850 StackFrame::forEachCanonicalActualArg(Op op, unsigned start , unsigned count )
57851 {
57852 unsigned nformal = fun()->nargs;
57853 do { } while(0);
57854
57855 Value *formals = formalArgsEnd() - nformal;
57856 unsigned nactual = numActualArgs();
57857 if (count == unsigned(-1))
57858 count = nactual - start;
57859
57860 unsigned end = start + count;
57861 do { } while(0);
57862 do { } while(0);
57863
57864 if (end <= nformal) {
57865 Value *p = formals + start;
57866 for (; start < end; ++p, ++start) {
57867 if (!op(start, p))
57868 return false;
57869 }
57870 } else {
57871 for (Value *p = formals + start; start < nformal; ++p, ++start) {
57872 if (!op(start, p))
57873 return false;
57874 }
57875 do { } while(0);
57876 Value *actuals = formals - (nactual + 2) + start;
57877 for (Value *p = actuals; start < end; ++p, ++start) {
57878 if (!op(start, p))
57879 return false;
57880 }
57881 }
57882 return true;
57883 }
57884
57885 template <class Op>
57886 inline bool
57887 StackFrame::forEachFormalArg(Op op)
57888 {
57889 Value *formals = formalArgsEnd() - fun()->nargs;
57890 Value *formalsEnd = formalArgsEnd();
57891 unsigned i = 0;
57892 for (Value *p = formals; p != formalsEnd; ++p, ++i) {
57893 if (!op(i, p))
57894 return false;
57895 }
57896 return true;
57897 }
57898
57899 struct CopyTo
57900 {
57901 Value *dst;
57902 CopyTo(Value *dst) : dst(dst) {}
57903 bool operator()(unsigned, Value *src) {
57904 *dst++ = *src;
57905 return true;
57906 }
57907 };
57908
57909 inline unsigned
57910 StackFrame::numActualArgs() const
57911 {
57912 # 264 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack-inl.h"
57913 do { } while(0);
57914 if ((__builtin_expect((flags_ & (OVERFLOW_ARGS | UNDERFLOW_ARGS)), 0)))
57915 return u.nactual;
57916 return numFormalArgs();
57917 }
57918
57919 inline Value *
57920 StackFrame::actualArgs() const
57921 {
57922 do { } while(0);
57923 Value *argv = formalArgs();
57924 if ((__builtin_expect((flags_ & OVERFLOW_ARGS), 0)))
57925 return argv - (2 + u.nactual);
57926 return argv;
57927 }
57928
57929 inline Value *
57930 StackFrame::actualArgsEnd() const
57931 {
57932 do { } while(0);
57933 if ((__builtin_expect((flags_ & OVERFLOW_ARGS), 0)))
57934 return formalArgs() - 2;
57935 return formalArgs() + numActualArgs();
57936 }
57937
57938 inline void
57939 StackFrame::setScopeChain(JSObject &obj)
57940 {
57941 # 304 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Stack-inl.h"
57942 scopeChain_ = &obj;
57943 flags_ |= HAS_SCOPECHAIN;
57944 }
57945
57946 inline void
57947 StackFrame::initScopeChain(CallObject &obj)
57948 {
57949 do { } while(0);
57950 do { } while(0);
57951 scopeChain_ = &obj;
57952 flags_ |= HAS_SCOPECHAIN | HAS_CALL_OBJ;
57953 }
57954
57955 inline CallObject &
57956 StackFrame::callObj() const
57957 {
57958 do { } while (0);
57959
57960 JSObject *pobj = scopeChain();
57961 while ((__builtin_expect((!pobj->isCall()), 0)))
57962 pobj = pobj->enclosingScope();
57963 return pobj->asCall();
57964 }
57965
57966 inline bool
57967 StackFrame::maintainNestingState() const
57968 {
57969
57970
57971
57972
57973 return isNonEvalFunctionFrame() && !isGeneratorFrame() && script()->nesting();
57974 }
57975
57976 inline bool
57977 StackFrame::functionPrologue(JSContext *cx)
57978 {
57979 do { } while(0);
57980 do { } while(0);
57981
57982 if (fun()->isHeavyweight()) {
57983 CallObject *callobj = CallObject::createForFunction(cx, this);
57984 if (!callobj)
57985 return false;
57986 initScopeChain(*callobj);
57987 } else {
57988
57989 scopeChain();
57990 }
57991
57992 if (script()->nesting()) {
57993 do { } while(0);
57994 types::NestingPrologue(cx, this);
57995 }
57996
57997 return true;
57998 }
57999
58000 inline void
58001 StackFrame::functionEpilogue(JSContext *cx)
58002 {
58003 do { } while(0);
58004
58005 if (cx->compartment->debugMode())
58006 cx->runtime->debugScopes->onPopCall(this);
58007
58008 if (flags_ & (HAS_ARGS_OBJ | HAS_CALL_OBJ)) {
58009 if (hasCallObj())
58010 js_PutCallObject(this, scopeChain_->asCall());
58011 if (hasArgsObj())
58012 js_PutArgsObject(this);
58013 }
58014
58015 if (maintainNestingState())
58016 types::NestingEpilogue(this);
58017 }
58018
58019 inline void
58020 StackFrame::updateEpilogueFlags()
58021 {
58022 if (flags_ & (HAS_ARGS_OBJ | HAS_CALL_OBJ)) {
58023 if (hasArgsObj() && !argsObj().maybeStackFrame())
58024 flags_ &= ~HAS_ARGS_OBJ;
58025 if (hasCallObj() && !callObj().maybeStackFrame()) {
58026
58027
58028
58029
58030
58031
58032
58033 scopeChain_ = isFunctionFrame()
58034 ? callee().environment()
58035 : &scopeChain_->asScope().enclosingScope();
58036 flags_ &= ~HAS_CALL_OBJ;
58037 }
58038 }
58039
58040
58041
58042
58043
58044
58045 if (maintainNestingState())
58046 script()->nesting()->activeFrames++;
58047 }
58048
58049
58050
58051
58052 __attribute__((always_inline)) inline bool
58053 StackSpace::ensureSpace(JSContext *cx, MaybeReportError report, Value *from, ptrdiff_t nvals,
58054 JSCompartment *dest) const
58055 {
58056 assertInvariants();
58057 do { } while(0);
58058
58059
58060
58061 if ((__builtin_expect((conservativeEnd_ - from < nvals), 0)))
58062 return ensureSpaceSlow(cx, report, from, nvals, dest);
58063 return true;
58064 }
58065
58066 inline Value *
58067 StackSpace::getStackLimit(JSContext *cx, MaybeReportError report)
58068 {
58069 FrameRegs &regs = cx->regs();
58070 unsigned nvals = regs.fp()->numSlots() + STACK_JIT_EXTRA;
58071 return ensureSpace(cx, report, regs.sp, nvals)
58072 ? conservativeEnd_
58073 : __null;
58074 }
58075
58076
58077
58078 __attribute__((always_inline)) inline StackFrame *
58079 ContextStack::getCallFrame(JSContext *cx, MaybeReportError report, const CallArgs &args,
58080 JSFunction *fun, JSScript *script, StackFrame::Flags *flags) const
58081 {
58082 do { } while(0);
58083 unsigned nformal = fun->nargs;
58084
58085 Value *firstUnused = args.end();
58086 do { } while(0);
58087
58088
58089 unsigned nvals = VALUES_PER_STACK_FRAME + script->nslots + StackSpace::STACK_JIT_EXTRA;
58090
58091
58092
58093 if (args.length() == nformal) {
58094 if (!space().ensureSpace(cx, report, firstUnused, nvals))
58095 return __null;
58096 return reinterpret_cast<StackFrame *>(firstUnused);
58097 }
58098
58099 if (args.length() < nformal) {
58100 *flags = StackFrame::Flags(*flags | StackFrame::UNDERFLOW_ARGS);
58101 unsigned nmissing = nformal - args.length();
58102 if (!space().ensureSpace(cx, report, firstUnused, nmissing + nvals))
58103 return __null;
58104 SetValueRangeToUndefined(firstUnused, nmissing);
58105 return reinterpret_cast<StackFrame *>(firstUnused + nmissing);
58106 }
58107
58108 *flags = StackFrame::Flags(*flags | StackFrame::OVERFLOW_ARGS);
58109 unsigned ncopy = 2 + nformal;
58110 if (!space().ensureSpace(cx, report, firstUnused, ncopy + nvals))
58111 return __null;
58112 Value *dst = firstUnused;
58113 Value *src = args.base();
58114 PodCopy(dst, src, ncopy);
58115 return reinterpret_cast<StackFrame *>(firstUnused + ncopy);
58116 }
58117
58118 __attribute__((always_inline)) inline bool
58119 ContextStack::pushInlineFrame(JSContext *cx, FrameRegs &regs, const CallArgs &args,
58120 JSFunction &callee, JSScript *script,
58121 InitialFrameFlags initial)
58122 {
58123 do { } while(0);
58124 do { } while(0);
58125
58126 do { } while(0);
58127
58128 StackFrame::Flags flags = ToFrameFlags(initial);
58129 StackFrame *fp = getCallFrame(cx, REPORT_ERROR, args, &callee, script, &flags);
58130 if (!fp)
58131 return false;
58132
58133
58134 fp->initCallFrame(cx, callee, script, args.length(), flags);
58135
58136
58137
58138
58139
58140 regs.prepareToRun(*fp, script);
58141 return true;
58142 }
58143
58144 __attribute__((always_inline)) inline bool
58145 ContextStack::pushInlineFrame(JSContext *cx, FrameRegs &regs, const CallArgs &args,
58146 JSFunction &callee, JSScript *script,
58147 InitialFrameFlags initial, Value **stackLimit)
58148 {
58149 if (!pushInlineFrame(cx, regs, args, callee, script, initial))
58150 return false;
58151 *stackLimit = space().conservativeEnd_;
58152 return true;
58153 }
58154
58155 __attribute__((always_inline)) inline StackFrame *
58156 ContextStack::getFixupFrame(JSContext *cx, MaybeReportError report,
58157 const CallArgs &args, JSFunction *fun, JSScript *script,
58158 void *ncode, InitialFrameFlags initial, Value **stackLimit)
58159 {
58160 do { } while(0);
58161 do { } while(0);
58162 do { } while(0);
58163
58164 StackFrame::Flags flags = ToFrameFlags(initial);
58165 StackFrame *fp = getCallFrame(cx, report, args, fun, script, &flags);
58166 if (!fp)
58167 return __null;
58168
58169
58170 fp->initFixupFrame(cx->fp(), flags, ncode, args.length());
58171
58172 *stackLimit = space().conservativeEnd_;
58173 return fp;
58174 }
58175
58176 __attribute__((always_inline)) inline void
58177 ContextStack::popInlineFrame(FrameRegs &regs)
58178 {
58179 do { } while(0);
58180 do { } while(0);
58181
58182 StackFrame *fp = regs.fp();
58183 fp->functionEpilogue(cx_);
58184
58185 Value *newsp = fp->actualArgs() - 1;
58186 do { } while(0);
58187
58188 newsp[-1] = fp->returnValue();
58189 regs.popFrame(newsp);
58190 }
58191
58192 inline void
58193 ContextStack::popFrameAfterOverflow()
58194 {
58195
58196 FrameRegs &regs = seg_->regs();
58197 StackFrame *fp = regs.fp();
58198 regs.popFrame(fp->actualArgsEnd());
58199 }
58200
58201 inline JSScript *
58202 ContextStack::currentScript(jsbytecode **ppc) const
58203 {
58204 if (ppc)
58205 *ppc = __null;
58206
58207 FrameRegs *regs = maybeRegs();
58208 StackFrame *fp = regs ? regs->fp() : __null;
58209 while (fp && fp->isDummyFrame())
58210 fp = fp->prev();
58211 if (!fp)
58212 return __null;
58213
58214
58215 mjit::CallSite *inlined = regs->inlined();
58216 if (inlined) {
58217 mjit::JITChunk *chunk = fp->jit()->chunk(regs->pc);
58218 do { } while(0);
58219 mjit::InlineFrame *frame = &chunk->inlineFrames()[inlined->inlineIndex];
58220 JSScript *script = frame->fun->script();
58221 if (script->compartment() != cx_->compartment)
58222 return __null;
58223 if (ppc)
58224 *ppc = script->code + inlined->pcOffset;
58225 return script;
58226 }
58227
58228
58229 JSScript *script = fp->script();
58230 if (script->compartment() != cx_->compartment)
58231 return __null;
58232
58233 if (ppc)
58234 *ppc = fp->pcQuadratic(*this);
58235 return script;
58236 }
58237
58238 inline JSScript *
58239 ContextStack::currentScriptWithDiagnostics(jsbytecode **ppc) const
58240 {
58241 if (ppc)
58242 *ppc = __null;
58243
58244 FrameRegs *regs = maybeRegs();
58245 StackFrame *fp = regs ? regs->fp() : __null;
58246 while (fp && fp->isDummyFrame())
58247 fp = fp->prev();
58248 if (!fp)
58249 *(int *) 0x10 = 0;
58250
58251
58252 mjit::CallSite *inlined = regs->inlined();
58253 if (inlined) {
58254 mjit::JITChunk *chunk = fp->jit()->chunk(regs->pc);
58255 do { } while(0);
58256 mjit::InlineFrame *frame = &chunk->inlineFrames()[inlined->inlineIndex];
58257 JSScript *script = frame->fun->script();
58258 if (script->compartment() != cx_->compartment)
58259 *(int *) 0x20 = 0;
58260 if (ppc)
58261 *ppc = script->code + inlined->pcOffset;
58262 return script;
58263 }
58264
58265
58266 JSScript *script = fp->script();
58267 if (script->compartment() != cx_->compartment)
58268 *(int *) 0x30 = 0;
58269
58270 if (ppc)
58271 *ppc = fp->pcQuadratic(*this);
58272 if (!script)
58273 *(int *) 0x40 = 0;
58274 return script;
58275 }
58276
58277 inline HandleObject
58278 ContextStack::currentScriptedScopeChain() const
58279 {
58280 return fp()->scopeChain();
58281 }
58282
58283 }
58284 # 19 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinferinlines.h" 2
58285
58286
58287 #define jsinferinlines_h___
58288
58289
58290
58291
58292
58293 namespace js {
58294 namespace types {
58295
58296 inline Type
58297 Type::ObjectType(JSObject *obj)
58298 {
58299 if (obj->hasSingletonType())
58300 return Type(uintptr_t(obj) | 1);
58301 return Type(uintptr_t(obj->type()));
58302 }
58303
58304 inline Type
58305 Type::ObjectType(TypeObject *obj)
58306 {
58307 if (obj->singleton)
58308 return Type(uintptr_t(obj->singleton.get()) | 1);
58309 return Type(uintptr_t(obj));
58310 }
58311
58312 inline Type
58313 Type::ObjectType(TypeObjectKey *obj)
58314 {
58315 return Type(uintptr_t(obj));
58316 }
58317
58318 inline Type
58319 GetValueType(JSContext *cx, const Value &val)
58320 {
58321 do { } while(0);
58322 if (val.isDouble())
58323 return Type::DoubleType();
58324 if (val.isObject())
58325 return Type::ObjectType(&val.toObject());
58326 return Type::PrimitiveType(val.extractNonDoubleType());
58327 }
58328
58329 inline TypeFlags
58330 PrimitiveTypeFlag(JSValueType type)
58331 {
58332 switch (type) {
58333 case JSVAL_TYPE_UNDEFINED:
58334 return TYPE_FLAG_UNDEFINED;
58335 case JSVAL_TYPE_NULL:
58336 return TYPE_FLAG_NULL;
58337 case JSVAL_TYPE_BOOLEAN:
58338 return TYPE_FLAG_BOOLEAN;
58339 case JSVAL_TYPE_INT32:
58340 return TYPE_FLAG_INT32;
58341 case JSVAL_TYPE_DOUBLE:
58342 return TYPE_FLAG_DOUBLE;
58343 case JSVAL_TYPE_STRING:
58344 return TYPE_FLAG_STRING;
58345 case JSVAL_TYPE_MAGIC:
58346 return TYPE_FLAG_LAZYARGS;
58347 default:
58348 __builtin_unreachable();
58349 return 0;
58350 }
58351 }
58352
58353 inline JSValueType
58354 TypeFlagPrimitive(TypeFlags flags)
58355 {
58356 switch (flags) {
58357 case TYPE_FLAG_UNDEFINED:
58358 return JSVAL_TYPE_UNDEFINED;
58359 case TYPE_FLAG_NULL:
58360 return JSVAL_TYPE_NULL;
58361 case TYPE_FLAG_BOOLEAN:
58362 return JSVAL_TYPE_BOOLEAN;
58363 case TYPE_FLAG_INT32:
58364 return JSVAL_TYPE_INT32;
58365 case TYPE_FLAG_DOUBLE:
58366 return JSVAL_TYPE_DOUBLE;
58367 case TYPE_FLAG_STRING:
58368 return JSVAL_TYPE_STRING;
58369 case TYPE_FLAG_LAZYARGS:
58370 return JSVAL_TYPE_MAGIC;
58371 default:
58372 __builtin_unreachable();
58373 return (JSValueType) 0;
58374 }
58375 }
58376
58377
58378
58379
58380
58381
58382 inline jsid
58383 MakeTypeId(JSContext *cx, jsid id)
58384 {
58385 do { } while(0);
58386
58387
58388
58389
58390
58391 if (JSID_IS_INT(id))
58392 return ((jsid)0x2);
58393
58394
58395
58396
58397
58398 if (JSID_IS_STRING(id)) {
58399 JSFlatString *str = JSID_TO_FLAT_STRING(id);
58400 const jschar *cp = str->getCharsZ(cx);
58401 if (((((unsigned)(*cp)) - '0') <= 9) || *cp == '-') {
58402 cp++;
58403 while (((((unsigned)(*cp)) - '0') <= 9))
58404 cp++;
58405 if (*cp == 0)
58406 return ((jsid)0x2);
58407 }
58408 return id;
58409 }
58410
58411 return ((jsid)0x2);
58412 }
58413
58414 const char * TypeIdStringImpl(jsid id);
58415
58416
58417 static inline const char *
58418 TypeIdString(jsid id)
58419 {
58420
58421
58422
58423 return "(missing)";
58424
58425 }
58426 # 171 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinferinlines.h"
58427 struct AutoEnterTypeInference
58428 {
58429 FreeOp *freeOp;
58430 JSCompartment *compartment;
58431 bool oldActiveAnalysis;
58432 bool oldActiveInference;
58433
58434 AutoEnterTypeInference(JSContext *cx, bool compiling = false)
58435 {
58436 do { } while (0);
58437 init(cx->runtime->defaultFreeOp(), cx->compartment);
58438 }
58439
58440 AutoEnterTypeInference(FreeOp *fop, JSCompartment *comp)
58441 {
58442 init(fop, comp);
58443 }
58444
58445 ~AutoEnterTypeInference()
58446 {
58447 compartment->activeAnalysis = oldActiveAnalysis;
58448 compartment->activeInference = oldActiveInference;
58449
58450
58451
58452
58453
58454
58455
58456 if (!compartment->activeInference) {
58457 TypeCompartment *types = &compartment->types;
58458 if (types->pendingNukeTypes)
58459 types->nukeTypes(freeOp);
58460 else if (types->pendingRecompiles)
58461 types->processPendingRecompiles(freeOp);
58462 }
58463 }
58464
58465 private:
58466 void init(FreeOp *fop, JSCompartment *comp) {
58467 freeOp = fop;
58468 compartment = comp;
58469 oldActiveAnalysis = compartment->activeAnalysis;
58470 oldActiveInference = compartment->activeInference;
58471 compartment->activeAnalysis = true;
58472 compartment->activeInference = true;
58473 }
58474 };
58475
58476
58477
58478
58479
58480 struct AutoEnterCompilation
58481 {
58482 RecompileInfo &info;
58483
58484 AutoEnterCompilation(JSContext *cx, JSScript *script, bool constructing, unsigned chunkIndex)
58485 : info(cx->compartment->types.compiledInfo)
58486 {
58487 do { } while(0);
58488 info.script = script;
58489 info.constructing = constructing;
58490 info.barriers = cx->compartment->needsBarrier();
58491 info.chunkIndex = chunkIndex;
58492 }
58493
58494 ~AutoEnterCompilation()
58495 {
58496 do { } while(0);
58497 info.script = __null;
58498 info.constructing = false;
58499 info.barriers = false;
58500 info.chunkIndex = 0;
58501 }
58502 };
58503 # 263 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinferinlines.h"
58504 inline TypeObject *
58505 GetTypeNewObject(JSContext *cx, JSProtoKey key)
58506 {
58507 JSObject *proto;
58508 if (!js_GetClassPrototype(cx, __null, key, &proto, __null))
58509 return __null;
58510 return proto->getNewType(cx);
58511 }
58512
58513
58514 inline TypeObject *
58515 GetTypeCallerInitObject(JSContext *cx, JSProtoKey key)
58516 {
58517 if (cx->typeInferenceEnabled()) {
58518 jsbytecode *pc;
58519 JSScript *script = cx->stack.currentScript(&pc);
58520 if (script)
58521 return TypeScript::InitObject(cx, script, pc, key);
58522 }
58523 return GetTypeNewObject(cx, key);
58524 }
58525
58526
58527
58528
58529
58530 inline void
58531 MarkIteratorUnknown(JSContext *cx)
58532 {
58533 extern void MarkIteratorUnknownSlow(JSContext *cx);
58534
58535 if (cx->typeInferenceEnabled())
58536 MarkIteratorUnknownSlow(cx);
58537 }
58538
58539
58540
58541
58542
58543 inline bool
58544 TypeMonitorCall(JSContext *cx, const js::CallArgs &args, bool constructing)
58545 {
58546 extern void TypeMonitorCallSlow(JSContext *cx, JSObject *callee,
58547 const CallArgs &args, bool constructing);
58548
58549 JSObject *callee = &args.callee();
58550 if (callee->isFunction()) {
58551 JSFunction *fun = callee->toFunction();
58552 if (fun->isInterpreted()) {
58553 JSScript *script = fun->script();
58554 if (!script->ensureRanAnalysis(cx, fun->environment()))
58555 return false;
58556 if (cx->typeInferenceEnabled())
58557 TypeMonitorCallSlow(cx, callee, args, constructing);
58558 }
58559 }
58560
58561 return true;
58562 }
58563
58564 inline bool
58565 TrackPropertyTypes(JSContext *cx, JSObject *obj, jsid id)
58566 {
58567 if (!cx->typeInferenceEnabled() || obj->hasLazyType() || obj->type()->unknownProperties())
58568 return false;
58569
58570 if (obj->hasSingletonType() && !obj->type()->maybeGetProperty(cx, id))
58571 return false;
58572
58573 return true;
58574 }
58575
58576
58577 inline void
58578 AddTypePropertyId(JSContext *cx, JSObject *obj, jsid id, Type type)
58579 {
58580 if (cx->typeInferenceEnabled())
58581 id = MakeTypeId(cx, id);
58582 if (TrackPropertyTypes(cx, obj, id))
58583 obj->type()->addPropertyType(cx, id, type);
58584 }
58585
58586 inline void
58587 AddTypePropertyId(JSContext *cx, JSObject *obj, jsid id, const Value &value)
58588 {
58589 if (cx->typeInferenceEnabled())
58590 id = MakeTypeId(cx, id);
58591 if (TrackPropertyTypes(cx, obj, id))
58592 obj->type()->addPropertyType(cx, id, value);
58593 }
58594
58595 inline void
58596 AddTypeProperty(JSContext *cx, TypeObject *obj, const char *name, Type type)
58597 {
58598 if (cx->typeInferenceEnabled() && !obj->unknownProperties())
58599 obj->addPropertyType(cx, name, type);
58600 }
58601
58602 inline void
58603 AddTypeProperty(JSContext *cx, TypeObject *obj, const char *name, const Value &value)
58604 {
58605 if (cx->typeInferenceEnabled() && !obj->unknownProperties())
58606 obj->addPropertyType(cx, name, value);
58607 }
58608
58609
58610 inline void
58611 MarkTypeObjectFlags(JSContext *cx, JSObject *obj, TypeObjectFlags flags)
58612 {
58613 if (cx->typeInferenceEnabled() && !obj->hasLazyType() && !obj->type()->hasAllFlags(flags))
58614 obj->type()->setFlags(cx, flags);
58615 }
58616
58617
58618
58619
58620
58621
58622
58623 inline void
58624 MarkTypeObjectUnknownProperties(JSContext *cx, TypeObject *obj,
58625 bool markSetsUnknown = false)
58626 {
58627 if (cx->typeInferenceEnabled()) {
58628 if (!obj->unknownProperties())
58629 obj->markUnknown(cx);
58630 if (markSetsUnknown && !(obj->flags & OBJECT_FLAG_SETS_MARKED_UNKNOWN))
58631 cx->compartment->types.markSetsUnknown(cx, obj);
58632 }
58633 }
58634
58635
58636
58637
58638
58639 inline void
58640 MarkTypePropertyConfigured(JSContext *cx, JSObject *obj, jsid id)
58641 {
58642 if (cx->typeInferenceEnabled())
58643 id = MakeTypeId(cx, id);
58644 if (TrackPropertyTypes(cx, obj, id))
58645 obj->type()->markPropertyConfigured(cx, id);
58646 }
58647
58648
58649 inline void
58650 MarkObjectStateChange(JSContext *cx, JSObject *obj)
58651 {
58652 if (cx->typeInferenceEnabled() && !obj->hasLazyType() && !obj->type()->unknownProperties())
58653 obj->type()->markStateChange(cx);
58654 }
58655
58656
58657
58658
58659
58660
58661 inline void
58662 FixArrayType(JSContext *cx, JSObject *obj)
58663 {
58664 if (cx->typeInferenceEnabled())
58665 cx->compartment->types.fixArrayType(cx, obj);
58666 }
58667
58668 inline void
58669 FixObjectType(JSContext *cx, JSObject *obj)
58670 {
58671 if (cx->typeInferenceEnabled())
58672 cx->compartment->types.fixObjectType(cx, obj);
58673 }
58674
58675
58676 extern void TypeMonitorResult(JSContext *cx, JSScript *script, jsbytecode *pc, const js::Value &rval);
58677 extern void TypeDynamicResult(JSContext *cx, JSScript *script, jsbytecode *pc, js::types::Type type);
58678
58679 inline bool
58680 UseNewTypeAtEntry(JSContext *cx, StackFrame *fp)
58681 {
58682 return fp->isConstructing() && cx->typeInferenceEnabled() &&
58683 fp->prev() && fp->prev()->isScriptFrame() &&
58684 UseNewType(cx, fp->prev()->script(), fp->prev()->pcQuadratic(cx->stack, fp));
58685 }
58686
58687
58688
58689
58690
58691 inline
58692 TypeScript::TypeScript()
58693 {
58694 this->global = (js::GlobalObject *) GLOBAL_MISSING_SCOPE;
58695 }
58696
58697 inline unsigned
58698 TypeScript::NumTypeSets(JSScript *script)
58699 {
58700 return script->nTypeSets + analyze::TotalSlots(script);
58701 }
58702
58703 inline TypeSet *
58704 TypeScript::ReturnTypes(JSScript *script)
58705 {
58706 return script->types->typeArray() + script->nTypeSets + js::analyze::CalleeSlot();
58707 }
58708
58709 inline TypeSet *
58710 TypeScript::ThisTypes(JSScript *script)
58711 {
58712 return script->types->typeArray() + script->nTypeSets + js::analyze::ThisSlot();
58713 }
58714
58715
58716
58717
58718
58719
58720
58721 inline TypeSet *
58722 TypeScript::ArgTypes(JSScript *script, unsigned i)
58723 {
58724 do { } while(0);
58725 return script->types->typeArray() + script->nTypeSets + js::analyze::ArgSlot(i);
58726 }
58727
58728 inline TypeSet *
58729 TypeScript::LocalTypes(JSScript *script, unsigned i)
58730 {
58731 do { } while(0);
58732 return script->types->typeArray() + script->nTypeSets + js::analyze::LocalSlot(script, i);
58733 }
58734
58735 inline TypeSet *
58736 TypeScript::SlotTypes(JSScript *script, unsigned slot)
58737 {
58738 do { } while(0);
58739 return script->types->typeArray() + script->nTypeSets + slot;
58740 }
58741
58742 inline TypeObject *
58743 TypeScript::StandardType(JSContext *cx, JSScript *script, JSProtoKey key)
58744 {
58745 JSObject *proto;
58746 if (!js_GetClassPrototype(cx, script->global(), key, &proto, __null))
58747 return __null;
58748 return proto->getNewType(cx);
58749 }
58750
58751 struct AllocationSiteKey {
58752 JSScript *script;
58753
58754 uint32_t offset : 24;
58755 JSProtoKey kind : 8;
58756
58757 static const uint32_t OFFSET_LIMIT = (1 << 23);
58758
58759 AllocationSiteKey() { PodZero(this); }
58760
58761 typedef AllocationSiteKey Lookup;
58762
58763 static inline uint32_t hash(AllocationSiteKey key) {
58764 return uint32_t(size_t(key.script->code + key.offset)) ^ key.kind;
58765 }
58766
58767 static inline bool match(const AllocationSiteKey &a, const AllocationSiteKey &b) {
58768 return a.script == b.script && a.offset == b.offset && a.kind == b.kind;
58769 }
58770 };
58771
58772 inline TypeObject *
58773 TypeScript::InitObject(JSContext *cx, JSScript *script, jsbytecode *pc, JSProtoKey kind)
58774 {
58775 do { } while(0);
58776
58777
58778 uint32_t offset = pc - script->code;
58779
58780 if (!cx->typeInferenceEnabled() || !script->hasGlobal() || offset >= AllocationSiteKey::OFFSET_LIMIT)
58781 return GetTypeNewObject(cx, kind);
58782
58783 AllocationSiteKey key;
58784 key.script = script;
58785 key.offset = offset;
58786 key.kind = kind;
58787
58788 if (!cx->compartment->types.allocationSiteTable)
58789 return cx->compartment->types.newAllocationSiteTypeObject(cx, key);
58790
58791 AllocationSiteTable::Ptr p = cx->compartment->types.allocationSiteTable->lookup(key);
58792
58793 if (p)
58794 return p->value;
58795 return cx->compartment->types.newAllocationSiteTypeObject(cx, key);
58796 }
58797
58798
58799 static inline bool
58800 SetInitializerObjectType(JSContext *cx, JSScript *script, jsbytecode *pc, JSObject *obj)
58801 {
58802 if (!cx->typeInferenceEnabled())
58803 return true;
58804
58805 if (UseNewTypeForInitializer(cx, script, pc)) {
58806 if (!obj->setSingletonType(cx))
58807 return false;
58808
58809
58810
58811
58812
58813
58814 TypeScript::Monitor(cx, script, pc, ObjectValue(*obj));
58815 } else {
58816 JSProtoKey key = obj->isDenseArray() ? JSProto_Array : JSProto_Object;
58817 types::TypeObject *type = TypeScript::InitObject(cx, script, pc, key);
58818 if (!type)
58819 return false;
58820 obj->setType(type);
58821 }
58822
58823 return true;
58824 }
58825
58826 inline void
58827 TypeScript::Monitor(JSContext *cx, JSScript *script, jsbytecode *pc, const js::Value &rval)
58828 {
58829 if (cx->typeInferenceEnabled())
58830 TypeMonitorResult(cx, script, pc, rval);
58831 }
58832
58833 inline void
58834 TypeScript::MonitorOverflow(JSContext *cx, JSScript *script, jsbytecode *pc)
58835 {
58836 if (cx->typeInferenceEnabled())
58837 TypeDynamicResult(cx, script, pc, Type::DoubleType());
58838 }
58839
58840 inline void
58841 TypeScript::MonitorString(JSContext *cx, JSScript *script, jsbytecode *pc)
58842 {
58843 if (cx->typeInferenceEnabled())
58844 TypeDynamicResult(cx, script, pc, Type::StringType());
58845 }
58846
58847 inline void
58848 TypeScript::MonitorUnknown(JSContext *cx, JSScript *script, jsbytecode *pc)
58849 {
58850 if (cx->typeInferenceEnabled())
58851 TypeDynamicResult(cx, script, pc, Type::UnknownType());
58852 }
58853
58854 inline void
58855 TypeScript::GetPcScript(JSContext *cx, JSScript **script, jsbytecode **pc)
58856 {
58857 *script = cx->fp()->script();
58858 *pc = cx->regs().pc;
58859 }
58860
58861 inline void
58862 TypeScript::MonitorOverflow(JSContext *cx)
58863 {
58864 JSScript *script;
58865 jsbytecode *pc;
58866 GetPcScript(cx, &script, &pc);
58867 MonitorOverflow(cx, script, pc);
58868 }
58869
58870 inline void
58871 TypeScript::MonitorString(JSContext *cx)
58872 {
58873 JSScript *script;
58874 jsbytecode *pc;
58875 GetPcScript(cx, &script, &pc);
58876 MonitorString(cx, script, pc);
58877 }
58878
58879 inline void
58880 TypeScript::MonitorUnknown(JSContext *cx)
58881 {
58882 JSScript *script;
58883 jsbytecode *pc;
58884 GetPcScript(cx, &script, &pc);
58885 MonitorUnknown(cx, script, pc);
58886 }
58887
58888 inline void
58889 TypeScript::Monitor(JSContext *cx, const js::Value &rval)
58890 {
58891 JSScript *script;
58892 jsbytecode *pc;
58893 GetPcScript(cx, &script, &pc);
58894 Monitor(cx, script, pc, rval);
58895 }
58896
58897 inline void
58898 TypeScript::MonitorAssign(JSContext *cx, JSObject *obj, jsid id)
58899 {
58900 if (cx->typeInferenceEnabled() && !obj->hasSingletonType()) {
58901 # 668 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinferinlines.h"
58902 uint32_t i;
58903 if (js_IdIsIndex(id, &i))
58904 return;
58905 MarkTypeObjectUnknownProperties(cx, obj->type());
58906 }
58907 }
58908
58909 inline void
58910 TypeScript::SetThis(JSContext *cx, JSScript *script, Type type)
58911 {
58912 if (!cx->typeInferenceEnabled())
58913 return;
58914 do { } while(0);
58915
58916
58917 bool analyze = cx->hasRunOption(((uint32_t)1 << (16)));
58918
58919 if (!ThisTypes(script)->hasType(type) || analyze) {
58920 AutoEnterTypeInference enter(cx);
58921
58922 InferSpew(ISpewOps, "externalType: setThis #%u: %s",
58923 script->id(), TypeString(type));
58924 ThisTypes(script)->addType(cx, type);
58925
58926 if (analyze && script->types->hasScope())
58927 script->ensureRanInference(cx);
58928 }
58929 }
58930
58931 inline void
58932 TypeScript::SetThis(JSContext *cx, JSScript *script, const js::Value &value)
58933 {
58934 if (cx->typeInferenceEnabled())
58935 SetThis(cx, script, GetValueType(cx, value));
58936 }
58937
58938 inline void
58939 TypeScript::SetLocal(JSContext *cx, JSScript *script, unsigned local, Type type)
58940 {
58941 if (!cx->typeInferenceEnabled())
58942 return;
58943 do { } while(0);
58944
58945 if (!LocalTypes(script, local)->hasType(type)) {
58946 AutoEnterTypeInference enter(cx);
58947
58948 InferSpew(ISpewOps, "externalType: setLocal #%u %u: %s",
58949 script->id(), local, TypeString(type));
58950 LocalTypes(script, local)->addType(cx, type);
58951 }
58952 }
58953
58954 inline void
58955 TypeScript::SetLocal(JSContext *cx, JSScript *script, unsigned local, const js::Value &value)
58956 {
58957 if (cx->typeInferenceEnabled()) {
58958 Type type = GetValueType(cx, value);
58959 SetLocal(cx, script, local, type);
58960 }
58961 }
58962
58963 inline void
58964 TypeScript::SetArgument(JSContext *cx, JSScript *script, unsigned arg, Type type)
58965 {
58966 if (!cx->typeInferenceEnabled())
58967 return;
58968 do { } while(0);
58969
58970 if (!ArgTypes(script, arg)->hasType(type)) {
58971 AutoEnterTypeInference enter(cx);
58972
58973 InferSpew(ISpewOps, "externalType: setArg #%u %u: %s",
58974 script->id(), arg, TypeString(type));
58975 ArgTypes(script, arg)->addType(cx, type);
58976 }
58977 }
58978
58979 inline void
58980 TypeScript::SetArgument(JSContext *cx, JSScript *script, unsigned arg, const js::Value &value)
58981 {
58982 if (cx->typeInferenceEnabled()) {
58983 Type type = GetValueType(cx, value);
58984 SetArgument(cx, script, arg, type);
58985 }
58986 }
58987
58988 void
58989 TypeScript::trace(JSTracer *trc)
58990 {
58991 if (hasScope() && global)
58992 gc::MarkObject(trc, &global, "script_global");
58993
58994
58995 }
58996
58997
58998
58999
59000
59001 inline JSCompartment *
59002 TypeCompartment::compartment()
59003 {
59004 return (JSCompartment *)((char *)this - __builtin_offsetof (JSCompartment, types));
59005 }
59006
59007 inline void
59008 TypeCompartment::addPending(JSContext *cx, TypeConstraint *constraint, TypeSet *source, Type type)
59009 {
59010 do { } while(0);
59011 do { } while(0);
59012
59013 InferSpew(ISpewOps, "pending: %sC%p%s %s",
59014 InferSpewColor(constraint), constraint, InferSpewColorReset(),
59015 TypeString(type));
59016
59017 if ((pendingCount == pendingCapacity) && !growPendingArray(cx))
59018 return;
59019
59020 PendingWork &pending = pendingArray[pendingCount++];
59021 pending.constraint = constraint;
59022 pending.source = source;
59023 pending.type = type;
59024 }
59025
59026 inline void
59027 TypeCompartment::resolvePending(JSContext *cx)
59028 {
59029 do { } while(0);
59030
59031 if (resolving) {
59032
59033 return;
59034 }
59035
59036 resolving = true;
59037
59038
59039 while (pendingCount) {
59040 const PendingWork &pending = pendingArray[--pendingCount];
59041 InferSpew(ISpewOps, "resolve: %sC%p%s %s",
59042 InferSpewColor(pending.constraint), pending.constraint,
59043 InferSpewColorReset(), TypeString(pending.type));
59044 pending.constraint->newType(cx, pending.source, pending.type);
59045 }
59046
59047 resolving = false;
59048 }
59049 # 828 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinferinlines.h"
59050 const unsigned SET_ARRAY_SIZE = 8;
59051
59052
59053 static inline unsigned
59054 HashSetCapacity(unsigned count)
59055 {
59056 do { } while(0);
59057
59058 if (count <= SET_ARRAY_SIZE)
59059 return SET_ARRAY_SIZE;
59060
59061 unsigned log2;
59062 do { (log2) = 31 - __builtin_clz(((unsigned int)(count)) | 1); } while (0);
59063 return 1 << (log2 + 2);
59064 }
59065
59066
59067 template <class T, class KEY>
59068 static inline uint32_t
59069 HashKey(T v)
59070 {
59071 uint32_t nv = KEY::keyBits(v);
59072
59073 uint32_t hash = 84696351 ^ (nv & 0xff);
59074 hash = (hash * 16777619) ^ ((nv >> 8) & 0xff);
59075 hash = (hash * 16777619) ^ ((nv >> 16) & 0xff);
59076 return (hash * 16777619) ^ ((nv >> 24) & 0xff);
59077 }
59078
59079
59080
59081
59082
59083 template <class T, class U, class KEY>
59084 static U **
59085 HashSetInsertTry(JSCompartment *compartment, U **&values, unsigned &count, T key)
59086 {
59087 unsigned capacity = HashSetCapacity(count);
59088 unsigned insertpos = HashKey<T,KEY>(key) & (capacity - 1);
59089
59090
59091 bool converting = (count == SET_ARRAY_SIZE);
59092
59093 if (!converting) {
59094 while (values[insertpos] != __null) {
59095 if (KEY::getKey(values[insertpos]) == key)
59096 return &values[insertpos];
59097 insertpos = (insertpos + 1) & (capacity - 1);
59098 }
59099 }
59100
59101 count++;
59102 unsigned newCapacity = HashSetCapacity(count);
59103
59104 if (newCapacity == capacity) {
59105 do { } while(0);
59106 return &values[insertpos];
59107 }
59108
59109 U **newValues = compartment->typeLifoAlloc.newArray<U*>(newCapacity);
59110 if (!newValues)
59111 return __null;
59112 PodZero(newValues, newCapacity);
59113
59114 for (unsigned i = 0; i < capacity; i++) {
59115 if (values[i]) {
59116 unsigned pos = HashKey<T,KEY>(KEY::getKey(values[i])) & (newCapacity - 1);
59117 while (newValues[pos] != __null)
59118 pos = (pos + 1) & (newCapacity - 1);
59119 newValues[pos] = values[i];
59120 }
59121 }
59122
59123 values = newValues;
59124
59125 insertpos = HashKey<T,KEY>(key) & (newCapacity - 1);
59126 while (values[insertpos] != __null)
59127 insertpos = (insertpos + 1) & (newCapacity - 1);
59128 return &values[insertpos];
59129 }
59130
59131
59132
59133
59134
59135 template <class T, class U, class KEY>
59136 static inline U **
59137 HashSetInsert(JSCompartment *compartment, U **&values, unsigned &count, T key)
59138 {
59139 if (count == 0) {
59140 do { } while(0);
59141 count++;
59142 return (U **) &values;
59143 }
59144
59145 if (count == 1) {
59146 U *oldData = (U*) values;
59147 if (KEY::getKey(oldData) == key)
59148 return (U **) &values;
59149
59150 values = compartment->typeLifoAlloc.newArray<U*>(SET_ARRAY_SIZE);
59151 if (!values) {
59152 values = (U **) oldData;
59153 return __null;
59154 }
59155 PodZero(values, SET_ARRAY_SIZE);
59156 count++;
59157
59158 values[0] = oldData;
59159 return &values[1];
59160 }
59161
59162 if (count <= SET_ARRAY_SIZE) {
59163 for (unsigned i = 0; i < count; i++) {
59164 if (KEY::getKey(values[i]) == key)
59165 return &values[i];
59166 }
59167
59168 if (count < SET_ARRAY_SIZE) {
59169 count++;
59170 return &values[count - 1];
59171 }
59172 }
59173
59174 return HashSetInsertTry<T,U,KEY>(compartment, values, count, key);
59175 }
59176
59177
59178 template <class T, class U, class KEY>
59179 static inline U *
59180 HashSetLookup(U **values, unsigned count, T key)
59181 {
59182 if (count == 0)
59183 return __null;
59184
59185 if (count == 1)
59186 return (KEY::getKey((U *) values) == key) ? (U *) values : __null;
59187
59188 if (count <= SET_ARRAY_SIZE) {
59189 for (unsigned i = 0; i < count; i++) {
59190 if (KEY::getKey(values[i]) == key)
59191 return values[i];
59192 }
59193 return __null;
59194 }
59195
59196 unsigned capacity = HashSetCapacity(count);
59197 unsigned pos = HashKey<T,KEY>(key) & (capacity - 1);
59198
59199 while (values[pos] != __null) {
59200 if (KEY::getKey(values[pos]) == key)
59201 return values[pos];
59202 pos = (pos + 1) & (capacity - 1);
59203 }
59204
59205 return __null;
59206 }
59207
59208 inline TypeObjectKey *
59209 Type::objectKey() const
59210 {
59211 do { } while(0);
59212 if (isTypeObject())
59213 TypeObject::readBarrier((TypeObject *) data);
59214 else
59215 JSObject::readBarrier((JSObject *) (data ^ 1));
59216 return (TypeObjectKey *) data;
59217 }
59218
59219 inline JSObject *
59220 Type::singleObject() const
59221 {
59222 do { } while(0);
59223 JSObject::readBarrier((JSObject *) (data ^ 1));
59224 return (JSObject *) (data ^ 1);
59225 }
59226
59227 inline TypeObject *
59228 Type::typeObject() const
59229 {
59230 do { } while(0);
59231 TypeObject::readBarrier((TypeObject *) data);
59232 return (TypeObject *) data;
59233 }
59234
59235 inline bool
59236 TypeSet::hasType(Type type)
59237 {
59238 if (unknown())
59239 return true;
59240
59241 if (type.isUnknown()) {
59242 return false;
59243 } else if (type.isPrimitive()) {
59244 return !!(flags & PrimitiveTypeFlag(type.primitive()));
59245 } else if (type.isAnyObject()) {
59246 return !!(flags & TYPE_FLAG_ANYOBJECT);
59247 } else {
59248 return !!(flags & TYPE_FLAG_ANYOBJECT) ||
59249 HashSetLookup<TypeObjectKey*,TypeObjectKey,TypeObjectKey>
59250 (objectSet, baseObjectCount(), type.objectKey()) != __null;
59251 }
59252 }
59253
59254 inline void
59255 TypeSet::setBaseObjectCount(uint32_t count)
59256 {
59257 do { } while(0);
59258 flags = (flags & ~TYPE_FLAG_OBJECT_COUNT_MASK)
59259 | (count << TYPE_FLAG_OBJECT_COUNT_SHIFT);
59260 }
59261
59262 inline void
59263 TypeSet::clearObjects()
59264 {
59265 setBaseObjectCount(0);
59266 objectSet = __null;
59267 }
59268
59269 inline void
59270 TypeSet::addType(JSContext *cx, Type type)
59271 {
59272 do { } while(0);
59273
59274 if (unknown())
59275 return;
59276
59277 if (type.isUnknown()) {
59278 flags |= TYPE_FLAG_BASE_MASK;
59279 clearObjects();
59280 do { } while(0);
59281 } else if (type.isPrimitive()) {
59282 TypeFlags flag = PrimitiveTypeFlag(type.primitive());
59283 if (flags & flag)
59284 return;
59285
59286
59287 if (flag == TYPE_FLAG_DOUBLE)
59288 flag |= TYPE_FLAG_INT32;
59289
59290 flags |= flag;
59291 } else {
59292 if (flags & TYPE_FLAG_ANYOBJECT)
59293 return;
59294 if (type.isAnyObject())
59295 goto unknownObject;
59296 uint32_t objectCount = baseObjectCount();
59297 TypeObjectKey *object = type.objectKey();
59298 TypeObjectKey **pentry = HashSetInsert<TypeObjectKey *,TypeObjectKey,TypeObjectKey>
59299 (cx->compartment, objectSet, objectCount, object);
59300 if (!pentry) {
59301 cx->compartment->types.setPendingNukeTypes(cx);
59302 return;
59303 }
59304 if (*pentry)
59305 return;
59306 *pentry = object;
59307
59308 setBaseObjectCount(objectCount);
59309
59310 if (objectCount == TYPE_FLAG_OBJECT_COUNT_LIMIT)
59311 goto unknownObject;
59312
59313 if (type.isTypeObject()) {
59314 TypeObject *nobject = type.typeObject();
59315 do { } while(0);
59316 if (nobject->unknownProperties())
59317 goto unknownObject;
59318 if (objectCount > 1) {
59319 nobject->contribution += (objectCount - 1) * (objectCount - 1);
59320 if (nobject->contribution >= TypeObject::CONTRIBUTION_LIMIT) {
59321 InferSpew(ISpewOps, "limitUnknown: %sT%p%s",
59322 InferSpewColor(this), this, InferSpewColorReset());
59323 goto unknownObject;
59324 }
59325 }
59326 }
59327 }
59328
59329 if (false) {
59330 unknownObject:
59331 type = Type::AnyObjectType();
59332 flags |= TYPE_FLAG_ANYOBJECT;
59333 clearObjects();
59334 }
59335
59336 InferSpew(ISpewOps, "addType: %sT%p%s %s",
59337 InferSpewColor(this), this, InferSpewColorReset(),
59338 TypeString(type));
59339
59340
59341 TypeConstraint *constraint = constraintList;
59342 while (constraint) {
59343 cx->compartment->types.addPending(cx, constraint, this, type);
59344 constraint = constraint->next;
59345 }
59346
59347 cx->compartment->types.resolvePending(cx);
59348 }
59349
59350 inline void
59351 TypeSet::setOwnProperty(JSContext *cx, bool configured)
59352 {
59353 TypeFlags nflags = TYPE_FLAG_OWN_PROPERTY | (configured ? TYPE_FLAG_CONFIGURED_PROPERTY : 0);
59354
59355 if ((flags & nflags) == nflags)
59356 return;
59357
59358 flags |= nflags;
59359
59360
59361 TypeConstraint *constraint = constraintList;
59362 while (constraint) {
59363 constraint->newPropertyState(cx, this);
59364 constraint = constraint->next;
59365 }
59366 }
59367
59368 inline unsigned
59369 TypeSet::getObjectCount()
59370 {
59371 do { } while(0);
59372 uint32_t count = baseObjectCount();
59373 if (count > SET_ARRAY_SIZE)
59374 return HashSetCapacity(count);
59375 return count;
59376 }
59377
59378 inline TypeObjectKey *
59379 TypeSet::getObject(unsigned i)
59380 {
59381 do { } while(0);
59382 if (baseObjectCount() == 1) {
59383 do { } while(0);
59384 return (TypeObjectKey *) objectSet;
59385 }
59386 return objectSet[i];
59387 }
59388
59389 inline JSObject *
59390 TypeSet::getSingleObject(unsigned i)
59391 {
59392 TypeObjectKey *key = getObject(i);
59393 return (uintptr_t(key) & 1) ? (JSObject *)(uintptr_t(key) ^ 1) : __null;
59394 }
59395
59396 inline TypeObject *
59397 TypeSet::getTypeObject(unsigned i)
59398 {
59399 TypeObjectKey *key = getObject(i);
59400 return (key && !(uintptr_t(key) & 1)) ? (TypeObject *) key : __null;
59401 }
59402
59403
59404
59405
59406
59407 inline
59408 TypeCallsite::TypeCallsite(JSContext *cx, JSScript *script, jsbytecode *pc,
59409 bool isNew, unsigned argumentCount)
59410 : script(script), pc(pc), isNew(isNew), argumentCount(argumentCount),
59411 thisTypes(__null), returnTypes(__null)
59412 {
59413
59414 argumentTypes = cx->typeLifoAlloc().newArray<TypeSet*>(argumentCount);
59415 }
59416
59417
59418
59419
59420
59421 inline TypeObject::TypeObject(JSObject *proto, bool function, bool unknown)
59422 {
59423 PodZero(this);
59424
59425
59426 do { } while (0);
59427
59428 this->proto = proto;
59429
59430 if (function)
59431 flags |= OBJECT_FLAG_FUNCTION;
59432 if (unknown)
59433 flags |= OBJECT_FLAG_UNKNOWN_MASK;
59434
59435 InferSpew(ISpewOps, "newObject: %s", TypeObjectString(this));
59436 }
59437
59438 inline uint32_t
59439 TypeObject::basePropertyCount() const
59440 {
59441 return (flags & OBJECT_FLAG_PROPERTY_COUNT_MASK) >> OBJECT_FLAG_PROPERTY_COUNT_SHIFT;
59442 }
59443
59444 inline void
59445 TypeObject::setBasePropertyCount(uint32_t count)
59446 {
59447 do { } while(0);
59448 flags = (flags & ~OBJECT_FLAG_PROPERTY_COUNT_MASK)
59449 | (count << OBJECT_FLAG_PROPERTY_COUNT_SHIFT);
59450 }
59451
59452 inline TypeSet *
59453 TypeObject::getProperty(JSContext *cx, jsid id, bool assign)
59454 {
59455 do { } while(0);
59456 do { } while(0);
59457 do { } while (0);
59458 do { } while(0);
59459
59460 uint32_t propertyCount = basePropertyCount();
59461 Property **pprop = HashSetInsert<jsid,Property,Property>
59462 (cx->compartment, propertySet, propertyCount, id);
59463 if (!pprop) {
59464 cx->compartment->types.setPendingNukeTypes(cx);
59465 return __null;
59466 }
59467
59468 if (!*pprop) {
59469 setBasePropertyCount(propertyCount);
59470 if (!addProperty(cx, id, pprop)) {
59471 setBasePropertyCount(0);
59472 propertySet = __null;
59473 return __null;
59474 }
59475 if (propertyCount == OBJECT_FLAG_PROPERTY_COUNT_LIMIT) {
59476 markUnknown(cx);
59477 TypeSet *types = TypeSet::make(cx, "propertyOverflow");
59478 types->addType(cx, Type::UnknownType());
59479 return types;
59480 }
59481 }
59482
59483 TypeSet *types = &(*pprop)->types;
59484
59485 if (assign)
59486 types->setOwnProperty(cx, false);
59487
59488 return types;
59489 }
59490
59491 inline TypeSet *
59492 TypeObject::maybeGetProperty(JSContext *cx, jsid id)
59493 {
59494 do { } while(0);
59495 do { } while (0);
59496 do { } while(0);
59497
59498 Property *prop = HashSetLookup<jsid,Property,Property>
59499 (propertySet, basePropertyCount(), id);
59500
59501 return prop ? &prop->types : __null;
59502 }
59503
59504 inline unsigned
59505 TypeObject::getPropertyCount()
59506 {
59507 uint32_t count = basePropertyCount();
59508 if (count > SET_ARRAY_SIZE)
59509 return HashSetCapacity(count);
59510 return count;
59511 }
59512
59513 inline Property *
59514 TypeObject::getProperty(unsigned i)
59515 {
59516 do { } while(0);
59517 if (basePropertyCount() == 1) {
59518 do { } while(0);
59519 return (Property *) propertySet;
59520 }
59521 return propertySet[i];
59522 }
59523
59524 inline void
59525 TypeObject::setFlagsFromKey(JSContext *cx, JSProtoKey key)
59526 {
59527 TypeObjectFlags flags = 0;
59528
59529 switch (key) {
59530 case JSProto_Function:
59531 do { } while(0);
59532
59533
59534 case JSProto_Object:
59535 flags = OBJECT_FLAG_NON_DENSE_ARRAY
59536 | OBJECT_FLAG_NON_PACKED_ARRAY
59537 | OBJECT_FLAG_NON_TYPED_ARRAY;
59538 break;
59539
59540 case JSProto_Array:
59541 flags = OBJECT_FLAG_NON_TYPED_ARRAY;
59542 break;
59543
59544 default:
59545
59546 do { } while(0)
59547 # 1333 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsinferinlines.h"
59548 ;
59549 flags = OBJECT_FLAG_NON_DENSE_ARRAY
59550 | OBJECT_FLAG_NON_PACKED_ARRAY;
59551 break;
59552 }
59553
59554 if (!hasAllFlags(flags))
59555 setFlags(cx, flags);
59556 }
59557
59558 inline JSObject *
59559 TypeObject::getGlobal()
59560 {
59561 if (singleton)
59562 return &singleton->global();
59563 if (interpretedFunction && interpretedFunction->script()->compileAndGo)
59564 return &interpretedFunction->global();
59565 return __null;
59566 }
59567
59568 inline void
59569 TypeObject::writeBarrierPre(TypeObject *type)
59570 {
59571
59572 if (!type)
59573 return;
59574
59575 JSCompartment *comp = type->compartment();
59576 if (comp->needsBarrier()) {
59577 TypeObject *tmp = type;
59578 MarkTypeObjectUnbarriered(comp->barrierTracer(), &tmp, "write barrier");
59579 do { } while(0);
59580 }
59581
59582 }
59583
59584 inline void
59585 TypeObject::writeBarrierPost(TypeObject *type, void *addr)
59586 {
59587 }
59588
59589 inline void
59590 TypeObject::readBarrier(TypeObject *type)
59591 {
59592
59593 JSCompartment *comp = type->compartment();
59594 if (comp->needsBarrier()) {
59595 TypeObject *tmp = type;
59596 MarkTypeObjectUnbarriered(comp->barrierTracer(), &tmp, "read barrier");
59597 do { } while(0);
59598 }
59599
59600 }
59601
59602 inline void
59603 TypeNewScript::writeBarrierPre(TypeNewScript *newScript)
59604 {
59605
59606 if (!newScript)
59607 return;
59608
59609 JSCompartment *comp = newScript->fun->compartment();
59610 if (comp->needsBarrier()) {
59611 MarkObject(comp->barrierTracer(), &newScript->fun, "write barrier");
59612 MarkShape(comp->barrierTracer(), &newScript->shape, "write barrier");
59613 }
59614
59615 }
59616
59617 inline void
59618 TypeNewScript::writeBarrierPost(TypeNewScript *newScript, void *addr)
59619 {
59620 }
59621
59622 inline
59623 Property::Property(jsid id)
59624 : id(id)
59625 {
59626 }
59627
59628 inline
59629 Property::Property(const Property &o)
59630 : id(o.id.get()), types(o.types)
59631 {
59632 }
59633
59634 } }
59635
59636 inline bool
59637 JSScript::ensureHasTypes(JSContext *cx)
59638 {
59639 return types || makeTypes(cx);
59640 }
59641
59642 inline bool
59643 JSScript::ensureRanAnalysis(JSContext *cx, JSObject *scope)
59644 {
59645 JSScript *self = this;
59646 JS::SkipRoot root(cx, &self);
59647
59648 if (!self->ensureHasTypes(cx))
59649 return false;
59650 if (!self->types->hasScope()) {
59651 js::RootedObject scopeRoot(cx, scope);
59652 if (!js::types::TypeScript::SetScope(cx, self, scope))
59653 return false;
59654 scope = scopeRoot;
59655 }
59656 if (!self->hasAnalysis() && !self->makeAnalysis(cx))
59657 return false;
59658 do { } while(0);
59659 return true;
59660 }
59661
59662 inline bool
59663 JSScript::ensureRanInference(JSContext *cx)
59664 {
59665 if (!ensureRanAnalysis(cx, __null))
59666 return false;
59667 if (!analysis()->ranInference()) {
59668 js::types::AutoEnterTypeInference enter(cx);
59669 analysis()->analyzeTypes(cx);
59670 }
59671 return !analysis()->OOM() &&
59672 !cx->compartment->types.pendingNukeTypes;
59673 }
59674
59675 inline bool
59676 JSScript::hasAnalysis()
59677 {
59678 return types && types->analysis;
59679 }
59680
59681 inline js::analyze::ScriptAnalysis *
59682 JSScript::analysis()
59683 {
59684 do { } while(0);
59685 return types->analysis;
59686 }
59687
59688 inline void
59689 JSScript::clearAnalysis()
59690 {
59691 if (types)
59692 types->analysis = __null;
59693 }
59694
59695 inline void
59696 js::analyze::ScriptAnalysis::addPushedType(JSContext *cx, uint32_t offset, uint32_t which,
59697 js::types::Type type)
59698 {
59699 js::types::TypeSet *pushed = pushedTypes(offset, which);
59700 pushed->addType(cx, type);
59701 }
59702
59703 inline js::types::TypeObject *
59704 JSCompartment::getEmptyType(JSContext *cx)
59705 {
59706 if (!emptyTypeObject)
59707 emptyTypeObject = types.newTypeObject(cx, __null, JSProto_Object, __null, true);
59708 return emptyTypeObject;
59709 }
59710 # 44 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobjinlines.h" 2
59711
59712 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsscriptinlines.h" 1
59713 # 46 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobjinlines.h" 2
59714
59715 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Barrier-inl.h" 1
59716 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Barrier-inl.h"
59717 #define jsgc_barrier_inl_h___
59718
59719
59720
59721
59722 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl-inl.h" 1
59723 # 15 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Barrier-inl.h" 2
59724 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/String-inl.h" 1
59725 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/String-inl.h"
59726 #define String_inl_h__
59727
59728
59729 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsprobes.h" 1
59730 # 13 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/String-inl.h" 2
59731
59732
59733 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/String.h" 1
59734 # 16 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/String-inl.h" 2
59735
59736 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsgcinlines.h" 1
59737 # 18 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/String-inl.h" 2
59738 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobjinlines.h" 1
59739 # 19 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/String-inl.h" 2
59740 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Barrier-inl.h" 1
59741 # 20 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/String-inl.h" 2
59742
59743 inline void
59744 JSString::writeBarrierPre(JSString *str)
59745 {
59746
59747 if (!str)
59748 return;
59749
59750 JSCompartment *comp = str->compartment();
59751 if (comp->needsBarrier()) {
59752 JSString *tmp = str;
59753 MarkStringUnbarriered(comp->barrierTracer(), &tmp, "write barrier");
59754 do { } while(0);
59755 }
59756
59757 }
59758
59759 inline void
59760 JSString::writeBarrierPost(JSString *str, void *addr)
59761 {
59762 }
59763
59764 inline bool
59765 JSString::needWriteBarrierPre(JSCompartment *comp)
59766 {
59767
59768 return comp->needsBarrier();
59769
59770
59771
59772 }
59773
59774 inline void
59775 JSString::readBarrier(JSString *str)
59776 {
59777
59778 JSCompartment *comp = str->compartment();
59779 if (comp->needsBarrier()) {
59780 JSString *tmp = str;
59781 MarkStringUnbarriered(comp->barrierTracer(), &tmp, "read barrier");
59782 do { } while(0);
59783 }
59784
59785 }
59786
59787 __attribute__((always_inline)) inline bool
59788 JSString::validateLength(JSContext *cx, size_t length)
59789 {
59790 if ((__builtin_expect((length > JSString::MAX_LENGTH), 0))) {
59791 js_ReportAllocationOverflow(cx);
59792 return false;
59793 }
59794
59795 return true;
59796 }
59797
59798 __attribute__((always_inline)) inline void
59799 JSRope::init(JSString *left, JSString *right, size_t length)
59800 {
59801 d.lengthAndFlags = buildLengthAndFlags(length, ROPE_BIT);
59802 d.u1.left = left;
59803 d.s.u2.right = right;
59804 JSString::writeBarrierPost(d.u1.left, &d.u1.left);
59805 JSString::writeBarrierPost(d.s.u2.right, &d.s.u2.right);
59806 }
59807
59808 __attribute__((always_inline)) inline JSRope *
59809 JSRope::new_(JSContext *cx, js::HandleString left, js::HandleString right, size_t length)
59810 {
59811 if (!validateLength(cx, length))
59812 return __null;
59813 JSRope *str = (JSRope *)js_NewGCString(cx);
59814 if (!str)
59815 return __null;
59816 str->init(left, right, length);
59817 return str;
59818 }
59819
59820 inline void
59821 JSRope::markChildren(JSTracer *trc)
59822 {
59823 js::gc::MarkStringUnbarriered(trc, &d.u1.left, "left child");
59824 js::gc::MarkStringUnbarriered(trc, &d.s.u2.right, "right child");
59825 }
59826
59827 __attribute__((always_inline)) inline void
59828 JSDependentString::init(JSLinearString *base, const jschar *chars, size_t length)
59829 {
59830 do { } while(0);
59831 d.lengthAndFlags = buildLengthAndFlags(length, DEPENDENT_FLAGS);
59832 d.u1.chars = chars;
59833 d.s.u2.base = base;
59834 JSString::writeBarrierPost(d.s.u2.base, &d.s.u2.base);
59835 }
59836
59837 __attribute__((always_inline)) inline JSDependentString *
59838 JSDependentString::new_(JSContext *cx, JSLinearString *base_, const jschar *chars, size_t length)
59839 {
59840 JS::Rooted<JSLinearString*> base(cx, base_);
59841
59842
59843 while (base->isDependent())
59844 base = base->asDependent().base();
59845
59846 do { } while(0);
59847 do { } while(0);
59848 do { } while(0);
59849
59850
59851
59852
59853
59854
59855 JS::SkipRoot charsRoot(cx, &chars);
59856
59857 JSDependentString *str = (JSDependentString *)js_NewGCString(cx);
59858 if (!str)
59859 return __null;
59860 str->init(base, chars, length);
59861 return str;
59862 }
59863
59864 inline void
59865 JSString::markBase(JSTracer *trc)
59866 {
59867 do { } while(0);
59868 js::gc::MarkStringUnbarriered(trc, &d.s.u2.base, "base");
59869 }
59870
59871 inline js::PropertyName *
59872 JSFlatString::toPropertyName(JSContext *cx)
59873 {
59874
59875
59876
59877
59878 if (isAtom())
59879 return asAtom().asPropertyName();
59880 JSAtom *atom = js_AtomizeString(cx, this);
59881 if (!atom)
59882 return __null;
59883 return atom->asPropertyName();
59884 }
59885
59886 __attribute__((always_inline)) inline void
59887 JSFixedString::init(const jschar *chars, size_t length)
59888 {
59889 d.lengthAndFlags = buildLengthAndFlags(length, FIXED_FLAGS);
59890 d.u1.chars = chars;
59891 }
59892
59893 __attribute__((always_inline)) inline JSFixedString *
59894 JSFixedString::new_(JSContext *cx, const jschar *chars, size_t length)
59895 {
59896 do { } while(0);
59897
59898 if (!validateLength(cx, length))
59899 return __null;
59900 JSFixedString *str = (JSFixedString *)js_NewGCString(cx);
59901 if (!str)
59902 return __null;
59903 str->init(chars, length);
59904 return str;
59905 }
59906
59907 __attribute__((always_inline)) inline JSAtom *
59908 JSFixedString::morphAtomizedStringIntoAtom()
59909 {
59910 d.lengthAndFlags = buildLengthAndFlags(length(), NON_STATIC_ATOM_FLAGS);
59911 return &asAtom();
59912 }
59913
59914 __attribute__((always_inline)) inline JSInlineString *
59915 JSInlineString::new_(JSContext *cx)
59916 {
59917 return (JSInlineString *)js_NewGCString(cx);
59918 }
59919
59920 __attribute__((always_inline)) inline jschar *
59921 JSInlineString::init(size_t length)
59922 {
59923 d.lengthAndFlags = buildLengthAndFlags(length, FIXED_FLAGS);
59924 d.u1.chars = d.inlineStorage;
59925 do { } while(0);
59926 return d.inlineStorage;
59927 }
59928
59929 __attribute__((always_inline)) inline void
59930 JSInlineString::resetLength(size_t length)
59931 {
59932 d.lengthAndFlags = buildLengthAndFlags(length, FIXED_FLAGS);
59933 do { } while(0);
59934 }
59935
59936 __attribute__((always_inline)) inline JSShortString *
59937 JSShortString::new_(JSContext *cx)
59938 {
59939 return js_NewGCShortString(cx);
59940 }
59941
59942 __attribute__((always_inline)) inline void
59943 JSShortString::initAtOffsetInBuffer(const jschar *chars, size_t length)
59944 {
59945 do { } while(0);
59946 do { } while(0);
59947 d.lengthAndFlags = buildLengthAndFlags(length, FIXED_FLAGS);
59948 d.u1.chars = chars;
59949 }
59950
59951 __attribute__((always_inline)) inline void
59952 JSExternalString::init(const jschar *chars, size_t length, const JSStringFinalizer *fin)
59953 {
59954 do { } while(0);
59955 do { } while(0);
59956 d.lengthAndFlags = buildLengthAndFlags(length, FIXED_FLAGS);
59957 d.u1.chars = chars;
59958 d.s.u2.externalFinalizer = fin;
59959 }
59960
59961 __attribute__((always_inline)) inline JSExternalString *
59962 JSExternalString::new_(JSContext *cx, const jschar *chars, size_t length,
59963 const JSStringFinalizer *fin)
59964 {
59965 do { } while(0);
59966
59967 if (!validateLength(cx, length))
59968 return __null;
59969 JSExternalString *str = js_NewGCExternalString(cx);
59970 if (!str)
59971 return __null;
59972 str->init(chars, length, fin);
59973 cx->runtime->updateMallocCounter(cx, (length + 1) * sizeof(jschar));
59974 return str;
59975 }
59976
59977 inline bool
59978 js::StaticStrings::fitsInSmallChar(jschar c)
59979 {
59980 return c < SMALL_CHAR_LIMIT && toSmallChar[c] != INVALID_SMALL_CHAR;
59981 }
59982
59983 inline bool
59984 js::StaticStrings::hasUnit(jschar c)
59985 {
59986 return c < UNIT_STATIC_LIMIT;
59987 }
59988
59989 inline JSAtom *
59990 js::StaticStrings::getUnit(jschar c)
59991 {
59992 do { } while(0);
59993 return unitStaticTable[c];
59994 }
59995
59996 inline bool
59997 js::StaticStrings::hasUint(uint32_t u)
59998 {
59999 return u < INT_STATIC_LIMIT;
60000 }
60001
60002 inline JSAtom *
60003 js::StaticStrings::getUint(uint32_t u)
60004 {
60005 do { } while(0);
60006 return intStaticTable[u];
60007 }
60008
60009 inline bool
60010 js::StaticStrings::hasInt(int32_t i)
60011 {
60012 return uint32_t(i) < INT_STATIC_LIMIT;
60013 }
60014
60015 inline JSAtom *
60016 js::StaticStrings::getInt(int32_t i)
60017 {
60018 do { } while(0);
60019 return getUint(uint32_t(i));
60020 }
60021
60022 inline JSLinearString *
60023 js::StaticStrings::getUnitStringForElement(JSContext *cx, JSString *str, size_t index)
60024 {
60025 do { } while(0);
60026 const jschar *chars = str->getChars(cx);
60027 if (!chars)
60028 return __null;
60029 jschar c = chars[index];
60030 if (c < UNIT_STATIC_LIMIT)
60031 return getUnit(c);
60032 return js_NewDependentString(cx, str, index, 1);
60033 }
60034
60035 inline JSAtom *
60036 js::StaticStrings::getLength2(jschar c1, jschar c2)
60037 {
60038 do { } while(0);
60039 do { } while(0);
60040 size_t index = (((size_t)toSmallChar[c1]) << 6) + toSmallChar[c2];
60041 return length2StaticTable[index];
60042 }
60043
60044 inline JSAtom *
60045 js::StaticStrings::getLength2(uint32_t i)
60046 {
60047 do { } while(0);
60048 return getLength2('0' + i / 10, '0' + i % 10);
60049 }
60050
60051
60052 inline JSAtom *
60053 js::StaticStrings::lookup(const jschar *chars, size_t length)
60054 {
60055 switch (length) {
60056 case 1:
60057 if (chars[0] < UNIT_STATIC_LIMIT)
60058 return getUnit(chars[0]);
60059 return __null;
60060 case 2:
60061 if (fitsInSmallChar(chars[0]) && fitsInSmallChar(chars[1]))
60062 return getLength2(chars[0], chars[1]);
60063 return __null;
60064 case 3:
60065
60066
60067
60068
60069
60070
60071 typedef int moz_static_assert111[(INT_STATIC_LIMIT <= 999) ? 1 : -1];
60072 if ('1' <= chars[0] && chars[0] <= '9' &&
60073 '0' <= chars[1] && chars[1] <= '9' &&
60074 '0' <= chars[2] && chars[2] <= '9') {
60075 int i = (chars[0] - '0') * 100 +
60076 (chars[1] - '0') * 10 +
60077 (chars[2] - '0');
60078
60079 if (unsigned(i) < INT_STATIC_LIMIT)
60080 return getInt(i);
60081 }
60082 return __null;
60083 }
60084
60085 return __null;
60086 }
60087
60088 __attribute__((always_inline)) inline void
60089 JSString::finalize(js::FreeOp *fop)
60090 {
60091
60092 do { } while(0);
60093
60094 if (isFlat())
60095 asFlat().finalize(fop);
60096 else
60097 do { } while(0);
60098 }
60099
60100 inline void
60101 JSFlatString::finalize(js::FreeOp *fop)
60102 {
60103 do { } while(0);
60104
60105
60106
60107
60108
60109 if (chars() != d.inlineStorage)
60110 fop->free_(const_cast<jschar *>(chars()));
60111 }
60112
60113 inline void
60114 JSShortString::finalize(js::FreeOp *fop)
60115 {
60116 do { } while(0);
60117 }
60118
60119 inline void
60120 JSAtom::finalize(js::FreeOp *fop)
60121 {
60122 do { } while(0);
60123 if (getAllocKind() == js::gc::FINALIZE_STRING)
60124 JSFlatString::finalize(fop);
60125 else
60126 do { } while(0);
60127 }
60128
60129 inline void
60130 JSExternalString::finalize(js::FreeOp *fop)
60131 {
60132 const JSStringFinalizer *fin = externalFinalizer();
60133 fin->finalize(fin, const_cast<jschar *>(chars()));
60134 }
60135
60136 namespace js {
60137
60138 static __attribute__((always_inline)) inline JSFixedString *
60139 NewShortString(JSContext *cx, const jschar *chars, size_t length)
60140 {
60141 SkipRoot skip(cx, &chars);
60142
60143
60144
60145
60146
60147 do { } while(0);
60148 JSInlineString *str = JSInlineString::lengthFits(length)
60149 ? JSInlineString::new_(cx)
60150 : JSShortString::new_(cx);
60151 if (!str)
60152 return __null;
60153
60154 jschar *storage = str->init(length);
60155 PodCopy(storage, chars, length);
60156 storage[length] = 0;
60157 Probes::createString(cx, str, length);
60158 return str;
60159 }
60160
60161 }
60162 # 16 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Barrier-inl.h" 2
60163
60164 namespace js {
60165
60166 inline void
60167 EncapsulatedValue::writeBarrierPre(const Value &value)
60168 {
60169
60170 if (value.isMarkable()) {
60171 js::gc::Cell *cell = (js::gc::Cell *)value.toGCThing();
60172 writeBarrierPre(cell->compartment(), value);
60173 }
60174
60175 }
60176
60177 inline void
60178 EncapsulatedValue::writeBarrierPre(JSCompartment *comp, const Value &value)
60179 {
60180
60181 if (comp->needsBarrier()) {
60182 Value tmp(value);
60183 js::gc::MarkValueUnbarriered(comp->barrierTracer(), &tmp, "write barrier");
60184 do { } while(0);
60185 }
60186
60187 }
60188
60189 inline void
60190 EncapsulatedValue::pre()
60191 {
60192 writeBarrierPre(value);
60193 }
60194
60195 inline void
60196 EncapsulatedValue::pre(JSCompartment *comp)
60197 {
60198 writeBarrierPre(comp, value);
60199 }
60200
60201 inline
60202 HeapValue::HeapValue()
60203 : EncapsulatedValue(UndefinedValue())
60204 {
60205 post();
60206 }
60207
60208 inline
60209 HeapValue::HeapValue(const Value &v)
60210 : EncapsulatedValue(v)
60211 {
60212 do { } while(0);
60213 post();
60214 }
60215
60216 inline
60217 HeapValue::HeapValue(const HeapValue &v)
60218 : EncapsulatedValue(v.value)
60219 {
60220 do { } while(0);
60221 post();
60222 }
60223
60224 inline
60225 HeapValue::~HeapValue()
60226 {
60227 pre();
60228 }
60229
60230 inline void
60231 HeapValue::init(const Value &v)
60232 {
60233 do { } while(0);
60234 value = v;
60235 post();
60236 }
60237
60238 inline void
60239 HeapValue::init(JSCompartment *comp, const Value &v)
60240 {
60241 do { } while(0);
60242 value = v;
60243 post(comp);
60244 }
60245
60246 inline HeapValue &
60247 HeapValue::operator=(const Value &v)
60248 {
60249 pre();
60250 do { } while(0);
60251 value = v;
60252 post();
60253 return *this;
60254 }
60255
60256 inline HeapValue &
60257 HeapValue::operator=(const HeapValue &v)
60258 {
60259 pre();
60260 do { } while(0);
60261 value = v.value;
60262 post();
60263 return *this;
60264 }
60265
60266 inline void
60267 HeapValue::set(JSCompartment *comp, const Value &v)
60268 {
60269 # 130 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/gc/Barrier-inl.h"
60270 pre(comp);
60271 do { } while(0);
60272 value = v;
60273 post(comp);
60274 }
60275
60276 inline void
60277 HeapValue::writeBarrierPost(const Value &value, Value *addr)
60278 {
60279
60280
60281 }
60282
60283 inline void
60284 HeapValue::writeBarrierPost(JSCompartment *comp, const Value &value, Value *addr)
60285 {
60286
60287
60288 }
60289
60290 inline void
60291 HeapValue::post()
60292 {
60293 writeBarrierPost(value, &value);
60294 }
60295
60296 inline void
60297 HeapValue::post(JSCompartment *comp)
60298 {
60299 writeBarrierPost(comp, value, &value);
60300 }
60301
60302 inline
60303 RelocatableValue::RelocatableValue()
60304 : EncapsulatedValue(UndefinedValue())
60305 {
60306 }
60307
60308 inline
60309 RelocatableValue::RelocatableValue(const Value &v)
60310 : EncapsulatedValue(v)
60311 {
60312 do { } while(0);
60313 post();
60314 }
60315
60316 inline
60317 RelocatableValue::RelocatableValue(const RelocatableValue &v)
60318 : EncapsulatedValue(v.value)
60319 {
60320 do { } while(0);
60321 post();
60322 }
60323
60324 inline
60325 RelocatableValue::~RelocatableValue()
60326 {
60327 pre();
60328 relocate();
60329 }
60330
60331 inline RelocatableValue &
60332 RelocatableValue::operator=(const Value &v)
60333 {
60334 pre();
60335 do { } while(0);
60336 value = v;
60337 post();
60338 return *this;
60339 }
60340
60341 inline RelocatableValue &
60342 RelocatableValue::operator=(const RelocatableValue &v)
60343 {
60344 pre();
60345 do { } while(0);
60346 value = v.value;
60347 post();
60348 return *this;
60349 }
60350
60351 inline void
60352 RelocatableValue::post()
60353 {
60354
60355
60356 }
60357
60358 inline void
60359 RelocatableValue::post(JSCompartment *comp)
60360 {
60361
60362
60363 }
60364
60365 inline void
60366 RelocatableValue::relocate()
60367 {
60368
60369
60370 }
60371
60372 inline
60373 HeapSlot::HeapSlot(JSObject *obj, uint32_t slot, const Value &v)
60374 : EncapsulatedValue(v)
60375 {
60376 do { } while(0);
60377 post(obj, slot);
60378 }
60379
60380 inline
60381 HeapSlot::HeapSlot(JSObject *obj, uint32_t slot, const HeapSlot &s)
60382 : EncapsulatedValue(s.value)
60383 {
60384 do { } while(0);
60385 post(obj, slot);
60386 }
60387
60388 inline
60389 HeapSlot::~HeapSlot()
60390 {
60391 pre();
60392 }
60393
60394 inline void
60395 HeapSlot::init(JSObject *obj, uint32_t slot, const Value &v)
60396 {
60397 value = v;
60398 post(obj, slot);
60399 }
60400
60401 inline void
60402 HeapSlot::init(JSCompartment *comp, JSObject *obj, uint32_t slot, const Value &v)
60403 {
60404 value = v;
60405 post(comp, obj, slot);
60406 }
60407
60408 inline void
60409 HeapSlot::set(JSObject *obj, uint32_t slot, const Value &v)
60410 {
60411 do { } while (0);
60412 do { } while (0);
60413
60414 pre();
60415 do { } while(0);
60416 value = v;
60417 post(obj, slot);
60418 }
60419
60420 inline void
60421 HeapSlot::set(JSCompartment *comp, JSObject *obj, uint32_t slot, const Value &v)
60422 {
60423 do { } while (0);
60424 do { } while (0);
60425 do { } while(0);
60426
60427 pre(comp);
60428 do { } while(0);
60429 value = v;
60430 post(comp, obj, slot);
60431 }
60432
60433 inline void
60434 HeapSlot::writeBarrierPost(JSObject *obj, uint32_t slot)
60435 {
60436 }
60437
60438 inline void
60439 HeapSlot::writeBarrierPost(JSCompartment *comp, JSObject *obj, uint32_t slotno)
60440 {
60441 }
60442
60443 inline void
60444 HeapSlot::post(JSObject *owner, uint32_t slot)
60445 {
60446 HeapSlot::writeBarrierPost(owner, slot);
60447 }
60448
60449 inline void
60450 HeapSlot::post(JSCompartment *comp, JSObject *owner, uint32_t slot)
60451 {
60452 HeapSlot::writeBarrierPost(comp, owner, slot);
60453 }
60454
60455 inline void
60456 EncapsulatedId::pre()
60457 {
60458
60459 if (JSID_IS_OBJECT(value)) {
60460 JSObject *obj = JSID_TO_OBJECT(value);
60461 JSCompartment *comp = obj->compartment();
60462 if (comp->needsBarrier()) {
60463 js::gc::MarkObjectUnbarriered(comp->barrierTracer(), &obj, "write barrier");
60464 do { } while(0);
60465 }
60466 } else if (JSID_IS_STRING(value)) {
60467 JSString *str = JSID_TO_STRING(value);
60468 JSCompartment *comp = str->compartment();
60469 if (comp->needsBarrier()) {
60470 js::gc::MarkStringUnbarriered(comp->barrierTracer(), &str, "write barrier");
60471 do { } while(0);
60472 }
60473 }
60474
60475 }
60476
60477 inline
60478 RelocatableId::~RelocatableId()
60479 {
60480 pre();
60481 }
60482
60483 inline RelocatableId &
60484 RelocatableId::operator=(jsid id)
60485 {
60486 if (id != value)
60487 pre();
60488 do { } while(0);
60489 value = id;
60490 return *this;
60491 }
60492
60493 inline RelocatableId &
60494 RelocatableId::operator=(const RelocatableId &v)
60495 {
60496 if (v.value != value)
60497 pre();
60498 do { } while(0);
60499 value = v.value;
60500 return *this;
60501 }
60502
60503 inline
60504 HeapId::HeapId(jsid id)
60505 : EncapsulatedId(id)
60506 {
60507 do { } while(0);
60508 post();
60509 }
60510
60511 inline
60512 HeapId::~HeapId()
60513 {
60514 pre();
60515 }
60516
60517 inline void
60518 HeapId::init(jsid id)
60519 {
60520 do { } while(0);
60521 value = id;
60522 post();
60523 }
60524
60525 inline void
60526 HeapId::post()
60527 {
60528 }
60529
60530 inline HeapId &
60531 HeapId::operator=(jsid id)
60532 {
60533 if (id != value)
60534 pre();
60535 do { } while(0);
60536 value = id;
60537 post();
60538 return *this;
60539 }
60540
60541 inline HeapId &
60542 HeapId::operator=(const HeapId &v)
60543 {
60544 if (v.value != value)
60545 pre();
60546 do { } while(0);
60547 value = v.value;
60548 post();
60549 return *this;
60550 }
60551
60552 inline const Value &
60553 ReadBarrieredValue::get() const
60554 {
60555 if (value.isObject())
60556 JSObject::readBarrier(&value.toObject());
60557 else if (value.isString())
60558 JSString::readBarrier(value.toString());
60559 else
60560 do { } while(0);
60561
60562 return value;
60563 }
60564
60565 inline
60566 ReadBarrieredValue::operator const Value &() const
60567 {
60568 return get();
60569 }
60570
60571 inline JSObject &
60572 ReadBarrieredValue::toObject() const
60573 {
60574 return get().toObject();
60575 }
60576
60577 }
60578 # 48 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobjinlines.h" 2
60579
60580
60581 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/RegExpStatics-inl.h" 1
60582 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/RegExpStatics-inl.h"
60583 #define RegExpStatics_inl_h__
60584
60585 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/RegExpStatics.h" 1
60586 # 12 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/RegExpStatics-inl.h" 2
60587
60588
60589
60590 namespace js {
60591
60592 inline js::RegExpStatics *
60593 js::GlobalObject::getRegExpStatics() const
60594 {
60595 JSObject &resObj = getSlot(REGEXP_STATICS).toObject();
60596 return static_cast<RegExpStatics *>(resObj.getPrivate());
60597 }
60598
60599 inline size_t
60600 SizeOfRegExpStaticsData(const JSObject *obj, JSMallocSizeOfFun mallocSizeOf)
60601 {
60602 return mallocSizeOf(obj->getPrivate());
60603 }
60604
60605 inline
60606 RegExpStatics::RegExpStatics()
60607 : bufferLink(__null),
60608 copied(false)
60609 {
60610 clear();
60611 }
60612
60613 inline bool
60614 RegExpStatics::createDependent(JSContext *cx, size_t start, size_t end, Value *out) const
60615 {
60616 do { } while(0);
60617 do { } while(0);
60618 JSString *str = js_NewDependentString(cx, matchPairsInput, start, end - start);
60619 if (!str)
60620 return false;
60621 *out = StringValue(str);
60622 return true;
60623 }
60624
60625 inline bool
60626 RegExpStatics::createPendingInput(JSContext *cx, Value *out) const
60627 {
60628 out->setString(pendingInput ? pendingInput.get() : cx->runtime->emptyString);
60629 return true;
60630 }
60631
60632 inline bool
60633 RegExpStatics::makeMatch(JSContext *cx, size_t checkValidIndex, size_t pairNum, Value *out) const
60634 {
60635 if (checkValidIndex / 2 >= pairCount() || matchPairs[checkValidIndex] < 0) {
60636 out->setString(cx->runtime->emptyString);
60637 return true;
60638 }
60639 return createDependent(cx, get(pairNum, 0), get(pairNum, 1), out);
60640 }
60641
60642 inline bool
60643 RegExpStatics::createLastParen(JSContext *cx, Value *out) const
60644 {
60645 if (pairCount() <= 1) {
60646 out->setString(cx->runtime->emptyString);
60647 return true;
60648 }
60649 size_t num = pairCount() - 1;
60650 int start = get(num, 0);
60651 int end = get(num, 1);
60652 if (start == -1) {
60653 out->setString(cx->runtime->emptyString);
60654 return true;
60655 }
60656 do { } while(0);
60657 do { } while(0);
60658 return createDependent(cx, start, end, out);
60659 }
60660
60661 inline bool
60662 RegExpStatics::createLeftContext(JSContext *cx, Value *out) const
60663 {
60664 if (!pairCount()) {
60665 out->setString(cx->runtime->emptyString);
60666 return true;
60667 }
60668 if (matchPairs[0] < 0) {
60669 *out = UndefinedValue();
60670 return true;
60671 }
60672 return createDependent(cx, 0, matchPairs[0], out);
60673 }
60674
60675 inline bool
60676 RegExpStatics::createRightContext(JSContext *cx, Value *out) const
60677 {
60678 if (!pairCount()) {
60679 out->setString(cx->runtime->emptyString);
60680 return true;
60681 }
60682 if (matchPairs[1] < 0) {
60683 *out = UndefinedValue();
60684 return true;
60685 }
60686 return createDependent(cx, matchPairs[1], matchPairsInput->length(), out);
60687 }
60688
60689 inline void
60690 RegExpStatics::getParen(size_t pairNum, JSSubString *out) const
60691 {
60692 checkParenNum(pairNum);
60693 if (!pairIsPresent(pairNum)) {
60694 *out = js_EmptySubString;
60695 return;
60696 }
60697 out->chars = matchPairsInput->chars() + get(pairNum, 0);
60698 out->length = getParenLength(pairNum);
60699 }
60700
60701 inline void
60702 RegExpStatics::getLastMatch(JSSubString *out) const
60703 {
60704 if (!pairCount()) {
60705 *out = js_EmptySubString;
60706 return;
60707 }
60708 do { } while(0);
60709 out->chars = matchPairsInput->chars() + get(0, 0);
60710 do { } while(0);
60711 out->length = get(0, 1) - get(0, 0);
60712 }
60713
60714 inline void
60715 RegExpStatics::getLastParen(JSSubString *out) const
60716 {
60717 size_t pc = pairCount();
60718
60719 if (pc <= 1) {
60720 *out = js_EmptySubString;
60721 return;
60722 }
60723 getParen(pc - 1, out);
60724 }
60725
60726 inline void
60727 RegExpStatics::getLeftContext(JSSubString *out) const
60728 {
60729 if (!pairCount()) {
60730 *out = js_EmptySubString;
60731 return;
60732 }
60733 out->chars = matchPairsInput->chars();
60734 out->length = get(0, 0);
60735 }
60736
60737 inline void
60738 RegExpStatics::getRightContext(JSSubString *out) const
60739 {
60740 if (!pairCount()) {
60741 *out = js_EmptySubString;
60742 return;
60743 }
60744 out->chars = matchPairsInput->chars() + get(0, 1);
60745 do { } while(0);
60746 out->length = matchPairsInput->length() - get(0, 1);
60747 }
60748
60749 inline void
60750 RegExpStatics::copyTo(RegExpStatics &dst)
60751 {
60752 dst.matchPairs.clear();
60753
60754 dst.matchPairs.infallibleAppend(matchPairs);
60755 dst.matchPairsInput = matchPairsInput;
60756 dst.pendingInput = pendingInput;
60757 dst.flags = flags;
60758 }
60759
60760 inline void
60761 RegExpStatics::aboutToWrite()
60762 {
60763 if (bufferLink && !bufferLink->copied) {
60764 copyTo(*bufferLink);
60765 bufferLink->copied = true;
60766 }
60767 }
60768
60769 inline void
60770 RegExpStatics::restore()
60771 {
60772 if (bufferLink->copied)
60773 bufferLink->copyTo(*this);
60774 bufferLink = bufferLink->bufferLink;
60775 }
60776
60777 inline bool
60778 RegExpStatics::updateFromMatchPairs(JSContext *cx, JSLinearString *input, MatchPairs *newPairs)
60779 {
60780 do { } while(0);
60781 aboutToWrite();
60782 BarrieredSetPair<JSString, JSLinearString>(cx->compartment,
60783 pendingInput, input,
60784 matchPairsInput, input);
60785
60786 if (!matchPairs.resizeUninitialized(2 * newPairs->pairCount())) {
60787 js_ReportOutOfMemory(cx);
60788 return false;
60789 }
60790
60791 for (size_t i = 0; i < newPairs->pairCount(); ++i) {
60792 matchPairs[2 * i] = newPairs->pair(i).start;
60793 matchPairs[2 * i + 1] = newPairs->pair(i).limit;
60794 }
60795
60796 return true;
60797 }
60798
60799 inline void
60800 RegExpStatics::clear()
60801 {
60802 aboutToWrite();
60803 flags = RegExpFlag(0);
60804 pendingInput = __null;
60805 matchPairsInput = __null;
60806 matchPairs.clear();
60807 }
60808
60809 inline void
60810 RegExpStatics::setPendingInput(JSString *newInput)
60811 {
60812 aboutToWrite();
60813 pendingInput = newInput;
60814 }
60815
60816 PreserveRegExpStatics::~PreserveRegExpStatics()
60817 {
60818 original->restore();
60819 }
60820
60821 inline void
60822 RegExpStatics::setMultiline(JSContext *cx, bool enabled)
60823 {
60824 aboutToWrite();
60825 if (enabled) {
60826 flags = RegExpFlag(flags | MultilineFlag);
60827 markFlagsSet(cx);
60828 } else {
60829 flags = RegExpFlag(flags & ~MultilineFlag);
60830 }
60831 }
60832
60833 inline void
60834 RegExpStatics::markFlagsSet(JSContext *cx)
60835 {
60836 # 269 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/RegExpStatics-inl.h"
60837 GlobalObject *global = GetGlobalForScopeChain(cx);
60838 do { } while(0);
60839
60840 types::MarkTypeObjectFlags(cx, global, types::OBJECT_FLAG_REGEXP_FLAGS_SET);
60841 }
60842
60843 inline void
60844 RegExpStatics::reset(JSContext *cx, JSString *newInput, bool newMultiline)
60845 {
60846 aboutToWrite();
60847 clear();
60848 pendingInput = newInput;
60849 setMultiline(cx, newMultiline);
60850 checkInvariants();
60851 }
60852
60853 }
60854
60855 inline js::RegExpStatics *
60856 JSContext::regExpStatics()
60857 {
60858 return js::GetGlobalForScopeChain(this)->getRegExpStatics();
60859 }
60860 # 51 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobjinlines.h" 2
60861 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/String-inl.h" 1
60862 # 52 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobjinlines.h" 2
60863
60864 inline bool
60865 JSObject::enumerate(JSContext *cx, JSIterateOp iterop, js::Value *statep, jsid *idp)
60866 {
60867 JSNewEnumerateOp op = getOps()->enumerate;
60868 return (op ? op : JS_EnumerateState)(cx, js::RootedObject(cx, this), iterop, statep, idp);
60869 }
60870
60871 inline bool
60872 JSObject::defaultValue(JSContext *cx, JSType hint, js::Value *vp)
60873 {
60874 js::RootedObject self(cx, this);
60875
60876 JSConvertOp op = getClass()->convert;
60877 bool ok;
60878 if (op == JS_ConvertStub)
60879 ok = js::DefaultValue(cx, self, hint, vp);
60880 else
60881 ok = op(cx, self, hint, vp);
60882 do { } while (0);
60883 return ok;
60884 }
60885
60886 inline JSType
60887 JSObject::typeOf(JSContext *cx)
60888 {
60889 js::TypeOfOp op = getOps()->typeOf;
60890 return (op ? op : js::baseops::TypeOf)(cx, js::RootedObject(cx, this));
60891 }
60892
60893 inline JSObject *
60894 JSObject::thisObject(JSContext *cx)
60895 {
60896 JSObjectOp op = getOps()->thisObject;
60897 return op ? op(cx, js::RootedObject(cx, this)) : this;
60898 }
60899
60900 inline JSBool
60901 JSObject::setGeneric(JSContext *cx, js::HandleId id, js::Value *vp, JSBool strict)
60902 {
60903 if (getOps()->setGeneric)
60904 return nonNativeSetProperty(cx, id, vp, strict);
60905 return js::baseops::SetPropertyHelper(cx,
60906 js::RootedObject(cx, this),
60907 id, 0, vp, strict);
60908 }
60909
60910 inline JSBool
60911 JSObject::setProperty(JSContext *cx, js::PropertyName *name, js::Value *vp, JSBool strict)
60912 {
60913 return setGeneric(cx, js::RootedId(cx, js::NameToId(name)), vp, strict);
60914 }
60915
60916 inline JSBool
60917 JSObject::setElement(JSContext *cx, uint32_t index, js::Value *vp, JSBool strict)
60918 {
60919 if (getOps()->setElement)
60920 return nonNativeSetElement(cx, index, vp, strict);
60921 return js::baseops::SetElementHelper(cx, js::RootedObject(cx, this), index, 0, vp, strict);
60922 }
60923
60924 inline JSBool
60925 JSObject::setSpecial(JSContext *cx, js::SpecialId sid, js::Value *vp, JSBool strict)
60926 {
60927 return setGeneric(cx, js::RootedId(cx, SPECIALID_TO_JSID(sid)), vp, strict);
60928 }
60929
60930 inline JSBool
60931 JSObject::setGenericAttributes(JSContext *cx, js::HandleId id, unsigned *attrsp)
60932 {
60933 js::types::MarkTypePropertyConfigured(cx, this, id);
60934 js::GenericAttributesOp op = getOps()->setGenericAttributes;
60935 return (op ? op : js::baseops::SetAttributes)(cx, js::RootedObject(cx, this), id, attrsp);
60936 }
60937
60938 inline JSBool
60939 JSObject::setPropertyAttributes(JSContext *cx, js::PropertyName *name, unsigned *attrsp)
60940 {
60941 return setGenericAttributes(cx, js::RootedId(cx, js::NameToId(name)), attrsp);
60942 }
60943
60944 inline JSBool
60945 JSObject::setElementAttributes(JSContext *cx, uint32_t index, unsigned *attrsp)
60946 {
60947 js::ElementAttributesOp op = getOps()->setElementAttributes;
60948 return (op ? op : js::baseops::SetElementAttributes)(cx, js::RootedObject(cx, this), index, attrsp);
60949 }
60950
60951 inline JSBool
60952 JSObject::setSpecialAttributes(JSContext *cx, js::SpecialId sid, unsigned *attrsp)
60953 {
60954 return setGenericAttributes(cx, js::RootedId(cx, SPECIALID_TO_JSID(sid)), attrsp);
60955 }
60956
60957 inline bool
60958 JSObject::changePropertyAttributes(JSContext *cx, js::Shape *shape, unsigned attrs)
60959 {
60960 return !!changeProperty(cx, shape, attrs, 0, shape->getter(), shape->setter());
60961 }
60962
60963 inline JSBool
60964 JSObject::getGeneric(JSContext *cx, js::HandleObject receiver, js::HandleId id, js::Value *vp)
60965 {
60966 js::RootedObject self(cx, this);
60967
60968 js::GenericIdOp op = getOps()->getGeneric;
60969 if (op) {
60970 if (!op(cx, self, receiver, id, vp))
60971 return false;
60972 } else {
60973 if (!js::baseops::GetProperty(cx, self, receiver, id, vp))
60974 return false;
60975 }
60976 return true;
60977 }
60978
60979 inline JSBool
60980 JSObject::getProperty(JSContext *cx, js::HandleObject receiver, js::PropertyName *name, js::Value *vp)
60981 {
60982 return getGeneric(cx, receiver, js::RootedId(cx, js::NameToId(name)), vp);
60983 }
60984
60985 inline JSBool
60986 JSObject::getGeneric(JSContext *cx, js::HandleId id, js::Value *vp)
60987 {
60988 return getGeneric(cx, js::RootedObject(cx, this), id, vp);
60989 }
60990
60991 inline JSBool
60992 JSObject::getProperty(JSContext *cx, js::PropertyName *name, js::Value *vp)
60993 {
60994 return getGeneric(cx, js::RootedId(cx, js::NameToId(name)), vp);
60995 }
60996
60997 inline bool
60998 JSObject::deleteProperty(JSContext *cx, js::HandlePropertyName name, js::Value *rval, bool strict)
60999 {
61000 jsid id = js::NameToId(name);
61001 js::types::AddTypePropertyId(cx, this, id, js::types::Type::UndefinedType());
61002 js::types::MarkTypePropertyConfigured(cx, this, id);
61003 js::DeletePropertyOp op = getOps()->deleteProperty;
61004 return (op ? op : js::baseops::DeleteProperty)(cx, js::RootedObject(cx, this), name, rval, strict);
61005 }
61006
61007 inline bool
61008 JSObject::deleteElement(JSContext *cx, uint32_t index, js::Value *rval, bool strict)
61009 {
61010 js::RootedObject self(cx, this);
61011
61012 jsid id;
61013 if (!js::IndexToId(cx, index, &id))
61014 return false;
61015 js::types::AddTypePropertyId(cx, self, id, js::types::Type::UndefinedType());
61016 js::types::MarkTypePropertyConfigured(cx, self, id);
61017 js::DeleteElementOp op = self->getOps()->deleteElement;
61018 return (op ? op : js::baseops::DeleteElement)(cx, self, index, rval, strict);
61019 }
61020
61021 inline bool
61022 JSObject::deleteSpecial(JSContext *cx, js::HandleSpecialId sid, js::Value *rval, bool strict)
61023 {
61024 jsid id = SPECIALID_TO_JSID(sid);
61025 js::types::AddTypePropertyId(cx, this, id, js::types::Type::UndefinedType());
61026 js::types::MarkTypePropertyConfigured(cx, this, id);
61027 js::DeleteSpecialOp op = getOps()->deleteSpecial;
61028 return (op ? op : js::baseops::DeleteSpecial)(cx, js::RootedObject(cx, this), sid, rval, strict);
61029 }
61030
61031 inline void
61032 JSObject::finalize(js::FreeOp *fop)
61033 {
61034 js::Probes::finalizeObject(this);
61035
61036 if (!fop->onBackgroundThread()) {
61037
61038
61039
61040
61041
61042 js::Class *clasp = getClass();
61043 if (clasp->finalize)
61044 clasp->finalize(fop, this);
61045 }
61046
61047 finish(fop);
61048 }
61049
61050 inline JSObject *
61051 JSObject::getParent() const
61052 {
61053 return lastProperty()->getObjectParent();
61054 }
61055
61056 inline JSObject *
61057 JSObject::enclosingScope()
61058 {
61059 return isScope()
61060 ? &asScope().enclosingScope()
61061 : isDebugScope()
61062 ? &asDebugScope().enclosingScope()
61063 : getParent();
61064 }
61065
61066 inline bool
61067 JSObject::isFixedSlot(size_t slot)
61068 {
61069 do { } while(0);
61070 return slot < numFixedSlots();
61071 }
61072
61073 inline size_t
61074 JSObject::dynamicSlotIndex(size_t slot)
61075 {
61076 do { } while(0);
61077 return slot - numFixedSlots();
61078 }
61079
61080 inline void
61081 JSObject::setLastPropertyInfallible(const js::Shape *shape)
61082 {
61083 do { } while(0);
61084 do { } while(0);
61085 do { } while(0);
61086 do { } while(0);
61087 do { } while(0);
61088
61089 shape_ = const_cast<js::Shape *>(shape);
61090 }
61091
61092 inline void
61093 JSObject::removeLastProperty(JSContext *cx)
61094 {
61095 do { } while(0);
61096 ((void)(setLastProperty(cx, lastProperty()->previous())));
61097 }
61098
61099 inline bool
61100 JSObject::canRemoveLastProperty()
61101 {
61102
61103
61104
61105
61106
61107
61108
61109 do { } while(0);
61110 const js::Shape *previous = lastProperty()->previous();
61111 return previous->getObjectParent() == lastProperty()->getObjectParent()
61112 && previous->getObjectFlags() == lastProperty()->getObjectFlags();
61113 }
61114
61115 inline const js::HeapSlot *
61116 JSObject::getRawSlots()
61117 {
61118 do { } while(0);
61119 return slots;
61120 }
61121
61122 inline const js::Value &
61123 JSObject::getReservedSlot(unsigned index) const
61124 {
61125 do { } while(0);
61126 return getSlot(index);
61127 }
61128
61129 inline js::HeapSlot &
61130 JSObject::getReservedSlotRef(unsigned index)
61131 {
61132 do { } while(0);
61133 return getSlotRef(index);
61134 }
61135
61136 inline void
61137 JSObject::setReservedSlot(unsigned index, const js::Value &v)
61138 {
61139 do { } while(0);
61140 setSlot(index, v);
61141 }
61142
61143 inline void
61144 JSObject::initReservedSlot(unsigned index, const js::Value &v)
61145 {
61146 do { } while(0);
61147 initSlot(index, v);
61148 }
61149
61150 inline void
61151 JSObject::prepareSlotRangeForOverwrite(size_t start, size_t end)
61152 {
61153 for (size_t i = start; i < end; i++)
61154 getSlotAddressUnchecked(i)->js::HeapSlot::~HeapSlot();
61155 }
61156
61157 inline void
61158 JSObject::prepareElementRangeForOverwrite(size_t start, size_t end)
61159 {
61160 do { } while(0);
61161 do { } while(0);
61162 for (size_t i = start; i < end; i++)
61163 elements[i].js::HeapSlot::~HeapSlot();
61164 }
61165
61166 inline uint32_t
61167 JSObject::getArrayLength() const
61168 {
61169 do { } while(0);
61170 return getElementsHeader()->length;
61171 }
61172
61173 inline void
61174 JSObject::setArrayLength(JSContext *cx, uint32_t length)
61175 {
61176 do { } while(0);
61177
61178 if (length > (2147483647)) {
61179
61180
61181
61182
61183 js::types::MarkTypeObjectFlags(cx, this,
61184 js::types::OBJECT_FLAG_NON_PACKED_ARRAY |
61185 js::types::OBJECT_FLAG_NON_DENSE_ARRAY);
61186 jsid lengthId = js::NameToId(cx->runtime->atomState.lengthAtom);
61187 js::types::AddTypePropertyId(cx, this, lengthId,
61188 js::types::Type::DoubleType());
61189 }
61190
61191 getElementsHeader()->length = length;
61192 }
61193
61194 inline void
61195 JSObject::setDenseArrayLength(uint32_t length)
61196 {
61197
61198 do { } while(0);
61199 do { } while(0);
61200 getElementsHeader()->length = length;
61201 }
61202
61203 inline void
61204 JSObject::setDenseArrayInitializedLength(uint32_t length)
61205 {
61206 do { } while(0);
61207 do { } while(0);
61208 prepareElementRangeForOverwrite(length, getElementsHeader()->initializedLength);
61209 getElementsHeader()->initializedLength = length;
61210 }
61211
61212 inline uint32_t
61213 JSObject::getDenseArrayCapacity()
61214 {
61215 do { } while(0);
61216 return getElementsHeader()->capacity;
61217 }
61218
61219 inline bool
61220 JSObject::ensureElements(JSContext *cx, uint32_t capacity)
61221 {
61222 if (capacity > getDenseArrayCapacity())
61223 return growElements(cx, capacity);
61224 return true;
61225 }
61226
61227 inline void
61228 JSObject::setDenseArrayElement(unsigned idx, const js::Value &val)
61229 {
61230 do { } while(0);
61231 elements[idx].set(this, idx, val);
61232 }
61233
61234 inline void
61235 JSObject::initDenseArrayElement(unsigned idx, const js::Value &val)
61236 {
61237 do { } while(0);
61238 elements[idx].init(this, idx, val);
61239 }
61240
61241 inline void
61242 JSObject::setDenseArrayElementWithType(JSContext *cx, unsigned idx, const js::Value &val)
61243 {
61244 js::types::AddTypePropertyId(cx, this, ((jsid)0x2), val);
61245 setDenseArrayElement(idx, val);
61246 }
61247
61248 inline void
61249 JSObject::initDenseArrayElementWithType(JSContext *cx, unsigned idx, const js::Value &val)
61250 {
61251 js::types::AddTypePropertyId(cx, this, ((jsid)0x2), val);
61252 initDenseArrayElement(idx, val);
61253 }
61254
61255 inline void
61256 JSObject::copyDenseArrayElements(unsigned dstStart, const js::Value *src, unsigned count)
61257 {
61258 do { } while(0);
61259 JSCompartment *comp = compartment();
61260 for (unsigned i = 0; i < count; ++i)
61261 elements[dstStart + i].set(comp, this, dstStart + i, src[i]);
61262 }
61263
61264 inline void
61265 JSObject::initDenseArrayElements(unsigned dstStart, const js::Value *src, unsigned count)
61266 {
61267 do { } while(0);
61268 JSCompartment *comp = compartment();
61269 for (unsigned i = 0; i < count; ++i)
61270 elements[dstStart + i].init(comp, this, dstStart + i, src[i]);
61271 }
61272
61273 inline void
61274 JSObject::moveDenseArrayElements(unsigned dstStart, unsigned srcStart, unsigned count)
61275 {
61276 do { } while(0);
61277 do { } while(0);
61278 # 480 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobjinlines.h"
61279 JSCompartment *comp = compartment();
61280 if (comp->needsBarrier()) {
61281 if (dstStart < srcStart) {
61282 js::HeapSlot *dst = elements + dstStart;
61283 js::HeapSlot *src = elements + srcStart;
61284 for (unsigned i = 0; i < count; i++, dst++, src++)
61285 dst->set(comp, this, dst - elements, *src);
61286 } else {
61287 js::HeapSlot *dst = elements + dstStart + count - 1;
61288 js::HeapSlot *src = elements + srcStart + count - 1;
61289 for (unsigned i = 0; i < count; i++, dst--, src--)
61290 dst->set(comp, this, dst - elements, *src);
61291 }
61292 } else {
61293 memmove(elements + dstStart, elements + srcStart, count * sizeof(js::HeapSlot));
61294 SlotRangeWriteBarrierPost(comp, this, dstStart, count);
61295 }
61296 }
61297
61298 inline void
61299 JSObject::moveDenseArrayElementsUnbarriered(unsigned dstStart, unsigned srcStart, unsigned count)
61300 {
61301 do { } while(0);
61302
61303 do { } while(0);
61304 do { } while(0);
61305
61306 memmove(elements + dstStart, elements + srcStart, count * sizeof(js::Value));
61307 }
61308
61309 inline bool
61310 JSObject::denseArrayHasInlineSlots() const
61311 {
61312 do { } while(0);
61313 return elements == fixedElements();
61314 }
61315
61316 namespace js {
61317
61318
61319
61320
61321
61322 static inline JSAtom *
61323 CallObjectLambdaName(JSFunction *fun)
61324 {
61325 return (fun->flags & 0x08) ? fun->atom.get() : __null;
61326 }
61327
61328 }
61329
61330 inline const js::Value &
61331 JSObject::getDateUTCTime() const
61332 {
61333 do { } while(0);
61334 return getFixedSlot(JSSLOT_DATE_UTC_TIME);
61335 }
61336
61337 inline void
61338 JSObject::setDateUTCTime(const js::Value &time)
61339 {
61340 do { } while(0);
61341 setFixedSlot(JSSLOT_DATE_UTC_TIME, time);
61342 }
61343
61344 inline js::NativeIterator *
61345 JSObject::getNativeIterator() const
61346 {
61347 return (js::NativeIterator *) getPrivate();
61348 }
61349
61350 inline void
61351 JSObject::setNativeIterator(js::NativeIterator *ni)
61352 {
61353 setPrivate(ni);
61354 }
61355
61356
61357
61358 inline JSLinearString *
61359 JSObject::getNamePrefix() const
61360 {
61361 do { } while(0);
61362 const js::Value &v = getSlot(JSSLOT_NAME_PREFIX);
61363 return !v.isUndefined() ? &v.toString()->asLinear() : __null;
61364 }
61365
61366 inline jsval
61367 JSObject::getNamePrefixVal() const
61368 {
61369 do { } while(0);
61370 return getSlot(JSSLOT_NAME_PREFIX);
61371 }
61372
61373 inline void
61374 JSObject::setNamePrefix(JSLinearString *prefix)
61375 {
61376 do { } while(0);
61377 setSlot(JSSLOT_NAME_PREFIX, prefix ? js::StringValue(prefix) : js::UndefinedValue());
61378 }
61379
61380 inline void
61381 JSObject::clearNamePrefix()
61382 {
61383 do { } while(0);
61384 setSlot(JSSLOT_NAME_PREFIX, js::UndefinedValue());
61385 }
61386
61387 inline JSLinearString *
61388 JSObject::getNameURI() const
61389 {
61390 do { } while(0);
61391 const js::Value &v = getSlot(JSSLOT_NAME_URI);
61392 return !v.isUndefined() ? &v.toString()->asLinear() : __null;
61393 }
61394
61395 inline jsval
61396 JSObject::getNameURIVal() const
61397 {
61398 do { } while(0);
61399 return getSlot(JSSLOT_NAME_URI);
61400 }
61401
61402 inline void
61403 JSObject::setNameURI(JSLinearString *uri)
61404 {
61405 do { } while(0);
61406 setSlot(JSSLOT_NAME_URI, uri ? js::StringValue(uri) : js::UndefinedValue());
61407 }
61408
61409 inline jsval
61410 JSObject::getNamespaceDeclared() const
61411 {
61412 do { } while(0);
61413 return getSlot(JSSLOT_NAMESPACE_DECLARED);
61414 }
61415
61416 inline void
61417 JSObject::setNamespaceDeclared(jsval decl)
61418 {
61419 do { } while(0);
61420 setSlot(JSSLOT_NAMESPACE_DECLARED, decl);
61421 }
61422
61423 inline JSAtom *
61424 JSObject::getQNameLocalName() const
61425 {
61426 do { } while(0);
61427 const js::Value &v = getSlot(JSSLOT_QNAME_LOCAL_NAME);
61428 return !v.isUndefined() ? &v.toString()->asAtom() : __null;
61429 }
61430
61431 inline jsval
61432 JSObject::getQNameLocalNameVal() const
61433 {
61434 do { } while(0);
61435 return getSlot(JSSLOT_QNAME_LOCAL_NAME);
61436 }
61437
61438 inline void
61439 JSObject::setQNameLocalName(JSAtom *name)
61440 {
61441 do { } while(0);
61442 setSlot(JSSLOT_QNAME_LOCAL_NAME, name ? js::StringValue(name) : js::UndefinedValue());
61443 }
61444
61445
61446
61447 inline bool
61448 JSObject::setSingletonType(JSContext *cx)
61449 {
61450 if (!cx->typeInferenceEnabled())
61451 return true;
61452
61453 do { } while(0);
61454 do { } while (0);
61455
61456 js::types::TypeObject *type = cx->compartment->getLazyType(cx, getProto());
61457 if (!type)
61458 return false;
61459
61460 type_ = type;
61461 return true;
61462 }
61463
61464 inline js::types::TypeObject *
61465 JSObject::getType(JSContext *cx)
61466 {
61467 if (hasLazyType())
61468 makeLazyType(cx);
61469 return type_;
61470 }
61471
61472 inline bool
61473 JSObject::clearType(JSContext *cx)
61474 {
61475 do { } while(0);
61476
61477 js::types::TypeObject *type = cx->compartment->getEmptyType(cx);
61478 if (!type)
61479 return false;
61480
61481 type_ = type;
61482 return true;
61483 }
61484
61485 inline void
61486 JSObject::setType(js::types::TypeObject *newType)
61487 {
61488
61489
61490
61491
61492
61493 do { } while (0)
61494 ;
61495 do { } while(0);
61496 type_ = newType;
61497 }
61498
61499 inline bool JSObject::setIteratedSingleton(JSContext *cx)
61500 {
61501 return setFlag(cx, js::BaseShape::ITERATED_SINGLETON);
61502 }
61503
61504 inline bool JSObject::isSystem() const
61505 {
61506 return lastProperty()->hasObjectFlag(js::BaseShape::SYSTEM);
61507 }
61508
61509 inline bool JSObject::setSystem(JSContext *cx)
61510 {
61511 return setFlag(cx, js::BaseShape::SYSTEM);
61512 }
61513
61514 inline bool JSObject::setDelegate(JSContext *cx)
61515 {
61516 return setFlag(cx, js::BaseShape::DELEGATE, GENERATE_SHAPE);
61517 }
61518
61519 inline bool JSObject::isVarObj()
61520 {
61521 if (isDebugScope())
61522 return asDebugScope().scope().isVarObj();
61523 return lastProperty()->hasObjectFlag(js::BaseShape::VAROBJ);
61524 }
61525
61526 inline bool JSObject::setVarObj(JSContext *cx)
61527 {
61528 return setFlag(cx, js::BaseShape::VAROBJ);
61529 }
61530
61531 inline bool JSObject::setWatched(JSContext *cx)
61532 {
61533 return setFlag(cx, js::BaseShape::WATCHED, GENERATE_SHAPE);
61534 }
61535
61536 inline bool JSObject::hasUncacheableProto() const
61537 {
61538 return lastProperty()->hasObjectFlag(js::BaseShape::UNCACHEABLE_PROTO);
61539 }
61540
61541 inline bool JSObject::setUncacheableProto(JSContext *cx)
61542 {
61543 return setFlag(cx, js::BaseShape::UNCACHEABLE_PROTO, GENERATE_SHAPE);
61544 }
61545
61546 inline bool JSObject::isBoundFunction() const
61547 {
61548 return lastProperty()->hasObjectFlag(js::BaseShape::BOUND_FUNCTION);
61549 }
61550
61551 inline bool JSObject::isIndexed() const
61552 {
61553 return lastProperty()->hasObjectFlag(js::BaseShape::INDEXED);
61554 }
61555
61556 inline bool JSObject::watched() const
61557 {
61558 return lastProperty()->hasObjectFlag(js::BaseShape::WATCHED);
61559 }
61560
61561 inline bool JSObject::hasSpecialEquality() const
61562 {
61563 return !!getClass()->ext.equality;
61564 }
61565
61566 inline bool JSObject::isArguments() const { return isNormalArguments() || isStrictArguments(); }
61567 inline bool JSObject::isArrayBuffer() const { return hasClass(&js::ArrayBufferClass); }
61568 inline bool JSObject::isBlock() const { return hasClass(&js::BlockClass); }
61569 inline bool JSObject::isBoolean() const { return hasClass(&js::BooleanClass); }
61570 inline bool JSObject::isCall() const { return hasClass(&js::CallClass); }
61571 inline bool JSObject::isClonedBlock() const { return isBlock() && !!getProto(); }
61572 inline bool JSObject::isDataView() const { return hasClass(&js::DataViewClass); }
61573 inline bool JSObject::isDate() const { return hasClass(&js::DateClass); }
61574 inline bool JSObject::isDeclEnv() const { return hasClass(&js::DeclEnvClass); }
61575 inline bool JSObject::isElementIterator() const { return hasClass(&js::ElementIteratorClass); }
61576 inline bool JSObject::isError() const { return hasClass(&js::ErrorClass); }
61577 inline bool JSObject::isFunction() const { return hasClass(&js::FunctionClass); }
61578 inline bool JSObject::isFunctionProxy() const { return hasClass(&js::FunctionProxyClass); }
61579 inline bool JSObject::isGenerator() const { return hasClass(&js::GeneratorClass); }
61580 inline bool JSObject::isIterator() const { return hasClass(&js::IteratorClass); }
61581 inline bool JSObject::isNestedScope() const { return isBlock() || isWith(); }
61582 inline bool JSObject::isNormalArguments() const { return hasClass(&js::NormalArgumentsObjectClass); }
61583 inline bool JSObject::isNumber() const { return hasClass(&js::NumberClass); }
61584 inline bool JSObject::isObject() const { return hasClass(&js::ObjectClass); }
61585 inline bool JSObject::isPrimitive() const { return isNumber() || isString() || isBoolean(); }
61586 inline bool JSObject::isRegExp() const { return hasClass(&js::RegExpClass); }
61587 inline bool JSObject::isRegExpStatics() const { return hasClass(&js::RegExpStaticsClass); }
61588 inline bool JSObject::isScope() const { return isCall() || isDeclEnv() || isNestedScope(); }
61589 inline bool JSObject::isStaticBlock() const { return isBlock() && !getProto(); }
61590 inline bool JSObject::isStopIteration() const { return hasClass(&js::StopIterationClass); }
61591 inline bool JSObject::isStrictArguments() const { return hasClass(&js::StrictArgumentsObjectClass); }
61592 inline bool JSObject::isString() const { return hasClass(&js::StringClass); }
61593 inline bool JSObject::isTypedArray() const { return IsTypedArrayClass(getClass()); }
61594 inline bool JSObject::isWeakMap() const { return hasClass(&js::WeakMapClass); }
61595 inline bool JSObject::isWith() const { return hasClass(&js::WithClass); }
61596
61597 inline bool
61598 JSObject::isDebugScope() const
61599 {
61600 extern bool js_IsDebugScopeSlow(const JSObject *obj);
61601 return getClass() == &js::ObjectProxyClass && js_IsDebugScopeSlow(this);
61602 }
61603
61604
61605 inline bool JSObject::isNamespace() const { return hasClass(&js::NamespaceClass); }
61606 inline bool JSObject::isXML() const { return hasClass(&js::XMLClass); }
61607
61608 inline bool
61609 JSObject::isXMLId() const
61610 {
61611 return hasClass(&js::QNameClass)
61612 || hasClass(&js::AttributeNameClass)
61613 || hasClass(&js::AnyNameClass);
61614 }
61615
61616 inline bool
61617 JSObject::isQName() const
61618 {
61619 return hasClass(&js::QNameClass)
61620 || hasClass(&js::AttributeNameClass)
61621 || hasClass(&js::AnyNameClass);
61622 }
61623
61624
61625 inline JSObject *
61626 JSObject::create(JSContext *cx, js::gc::AllocKind kind,
61627 js::HandleShape shape, js::HandleTypeObject type, js::HeapSlot *slots)
61628 {
61629
61630
61631
61632
61633
61634 do { } while(0);
61635 do { } while(0);
61636 do { } while(0);
61637
61638 JSObject *obj = js_NewGCObject(cx, kind);
61639 if (!obj)
61640 return __null;
61641
61642 obj->shape_.init(shape);
61643 obj->type_.init(type);
61644 obj->slots = slots;
61645 obj->elements = js::emptyObjectElements;
61646
61647 const js::Class *clasp = shape->getObjectClass();
61648 if (clasp->hasPrivate())
61649 obj->privateRef(shape->numFixedSlots()) = __null;
61650
61651 size_t span = shape->slotSpan();
61652 if (span && clasp != &js::ArrayBufferClass)
61653 obj->initializeSlotRange(0, span);
61654
61655 return obj;
61656 }
61657
61658 inline JSObject *
61659 JSObject::createDenseArray(JSContext *cx, js::gc::AllocKind kind,
61660 js::HandleShape shape, js::HandleTypeObject type,
61661 uint32_t length)
61662 {
61663 do { } while(0);
61664 do { } while(0);
61665
61666
61667
61668
61669
61670 do { } while(0);
61671
61672
61673
61674
61675
61676 do { } while(0);
61677
61678 uint32_t capacity = js::gc::GetGCKindSlots(kind) - js::ObjectElements::VALUES_PER_HEADER;
61679
61680 JSObject *obj = js_NewGCObject(cx, kind);
61681 if (!obj) {
61682 js_ReportOutOfMemory(cx);
61683 return __null;
61684 }
61685
61686 obj->shape_.init(shape);
61687 obj->type_.init(type);
61688 obj->slots = __null;
61689 obj->setFixedElements();
61690 new (obj->getElementsHeader()) js::ObjectElements(capacity, length);
61691
61692 return obj;
61693 }
61694
61695 inline void
61696 JSObject::finish(js::FreeOp *fop)
61697 {
61698 if (hasDynamicSlots())
61699 fop->free_(slots);
61700 if (hasDynamicElements())
61701 fop->free_(getElementsHeader());
61702 }
61703
61704 inline bool
61705 JSObject::hasProperty(JSContext *cx, js::HandleId id, bool *foundp, unsigned flags)
61706 {
61707 JSObject *pobj;
61708 JSProperty *prop;
61709 JSAutoResolveFlags rf(cx, flags);
61710 if (!lookupGeneric(cx, id, &pobj, &prop))
61711 return false;
61712 *foundp = !!prop;
61713 return true;
61714 }
61715
61716 inline bool
61717 JSObject::isCallable()
61718 {
61719 return isFunction() || getClass()->call;
61720 }
61721
61722 inline JSPrincipals *
61723 JSObject::principals(JSContext *cx)
61724 {
61725 if (JSObjectPrincipalsFinder find = cx->runtime->securityCallbacks->findObjectPrincipals)
61726 return find(this);
61727 return cx->compartment ? cx->compartment->principals : __null;
61728 }
61729
61730 inline void
61731 JSObject::nativeSetSlot(unsigned slot, const js::Value &value)
61732 {
61733 do { } while(0);
61734 do { } while(0);
61735 return setSlot(slot, value);
61736 }
61737
61738 inline void
61739 JSObject::nativeSetSlotWithType(JSContext *cx, const js::Shape *shape, const js::Value &value)
61740 {
61741 nativeSetSlot(shape->slot(), value);
61742 js::types::AddTypePropertyId(cx, this, shape->propid(), value);
61743 }
61744
61745 inline bool
61746 JSObject::nativeContains(JSContext *cx, jsid id)
61747 {
61748 return nativeLookup(cx, id) != __null;
61749 }
61750
61751 inline bool
61752 JSObject::nativeContains(JSContext *cx, const js::Shape &shape)
61753 {
61754 return nativeLookup(cx, shape.propid()) == &shape;
61755 }
61756
61757 inline bool
61758 JSObject::nativeEmpty() const
61759 {
61760 return lastProperty()->isEmptyShape();
61761 }
61762
61763 inline uint32_t
61764 JSObject::propertyCount() const
61765 {
61766 return lastProperty()->entryCount();
61767 }
61768
61769 inline bool
61770 JSObject::hasShapeTable() const
61771 {
61772 return lastProperty()->hasTable();
61773 }
61774
61775 inline size_t
61776 JSObject::computedSizeOfThisSlotsElements() const
61777 {
61778 size_t n = sizeOfThis();
61779
61780 if (hasDynamicSlots())
61781 n += numDynamicSlots() * sizeof(js::Value);
61782
61783 if (hasDynamicElements())
61784 n += (js::ObjectElements::VALUES_PER_HEADER + getElementsHeader()->capacity) *
61785 sizeof(js::Value);
61786
61787 return n;
61788 }
61789
61790 inline void
61791 JSObject::sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf,
61792 size_t *slotsSize, size_t *elementsSize,
61793 size_t *miscSize) const
61794 {
61795 *slotsSize = 0;
61796 if (hasDynamicSlots()) {
61797 *slotsSize += mallocSizeOf(slots);
61798 }
61799
61800 *elementsSize = 0;
61801 if (hasDynamicElements()) {
61802 *elementsSize += mallocSizeOf(getElementsHeader());
61803 }
61804
61805
61806 *miscSize = 0;
61807 if (isArguments()) {
61808 *miscSize += asArguments().sizeOfMisc(mallocSizeOf);
61809 } else if (isRegExpStatics()) {
61810 *miscSize += js::SizeOfRegExpStaticsData(this, mallocSizeOf);
61811 }
61812 }
61813
61814 inline JSBool
61815 JSObject::lookupGeneric(JSContext *cx, js::HandleId id, JSObject **objp, JSProperty **propp)
61816 {
61817 js::RootedObject self(cx, this);
61818
61819 js::LookupGenericOp op = getOps()->lookupGeneric;
61820 if (op)
61821 return op(cx, self, id, objp, propp);
61822 return js::baseops::LookupProperty(cx, self, id, objp, propp);
61823 }
61824
61825 inline JSBool
61826 JSObject::lookupProperty(JSContext *cx, js::PropertyName *name, JSObject **objp, JSProperty **propp)
61827 {
61828 return lookupGeneric(cx, js::RootedId(cx, js::NameToId(name)), objp, propp);
61829 }
61830
61831 inline JSBool
61832 JSObject::defineGeneric(JSContext *cx, js::HandleId id, const js::Value &value,
61833 JSPropertyOp getter ,
61834 JSStrictPropertyOp setter ,
61835 unsigned attrs )
61836 {
61837 js::RootedObject self(cx, this);
61838
61839 do { } while(0);
61840 js::DefineGenericOp op = getOps()->defineGeneric;
61841 return (op ? op : js::baseops::DefineProperty)(cx, self, id, &value, getter, setter, attrs);
61842 }
61843
61844 inline JSBool
61845 JSObject::defineProperty(JSContext *cx, js::PropertyName *name, const js::Value &value,
61846 JSPropertyOp getter ,
61847 JSStrictPropertyOp setter ,
61848 unsigned attrs )
61849 {
61850 return defineGeneric(cx, js::RootedId(cx, js::NameToId(name)), value, getter, setter, attrs);
61851 }
61852
61853 inline JSBool
61854 JSObject::defineElement(JSContext *cx, uint32_t index, const js::Value &value,
61855 JSPropertyOp getter ,
61856 JSStrictPropertyOp setter ,
61857 unsigned attrs )
61858 {
61859 js::RootedObject self(cx, this);
61860
61861 js::DefineElementOp op = getOps()->defineElement;
61862 return (op ? op : js::baseops::DefineElement)(cx, self, index, &value, getter, setter, attrs);
61863 }
61864
61865 inline JSBool
61866 JSObject::defineSpecial(JSContext *cx, js::SpecialId sid, const js::Value &value,
61867 JSPropertyOp getter ,
61868 JSStrictPropertyOp setter ,
61869 unsigned attrs )
61870 {
61871 return defineGeneric(cx, js::RootedId(cx, SPECIALID_TO_JSID(sid)), value, getter, setter, attrs);
61872 }
61873
61874 inline JSBool
61875 JSObject::lookupElement(JSContext *cx, uint32_t index, JSObject **objp, JSProperty **propp)
61876 {
61877 js::RootedObject self(cx, this);
61878
61879 js::LookupElementOp op = getOps()->lookupElement;
61880 return (op ? op : js::baseops::LookupElement)(cx, self, index, objp, propp);
61881 }
61882
61883 inline JSBool
61884 JSObject::lookupSpecial(JSContext *cx, js::SpecialId sid, JSObject **objp, JSProperty **propp)
61885 {
61886 return lookupGeneric(cx, js::RootedId(cx, SPECIALID_TO_JSID(sid)), objp, propp);
61887 }
61888
61889 inline JSBool
61890 JSObject::getElement(JSContext *cx, js::HandleObject receiver, uint32_t index, js::Value *vp)
61891 {
61892 js::RootedObject self(cx, this);
61893
61894 js::ElementIdOp op = getOps()->getElement;
61895 if (op)
61896 return op(cx, self, receiver, index, vp);
61897
61898 js::RootedId id(cx);
61899 if (!js::IndexToId(cx, index, id.address()))
61900 return false;
61901 return self->getGeneric(cx, receiver, id, vp);
61902 }
61903
61904 inline JSBool
61905 JSObject::getElement(JSContext *cx, uint32_t index, js::Value *vp)
61906 {
61907 return getElement(cx, js::RootedObject(cx, this), index, vp);
61908 }
61909
61910 inline JSBool
61911 JSObject::getElementIfPresent(JSContext *cx, js::HandleObject receiver, uint32_t index, js::Value *vp,
61912 bool *present)
61913 {
61914 js::RootedObject self(cx, this);
61915
61916 js::ElementIfPresentOp op = getOps()->getElementIfPresent;
61917 if (op)
61918 return op(cx, self, receiver, index, vp, present);
61919
61920
61921
61922
61923
61924
61925 js::RootedId id(cx);
61926 if (!js::IndexToId(cx, index, id.address()))
61927 return false;
61928
61929 JSObject *obj2;
61930 JSProperty *prop;
61931 if (!self->lookupGeneric(cx, id, &obj2, &prop))
61932 return false;
61933
61934 if (!prop) {
61935 *present = false;
61936 js::Debug_SetValueRangeToCrashOnTouch(vp, 1);
61937 return true;
61938 }
61939
61940 *present = true;
61941 return self->getGeneric(cx, receiver, id, vp);
61942 }
61943
61944 inline JSBool
61945 JSObject::getSpecial(JSContext *cx, js::HandleObject receiver, js::SpecialId sid, js::Value *vp)
61946 {
61947 return getGeneric(cx, receiver, js::RootedId(cx, SPECIALID_TO_JSID(sid)), vp);
61948 }
61949
61950 inline JSBool
61951 JSObject::getGenericAttributes(JSContext *cx, js::HandleId id, unsigned *attrsp)
61952 {
61953 js::GenericAttributesOp op = getOps()->getGenericAttributes;
61954 return (op ? op : js::baseops::GetAttributes)(cx, js::RootedObject(cx, this), id, attrsp);
61955 }
61956
61957 inline JSBool
61958 JSObject::getPropertyAttributes(JSContext *cx, js::PropertyName *name, unsigned *attrsp)
61959 {
61960 return getGenericAttributes(cx, js::RootedId(cx, js::NameToId(name)), attrsp);
61961 }
61962
61963 inline JSBool
61964 JSObject::getElementAttributes(JSContext *cx, uint32_t index, unsigned *attrsp)
61965 {
61966 js::RootedId id(cx);
61967 if (!js::IndexToId(cx, index, id.address()))
61968 return false;
61969 return getGenericAttributes(cx, id, attrsp);
61970 }
61971
61972 inline JSBool
61973 JSObject::getSpecialAttributes(JSContext *cx, js::SpecialId sid, unsigned *attrsp)
61974 {
61975 return getGenericAttributes(cx, js::RootedId(cx, SPECIALID_TO_JSID(sid)), attrsp);
61976 }
61977
61978 inline bool
61979 JSObject::isProxy() const
61980 {
61981 return js::IsProxy(this);
61982 }
61983
61984 inline bool
61985 JSObject::isCrossCompartmentWrapper() const
61986 {
61987 return js::IsCrossCompartmentWrapper(this);
61988 }
61989
61990 inline bool
61991 JSObject::isWrapper() const
61992 {
61993 return js::IsWrapper(this);
61994 }
61995
61996 inline js::GlobalObject &
61997 JSObject::global() const
61998 {
61999 JSObject *obj = const_cast<JSObject *>(this);
62000 while (JSObject *parent = obj->getParent())
62001 obj = parent;
62002 return obj->asGlobal();
62003 }
62004
62005 static inline bool
62006 js_IsCallable(const js::Value &v)
62007 {
62008 return v.isObject() && v.toObject().isCallable();
62009 }
62010
62011 namespace js {
62012
62013 inline JSObject *
62014 GetInnerObject(JSContext *cx, HandleObject obj)
62015 {
62016 if (JSObjectOp op = obj->getClass()->ext.innerObject)
62017 return op(cx, obj);
62018 return obj;
62019 }
62020
62021 inline JSObject *
62022 GetOuterObject(JSContext *cx, HandleObject obj)
62023 {
62024 if (JSObjectOp op = obj->getClass()->ext.outerObject)
62025 return op(cx, obj);
62026 return obj;
62027 }
62028
62029
62030
62031
62032
62033
62034 #define VALUE_IS_XML(v) ((v).isObject() && (v).toObject().isXML())
62035
62036 static inline bool
62037 IsXML(const js::Value &v)
62038 {
62039 return v.isObject() && v.toObject().isXML();
62040 }
62041
62042
62043
62044
62045
62046
62047
62048 static inline bool
62049 IsStopIteration(const js::Value &v)
62050 {
62051 return v.isObject() && v.toObject().isStopIteration();
62052 }
62053
62054
62055 static __attribute__((always_inline)) inline bool
62056 ToPrimitive(JSContext *cx, Value *vp)
62057 {
62058 if (vp->isPrimitive())
62059 return true;
62060 return vp->toObject().defaultValue(cx, JSTYPE_VOID, vp);
62061 }
62062
62063
62064 static __attribute__((always_inline)) inline bool
62065 ToPrimitive(JSContext *cx, JSType preferredType, Value *vp)
62066 {
62067 do { } while(0);
62068 if (vp->isPrimitive())
62069 return true;
62070 return vp->toObject().defaultValue(cx, preferredType, vp);
62071 }
62072
62073
62074
62075
62076
62077
62078 inline bool
62079 IsInternalFunctionObject(JSObject *funobj)
62080 {
62081 JSFunction *fun = funobj->toFunction();
62082 return (fun->flags & 0x08) && !funobj->getParent();
62083 }
62084
62085 class AutoPropDescArrayRooter : private AutoGCRooter
62086 {
62087 public:
62088 AutoPropDescArrayRooter(JSContext *cx)
62089 : AutoGCRooter(cx, DESCRIPTORS), descriptors(cx), skip(cx, &descriptors)
62090 { }
62091
62092 PropDesc *append() {
62093 if (!descriptors.append(PropDesc()))
62094 return __null;
62095 return &descriptors.back();
62096 }
62097
62098 bool reserve(size_t n) {
62099 return descriptors.reserve(n);
62100 }
62101
62102 PropDesc& operator[](size_t i) {
62103 do { } while(0);
62104 return descriptors[i];
62105 }
62106
62107 friend void AutoGCRooter::trace(JSTracer *trc);
62108
62109 private:
62110 PropDescArray descriptors;
62111 SkipRoot skip;
62112 };
62113
62114 class AutoPropertyDescriptorRooter : private AutoGCRooter, public PropertyDescriptor
62115 {
62116 SkipRoot skip;
62117
62118 AutoPropertyDescriptorRooter *thisDuringConstruction() { return this; }
62119
62120 public:
62121 AutoPropertyDescriptorRooter(JSContext *cx)
62122 : AutoGCRooter(cx, DESCRIPTOR), skip(cx, thisDuringConstruction())
62123 {
62124 obj = __null;
62125 attrs = 0;
62126 getter = (PropertyOp) __null;
62127 setter = (StrictPropertyOp) __null;
62128 value.setUndefined();
62129 }
62130
62131 AutoPropertyDescriptorRooter(JSContext *cx, PropertyDescriptor *desc)
62132 : AutoGCRooter(cx, DESCRIPTOR), skip(cx, thisDuringConstruction())
62133 {
62134 obj = desc->obj;
62135 attrs = desc->attrs;
62136 getter = desc->getter;
62137 setter = desc->setter;
62138 value = desc->value;
62139 }
62140
62141 friend void AutoGCRooter::trace(JSTracer *trc);
62142 };
62143
62144 inline void
62145 NewObjectCache::copyCachedToObject(JSObject *dst, JSObject *src)
62146 {
62147 js_memcpy(dst, src, dst->sizeOfThis());
62148
62149
62150
62151
62152 }
62153
62154 static inline bool
62155 CanBeFinalizedInBackground(gc::AllocKind kind, Class *clasp)
62156 {
62157
62158 do { } while(0);
62159
62160
62161
62162
62163
62164
62165
62166 if (!gc::IsBackgroundAllocKind(kind) && !clasp->finalize)
62167 return true;
62168
62169 return false;
62170 }
62171
62172
62173
62174
62175
62176 JSObject *
62177 NewObjectWithGivenProto(JSContext *cx, js::Class *clasp, JSObject *proto, JSObject *parent,
62178 gc::AllocKind kind);
62179
62180 inline JSObject *
62181 NewObjectWithGivenProto(JSContext *cx, js::Class *clasp, JSObject *proto, JSObject *parent)
62182 {
62183 gc::AllocKind kind = gc::GetGCObjectKind(clasp);
62184 return NewObjectWithGivenProto(cx, clasp, proto, parent, kind);
62185 }
62186
62187 inline JSProtoKey
62188 GetClassProtoKey(js::Class *clasp)
62189 {
62190 JSProtoKey key = ((JSProtoKey) (((clasp)->flags >> ((8 + 8) + 10)) & (((uint32_t)1 << (6)) - 1)));
62191 if (key != JSProto_Null)
62192 return key;
62193 if (clasp->flags & (1<<((8 + 8)+1)))
62194 return JSProto_Object;
62195 return JSProto_Null;
62196 }
62197
62198 inline bool
62199 FindProto(JSContext *cx, js::Class *clasp, HandleObject parent, JSObject **proto)
62200 {
62201 JSProtoKey protoKey = GetClassProtoKey(clasp);
62202 if (!js_GetClassPrototype(cx, parent, protoKey, proto, clasp))
62203 return false;
62204 if (!(*proto) && !js_GetClassPrototype(cx, parent, JSProto_Object, proto))
62205 return false;
62206 return true;
62207 }
62208 # 1427 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsobjinlines.h"
62209 JSObject *
62210 NewObjectWithClassProto(JSContext *cx, js::Class *clasp, JSObject *proto, JSObject *parent,
62211 gc::AllocKind kind);
62212
62213 inline JSObject *
62214 NewObjectWithClassProto(JSContext *cx, js::Class *clasp, JSObject *proto, JSObject *parent)
62215 {
62216 gc::AllocKind kind = gc::GetGCObjectKind(clasp);
62217 return NewObjectWithClassProto(cx, clasp, proto, parent, kind);
62218 }
62219
62220
62221
62222
62223
62224 inline JSObject *
62225 NewBuiltinClassInstance(JSContext *cx, Class *clasp, gc::AllocKind kind)
62226 {
62227 return NewObjectWithClassProto(cx, clasp, __null, __null, kind);
62228 }
62229
62230 inline JSObject *
62231 NewBuiltinClassInstance(JSContext *cx, Class *clasp)
62232 {
62233 gc::AllocKind kind = gc::GetGCObjectKind(clasp);
62234 return NewBuiltinClassInstance(cx, clasp, kind);
62235 }
62236
62237 inline GlobalObject *
62238 GetCurrentGlobal(JSContext *cx)
62239 {
62240 JSObject *scopeChain = (cx->hasfp()) ? cx->fp()->scopeChain() : cx->globalObject;
62241 return scopeChain ? &scopeChain->global() : __null;
62242 }
62243
62244 bool
62245 FindClassPrototype(JSContext *cx, JSObject *scope, JSProtoKey protoKey, JSObject **protop,
62246 Class *clasp);
62247
62248
62249
62250
62251
62252 JSObject *
62253 NewObjectWithType(JSContext *cx, HandleTypeObject type, JSObject *parent, gc::AllocKind kind);
62254
62255
62256 static inline JSObject *
62257 CopyInitializerObject(JSContext *cx, HandleObject baseobj)
62258 {
62259 do { } while(0);
62260 do { } while(0);
62261
62262 gc::AllocKind kind = gc::GetGCObjectFixedSlotsKind(baseobj->numFixedSlots());
62263
62264 kind = gc::GetBackgroundAllocKind(kind);
62265
62266 do { } while(0);
62267 JSObject *obj = NewBuiltinClassInstance(cx, &ObjectClass, kind);
62268
62269 if (!obj)
62270 return __null;
62271
62272 if (!obj->setLastProperty(cx, baseobj->lastProperty()))
62273 return __null;
62274
62275 return obj;
62276 }
62277
62278 JSObject *
62279 NewReshapedObject(JSContext *cx, HandleTypeObject type, JSObject *parent,
62280 gc::AllocKind kind, const Shape *shape);
62281
62282
62283
62284
62285
62286
62287 static inline gc::AllocKind
62288 GuessObjectGCKind(size_t numSlots)
62289 {
62290 if (numSlots)
62291 return gc::GetGCObjectKind(numSlots);
62292 return gc::FINALIZE_OBJECT4;
62293 }
62294
62295 static inline gc::AllocKind
62296 GuessArrayGCKind(size_t numSlots)
62297 {
62298 if (numSlots)
62299 return gc::GetGCArrayKind(numSlots);
62300 return gc::FINALIZE_OBJECT8;
62301 }
62302
62303
62304
62305
62306
62307 static inline gc::AllocKind
62308 NewObjectGCKind(JSContext *cx, js::Class *clasp)
62309 {
62310 if (clasp == &ArrayClass || clasp == &SlowArrayClass)
62311 return gc::FINALIZE_OBJECT8;
62312 if (clasp == &FunctionClass)
62313 return gc::FINALIZE_OBJECT2;
62314 return gc::FINALIZE_OBJECT4;
62315 }
62316
62317
62318
62319
62320
62321 inline bool
62322 PreallocateObjectDynamicSlots(JSContext *cx, Shape *shape, HeapSlot **slots)
62323 {
62324 if (size_t count = JSObject::dynamicSlotsCount(shape->numFixedSlots(), shape->slotSpan())) {
62325 *slots = (HeapSlot *) cx->malloc_(count * sizeof(HeapSlot));
62326 if (!*slots)
62327 return false;
62328 Debug_SetSlotRangeToCrashOnTouch(*slots, count);
62329 return true;
62330 }
62331 *slots = __null;
62332 return true;
62333 }
62334
62335 inline bool
62336 DefineConstructorAndPrototype(JSContext *cx, GlobalObject *global,
62337 JSProtoKey key, JSObject *ctor, JSObject *proto)
62338 {
62339 do { } while(0);
62340 do { } while(0);
62341 do { } while(0);
62342
62343 jsid id = NameToId(cx->runtime->atomState.classAtoms[key]);
62344 do { } while(0);
62345
62346
62347 global->setSlot(key, ObjectValue(*ctor));
62348 global->setSlot(key + JSProto_LIMIT, ObjectValue(*proto));
62349 global->setSlot(key + JSProto_LIMIT * 2, ObjectValue(*ctor));
62350
62351 types::AddTypePropertyId(cx, global, id, ObjectValue(*ctor));
62352 if (!global->addDataProperty(cx, id, key + JSProto_LIMIT * 2, 0)) {
62353 global->setSlot(key, UndefinedValue());
62354 global->setSlot(key + JSProto_LIMIT, UndefinedValue());
62355 global->setSlot(key + JSProto_LIMIT * 2, UndefinedValue());
62356 return false;
62357 }
62358
62359 return true;
62360 }
62361
62362 inline bool
62363 ObjectClassIs(JSObject &obj, ESClassValue classValue, JSContext *cx)
62364 {
62365 if ((__builtin_expect((obj.isProxy()), 0)))
62366 return Proxy::objectClassIs(&obj, classValue, cx);
62367
62368 switch (classValue) {
62369 case ESClass_Array: return obj.isArray();
62370 case ESClass_Number: return obj.isNumber();
62371 case ESClass_String: return obj.isString();
62372 case ESClass_Boolean: return obj.isBoolean();
62373 case ESClass_RegExp: return obj.isRegExp();
62374 case ESClass_ArrayBuffer: return obj.isArrayBuffer();
62375 }
62376 __builtin_unreachable();
62377 return false;
62378 }
62379
62380 inline bool
62381 IsObjectWithClass(const Value &v, ESClassValue classValue, JSContext *cx)
62382 {
62383 if (!v.isObject())
62384 return false;
62385 return ObjectClassIs(v.toObject(), classValue, cx);
62386 }
62387
62388 static __attribute__((always_inline)) inline bool
62389 ValueIsSpecial(JSObject *obj, Value *propval, SpecialId *sidp, JSContext *cx)
62390 {
62391
62392 if (!propval->isObject())
62393 return false;
62394
62395 if (obj->isXML()) {
62396 *sidp = SpecialId(propval->toObject());
62397 return true;
62398 }
62399
62400 JSObject &propobj = propval->toObject();
62401 JSAtom *name;
62402 if (propobj.isQName() && GetLocalNameFromFunctionQName(&propobj, &name, cx)) {
62403 propval->setString(name);
62404 return false;
62405 }
62406
62407
62408 return false;
62409 }
62410
62411 JSObject *
62412 DefineConstructorAndPrototype(JSContext *cx, HandleObject obj, JSProtoKey key, HandleAtom atom,
62413 JSObject *protoProto, Class *clasp,
62414 Native constructor, unsigned nargs,
62415 JSPropertySpec *ps, JSFunctionSpec *fs,
62416 JSPropertySpec *static_ps, JSFunctionSpec *static_fs,
62417 JSObject **ctorp = __null,
62418 gc::AllocKind ctorKind = JSFunction::FinalizeKind);
62419
62420 }
62421
62422 extern JSObject *
62423 js_InitClass(JSContext *cx, js::HandleObject obj, JSObject *parent_proto,
62424 js::Class *clasp, JSNative constructor, unsigned nargs,
62425 JSPropertySpec *ps, JSFunctionSpec *fs,
62426 JSPropertySpec *static_ps, JSFunctionSpec *static_fs,
62427 JSObject **ctorp = __null,
62428 js::gc::AllocKind ctorKind = JSFunction::FinalizeKind);
62429
62430
62431
62432
62433
62434
62435
62436 extern bool
62437 js_PurgeScopeChainHelper(JSContext *cx, JSObject *obj, jsid id);
62438
62439 inline bool
62440 js_PurgeScopeChain(JSContext *cx, JSObject *obj, jsid id)
62441 {
62442 if (obj->isDelegate())
62443 return js_PurgeScopeChainHelper(cx, obj, id);
62444 return true;
62445 }
62446
62447 inline void
62448 js::DestroyIdArray(FreeOp *fop, JSIdArray *ida)
62449 {
62450 fop->free_(ida);
62451 }
62452 # 13 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl.cpp" 2
62453
62454
62455
62456 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Debugger.h" 1
62457 # 9 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Debugger.h"
62458 #define Debugger_h__
62459
62460
62461
62462
62463 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jsclist.h" 1
62464 # 15 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Debugger.h" 2
62465
62466
62467
62468
62469 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/jswrapper.h" 1
62470 # 20 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Debugger.h" 2
62471
62472
62473
62474 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/GlobalObject.h" 1
62475 # 24 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Debugger.h" 2
62476
62477 namespace js {
62478
62479 class Debugger {
62480 friend class Breakpoint;
62481 friend JSBool (::JS_DefineDebuggerObject)(JSContext *cx, JSObject *obj);
62482
62483 public:
62484 enum Hook {
62485 OnDebuggerStatement,
62486 OnExceptionUnwind,
62487 OnNewScript,
62488 OnEnterFrame,
62489 HookCount
62490 };
62491
62492 enum {
62493 JSSLOT_DEBUG_PROTO_START,
62494 JSSLOT_DEBUG_FRAME_PROTO = JSSLOT_DEBUG_PROTO_START,
62495 JSSLOT_DEBUG_ENV_PROTO,
62496 JSSLOT_DEBUG_OBJECT_PROTO,
62497 JSSLOT_DEBUG_SCRIPT_PROTO,
62498 JSSLOT_DEBUG_PROTO_STOP,
62499 JSSLOT_DEBUG_HOOK_START = JSSLOT_DEBUG_PROTO_STOP,
62500 JSSLOT_DEBUG_HOOK_STOP = JSSLOT_DEBUG_HOOK_START + HookCount,
62501 JSSLOT_DEBUG_COUNT = JSSLOT_DEBUG_HOOK_STOP
62502 };
62503
62504 private:
62505 JSCList link;
62506 HeapPtrObject object;
62507 GlobalObjectSet debuggees;
62508 js::HeapPtrObject uncaughtExceptionHook;
62509 bool enabled;
62510 JSCList breakpoints;
62511 # 73 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Debugger.h"
62512 typedef HashMap<StackFrame *, HeapPtrObject, DefaultHasher<StackFrame *>, RuntimeAllocPolicy>
62513 FrameMap;
62514 FrameMap frames;
62515
62516
62517 typedef WeakMap<HeapPtrScript, HeapPtrObject> ScriptWeakMap;
62518 ScriptWeakMap scripts;
62519
62520
62521 typedef WeakMap<HeapPtrObject, HeapPtrObject> ObjectWeakMap;
62522 ObjectWeakMap objects;
62523
62524
62525 ObjectWeakMap environments;
62526
62527 class FrameRange;
62528 class ScriptQuery;
62529
62530 bool addDebuggeeGlobal(JSContext *cx, Handle<GlobalObject*> obj);
62531 void removeDebuggeeGlobal(FreeOp *fop, GlobalObject *global,
62532 GlobalObjectSet::Enum *compartmentEnum,
62533 GlobalObjectSet::Enum *debugEnum);
62534 # 110 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Debugger.h"
62535 JSTrapStatus handleUncaughtException(AutoCompartment &ac, Value *vp, bool callHook);
62536 # 137 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Debugger.h"
62537 JSTrapStatus parseResumptionValue(AutoCompartment &ac, bool ok, const Value &rv, Value *vp,
62538 bool callHook = true);
62539
62540 JSObject *unwrapDebuggeeArgument(JSContext *cx, const Value &v);
62541
62542 static void traceObject(JSTracer *trc, JSObject *obj);
62543 void trace(JSTracer *trc);
62544 static void finalize(FreeOp *fop, JSObject *obj);
62545 void markKeysInCompartment(JSTracer *tracer);
62546
62547 static Class jsclass;
62548
62549 static Debugger *fromThisValue(JSContext *cx, const CallArgs &ca, const char *fnname);
62550 static JSBool getEnabled(JSContext *cx, unsigned argc, Value *vp);
62551 static JSBool setEnabled(JSContext *cx, unsigned argc, Value *vp);
62552 static JSBool getHookImpl(JSContext *cx, unsigned argc, Value *vp, Hook which);
62553 static JSBool setHookImpl(JSContext *cx, unsigned argc, Value *vp, Hook which);
62554 static JSBool getOnDebuggerStatement(JSContext *cx, unsigned argc, Value *vp);
62555 static JSBool setOnDebuggerStatement(JSContext *cx, unsigned argc, Value *vp);
62556 static JSBool getOnExceptionUnwind(JSContext *cx, unsigned argc, Value *vp);
62557 static JSBool setOnExceptionUnwind(JSContext *cx, unsigned argc, Value *vp);
62558 static JSBool getOnNewScript(JSContext *cx, unsigned argc, Value *vp);
62559 static JSBool setOnNewScript(JSContext *cx, unsigned argc, Value *vp);
62560 static JSBool getOnEnterFrame(JSContext *cx, unsigned argc, Value *vp);
62561 static JSBool setOnEnterFrame(JSContext *cx, unsigned argc, Value *vp);
62562 static JSBool getUncaughtExceptionHook(JSContext *cx, unsigned argc, Value *vp);
62563 static JSBool setUncaughtExceptionHook(JSContext *cx, unsigned argc, Value *vp);
62564 static JSBool addDebuggee(JSContext *cx, unsigned argc, Value *vp);
62565 static JSBool removeDebuggee(JSContext *cx, unsigned argc, Value *vp);
62566 static JSBool hasDebuggee(JSContext *cx, unsigned argc, Value *vp);
62567 static JSBool getDebuggees(JSContext *cx, unsigned argc, Value *vp);
62568 static JSBool getNewestFrame(JSContext *cx, unsigned argc, Value *vp);
62569 static JSBool clearAllBreakpoints(JSContext *cx, unsigned argc, Value *vp);
62570 static JSBool findScripts(JSContext *cx, unsigned argc, Value *vp);
62571 static JSBool wrap(JSContext *cx, unsigned argc, Value *vp);
62572 static JSBool construct(JSContext *cx, unsigned argc, Value *vp);
62573 static JSPropertySpec properties[];
62574 static JSFunctionSpec methods[];
62575
62576 JSObject *getHook(Hook hook) const;
62577 bool hasAnyLiveHooks() const;
62578
62579 static JSTrapStatus slowPathOnEnterFrame(JSContext *cx, Value *vp);
62580 static bool slowPathOnLeaveFrame(JSContext *cx, bool ok);
62581 static void slowPathOnNewScript(JSContext *cx, JSScript *script,
62582 GlobalObject *compileAndGoGlobal);
62583 static JSTrapStatus dispatchHook(JSContext *cx, Value *vp, Hook which);
62584
62585 JSTrapStatus fireDebuggerStatement(JSContext *cx, Value *vp);
62586 JSTrapStatus fireExceptionUnwind(JSContext *cx, Value *vp);
62587 JSTrapStatus fireEnterFrame(JSContext *cx, Value *vp);
62588
62589
62590
62591
62592
62593 JSObject *newDebuggerScript(JSContext *cx, Handle<JSScript*> script);
62594
62595
62596
62597
62598
62599 void fireNewScript(JSContext *cx, Handle<JSScript*> script);
62600
62601 static inline Debugger *fromLinks(JSCList *links);
62602 inline Breakpoint *firstBreakpoint() const;
62603
62604 public:
62605 Debugger(JSContext *cx, JSObject *dbg);
62606 ~Debugger();
62607
62608 bool init(JSContext *cx);
62609 inline const js::HeapPtrObject &toJSObject() const;
62610 inline js::HeapPtrObject &toJSObjectRef();
62611 static inline Debugger *fromJSObject(JSObject *obj);
62612 static Debugger *fromChildJSObject(JSObject *obj);
62613 # 231 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Debugger.h"
62614 static void markCrossCompartmentDebuggerObjectReferents(JSTracer *tracer);
62615 static bool markAllIteratively(GCMarker *trc);
62616 static void sweepAll(FreeOp *fop);
62617 static void detachAllDebuggersFromGlobal(FreeOp *fop, GlobalObject *global,
62618 GlobalObjectSet::Enum *compartmentEnum);
62619
62620 static inline JSTrapStatus onEnterFrame(JSContext *cx, Value *vp);
62621 static inline bool onLeaveFrame(JSContext *cx, bool ok);
62622 static inline JSTrapStatus onDebuggerStatement(JSContext *cx, Value *vp);
62623 static inline JSTrapStatus onExceptionUnwind(JSContext *cx, Value *vp);
62624 static inline void onNewScript(JSContext *cx, JSScript *script,
62625 GlobalObject *compileAndGoGlobal);
62626 static JSTrapStatus onTrap(JSContext *cx, Value *vp);
62627 static JSTrapStatus onSingleStep(JSContext *cx, Value *vp);
62628
62629
62630
62631 inline bool observesEnterFrame() const;
62632 inline bool observesNewScript() const;
62633 inline bool observesGlobal(GlobalObject *global) const;
62634 inline bool observesFrame(StackFrame *fp) const;
62635 bool observesScript(JSScript *script) const;
62636
62637
62638
62639
62640
62641
62642 bool wrapEnvironment(JSContext *cx, Handle<Env*> env, Value *vp);
62643 # 270 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Debugger.h"
62644 bool wrapDebuggeeValue(JSContext *cx, Value *vp);
62645 # 299 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Debugger.h"
62646 bool unwrapDebuggeeValue(JSContext *cx, Value *vp);
62647
62648
62649 bool getScriptFrame(JSContext *cx, StackFrame *fp, Value *vp);
62650 # 311 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Debugger.h"
62651 static void resultToCompletion(JSContext *cx, bool ok, const Value &rv,
62652 JSTrapStatus *status, Value *value);
62653
62654
62655
62656
62657
62658
62659 bool newCompletionValue(JSContext *cx, JSTrapStatus status, Value value, Value *result);
62660 # 333 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Debugger.h"
62661 bool receiveCompletionValue(AutoCompartment &ac, bool ok, Value val, Value *vp);
62662
62663
62664
62665
62666
62667
62668 JSObject *wrapScript(JSContext *cx, Handle<JSScript*> script);
62669
62670 private:
62671 Debugger(const Debugger &) ;
62672 Debugger & operator=(const Debugger &) ;
62673 };
62674
62675 class BreakpointSite {
62676 friend class Breakpoint;
62677 friend struct ::JSCompartment;
62678 friend struct ::JSScript;
62679 friend class Debugger;
62680
62681 public:
62682 JSScript *script;
62683 jsbytecode * const pc;
62684
62685 private:
62686
62687
62688
62689
62690
62691 GlobalObject *scriptGlobal;
62692
62693 JSCList breakpoints;
62694 size_t enabledCount;
62695 JSTrapHandler trapHandler;
62696 HeapValue trapClosure;
62697
62698 void recompile(FreeOp *fop);
62699
62700 public:
62701 BreakpointSite(JSScript *script, jsbytecode *pc);
62702 Breakpoint *firstBreakpoint() const;
62703 bool hasBreakpoint(Breakpoint *bp);
62704 bool hasTrap() const { return !!trapHandler; }
62705 GlobalObject *getScriptGlobal() const { return scriptGlobal; }
62706
62707 void inc(FreeOp *fop);
62708 void dec(FreeOp *fop);
62709 void setTrap(FreeOp *fop, JSTrapHandler handler, const Value &closure);
62710 void clearTrap(FreeOp *fop, JSTrapHandler *handlerp = __null, Value *closurep = __null);
62711 void destroyIfEmpty(FreeOp *fop);
62712 };
62713 # 404 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/Debugger.h"
62714 class Breakpoint {
62715 friend struct ::JSCompartment;
62716 friend class Debugger;
62717
62718 public:
62719 Debugger * const debugger;
62720 BreakpointSite * const site;
62721 private:
62722 js::HeapPtrObject handler;
62723 JSCList debuggerLinks;
62724 JSCList siteLinks;
62725
62726 public:
62727 static Breakpoint *fromDebuggerLinks(JSCList *links);
62728 static Breakpoint *fromSiteLinks(JSCList *links);
62729 Breakpoint(Debugger *debugger, BreakpointSite *site, JSObject *handler);
62730 void destroy(FreeOp *fop);
62731 Breakpoint *nextInDebugger();
62732 Breakpoint *nextInSite();
62733 const HeapPtrObject &getHandler() const { return handler; }
62734 HeapPtrObject &getHandlerRef() { return handler; }
62735 };
62736
62737 Debugger *
62738 Debugger::fromLinks(JSCList *links)
62739 {
62740 unsigned char *p = reinterpret_cast<unsigned char *>(links);
62741 return reinterpret_cast<Debugger *>(p - __builtin_offsetof (Debugger, link));
62742 }
62743
62744 Breakpoint *
62745 Debugger::firstBreakpoint() const
62746 {
62747 if (((&breakpoints)->next == (&breakpoints)))
62748 return __null;
62749 return Breakpoint::fromDebuggerLinks(((&breakpoints)->next));
62750 }
62751
62752 const js::HeapPtrObject &
62753 Debugger::toJSObject() const
62754 {
62755 do { } while(0);
62756 return object;
62757 }
62758
62759 js::HeapPtrObject &
62760 Debugger::toJSObjectRef()
62761 {
62762 do { } while(0);
62763 return object;
62764 }
62765
62766 Debugger *
62767 Debugger::fromJSObject(JSObject *obj)
62768 {
62769 do { } while(0);
62770 return (Debugger *) obj->getPrivate();
62771 }
62772
62773 bool
62774 Debugger::observesEnterFrame() const
62775 {
62776 return enabled && getHook(OnEnterFrame);
62777 }
62778
62779 bool
62780 Debugger::observesNewScript() const
62781 {
62782 return enabled && getHook(OnNewScript);
62783 }
62784
62785 bool
62786 Debugger::observesGlobal(GlobalObject *global) const
62787 {
62788 return debuggees.has(global);
62789 }
62790
62791 bool
62792 Debugger::observesFrame(StackFrame *fp) const
62793 {
62794 return !fp->isDummyFrame() && observesGlobal(&fp->global());
62795 }
62796
62797 JSTrapStatus
62798 Debugger::onEnterFrame(JSContext *cx, Value *vp)
62799 {
62800 if (cx->compartment->getDebuggees().empty())
62801 return JSTRAP_CONTINUE;
62802 return slowPathOnEnterFrame(cx, vp);
62803 }
62804
62805 bool
62806 Debugger::onLeaveFrame(JSContext *cx, bool ok)
62807 {
62808
62809 bool evalTraps = cx->fp()->isEvalFrame() &&
62810 cx->fp()->script()->hasAnyBreakpointsOrStepMode();
62811 if (!cx->compartment->getDebuggees().empty() || evalTraps)
62812 ok = slowPathOnLeaveFrame(cx, ok);
62813 return ok;
62814 }
62815
62816 JSTrapStatus
62817 Debugger::onDebuggerStatement(JSContext *cx, Value *vp)
62818 {
62819 return cx->compartment->getDebuggees().empty()
62820 ? JSTRAP_CONTINUE
62821 : dispatchHook(cx, vp, OnDebuggerStatement);
62822 }
62823
62824 JSTrapStatus
62825 Debugger::onExceptionUnwind(JSContext *cx, Value *vp)
62826 {
62827 return cx->compartment->getDebuggees().empty()
62828 ? JSTRAP_CONTINUE
62829 : dispatchHook(cx, vp, OnExceptionUnwind);
62830 }
62831
62832 void
62833 Debugger::onNewScript(JSContext *cx, JSScript *script, GlobalObject *compileAndGoGlobal)
62834 {
62835 do { } while (0);
62836 do { } while (0);
62837 if (!script->compartment()->getDebuggees().empty())
62838 slowPathOnNewScript(cx, script, compileAndGoGlobal);
62839 }
62840
62841 extern JSBool
62842 EvaluateInEnv(JSContext *cx, Handle<Env*> env, StackFrame *fp, const jschar *chars,
62843 unsigned length, const char *filename, unsigned lineno, Value *rval);
62844
62845 }
62846 # 17 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl.cpp" 2
62847
62848
62849
62850
62851 # 1 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl-inl.h" 1
62852 # 22 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl.cpp" 2
62853
62854 using namespace js;
62855
62856 PropDesc::PropDesc()
62857 : pd_(UndefinedValue()),
62858 value_(UndefinedValue()),
62859 get_(UndefinedValue()),
62860 set_(UndefinedValue()),
62861 attrs(0),
62862 hasGet_(false),
62863 hasSet_(false),
62864 hasValue_(false),
62865 hasWritable_(false),
62866 hasEnumerable_(false),
62867 hasConfigurable_(false),
62868 isUndefined_(true)
62869 {
62870 }
62871
62872 bool
62873 PropDesc::checkGetter(JSContext *cx)
62874 {
62875 if (hasGet_) {
62876 if (!js_IsCallable(get_) && !get_.isUndefined()) {
62877 JS_ReportErrorNumber(cx, js_GetErrorMessage, __null, JSMSG_BAD_GET_SET_FIELD,
62878 js_getter_str);
62879 return false;
62880 }
62881 }
62882 return true;
62883 }
62884
62885 bool
62886 PropDesc::checkSetter(JSContext *cx)
62887 {
62888 if (hasSet_) {
62889 if (!js_IsCallable(set_) && !set_.isUndefined()) {
62890 JS_ReportErrorNumber(cx, js_GetErrorMessage, __null, JSMSG_BAD_GET_SET_FIELD,
62891 js_setter_str);
62892 return false;
62893 }
62894 }
62895 return true;
62896 }
62897
62898 static bool
62899 CheckArgCompartment(JSContext *cx, JSObject *obj, const Value &v,
62900 const char *methodname, const char *propname)
62901 {
62902 if (v.isObject() && v.toObject().compartment() != obj->compartment()) {
62903 JS_ReportErrorNumber(cx, js_GetErrorMessage, __null, JSMSG_DEBUG_COMPARTMENT_MISMATCH,
62904 methodname, propname);
62905 return false;
62906 }
62907 return true;
62908 }
62909
62910
62911
62912
62913
62914 bool
62915 PropDesc::unwrapDebuggerObjectsInto(JSContext *cx, Debugger *dbg, JSObject *obj,
62916 PropDesc *unwrapped) const
62917 {
62918 do { } while(0);
62919
62920 *unwrapped = *this;
62921
62922 if (unwrapped->hasValue()) {
62923 if (!dbg->unwrapDebuggeeValue(cx, &unwrapped->value_) ||
62924 !CheckArgCompartment(cx, obj, unwrapped->value_, "defineProperty", "value"))
62925 {
62926 return false;
62927 }
62928 }
62929
62930 if (unwrapped->hasGet()) {
62931 if (!dbg->unwrapDebuggeeValue(cx, &unwrapped->get_) ||
62932 !CheckArgCompartment(cx, obj, unwrapped->get_, "defineProperty", "get"))
62933 {
62934 return false;
62935 }
62936 }
62937
62938 if (unwrapped->hasSet()) {
62939 if (!dbg->unwrapDebuggeeValue(cx, &unwrapped->set_) ||
62940 !CheckArgCompartment(cx, obj, unwrapped->set_, "defineProperty", "set"))
62941 {
62942 return false;
62943 }
62944 }
62945
62946 return true;
62947 }
62948
62949
62950
62951
62952
62953
62954 bool
62955 PropDesc::wrapInto(JSContext *cx, JSObject *obj, const jsid &id, jsid *wrappedId,
62956 PropDesc *desc) const
62957 {
62958 do { } while(0);
62959
62960 JSCompartment *comp = cx->compartment;
62961
62962 *wrappedId = id;
62963 if (!comp->wrapId(cx, wrappedId))
62964 return false;
62965
62966 *desc = *this;
62967 if (!comp->wrap(cx, &desc->value_))
62968 return false;
62969 if (!comp->wrap(cx, &desc->get_))
62970 return false;
62971 if (!comp->wrap(cx, &desc->set_))
62972 return false;
62973 return !obj->isProxy() || desc->makeObject(cx);
62974 }
62975
62976 static ObjectElements emptyElementsHeader(0, 0);
62977
62978
62979 HeapSlot *js::emptyObjectElements =
62980 reinterpret_cast<HeapSlot *>(uintptr_t(&emptyElementsHeader) + sizeof(ObjectElements));
62981 # 217 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl.cpp"
62982 void
62983 js::ObjectImpl::initSlotRange(uint32_t start, const Value *vector, uint32_t length)
62984 {
62985 JSCompartment *comp = compartment();
62986 HeapSlot *fixedStart, *fixedEnd, *slotsStart, *slotsEnd;
62987 getSlotRange(start, length, &fixedStart, &fixedEnd, &slotsStart, &slotsEnd);
62988 for (HeapSlot *sp = fixedStart; sp < fixedEnd; sp++)
62989 sp->init(comp, this->asObjectPtr(), start++, *vector++);
62990 for (HeapSlot *sp = slotsStart; sp < slotsEnd; sp++)
62991 sp->init(comp, this->asObjectPtr(), start++, *vector++);
62992 }
62993
62994 void
62995 js::ObjectImpl::copySlotRange(uint32_t start, const Value *vector, uint32_t length)
62996 {
62997 JSCompartment *comp = compartment();
62998 HeapSlot *fixedStart, *fixedEnd, *slotsStart, *slotsEnd;
62999 getSlotRange(start, length, &fixedStart, &fixedEnd, &slotsStart, &slotsEnd);
63000 for (HeapSlot *sp = fixedStart; sp < fixedEnd; sp++)
63001 sp->set(comp, this->asObjectPtr(), start++, *vector++);
63002 for (HeapSlot *sp = slotsStart; sp < slotsEnd; sp++)
63003 sp->set(comp, this->asObjectPtr(), start++, *vector++);
63004 }
63005 # 260 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl.cpp"
63006 const Shape *
63007 js::ObjectImpl::nativeLookup(JSContext *cx, jsid id)
63008 {
63009 do { } while(0);
63010 Shape **spp;
63011 return Shape::search(cx, lastProperty(), id, &spp);
63012 }
63013 # 277 "/var/tmp/portage/www-client/firefox-15.0.1/work/mozilla-release/js/src/vm/ObjectImpl.cpp"
63014 void
63015 js::ObjectImpl::markChildren(JSTracer *trc)
63016 {
63017 MarkTypeObject(trc, &type_, "type");
63018
63019 MarkShape(trc, &shape_, "shape");
63020
63021 Class *clasp = shape_->getObjectClass();
63022 JSObject *obj = asObjectPtr();
63023 if (clasp->trace)
63024 clasp->trace(trc, obj);
63025
63026 if (shape_->isNative())
63027 MarkObjectSlots(trc, obj, 0, obj->slotSpan());
63028 }
63029
63030 bool
63031 DenseElementsHeader::getOwnElement(JSContext *cx, ObjectImpl *obj, uint32_t index, PropDesc *desc)
63032 {
63033 do { } while(0);
63034
63035 uint32_t len = initializedLength();
63036 if (index >= len) {
63037 *desc = PropDesc::undefined();
63038 return true;
63039 }
63040
63041 HeapSlot &slot = obj->elements[index];
63042 if (slot.isMagic(JS_ARRAY_HOLE)) {
63043 *desc = PropDesc::undefined();
63044 return true;
63045 }
63046
63047 *desc = PropDesc(slot, PropDesc::Writable, PropDesc::Enumerable, PropDesc::Configurable);
63048 return true;
63049 }
63050
63051 bool
63052 SparseElementsHeader::getOwnElement(JSContext *cx, ObjectImpl *obj, uint32_t index, PropDesc *desc)
63053 {
63054 do { } while(0);
63055
63056 __builtin_unreachable();
63057 return false;
63058 }
63059
63060 template<typename T>
63061 static Value
63062 ElementToValue(const T &t)
63063 {
63064 return NumberValue(t);
63065 }
63066
63067 template<>
63068 Value
63069 ElementToValue(const uint8_clamped &u)
63070 {
63071 return NumberValue(uint8_t(u));
63072 }
63073
63074 template<typename T>
63075 bool
63076 TypedElementsHeader<T>::getOwnElement(JSContext *cx, ObjectImpl *obj, uint32_t index,
63077 PropDesc *desc)
63078 {
63079 do { } while(0);
63080
63081 if (index >= length()) {
63082 *desc = PropDesc::undefined();
63083 return true;
63084 }
63085
63086 *desc = PropDesc(ElementToValue(getElement(index)), PropDesc::Writable,
63087 PropDesc::Enumerable, PropDesc::Configurable);
63088 return false;
63089 }
63090
63091 bool
63092 ArrayBufferElementsHeader::getOwnElement(JSContext *cx, ObjectImpl *obj, uint32_t index,
63093 PropDesc *desc)
63094 {
63095 do { } while(0);
63096
63097 __builtin_unreachable();
63098 return false;
63099 }
63100
63101 bool
63102 SparseElementsHeader::defineElement(JSContext *cx, ObjectImpl *obj, uint32_t index,
63103 const PropDesc &desc, bool shouldThrow, bool *succeeded)
63104 {
63105 do { } while(0);
63106
63107 __builtin_unreachable();
63108 return false;
63109 }
63110
63111 bool
63112 DenseElementsHeader::defineElement(JSContext *cx, ObjectImpl *obj, uint32_t index,
63113 const PropDesc &desc, bool shouldThrow, bool *succeeded)
63114 {
63115 do { } while(0);
63116
63117 do { } while (0);
63118 do { } while (0);
63119
63120
63121
63122
63123
63124 if (desc.hasGet() || desc.hasSet() ||
63125 (desc.hasEnumerable() && !desc.enumerable()) ||
63126 (desc.hasConfigurable() && !desc.configurable()) ||
63127 (desc.hasWritable() && !desc.writable()))
63128 {
63129 if (!obj->makeElementsSparse(cx))
63130 return false;
63131 SparseElementsHeader &elts = obj->elementsHeader().asSparseElements();
63132 return elts.defineElement(cx, obj, index, desc, shouldThrow, succeeded);
63133 }
63134
63135
63136 uint32_t initLen = initializedLength();
63137 if (index < initLen) {
63138 HeapSlot &slot = obj->elements[index];
63139 if (!slot.isMagic(JS_ARRAY_HOLE)) {
63140
63141
63142
63143
63144
63145 }
63146 }
63147
63148
63149
63150
63151
63152 if (!obj->isExtensible()) {
63153 *succeeded = false;
63154 if (!shouldThrow)
63155 return true;
63156 ((void)(js_ReportValueErrorFlags(cx, 0x0, JSMSG_OBJECT_NOT_EXTENSIBLE, 0, ObjectValue(*obj), __null, __null, __null)))
63157
63158
63159 ;
63160 return false;
63161 }
63162
63163
63164 ObjectImpl::DenseElementsResult res = obj->ensureDenseElementsInitialized(cx, index, 0);
63165
63166
63167 if (res == ObjectImpl::Failure)
63168 return false;
63169
63170
63171 if (res == ObjectImpl::ConvertToSparse) {
63172 if (!obj->makeElementsSparse(cx))
63173 return false;
63174 SparseElementsHeader &elts = obj->elementsHeader().asSparseElements();
63175 return elts.defineElement(cx, obj, index, desc, shouldThrow, succeeded);
63176 }
63177
63178
63179 do { } while(0);
63180 obj->elements[index].set(obj->asObjectPtr(), index, desc.value());
63181 *succeeded = true;
63182 return true;
63183 }
63184
63185 static JSObject *
63186 ArrayBufferDelegate(JSContext *cx, ObjectImpl *obj)
63187 {
63188 do { } while(0);
63189 if (obj->getPrivate())
63190 return static_cast<JSObject *>(obj->getPrivate());
63191 JSObject *delegate = NewObjectWithGivenProto(cx, &ObjectClass, obj->getProto(), __null);
63192 obj->setPrivate(delegate);
63193 return delegate;
63194 }
63195
63196 template <typename T>
63197 bool
63198 TypedElementsHeader<T>::defineElement(JSContext *cx, ObjectImpl *obj,
63199 uint32_t index, const PropDesc &desc, bool shouldThrow,
63200 bool *succeeded)
63201 {
63202
63203 *succeeded = false;
63204 js_ReportValueErrorFlags(cx, 0x0, JSMSG_OBJECT_NOT_EXTENSIBLE,
63205 0,
63206 ObjectValue(*obj),
63207 __null, __null, __null);
63208 return false;
63209 }
63210
63211 bool
63212 ArrayBufferElementsHeader::defineElement(JSContext *cx, ObjectImpl *obj,
63213 uint32_t index, const PropDesc &desc, bool shouldThrow,
63214 bool *succeeded)
63215 {
63216 do { } while(0);
63217
63218 JSObject *delegate = ArrayBufferDelegate(cx, obj);
63219 if (!delegate)
63220 return false;
63221 return DefineElement(cx, delegate, index, desc, shouldThrow, succeeded);
63222 }
63223
63224 bool
63225 js::GetOwnElement(JSContext *cx, ObjectImpl *obj, uint32_t index, PropDesc *desc)
63226 {
63227 ElementsHeader &header = obj->elementsHeader();
63228 switch (header.kind()) {
63229 case DenseElements:
63230 return header.asDenseElements().getOwnElement(cx, obj, index, desc);
63231 case SparseElements:
63232 return header.asSparseElements().getOwnElement(cx, obj, index, desc);
63233 case Uint8Elements:
63234 return header.asUint8Elements().getOwnElement(cx, obj, index, desc);
63235 case Int8Elements:
63236 return header.asInt8Elements().getOwnElement(cx, obj, index, desc);
63237 case Uint16Elements:
63238 return header.asUint16Elements().getOwnElement(cx, obj, index, desc);
63239 case Int16Elements:
63240 return header.asInt16Elements().getOwnElement(cx, obj, index, desc);
63241 case Uint32Elements:
63242 return header.asUint32Elements().getOwnElement(cx, obj, index, desc);
63243 case Int32Elements:
63244 return header.asInt32Elements().getOwnElement(cx, obj, index, desc);
63245 case Uint8ClampedElements:
63246 return header.asUint8ClampedElements().getOwnElement(cx, obj, index, desc);
63247 case Float32Elements:
63248 return header.asFloat32Elements().getOwnElement(cx, obj, index, desc);
63249 case Float64Elements:
63250 return header.asFloat64Elements().getOwnElement(cx, obj, index, desc);
63251 case ArrayBufferElements:
63252 return header.asArrayBufferElements().getOwnElement(cx, obj, index, desc);
63253 }
63254
63255 __builtin_unreachable();
63256 return false;
63257 }
63258
63259 bool
63260 js::GetElement(JSContext *cx, ObjectImpl *obj, ObjectImpl *receiver, uint32_t index,
63261 Value *vp)
63262 {
63263 __builtin_unreachable();
63264
63265 do {
63266 do { } while(0);
63267
63268 if (static_cast<JSObject *>(obj)->isProxy()) {
63269 __builtin_unreachable();
63270 return false;
63271 }
63272
63273 PropDesc desc;
63274 if (!GetOwnElement(cx, obj, index, &desc))
63275 return false;
63276
63277
63278 if (desc.isUndefined()) {
63279 obj = obj->getProto();
63280 if (obj)
63281 continue;
63282
63283 vp->setUndefined();
63284 return true;
63285 }
63286
63287
63288 if (desc.isDataDescriptor()) {
63289 *vp = desc.value();
63290 return true;
63291 }
63292
63293
63294 if (desc.isAccessorDescriptor()) {
63295 Value get = desc.getterValue();
63296 if (get.isUndefined()) {
63297 vp->setUndefined();
63298 return true;
63299 }
63300
63301 InvokeArgsGuard args;
63302 if (!cx->stack.pushInvokeArgs(cx, 0, &args))
63303 return false;
63304
63305
63306 args.calleev() = get;
63307 args.thisv() = ObjectValue(*receiver);
63308
63309 bool ok = Invoke(cx, args);
63310 *vp = args.rval();
63311 return ok;
63312 }
63313
63314
63315 __builtin_unreachable();
63316 return false;
63317 } while (false);
63318 }
63319
63320 bool
63321 js::HasElement(JSContext *cx, ObjectImpl *obj, uint32_t index, bool *found)
63322 {
63323 __builtin_unreachable();
63324
63325 do {
63326 do { } while(0);
63327
63328 if (static_cast<JSObject *>(obj)->isProxy()) {
63329 __builtin_unreachable();
63330 return false;
63331 }
63332
63333 PropDesc prop;
63334 if (!GetOwnElement(cx, obj, index, &prop))
63335 return false;
63336
63337 if (!prop.isUndefined()) {
63338 *found = true;
63339 return true;
63340 }
63341
63342 obj = obj->getProto();
63343 if (obj)
63344 continue;
63345
63346 *found = false;
63347 return true;
63348 } while (false);
63349 }
63350
63351 bool
63352 js::DefineElement(JSContext *cx, ObjectImpl *obj, uint32_t index, const PropDesc &desc,
63353 bool shouldThrow, bool *succeeded)
63354 {
63355 __builtin_unreachable();
63356
63357 ElementsHeader &header = obj->elementsHeader();
63358
63359 switch (header.kind()) {
63360 case DenseElements:
63361 return header.asDenseElements().defineElement(cx, obj, index, desc, shouldThrow,
63362 succeeded);
63363 case SparseElements:
63364 return header.asSparseElements().defineElement(cx, obj, index, desc, shouldThrow,
63365 succeeded);
63366 case Uint8Elements:
63367 return header.asUint8Elements().defineElement(cx, obj, index, desc, shouldThrow,
63368 succeeded);
63369 case Int8Elements:
63370 return header.asInt8Elements().defineElement(cx, obj, index, desc, shouldThrow,
63371 succeeded);
63372 case Uint16Elements:
63373 return header.asUint16Elements().defineElement(cx, obj, index, desc, shouldThrow,
63374 succeeded);
63375 case Int16Elements:
63376 return header.asInt16Elements().defineElement(cx, obj, index, desc, shouldThrow,
63377 succeeded);
63378 case Uint32Elements:
63379 return header.asUint32Elements().defineElement(cx, obj, index, desc, shouldThrow,
63380 succeeded);
63381 case Int32Elements:
63382 return header.asInt32Elements().defineElement(cx, obj, index, desc, shouldThrow,
63383 succeeded);
63384 case Uint8ClampedElements:
63385 return header.asUint8ClampedElements().defineElement(cx, obj, index, desc, shouldThrow,
63386 succeeded);
63387 case Float32Elements:
63388 return header.asFloat32Elements().defineElement(cx, obj, index, desc, shouldThrow,
63389 succeeded);
63390 case Float64Elements:
63391 return header.asFloat64Elements().defineElement(cx, obj, index, desc, shouldThrow,
63392 succeeded);
63393 case ArrayBufferElements:
63394 return header.asArrayBufferElements().defineElement(cx, obj, index, desc, shouldThrow,
63395 succeeded);
63396 }
63397
63398 __builtin_unreachable();
63399 return false;
63400 }
63401
63402 bool
63403 SparseElementsHeader::setElement(JSContext *cx, ObjectImpl *obj, ObjectImpl *receiver,
63404 uint32_t index, const Value &v, bool *succeeded)
63405 {
63406 do { } while(0);
63407
63408 __builtin_unreachable();
63409 return false;
63410 }
63411
63412 bool
63413 DenseElementsHeader::setElement(JSContext *cx, ObjectImpl *obj, ObjectImpl *receiver,
63414 uint32_t index, const Value &v, bool *succeeded)
63415 {
63416 do { } while(0);
63417
63418 __builtin_unreachable();
63419 return false;
63420 }
63421
63422 template <typename T>
63423 bool
63424 TypedElementsHeader<T>::setElement(JSContext *cx, ObjectImpl *obj, ObjectImpl *receiver,
63425 uint32_t index, const Value &v, bool *succeeded)
63426 {
63427 do { } while(0);
63428
63429 uint32_t len = length();
63430 if (index >= len) {
63431
63432
63433
63434
63435 *succeeded = true;
63436 return true;
63437 }
63438
63439
63440 double d;
63441 if (v.isNumber()) {
63442 d = v.toNumber();
63443 } else if (v.isNull()) {
63444 d = 0.0;
63445 } else if (v.isPrimitive()) {
63446 if (v.isString()) {
63447 if (!ToNumber(cx, v, &d))
63448 return false;
63449 } else if (v.isUndefined()) {
63450 d = js_NaN;
63451 } else {
63452 d = double(v.toBoolean());
63453 }
63454 } else {
63455
63456 d = js_NaN;
63457 }
63458
63459 assign(index, d);
63460 *succeeded = true;
63461 return true;
63462 }
63463
63464 bool
63465 ArrayBufferElementsHeader::setElement(JSContext *cx, ObjectImpl *obj, ObjectImpl *receiver,
63466 uint32_t index, const Value &v, bool *succeeded)
63467 {
63468 do { } while(0);
63469
63470 JSObject *delegate = ArrayBufferDelegate(cx, obj);
63471 if (!delegate)
63472 return false;
63473 return SetElement(cx, obj, receiver, index, v, succeeded);
63474 }
63475
63476 bool
63477 js::SetElement(JSContext *cx, ObjectImpl *obj, ObjectImpl *receiver, uint32_t index,
63478 const Value &v, bool *succeeded)
63479 {
63480 __builtin_unreachable();
63481
63482 do {
63483 do { } while(0);
63484
63485 if (static_cast<JSObject *>(obj)->isProxy()) {
63486 __builtin_unreachable();
63487 return false;
63488 }
63489
63490 PropDesc ownDesc;
63491 if (!GetOwnElement(cx, obj, index, &ownDesc))
63492 return false;
63493
63494 if (!ownDesc.isUndefined()) {
63495 if (ownDesc.isDataDescriptor()) {
63496 if (!ownDesc.writable()) {
63497 *succeeded = false;
63498 return true;
63499 }
63500
63501 if (receiver == obj) {
63502 PropDesc updateDesc = PropDesc::valueOnly(v);
63503 return DefineElement(cx, receiver, index, updateDesc, false, succeeded);
63504 }
63505
63506 PropDesc newDesc;
63507 return DefineElement(cx, receiver, index, newDesc, false, succeeded);
63508 }
63509
63510 if (ownDesc.isAccessorDescriptor()) {
63511 Value setter = ownDesc.setterValue();
63512 if (setter.isUndefined()) {
63513 *succeeded = false;
63514 return true;
63515 }
63516
63517 InvokeArgsGuard args;
63518 if (!cx->stack.pushInvokeArgs(cx, 1, &args))
63519 return false;
63520
63521
63522 args.calleev() = setter;
63523 args.thisv() = ObjectValue(*receiver);
63524 args[0] = v;
63525
63526 *succeeded = true;
63527 return Invoke(cx, args);
63528 }
63529
63530 __builtin_unreachable();
63531 return false;
63532 }
63533
63534 obj = obj->getProto();
63535 if (obj)
63536 continue;
63537
63538 PropDesc newDesc(v, PropDesc::Writable, PropDesc::Enumerable, PropDesc::Configurable);
63539 return DefineElement(cx, receiver, index, newDesc, false, succeeded);
63540 } while (false);
63541 }