jbarnette-johnson 1.0.0.200806240111 → 1.0.0.200807291507

Sign up to get free protection for your applications and to get access to all the features.
Files changed (269) hide show
  1. data/MANIFEST +1 -0
  2. data/Rakefile +3 -10
  3. data/bin/johnson +2 -1
  4. data/ext/spidermonkey/context.c +3 -4
  5. data/ext/spidermonkey/context.h +1 -1
  6. data/ext/spidermonkey/conversions.c +39 -33
  7. data/ext/spidermonkey/debugger.c +5 -5
  8. data/ext/spidermonkey/immutable_node.c.erb +11 -11
  9. data/ext/spidermonkey/jroot.h +4 -4
  10. data/ext/spidermonkey/js_land_proxy.c +9 -8
  11. data/ext/spidermonkey/ruby_land_proxy.c +5 -4
  12. data/ext/spidermonkey/runtime.c +1 -1
  13. data/johnson.gemspec +36 -0
  14. data/lib/hoe.rb +0 -7
  15. data/lib/johnson/cli/options.rb +10 -4
  16. data/lib/johnson/spidermonkey/runtime.rb +2 -2
  17. data/lib/johnson/version.rb +4 -2
  18. data/lib/johnson.rb +1 -0
  19. data/test/johnson/runtime_test.rb +11 -0
  20. data/test/johnson/spidermonkey/ruby_land_proxy_test.rb +6 -0
  21. data/vendor/spidermonkey/.cvsignore +9 -0
  22. data/vendor/spidermonkey/Makefile.in +462 -0
  23. data/vendor/spidermonkey/Makefile.ref +364 -0
  24. data/vendor/spidermonkey/README.html +820 -0
  25. data/vendor/spidermonkey/SpiderMonkey.rsp +12 -0
  26. data/vendor/spidermonkey/Y.js +19 -0
  27. data/vendor/spidermonkey/build.mk +43 -0
  28. data/vendor/spidermonkey/config/AIX4.1.mk +65 -0
  29. data/vendor/spidermonkey/config/AIX4.2.mk +64 -0
  30. data/vendor/spidermonkey/config/AIX4.3.mk +65 -0
  31. data/vendor/spidermonkey/config/Darwin.mk +83 -0
  32. data/vendor/spidermonkey/config/Darwin1.3.mk +81 -0
  33. data/vendor/spidermonkey/config/Darwin1.4.mk +41 -0
  34. data/vendor/spidermonkey/config/Darwin5.2.mk +81 -0
  35. data/vendor/spidermonkey/config/Darwin5.3.mk +81 -0
  36. data/vendor/spidermonkey/config/HP-UXB.10.10.mk +77 -0
  37. data/vendor/spidermonkey/config/HP-UXB.10.20.mk +77 -0
  38. data/vendor/spidermonkey/config/HP-UXB.11.00.mk +80 -0
  39. data/vendor/spidermonkey/config/IRIX.mk +87 -0
  40. data/vendor/spidermonkey/config/IRIX5.3.mk +44 -0
  41. data/vendor/spidermonkey/config/IRIX6.1.mk +44 -0
  42. data/vendor/spidermonkey/config/IRIX6.2.mk +44 -0
  43. data/vendor/spidermonkey/config/IRIX6.3.mk +44 -0
  44. data/vendor/spidermonkey/config/IRIX6.5.mk +44 -0
  45. data/vendor/spidermonkey/config/Linux_All.mk +103 -0
  46. data/vendor/spidermonkey/config/Mac_OS10.0.mk +82 -0
  47. data/vendor/spidermonkey/config/OSF1V4.0.mk +72 -0
  48. data/vendor/spidermonkey/config/OSF1V5.0.mk +69 -0
  49. data/vendor/spidermonkey/config/SunOS4.1.4.mk +101 -0
  50. data/vendor/spidermonkey/config/SunOS5.10.mk +50 -0
  51. data/vendor/spidermonkey/config/SunOS5.3.mk +91 -0
  52. data/vendor/spidermonkey/config/SunOS5.4.mk +92 -0
  53. data/vendor/spidermonkey/config/SunOS5.5.1.mk +44 -0
  54. data/vendor/spidermonkey/config/SunOS5.5.mk +87 -0
  55. data/vendor/spidermonkey/config/SunOS5.6.mk +89 -0
  56. data/vendor/spidermonkey/config/SunOS5.7.mk +44 -0
  57. data/vendor/spidermonkey/config/SunOS5.8.mk +44 -0
  58. data/vendor/spidermonkey/config/SunOS5.9.mk +44 -0
  59. data/vendor/spidermonkey/config/WINNT4.0.mk +117 -0
  60. data/vendor/spidermonkey/config/WINNT5.0.mk +117 -0
  61. data/vendor/spidermonkey/config/WINNT5.1.mk +117 -0
  62. data/vendor/spidermonkey/config/WINNT5.2.mk +117 -0
  63. data/vendor/spidermonkey/config/WINNT6.0.mk +117 -0
  64. data/vendor/spidermonkey/config/dgux.mk +64 -0
  65. data/vendor/spidermonkey/config.mk +192 -0
  66. data/vendor/spidermonkey/editline/Makefile.ref +144 -0
  67. data/vendor/spidermonkey/editline/README +83 -0
  68. data/vendor/spidermonkey/editline/editline.3 +175 -0
  69. data/vendor/spidermonkey/editline/editline.c +1369 -0
  70. data/vendor/spidermonkey/editline/editline.h +135 -0
  71. data/vendor/spidermonkey/editline/sysunix.c +182 -0
  72. data/vendor/spidermonkey/editline/unix.h +82 -0
  73. data/vendor/spidermonkey/fdlibm/.cvsignore +7 -0
  74. data/vendor/spidermonkey/fdlibm/Makefile.in +127 -0
  75. data/vendor/spidermonkey/fdlibm/Makefile.ref +192 -0
  76. data/vendor/spidermonkey/fdlibm/e_acos.c +147 -0
  77. data/vendor/spidermonkey/fdlibm/e_acosh.c +105 -0
  78. data/vendor/spidermonkey/fdlibm/e_asin.c +156 -0
  79. data/vendor/spidermonkey/fdlibm/e_atan2.c +165 -0
  80. data/vendor/spidermonkey/fdlibm/e_atanh.c +110 -0
  81. data/vendor/spidermonkey/fdlibm/e_cosh.c +133 -0
  82. data/vendor/spidermonkey/fdlibm/e_exp.c +202 -0
  83. data/vendor/spidermonkey/fdlibm/e_fmod.c +184 -0
  84. data/vendor/spidermonkey/fdlibm/e_gamma.c +71 -0
  85. data/vendor/spidermonkey/fdlibm/e_gamma_r.c +70 -0
  86. data/vendor/spidermonkey/fdlibm/e_hypot.c +173 -0
  87. data/vendor/spidermonkey/fdlibm/e_j0.c +524 -0
  88. data/vendor/spidermonkey/fdlibm/e_j1.c +523 -0
  89. data/vendor/spidermonkey/fdlibm/e_jn.c +315 -0
  90. data/vendor/spidermonkey/fdlibm/e_lgamma.c +71 -0
  91. data/vendor/spidermonkey/fdlibm/e_lgamma_r.c +347 -0
  92. data/vendor/spidermonkey/fdlibm/e_log.c +184 -0
  93. data/vendor/spidermonkey/fdlibm/e_log10.c +134 -0
  94. data/vendor/spidermonkey/fdlibm/e_pow.c +386 -0
  95. data/vendor/spidermonkey/fdlibm/e_rem_pio2.c +222 -0
  96. data/vendor/spidermonkey/fdlibm/e_remainder.c +120 -0
  97. data/vendor/spidermonkey/fdlibm/e_scalb.c +89 -0
  98. data/vendor/spidermonkey/fdlibm/e_sinh.c +122 -0
  99. data/vendor/spidermonkey/fdlibm/e_sqrt.c +497 -0
  100. data/vendor/spidermonkey/fdlibm/fdlibm.h +273 -0
  101. data/vendor/spidermonkey/fdlibm/fdlibm.mak +1453 -0
  102. data/vendor/spidermonkey/fdlibm/fdlibm.mdp +0 -0
  103. data/vendor/spidermonkey/fdlibm/k_cos.c +135 -0
  104. data/vendor/spidermonkey/fdlibm/k_rem_pio2.c +354 -0
  105. data/vendor/spidermonkey/fdlibm/k_sin.c +114 -0
  106. data/vendor/spidermonkey/fdlibm/k_standard.c +785 -0
  107. data/vendor/spidermonkey/fdlibm/k_tan.c +170 -0
  108. data/vendor/spidermonkey/fdlibm/s_asinh.c +101 -0
  109. data/vendor/spidermonkey/fdlibm/s_atan.c +175 -0
  110. data/vendor/spidermonkey/fdlibm/s_cbrt.c +133 -0
  111. data/vendor/spidermonkey/fdlibm/s_ceil.c +120 -0
  112. data/vendor/spidermonkey/fdlibm/s_copysign.c +72 -0
  113. data/vendor/spidermonkey/fdlibm/s_cos.c +118 -0
  114. data/vendor/spidermonkey/fdlibm/s_erf.c +356 -0
  115. data/vendor/spidermonkey/fdlibm/s_expm1.c +267 -0
  116. data/vendor/spidermonkey/fdlibm/s_fabs.c +70 -0
  117. data/vendor/spidermonkey/fdlibm/s_finite.c +71 -0
  118. data/vendor/spidermonkey/fdlibm/s_floor.c +121 -0
  119. data/vendor/spidermonkey/fdlibm/s_frexp.c +99 -0
  120. data/vendor/spidermonkey/fdlibm/s_ilogb.c +85 -0
  121. data/vendor/spidermonkey/fdlibm/s_isnan.c +74 -0
  122. data/vendor/spidermonkey/fdlibm/s_ldexp.c +66 -0
  123. data/vendor/spidermonkey/fdlibm/s_lib_version.c +73 -0
  124. data/vendor/spidermonkey/fdlibm/s_log1p.c +211 -0
  125. data/vendor/spidermonkey/fdlibm/s_logb.c +79 -0
  126. data/vendor/spidermonkey/fdlibm/s_matherr.c +64 -0
  127. data/vendor/spidermonkey/fdlibm/s_modf.c +132 -0
  128. data/vendor/spidermonkey/fdlibm/s_nextafter.c +124 -0
  129. data/vendor/spidermonkey/fdlibm/s_rint.c +131 -0
  130. data/vendor/spidermonkey/fdlibm/s_scalbn.c +107 -0
  131. data/vendor/spidermonkey/fdlibm/s_signgam.c +40 -0
  132. data/vendor/spidermonkey/fdlibm/s_significand.c +68 -0
  133. data/vendor/spidermonkey/fdlibm/s_sin.c +118 -0
  134. data/vendor/spidermonkey/fdlibm/s_tan.c +112 -0
  135. data/vendor/spidermonkey/fdlibm/s_tanh.c +122 -0
  136. data/vendor/spidermonkey/fdlibm/w_acos.c +78 -0
  137. data/vendor/spidermonkey/fdlibm/w_acosh.c +78 -0
  138. data/vendor/spidermonkey/fdlibm/w_asin.c +80 -0
  139. data/vendor/spidermonkey/fdlibm/w_atan2.c +79 -0
  140. data/vendor/spidermonkey/fdlibm/w_atanh.c +81 -0
  141. data/vendor/spidermonkey/fdlibm/w_cosh.c +77 -0
  142. data/vendor/spidermonkey/fdlibm/w_exp.c +88 -0
  143. data/vendor/spidermonkey/fdlibm/w_fmod.c +78 -0
  144. data/vendor/spidermonkey/fdlibm/w_gamma.c +85 -0
  145. data/vendor/spidermonkey/fdlibm/w_gamma_r.c +81 -0
  146. data/vendor/spidermonkey/fdlibm/w_hypot.c +78 -0
  147. data/vendor/spidermonkey/fdlibm/w_j0.c +105 -0
  148. data/vendor/spidermonkey/fdlibm/w_j1.c +106 -0
  149. data/vendor/spidermonkey/fdlibm/w_jn.c +128 -0
  150. data/vendor/spidermonkey/fdlibm/w_lgamma.c +85 -0
  151. data/vendor/spidermonkey/fdlibm/w_lgamma_r.c +81 -0
  152. data/vendor/spidermonkey/fdlibm/w_log.c +78 -0
  153. data/vendor/spidermonkey/fdlibm/w_log10.c +81 -0
  154. data/vendor/spidermonkey/fdlibm/w_pow.c +99 -0
  155. data/vendor/spidermonkey/fdlibm/w_remainder.c +77 -0
  156. data/vendor/spidermonkey/fdlibm/w_scalb.c +95 -0
  157. data/vendor/spidermonkey/fdlibm/w_sinh.c +77 -0
  158. data/vendor/spidermonkey/fdlibm/w_sqrt.c +77 -0
  159. data/vendor/spidermonkey/javascript-trace.d +73 -0
  160. data/vendor/spidermonkey/js.c +3951 -0
  161. data/vendor/spidermonkey/js.mak +4438 -0
  162. data/vendor/spidermonkey/js.mdp +0 -0
  163. data/vendor/spidermonkey/js.msg +307 -0
  164. data/vendor/spidermonkey/js.pkg +2 -0
  165. data/vendor/spidermonkey/js3240.rc +79 -0
  166. data/vendor/spidermonkey/jsOS240.def +654 -0
  167. data/vendor/spidermonkey/jsapi.c +5836 -0
  168. data/vendor/spidermonkey/jsapi.h +2624 -0
  169. data/vendor/spidermonkey/jsarena.c +450 -0
  170. data/vendor/spidermonkey/jsarena.h +318 -0
  171. data/vendor/spidermonkey/jsarray.c +2988 -0
  172. data/vendor/spidermonkey/jsarray.h +124 -0
  173. data/vendor/spidermonkey/jsatom.c +1045 -0
  174. data/vendor/spidermonkey/jsatom.h +442 -0
  175. data/vendor/spidermonkey/jsbit.h +253 -0
  176. data/vendor/spidermonkey/jsbool.c +176 -0
  177. data/vendor/spidermonkey/jsbool.h +73 -0
  178. data/vendor/spidermonkey/jsclist.h +139 -0
  179. data/vendor/spidermonkey/jscntxt.c +1348 -0
  180. data/vendor/spidermonkey/jscntxt.h +1120 -0
  181. data/vendor/spidermonkey/jscompat.h +57 -0
  182. data/vendor/spidermonkey/jsconfig.h +248 -0
  183. data/vendor/spidermonkey/jsconfig.mk +181 -0
  184. data/vendor/spidermonkey/jscpucfg.c +383 -0
  185. data/vendor/spidermonkey/jscpucfg.h +212 -0
  186. data/vendor/spidermonkey/jsdate.c +2398 -0
  187. data/vendor/spidermonkey/jsdate.h +124 -0
  188. data/vendor/spidermonkey/jsdbgapi.c +1799 -0
  189. data/vendor/spidermonkey/jsdbgapi.h +464 -0
  190. data/vendor/spidermonkey/jsdhash.c +868 -0
  191. data/vendor/spidermonkey/jsdhash.h +592 -0
  192. data/vendor/spidermonkey/jsdtoa.c +3167 -0
  193. data/vendor/spidermonkey/jsdtoa.h +130 -0
  194. data/vendor/spidermonkey/jsdtracef.c +317 -0
  195. data/vendor/spidermonkey/jsdtracef.h +77 -0
  196. data/vendor/spidermonkey/jsemit.c +6909 -0
  197. data/vendor/spidermonkey/jsemit.h +741 -0
  198. data/vendor/spidermonkey/jsexn.c +1371 -0
  199. data/vendor/spidermonkey/jsexn.h +96 -0
  200. data/vendor/spidermonkey/jsfile.c +2736 -0
  201. data/vendor/spidermonkey/jsfile.h +56 -0
  202. data/vendor/spidermonkey/jsfile.msg +90 -0
  203. data/vendor/spidermonkey/jsfun.c +2634 -0
  204. data/vendor/spidermonkey/jsfun.h +254 -0
  205. data/vendor/spidermonkey/jsgc.c +3554 -0
  206. data/vendor/spidermonkey/jsgc.h +403 -0
  207. data/vendor/spidermonkey/jshash.c +476 -0
  208. data/vendor/spidermonkey/jshash.h +151 -0
  209. data/vendor/spidermonkey/jsify.pl +485 -0
  210. data/vendor/spidermonkey/jsinterp.c +6981 -0
  211. data/vendor/spidermonkey/jsinterp.h +521 -0
  212. data/vendor/spidermonkey/jsinvoke.c +43 -0
  213. data/vendor/spidermonkey/jsiter.c +1067 -0
  214. data/vendor/spidermonkey/jsiter.h +122 -0
  215. data/vendor/spidermonkey/jskeyword.tbl +124 -0
  216. data/vendor/spidermonkey/jskwgen.c +460 -0
  217. data/vendor/spidermonkey/jslibmath.h +266 -0
  218. data/vendor/spidermonkey/jslock.c +1309 -0
  219. data/vendor/spidermonkey/jslock.h +313 -0
  220. data/vendor/spidermonkey/jslocko.asm +60 -0
  221. data/vendor/spidermonkey/jslog2.c +94 -0
  222. data/vendor/spidermonkey/jslong.c +264 -0
  223. data/vendor/spidermonkey/jslong.h +412 -0
  224. data/vendor/spidermonkey/jsmath.c +568 -0
  225. data/vendor/spidermonkey/jsmath.h +57 -0
  226. data/vendor/spidermonkey/jsnum.c +1228 -0
  227. data/vendor/spidermonkey/jsnum.h +283 -0
  228. data/vendor/spidermonkey/jsobj.c +5266 -0
  229. data/vendor/spidermonkey/jsobj.h +709 -0
  230. data/vendor/spidermonkey/jsopcode.c +5245 -0
  231. data/vendor/spidermonkey/jsopcode.h +394 -0
  232. data/vendor/spidermonkey/jsopcode.tbl +523 -0
  233. data/vendor/spidermonkey/jsotypes.h +202 -0
  234. data/vendor/spidermonkey/jsparse.c +6680 -0
  235. data/vendor/spidermonkey/jsparse.h +511 -0
  236. data/vendor/spidermonkey/jsprf.c +1262 -0
  237. data/vendor/spidermonkey/jsprf.h +150 -0
  238. data/vendor/spidermonkey/jsproto.tbl +128 -0
  239. data/vendor/spidermonkey/jsprvtd.h +267 -0
  240. data/vendor/spidermonkey/jspubtd.h +744 -0
  241. data/vendor/spidermonkey/jsregexp.c +4352 -0
  242. data/vendor/spidermonkey/jsregexp.h +183 -0
  243. data/vendor/spidermonkey/jsreops.tbl +145 -0
  244. data/vendor/spidermonkey/jsscan.c +2003 -0
  245. data/vendor/spidermonkey/jsscan.h +387 -0
  246. data/vendor/spidermonkey/jsscope.c +1948 -0
  247. data/vendor/spidermonkey/jsscope.h +418 -0
  248. data/vendor/spidermonkey/jsscript.c +1832 -0
  249. data/vendor/spidermonkey/jsscript.h +287 -0
  250. data/vendor/spidermonkey/jsshell.msg +50 -0
  251. data/vendor/spidermonkey/jsstddef.h +83 -0
  252. data/vendor/spidermonkey/jsstr.c +5004 -0
  253. data/vendor/spidermonkey/jsstr.h +641 -0
  254. data/vendor/spidermonkey/jstypes.h +475 -0
  255. data/vendor/spidermonkey/jsutil.c +345 -0
  256. data/vendor/spidermonkey/jsutil.h +157 -0
  257. data/vendor/spidermonkey/jsxdrapi.c +800 -0
  258. data/vendor/spidermonkey/jsxdrapi.h +218 -0
  259. data/vendor/spidermonkey/jsxml.c +8471 -0
  260. data/vendor/spidermonkey/jsxml.h +349 -0
  261. data/vendor/spidermonkey/lock_SunOS.s +119 -0
  262. data/vendor/spidermonkey/perfect.js +39 -0
  263. data/vendor/spidermonkey/plify_jsdhash.sed +36 -0
  264. data/vendor/spidermonkey/prmjtime.c +846 -0
  265. data/vendor/spidermonkey/prmjtime.h +103 -0
  266. data/vendor/spidermonkey/resource.h +15 -0
  267. data/vendor/spidermonkey/rules.mk +197 -0
  268. data/vendor/spidermonkey/win32.order +384 -0
  269. metadata +4 -3
@@ -0,0 +1,383 @@
1
+ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2
+ *
3
+ * ***** BEGIN LICENSE BLOCK *****
4
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5
+ *
6
+ * The contents of this file are subject to the Mozilla Public License Version
7
+ * 1.1 (the "License"); you may not use this file except in compliance with
8
+ * the License. You may obtain a copy of the License at
9
+ * http://www.mozilla.org/MPL/
10
+ *
11
+ * Software distributed under the License is distributed on an "AS IS" basis,
12
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13
+ * for the specific language governing rights and limitations under the
14
+ * License.
15
+ *
16
+ * The Original Code is Mozilla Communicator client code, released
17
+ * March 31, 1998.
18
+ *
19
+ * The Initial Developer of the Original Code is
20
+ * Netscape Communications Corporation.
21
+ * Portions created by the Initial Developer are Copyright (C) 1998
22
+ * the Initial Developer. All Rights Reserved.
23
+ *
24
+ * Contributor(s):
25
+ * Roland Mainz <roland.mainz@informatik.med.uni-giessen.de>
26
+ *
27
+ * Alternatively, the contents of this file may be used under the terms of
28
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
29
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
30
+ * in which case the provisions of the GPL or the LGPL are applicable instead
31
+ * of those above. If you wish to allow use of your version of this file only
32
+ * under the terms of either the GPL or the LGPL, and not to allow others to
33
+ * use your version of this file under the terms of the MPL, indicate your
34
+ * decision by deleting the provisions above and replace them with the notice
35
+ * and other provisions required by the GPL or the LGPL. If you do not delete
36
+ * the provisions above, a recipient may use your version of this file under
37
+ * the terms of any one of the MPL, the GPL or the LGPL.
38
+ *
39
+ * ***** END LICENSE BLOCK ***** */
40
+
41
+ /*
42
+ * Generate CPU-specific bit-size and similar #defines.
43
+ */
44
+ #include <stdio.h>
45
+ #include <stdlib.h>
46
+
47
+ #ifdef CROSS_COMPILE
48
+ #include <prtypes.h>
49
+ #define INT64 PRInt64
50
+ #else
51
+
52
+ /************************************************************************/
53
+
54
+ /* Generate cpucfg.h */
55
+
56
+ #if defined(XP_WIN) || defined(XP_OS2)
57
+ #ifdef WIN32
58
+ #if defined(__GNUC__)
59
+ #define INT64 long long
60
+ #else
61
+ #define INT64 _int64
62
+ #endif /* __GNUC__ */
63
+ #else
64
+ #define INT64 long
65
+ #endif
66
+ #else
67
+ #if defined(HPUX) || defined(__QNX__)
68
+ #define INT64 long
69
+ #else
70
+ #define INT64 long long
71
+ #endif
72
+ #endif
73
+
74
+ #endif /* CROSS_COMPILE */
75
+
76
+ #ifdef __GNUC__
77
+ #define NS_NEVER_INLINE __attribute__((noinline))
78
+ #else
79
+ #define NS_NEVER_INLINE
80
+ #endif
81
+
82
+ #ifdef __SUNPRO_C
83
+ static int StackGrowthDirection(int *dummy1addr);
84
+ #pragma no_inline(StackGrowthDirection)
85
+ #endif
86
+
87
+ typedef void *prword;
88
+
89
+ struct align_short {
90
+ char c;
91
+ short a;
92
+ };
93
+ struct align_int {
94
+ char c;
95
+ int a;
96
+ };
97
+ struct align_long {
98
+ char c;
99
+ long a;
100
+ };
101
+ struct align_int64 {
102
+ char c;
103
+ INT64 a;
104
+ };
105
+ struct align_fakelonglong {
106
+ char c;
107
+ struct {
108
+ long hi, lo;
109
+ } a;
110
+ };
111
+ struct align_float {
112
+ char c;
113
+ float a;
114
+ };
115
+ struct align_double {
116
+ char c;
117
+ double a;
118
+ };
119
+ struct align_pointer {
120
+ char c;
121
+ void *a;
122
+ };
123
+ struct align_prword {
124
+ char c;
125
+ prword a;
126
+ };
127
+
128
+ #define ALIGN_OF(type) \
129
+ (((char*)&(((struct align_##type *)0)->a)) - ((char*)0))
130
+
131
+ unsigned int bpb;
132
+
133
+ static int Log2(unsigned int n)
134
+ {
135
+ int log2 = 0;
136
+
137
+ if (n & (n-1))
138
+ log2++;
139
+ if (n >> 16)
140
+ log2 += 16, n >>= 16;
141
+ if (n >> 8)
142
+ log2 += 8, n >>= 8;
143
+ if (n >> 4)
144
+ log2 += 4, n >>= 4;
145
+ if (n >> 2)
146
+ log2 += 2, n >>= 2;
147
+ if (n >> 1)
148
+ log2++;
149
+ return log2;
150
+ }
151
+
152
+ /*
153
+ * Conceivably this could actually be used, but there is lots of code out
154
+ * there with ands and shifts in it that assumes a byte is exactly 8 bits,
155
+ * so forget about porting THIS code to all those non 8 bit byte machines.
156
+ */
157
+ static void BitsPerByte(void)
158
+ {
159
+ bpb = 8;
160
+ }
161
+
162
+ static int NS_NEVER_INLINE StackGrowthDirection(int *dummy1addr)
163
+ {
164
+ int dummy2;
165
+
166
+ return (&dummy2 < dummy1addr) ? -1 : 1;
167
+ }
168
+
169
+ int main(int argc, char **argv)
170
+ {
171
+ int sizeof_char, sizeof_short, sizeof_int, sizeof_int64, sizeof_long,
172
+ sizeof_float, sizeof_double, sizeof_word, sizeof_dword;
173
+ int bits_per_int64_log2, align_of_short, align_of_int, align_of_long,
174
+ align_of_int64, align_of_float, align_of_double, align_of_pointer,
175
+ align_of_word;
176
+ int dummy1;
177
+
178
+ BitsPerByte();
179
+
180
+ printf("#ifndef js_cpucfg___\n");
181
+ printf("#define js_cpucfg___\n\n");
182
+
183
+ printf("/* AUTOMATICALLY GENERATED - DO NOT EDIT */\n\n");
184
+
185
+ #ifdef CROSS_COMPILE
186
+ #if defined(IS_LITTLE_ENDIAN)
187
+ printf("#define IS_LITTLE_ENDIAN 1\n");
188
+ printf("#undef IS_BIG_ENDIAN\n\n");
189
+ #elif defined(IS_BIG_ENDIAN)
190
+ printf("#undef IS_LITTLE_ENDIAN\n");
191
+ printf("#define IS_BIG_ENDIAN 1\n\n");
192
+ #else
193
+ #error "Endianess not defined."
194
+ #endif
195
+
196
+ sizeof_char = PR_BYTES_PER_BYTE;
197
+ sizeof_short = PR_BYTES_PER_SHORT;
198
+ sizeof_int = PR_BYTES_PER_INT;
199
+ sizeof_int64 = PR_BYTES_PER_INT64;
200
+ sizeof_long = PR_BYTES_PER_LONG;
201
+ sizeof_float = PR_BYTES_PER_FLOAT;
202
+ sizeof_double = PR_BYTES_PER_DOUBLE;
203
+ sizeof_word = PR_BYTES_PER_WORD;
204
+ sizeof_dword = PR_BYTES_PER_DWORD;
205
+
206
+ bits_per_int64_log2 = PR_BITS_PER_INT64_LOG2;
207
+
208
+ align_of_short = PR_ALIGN_OF_SHORT;
209
+ align_of_int = PR_ALIGN_OF_INT;
210
+ align_of_long = PR_ALIGN_OF_LONG;
211
+ align_of_int64 = PR_ALIGN_OF_INT64;
212
+ align_of_float = PR_ALIGN_OF_FLOAT;
213
+ align_of_double = PR_ALIGN_OF_DOUBLE;
214
+ align_of_pointer = PR_ALIGN_OF_POINTER;
215
+ align_of_word = PR_ALIGN_OF_WORD;
216
+
217
+ #else /* !CROSS_COMPILE */
218
+
219
+ /*
220
+ * We don't handle PDP-endian or similar orders: if a short is big-endian,
221
+ * so must int and long be big-endian for us to generate the IS_BIG_ENDIAN
222
+ * #define and the IS_LITTLE_ENDIAN #undef.
223
+ */
224
+ {
225
+ int big_endian = 0, little_endian = 0, ntests = 0;
226
+
227
+ if (sizeof(short) == 2) {
228
+ /* force |volatile| here to get rid of any compiler optimisations
229
+ * (var in register etc.) which may be appiled to |auto| vars -
230
+ * even those in |union|s...
231
+ * (|static| is used to get the same functionality for compilers
232
+ * which do not honor |volatile|...).
233
+ */
234
+ volatile static union {
235
+ short i;
236
+ char c[2];
237
+ } u;
238
+
239
+ u.i = 0x0102;
240
+ big_endian += (u.c[0] == 0x01 && u.c[1] == 0x02);
241
+ little_endian += (u.c[0] == 0x02 && u.c[1] == 0x01);
242
+ ntests++;
243
+ }
244
+
245
+ if (sizeof(int) == 4) {
246
+ /* force |volatile| here ... */
247
+ volatile static union {
248
+ int i;
249
+ char c[4];
250
+ } u;
251
+
252
+ u.i = 0x01020304;
253
+ big_endian += (u.c[0] == 0x01 && u.c[1] == 0x02 &&
254
+ u.c[2] == 0x03 && u.c[3] == 0x04);
255
+ little_endian += (u.c[0] == 0x04 && u.c[1] == 0x03 &&
256
+ u.c[2] == 0x02 && u.c[3] == 0x01);
257
+ ntests++;
258
+ }
259
+
260
+ if (sizeof(long) == 8) {
261
+ /* force |volatile| here ... */
262
+ volatile static union {
263
+ long i;
264
+ char c[8];
265
+ } u;
266
+
267
+ /*
268
+ * Write this as portably as possible: avoid 0x0102030405060708L
269
+ * and <<= 32.
270
+ */
271
+ u.i = 0x01020304;
272
+ u.i <<= 16, u.i <<= 16;
273
+ u.i |= 0x05060708;
274
+ big_endian += (u.c[0] == 0x01 && u.c[1] == 0x02 &&
275
+ u.c[2] == 0x03 && u.c[3] == 0x04 &&
276
+ u.c[4] == 0x05 && u.c[5] == 0x06 &&
277
+ u.c[6] == 0x07 && u.c[7] == 0x08);
278
+ little_endian += (u.c[0] == 0x08 && u.c[1] == 0x07 &&
279
+ u.c[2] == 0x06 && u.c[3] == 0x05 &&
280
+ u.c[4] == 0x04 && u.c[5] == 0x03 &&
281
+ u.c[6] == 0x02 && u.c[7] == 0x01);
282
+ ntests++;
283
+ }
284
+
285
+ if (big_endian && big_endian == ntests) {
286
+ printf("#undef IS_LITTLE_ENDIAN\n");
287
+ printf("#define IS_BIG_ENDIAN 1\n\n");
288
+ } else if (little_endian && little_endian == ntests) {
289
+ printf("#define IS_LITTLE_ENDIAN 1\n");
290
+ printf("#undef IS_BIG_ENDIAN\n\n");
291
+ } else {
292
+ fprintf(stderr, "%s: unknown byte order"
293
+ "(big_endian=%d, little_endian=%d, ntests=%d)!\n",
294
+ argv[0], big_endian, little_endian, ntests);
295
+ return EXIT_FAILURE;
296
+ }
297
+ }
298
+
299
+ sizeof_char = sizeof(char);
300
+ sizeof_short = sizeof(short);
301
+ sizeof_int = sizeof(int);
302
+ sizeof_int64 = 8;
303
+ sizeof_long = sizeof(long);
304
+ sizeof_float = sizeof(float);
305
+ sizeof_double = sizeof(double);
306
+ sizeof_word = sizeof(prword);
307
+ sizeof_dword = 8;
308
+
309
+ bits_per_int64_log2 = 6;
310
+
311
+ align_of_short = ALIGN_OF(short);
312
+ align_of_int = ALIGN_OF(int);
313
+ align_of_long = ALIGN_OF(long);
314
+ if (sizeof(INT64) < 8) {
315
+ /* this machine doesn't actually support int64's */
316
+ align_of_int64 = ALIGN_OF(fakelonglong);
317
+ } else {
318
+ align_of_int64 = ALIGN_OF(int64);
319
+ }
320
+ align_of_float = ALIGN_OF(float);
321
+ align_of_double = ALIGN_OF(double);
322
+ align_of_pointer = ALIGN_OF(pointer);
323
+ align_of_word = ALIGN_OF(prword);
324
+
325
+ #endif /* CROSS_COMPILE */
326
+
327
+ printf("#define JS_BYTES_PER_BYTE %dL\n", sizeof_char);
328
+ printf("#define JS_BYTES_PER_SHORT %dL\n", sizeof_short);
329
+ printf("#define JS_BYTES_PER_INT %dL\n", sizeof_int);
330
+ printf("#define JS_BYTES_PER_INT64 %dL\n", sizeof_int64);
331
+ printf("#define JS_BYTES_PER_LONG %dL\n", sizeof_long);
332
+ printf("#define JS_BYTES_PER_FLOAT %dL\n", sizeof_float);
333
+ printf("#define JS_BYTES_PER_DOUBLE %dL\n", sizeof_double);
334
+ printf("#define JS_BYTES_PER_WORD %dL\n", sizeof_word);
335
+ printf("#define JS_BYTES_PER_DWORD %dL\n", sizeof_dword);
336
+ printf("\n");
337
+
338
+ printf("#define JS_BITS_PER_BYTE %dL\n", bpb);
339
+ printf("#define JS_BITS_PER_SHORT %dL\n", bpb * sizeof_short);
340
+ printf("#define JS_BITS_PER_INT %dL\n", bpb * sizeof_int);
341
+ printf("#define JS_BITS_PER_INT64 %dL\n", bpb * sizeof_int64);
342
+ printf("#define JS_BITS_PER_LONG %dL\n", bpb * sizeof_long);
343
+ printf("#define JS_BITS_PER_FLOAT %dL\n", bpb * sizeof_float);
344
+ printf("#define JS_BITS_PER_DOUBLE %dL\n", bpb * sizeof_double);
345
+ printf("#define JS_BITS_PER_WORD %dL\n", bpb * sizeof_word);
346
+ printf("\n");
347
+
348
+ printf("#define JS_BITS_PER_BYTE_LOG2 %dL\n", Log2(bpb));
349
+ printf("#define JS_BITS_PER_SHORT_LOG2 %dL\n", Log2(bpb * sizeof_short));
350
+ printf("#define JS_BITS_PER_INT_LOG2 %dL\n", Log2(bpb * sizeof_int));
351
+ printf("#define JS_BITS_PER_INT64_LOG2 %dL\n", bits_per_int64_log2);
352
+ printf("#define JS_BITS_PER_LONG_LOG2 %dL\n", Log2(bpb * sizeof_long));
353
+ printf("#define JS_BITS_PER_FLOAT_LOG2 %dL\n", Log2(bpb * sizeof_float));
354
+ printf("#define JS_BITS_PER_DOUBLE_LOG2 %dL\n", Log2(bpb * sizeof_double));
355
+ printf("#define JS_BITS_PER_WORD_LOG2 %dL\n", Log2(bpb * sizeof_word));
356
+ printf("\n");
357
+
358
+ printf("#define JS_ALIGN_OF_SHORT %dL\n", align_of_short);
359
+ printf("#define JS_ALIGN_OF_INT %dL\n", align_of_int);
360
+ printf("#define JS_ALIGN_OF_LONG %dL\n", align_of_long);
361
+ printf("#define JS_ALIGN_OF_INT64 %dL\n", align_of_int64);
362
+ printf("#define JS_ALIGN_OF_FLOAT %dL\n", align_of_float);
363
+ printf("#define JS_ALIGN_OF_DOUBLE %dL\n", align_of_double);
364
+ printf("#define JS_ALIGN_OF_POINTER %dL\n", align_of_pointer);
365
+ printf("#define JS_ALIGN_OF_WORD %dL\n", align_of_word);
366
+ printf("\n");
367
+
368
+ printf("#define JS_BYTES_PER_WORD_LOG2 %dL\n", Log2(sizeof_word));
369
+ printf("#define JS_BYTES_PER_DWORD_LOG2 %dL\n", Log2(sizeof_dword));
370
+ printf("#define JS_WORDS_PER_DWORD_LOG2 %dL\n", Log2(sizeof_dword/sizeof_word));
371
+ printf("\n");
372
+
373
+ printf("#define JS_STACK_GROWTH_DIRECTION (%d)\n", StackGrowthDirection(&dummy1));
374
+ printf("\n");
375
+
376
+ printf("#define JS_HAVE_LONG_LONG\n");
377
+ printf("\n");
378
+
379
+ printf("#endif /* js_cpucfg___ */\n");
380
+
381
+ return EXIT_SUCCESS;
382
+ }
383
+
@@ -0,0 +1,212 @@
1
+ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2
+ *
3
+ * ***** BEGIN LICENSE BLOCK *****
4
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5
+ *
6
+ * The contents of this file are subject to the Mozilla Public License Version
7
+ * 1.1 (the "License"); you may not use this file except in compliance with
8
+ * the License. You may obtain a copy of the License at
9
+ * http://www.mozilla.org/MPL/
10
+ *
11
+ * Software distributed under the License is distributed on an "AS IS" basis,
12
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13
+ * for the specific language governing rights and limitations under the
14
+ * License.
15
+ *
16
+ * The Original Code is Mozilla Communicator client code, released
17
+ * March 31, 1998.
18
+ *
19
+ * The Initial Developer of the Original Code is
20
+ * Netscape Communications Corporation.
21
+ * Portions created by the Initial Developer are Copyright (C) 1998
22
+ * the Initial Developer. All Rights Reserved.
23
+ *
24
+ * Contributor(s):
25
+ *
26
+ * Alternatively, the contents of this file may be used under the terms of
27
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
28
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29
+ * in which case the provisions of the GPL or the LGPL are applicable instead
30
+ * of those above. If you wish to allow use of your version of this file only
31
+ * under the terms of either the GPL or the LGPL, and not to allow others to
32
+ * use your version of this file under the terms of the MPL, indicate your
33
+ * decision by deleting the provisions above and replace them with the notice
34
+ * and other provisions required by the GPL or the LGPL. If you do not delete
35
+ * the provisions above, a recipient may use your version of this file under
36
+ * the terms of any one of the MPL, the GPL or the LGPL.
37
+ *
38
+ * ***** END LICENSE BLOCK ***** */
39
+
40
+ #ifndef js_cpucfg___
41
+ #define js_cpucfg___
42
+
43
+ #define JS_HAVE_LONG_LONG
44
+
45
+ #if defined(XP_WIN) || defined(XP_OS2) || defined(WINCE)
46
+
47
+ #if defined(_WIN64)
48
+
49
+ #if defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)
50
+ #define IS_LITTLE_ENDIAN 1
51
+ #undef IS_BIG_ENDIAN
52
+
53
+ #define JS_BYTES_PER_BYTE 1L
54
+ #define JS_BYTES_PER_SHORT 2L
55
+ #define JS_BYTES_PER_INT 4L
56
+ #define JS_BYTES_PER_INT64 8L
57
+ #define JS_BYTES_PER_LONG 4L
58
+ #define JS_BYTES_PER_FLOAT 4L
59
+ #define JS_BYTES_PER_DOUBLE 8L
60
+ #define JS_BYTES_PER_WORD 8L
61
+ #define JS_BYTES_PER_DWORD 8L
62
+
63
+ #define JS_BITS_PER_BYTE 8L
64
+ #define JS_BITS_PER_SHORT 16L
65
+ #define JS_BITS_PER_INT 32L
66
+ #define JS_BITS_PER_INT64 64L
67
+ #define JS_BITS_PER_LONG 32L
68
+ #define JS_BITS_PER_FLOAT 32L
69
+ #define JS_BITS_PER_DOUBLE 64L
70
+ #define JS_BITS_PER_WORD 64L
71
+
72
+ #define JS_BITS_PER_BYTE_LOG2 3L
73
+ #define JS_BITS_PER_SHORT_LOG2 4L
74
+ #define JS_BITS_PER_INT_LOG2 5L
75
+ #define JS_BITS_PER_INT64_LOG2 6L
76
+ #define JS_BITS_PER_LONG_LOG2 5L
77
+ #define JS_BITS_PER_FLOAT_LOG2 5L
78
+ #define JS_BITS_PER_DOUBLE_LOG2 6L
79
+ #define JS_BITS_PER_WORD_LOG2 6L
80
+
81
+ #define JS_ALIGN_OF_SHORT 2L
82
+ #define JS_ALIGN_OF_INT 4L
83
+ #define JS_ALIGN_OF_LONG 4L
84
+ #define JS_ALIGN_OF_INT64 8L
85
+ #define JS_ALIGN_OF_FLOAT 4L
86
+ #define JS_ALIGN_OF_DOUBLE 8L
87
+ #define JS_ALIGN_OF_POINTER 8L
88
+ #define JS_ALIGN_OF_WORD 8L
89
+
90
+ #define JS_BYTES_PER_WORD_LOG2 3L
91
+ #define JS_BYTES_PER_DWORD_LOG2 3L
92
+ #define PR_WORDS_PER_DWORD_LOG2 0L
93
+ #else /* !(defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)) */
94
+ #error "CPU type is unknown"
95
+ #endif /* !(defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)) */
96
+
97
+ #elif defined(_WIN32) || defined(XP_OS2) || defined(WINCE)
98
+
99
+ #ifdef __WATCOMC__
100
+ #define HAVE_VA_LIST_AS_ARRAY
101
+ #endif
102
+
103
+ #define IS_LITTLE_ENDIAN 1
104
+ #undef IS_BIG_ENDIAN
105
+
106
+ #define JS_BYTES_PER_BYTE 1L
107
+ #define JS_BYTES_PER_SHORT 2L
108
+ #define JS_BYTES_PER_INT 4L
109
+ #define JS_BYTES_PER_INT64 8L
110
+ #define JS_BYTES_PER_LONG 4L
111
+ #define JS_BYTES_PER_FLOAT 4L
112
+ #define JS_BYTES_PER_DOUBLE 8L
113
+ #define JS_BYTES_PER_WORD 4L
114
+ #define JS_BYTES_PER_DWORD 8L
115
+
116
+ #define JS_BITS_PER_BYTE 8L
117
+ #define JS_BITS_PER_SHORT 16L
118
+ #define JS_BITS_PER_INT 32L
119
+ #define JS_BITS_PER_INT64 64L
120
+ #define JS_BITS_PER_LONG 32L
121
+ #define JS_BITS_PER_FLOAT 32L
122
+ #define JS_BITS_PER_DOUBLE 64L
123
+ #define JS_BITS_PER_WORD 32L
124
+
125
+ #define JS_BITS_PER_BYTE_LOG2 3L
126
+ #define JS_BITS_PER_SHORT_LOG2 4L
127
+ #define JS_BITS_PER_INT_LOG2 5L
128
+ #define JS_BITS_PER_INT64_LOG2 6L
129
+ #define JS_BITS_PER_LONG_LOG2 5L
130
+ #define JS_BITS_PER_FLOAT_LOG2 5L
131
+ #define JS_BITS_PER_DOUBLE_LOG2 6L
132
+ #define JS_BITS_PER_WORD_LOG2 5L
133
+
134
+ #define JS_ALIGN_OF_SHORT 2L
135
+ #define JS_ALIGN_OF_INT 4L
136
+ #define JS_ALIGN_OF_LONG 4L
137
+ #define JS_ALIGN_OF_INT64 8L
138
+ #define JS_ALIGN_OF_FLOAT 4L
139
+ #define JS_ALIGN_OF_DOUBLE 4L
140
+ #define JS_ALIGN_OF_POINTER 4L
141
+ #define JS_ALIGN_OF_WORD 4L
142
+
143
+ #define JS_BYTES_PER_WORD_LOG2 2L
144
+ #define JS_BYTES_PER_DWORD_LOG2 3L
145
+ #define PR_WORDS_PER_DWORD_LOG2 1L
146
+ #endif /* _WIN32 || XP_OS2 || WINCE*/
147
+
148
+ #if defined(_WINDOWS) && !defined(_WIN32) /* WIN16 */
149
+
150
+ #define IS_LITTLE_ENDIAN 1
151
+ #undef IS_BIG_ENDIAN
152
+
153
+ #define JS_BYTES_PER_BYTE 1L
154
+ #define JS_BYTES_PER_SHORT 2L
155
+ #define JS_BYTES_PER_INT 2L
156
+ #define JS_BYTES_PER_INT64 8L
157
+ #define JS_BYTES_PER_LONG 4L
158
+ #define JS_BYTES_PER_FLOAT 4L
159
+ #define JS_BYTES_PER_DOUBLE 8L
160
+ #define JS_BYTES_PER_WORD 4L
161
+ #define JS_BYTES_PER_DWORD 8L
162
+
163
+ #define JS_BITS_PER_BYTE 8L
164
+ #define JS_BITS_PER_SHORT 16L
165
+ #define JS_BITS_PER_INT 16L
166
+ #define JS_BITS_PER_INT64 64L
167
+ #define JS_BITS_PER_LONG 32L
168
+ #define JS_BITS_PER_FLOAT 32L
169
+ #define JS_BITS_PER_DOUBLE 64L
170
+ #define JS_BITS_PER_WORD 32L
171
+
172
+ #define JS_BITS_PER_BYTE_LOG2 3L
173
+ #define JS_BITS_PER_SHORT_LOG2 4L
174
+ #define JS_BITS_PER_INT_LOG2 4L
175
+ #define JS_BITS_PER_INT64_LOG2 6L
176
+ #define JS_BITS_PER_LONG_LOG2 5L
177
+ #define JS_BITS_PER_FLOAT_LOG2 5L
178
+ #define JS_BITS_PER_DOUBLE_LOG2 6L
179
+ #define JS_BITS_PER_WORD_LOG2 5L
180
+
181
+ #define JS_ALIGN_OF_SHORT 2L
182
+ #define JS_ALIGN_OF_INT 2L
183
+ #define JS_ALIGN_OF_LONG 2L
184
+ #define JS_ALIGN_OF_INT64 2L
185
+ #define JS_ALIGN_OF_FLOAT 2L
186
+ #define JS_ALIGN_OF_DOUBLE 2L
187
+ #define JS_ALIGN_OF_POINTER 2L
188
+ #define JS_ALIGN_OF_WORD 2L
189
+
190
+ #define JS_BYTES_PER_WORD_LOG2 2L
191
+ #define JS_BYTES_PER_DWORD_LOG2 3L
192
+ #define PR_WORDS_PER_DWORD_LOG2 1L
193
+
194
+ #endif /* defined(_WINDOWS) && !defined(_WIN32) */
195
+
196
+ #elif defined(XP_UNIX) || defined(XP_BEOS)
197
+
198
+ #error "This file is supposed to be auto-generated on UNIX platforms, but the"
199
+ #error "static version for Mac and Windows platforms is being used."
200
+ #error "Something's probably wrong with paths/headers/dependencies/Makefiles."
201
+
202
+ #else
203
+
204
+ #error "Must define one of XP_BEOS, XP_OS2, XP_WIN, or XP_UNIX"
205
+
206
+ #endif
207
+
208
+ #ifndef JS_STACK_GROWTH_DIRECTION
209
+ #define JS_STACK_GROWTH_DIRECTION (-1)
210
+ #endif
211
+
212
+ #endif /* js_cpucfg___ */