jbarnette-johnson 1.0.0.200806240111 → 1.0.0.200807291507

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,349 @@
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 SpiderMonkey E4X code, released August, 2004.
17
+ *
18
+ * The Initial Developer of the Original Code is
19
+ * Netscape Communications Corporation.
20
+ * Portions created by the Initial Developer are Copyright (C) 1998
21
+ * the Initial Developer. All Rights Reserved.
22
+ *
23
+ * Contributor(s):
24
+ *
25
+ * Alternatively, the contents of this file may be used under the terms of
26
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
27
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28
+ * in which case the provisions of the GPL or the LGPL are applicable instead
29
+ * of those above. If you wish to allow use of your version of this file only
30
+ * under the terms of either the GPL or the LGPL, and not to allow others to
31
+ * use your version of this file under the terms of the MPL, indicate your
32
+ * decision by deleting the provisions above and replace them with the notice
33
+ * and other provisions required by the GPL or the LGPL. If you do not delete
34
+ * the provisions above, a recipient may use your version of this file under
35
+ * the terms of any one of the MPL, the GPL or the LGPL.
36
+ *
37
+ * ***** END LICENSE BLOCK ***** */
38
+
39
+ #ifndef jsxml_h___
40
+ #define jsxml_h___
41
+
42
+ #include "jsstddef.h"
43
+ #include "jspubtd.h"
44
+
45
+ JS_BEGIN_EXTERN_C
46
+
47
+ extern const char js_AnyName_str[];
48
+ extern const char js_AttributeName_str[];
49
+ extern const char js_isXMLName_str[];
50
+ extern const char js_XMLList_str[];
51
+
52
+ extern const char js_amp_entity_str[];
53
+ extern const char js_gt_entity_str[];
54
+ extern const char js_lt_entity_str[];
55
+ extern const char js_quot_entity_str[];
56
+
57
+ struct JSXMLNamespace {
58
+ JSObject *object;
59
+ JSString *prefix;
60
+ JSString *uri;
61
+ JSBool declared; /* true if declared in its XML tag */
62
+ };
63
+
64
+ extern JSXMLNamespace *
65
+ js_NewXMLNamespace(JSContext *cx, JSString *prefix, JSString *uri,
66
+ JSBool declared);
67
+
68
+ extern void
69
+ js_TraceXMLNamespace(JSTracer *trc, JSXMLNamespace *ns);
70
+
71
+ extern void
72
+ js_FinalizeXMLNamespace(JSContext *cx, JSXMLNamespace *ns);
73
+
74
+ extern JSObject *
75
+ js_NewXMLNamespaceObject(JSContext *cx, JSString *prefix, JSString *uri,
76
+ JSBool declared);
77
+
78
+ extern JSObject *
79
+ js_GetXMLNamespaceObject(JSContext *cx, JSXMLNamespace *ns);
80
+
81
+ struct JSXMLQName {
82
+ JSObject *object;
83
+ JSString *uri;
84
+ JSString *prefix;
85
+ JSString *localName;
86
+ };
87
+
88
+ extern JSXMLQName *
89
+ js_NewXMLQName(JSContext *cx, JSString *uri, JSString *prefix,
90
+ JSString *localName);
91
+
92
+ extern void
93
+ js_TraceXMLQName(JSTracer *trc, JSXMLQName *qn);
94
+
95
+ extern void
96
+ js_FinalizeXMLQName(JSContext *cx, JSXMLQName *qn);
97
+
98
+ extern JSObject *
99
+ js_NewXMLQNameObject(JSContext *cx, JSString *uri, JSString *prefix,
100
+ JSString *localName);
101
+
102
+ extern JSObject *
103
+ js_GetXMLQNameObject(JSContext *cx, JSXMLQName *qn);
104
+
105
+ extern JSObject *
106
+ js_GetAttributeNameObject(JSContext *cx, JSXMLQName *qn);
107
+
108
+ extern JSObject *
109
+ js_ConstructXMLQNameObject(JSContext *cx, jsval nsval, jsval lnval);
110
+
111
+ typedef JSBool
112
+ (* JS_DLL_CALLBACK JSIdentityOp)(const void *a, const void *b);
113
+
114
+ struct JSXMLArray {
115
+ uint32 length;
116
+ uint32 capacity;
117
+ void **vector;
118
+ JSXMLArrayCursor *cursors;
119
+ };
120
+
121
+ #define JSXML_PRESET_CAPACITY JS_BIT(31)
122
+ #define JSXML_CAPACITY_MASK JS_BITMASK(31)
123
+ #define JSXML_CAPACITY(array) ((array)->capacity & JSXML_CAPACITY_MASK)
124
+
125
+ struct JSXMLArrayCursor {
126
+ JSXMLArray *array;
127
+ uint32 index;
128
+ JSXMLArrayCursor *next;
129
+ JSXMLArrayCursor **prevp;
130
+ void *root;
131
+ };
132
+
133
+ /*
134
+ * NB: don't reorder this enum without changing all array initializers that
135
+ * depend on it in jsxml.c.
136
+ */
137
+ typedef enum JSXMLClass {
138
+ JSXML_CLASS_LIST,
139
+ JSXML_CLASS_ELEMENT,
140
+ JSXML_CLASS_ATTRIBUTE,
141
+ JSXML_CLASS_PROCESSING_INSTRUCTION,
142
+ JSXML_CLASS_TEXT,
143
+ JSXML_CLASS_COMMENT,
144
+ JSXML_CLASS_LIMIT
145
+ } JSXMLClass;
146
+
147
+ #define JSXML_CLASS_HAS_KIDS(class_) ((class_) < JSXML_CLASS_ATTRIBUTE)
148
+ #define JSXML_CLASS_HAS_VALUE(class_) ((class_) >= JSXML_CLASS_ATTRIBUTE)
149
+ #define JSXML_CLASS_HAS_NAME(class_) \
150
+ ((uintN)((class_) - JSXML_CLASS_ELEMENT) <= \
151
+ (uintN)(JSXML_CLASS_PROCESSING_INSTRUCTION - JSXML_CLASS_ELEMENT))
152
+
153
+ #ifdef DEBUG_notme
154
+ #include "jsclist.h"
155
+ #endif
156
+
157
+ typedef struct JSXMLListVar {
158
+ JSXMLArray kids; /* NB: must come first */
159
+ JSXML *target;
160
+ JSXMLQName *targetprop;
161
+ } JSXMLListVar;
162
+
163
+ typedef struct JSXMLElemVar {
164
+ JSXMLArray kids; /* NB: must come first */
165
+ JSXMLArray namespaces;
166
+ JSXMLArray attrs;
167
+ } JSXMLElemVar;
168
+
169
+ struct JSXML {
170
+ #ifdef DEBUG_notme
171
+ JSCList links;
172
+ uint32 serial;
173
+ #endif
174
+ JSObject *object;
175
+ void *domnode; /* DOM node if mapped info item */
176
+ JSXML *parent;
177
+ JSXMLQName *name;
178
+ uint16 xml_class; /* discriminates u, below */
179
+ uint16 xml_flags; /* flags, see below */
180
+ union {
181
+ JSXMLListVar list;
182
+ JSXMLElemVar elem;
183
+ JSString *value;
184
+ } u;
185
+
186
+ /* Don't add anything after u -- see js_NewXML for why. */
187
+ };
188
+
189
+ /* union member shorthands */
190
+ #define xml_kids u.list.kids
191
+ #define xml_target u.list.target
192
+ #define xml_targetprop u.list.targetprop
193
+ #define xml_namespaces u.elem.namespaces
194
+ #define xml_attrs u.elem.attrs
195
+ #define xml_value u.value
196
+
197
+ /* xml_flags values */
198
+ #define XMLF_WHITESPACE_TEXT 0x1
199
+
200
+ /* xml_class-testing macros */
201
+ #define JSXML_HAS_KIDS(xml) JSXML_CLASS_HAS_KIDS((xml)->xml_class)
202
+ #define JSXML_HAS_VALUE(xml) JSXML_CLASS_HAS_VALUE((xml)->xml_class)
203
+ #define JSXML_HAS_NAME(xml) JSXML_CLASS_HAS_NAME((xml)->xml_class)
204
+ #define JSXML_LENGTH(xml) (JSXML_CLASS_HAS_KIDS((xml)->xml_class) \
205
+ ? (xml)->xml_kids.length \
206
+ : 0)
207
+
208
+ extern JSXML *
209
+ js_NewXML(JSContext *cx, JSXMLClass xml_class);
210
+
211
+ extern void
212
+ js_TraceXML(JSTracer *trc, JSXML *xml);
213
+
214
+ extern void
215
+ js_FinalizeXML(JSContext *cx, JSXML *xml);
216
+
217
+ extern JSObject *
218
+ js_ParseNodeToXMLObject(JSContext *cx, JSParseContext *pc, JSParseNode *pn);
219
+
220
+ extern JSObject *
221
+ js_NewXMLObject(JSContext *cx, JSXMLClass xml_class);
222
+
223
+ extern JSObject *
224
+ js_GetXMLObject(JSContext *cx, JSXML *xml);
225
+
226
+ extern JS_FRIEND_DATA(JSXMLObjectOps) js_XMLObjectOps;
227
+ extern JS_FRIEND_DATA(JSClass) js_XMLClass;
228
+ extern JS_FRIEND_DATA(JSExtendedClass) js_NamespaceClass;
229
+ extern JS_FRIEND_DATA(JSExtendedClass) js_QNameClass;
230
+ extern JS_FRIEND_DATA(JSClass) js_AttributeNameClass;
231
+ extern JS_FRIEND_DATA(JSClass) js_AnyNameClass;
232
+ extern JSClass js_XMLFilterClass;
233
+
234
+ /*
235
+ * Macros to test whether an object or a value is of type "xml" (per typeof).
236
+ * NB: jsobj.h must be included before any call to OBJECT_IS_XML, and jsapi.h
237
+ * and jsobj.h must be included before any call to VALUE_IS_XML.
238
+ */
239
+ #define OBJECT_IS_XML(cx,obj) ((obj)->map->ops == &js_XMLObjectOps.base)
240
+ #define VALUE_IS_XML(cx,v) (!JSVAL_IS_PRIMITIVE(v) && \
241
+ OBJECT_IS_XML(cx, JSVAL_TO_OBJECT(v)))
242
+
243
+ extern JSObject *
244
+ js_InitNamespaceClass(JSContext *cx, JSObject *obj);
245
+
246
+ extern JSObject *
247
+ js_InitQNameClass(JSContext *cx, JSObject *obj);
248
+
249
+ extern JSObject *
250
+ js_InitAttributeNameClass(JSContext *cx, JSObject *obj);
251
+
252
+ extern JSObject *
253
+ js_InitAnyNameClass(JSContext *cx, JSObject *obj);
254
+
255
+ extern JSObject *
256
+ js_InitXMLClass(JSContext *cx, JSObject *obj);
257
+
258
+ extern JSObject *
259
+ js_InitXMLClasses(JSContext *cx, JSObject *obj);
260
+
261
+ extern JSBool
262
+ js_GetFunctionNamespace(JSContext *cx, jsval *vp);
263
+
264
+ /*
265
+ * If obj is QName corresponding to function::name, set *funidp to name's id,
266
+ * otherwise set *funidp to 0.
267
+ */
268
+ JSBool
269
+ js_IsFunctionQName(JSContext *cx, JSObject *obj, jsid *funidp);
270
+
271
+ extern JSBool
272
+ js_GetDefaultXMLNamespace(JSContext *cx, jsval *vp);
273
+
274
+ extern JSBool
275
+ js_SetDefaultXMLNamespace(JSContext *cx, jsval v);
276
+
277
+ /*
278
+ * Return true if v is a XML QName object, or if it converts to a string that
279
+ * contains a valid XML qualified name (one containing no :), false otherwise.
280
+ * NB: This function is an infallible predicate, it hides exceptions.
281
+ */
282
+ extern JSBool
283
+ js_IsXMLName(JSContext *cx, jsval v);
284
+
285
+ extern JSBool
286
+ js_ToAttributeName(JSContext *cx, jsval *vp);
287
+
288
+ extern JSString *
289
+ js_EscapeAttributeValue(JSContext *cx, JSString *str, JSBool quote);
290
+
291
+ extern JSString *
292
+ js_AddAttributePart(JSContext *cx, JSBool isName, JSString *str,
293
+ JSString *str2);
294
+
295
+ extern JSString *
296
+ js_EscapeElementValue(JSContext *cx, JSString *str);
297
+
298
+ extern JSString *
299
+ js_ValueToXMLString(JSContext *cx, jsval v);
300
+
301
+ extern JSBool
302
+ js_GetAnyName(JSContext *cx, jsval *vp);
303
+
304
+ /*
305
+ * Note: nameval must be either QName, AttributeName, or AnyName.
306
+ */
307
+ extern JSBool
308
+ js_FindXMLProperty(JSContext *cx, jsval nameval, JSObject **objp, jsid *idp);
309
+
310
+ extern JSBool
311
+ js_GetXMLFunction(JSContext *cx, JSObject *obj, jsid id, jsval *vp);
312
+
313
+ extern JSBool
314
+ js_GetXMLDescendants(JSContext *cx, JSObject *obj, jsval id, jsval *vp);
315
+
316
+ extern JSBool
317
+ js_DeleteXMLListElements(JSContext *cx, JSObject *listobj);
318
+
319
+ extern JSObject *
320
+ js_InitXMLFilterClass(JSContext *cx, JSObject* obj);
321
+
322
+ extern JSBool
323
+ js_StepXMLListFilter(JSContext *cx, JSBool initialized);
324
+
325
+ extern JSObject *
326
+ js_ValueToXMLObject(JSContext *cx, jsval v);
327
+
328
+ extern JSObject *
329
+ js_ValueToXMLListObject(JSContext *cx, jsval v);
330
+
331
+ extern JSObject *
332
+ js_CloneXMLObject(JSContext *cx, JSObject *obj);
333
+
334
+ extern JSObject *
335
+ js_NewXMLSpecialObject(JSContext *cx, JSXMLClass xml_class, JSString *name,
336
+ JSString *value);
337
+
338
+ extern JSString *
339
+ js_MakeXMLCDATAString(JSContext *cx, JSString *str);
340
+
341
+ extern JSString *
342
+ js_MakeXMLCommentString(JSContext *cx, JSString *str);
343
+
344
+ extern JSString *
345
+ js_MakeXMLPIString(JSContext *cx, JSString *name, JSString *str);
346
+
347
+ JS_END_EXTERN_C
348
+
349
+ #endif /* jsxml_h___ */
@@ -0,0 +1,119 @@
1
+ !
2
+ ! ***** BEGIN LICENSE BLOCK *****
3
+ ! Version: MPL 1.1/GPL 2.0/LGPL 2.1
4
+ !
5
+ ! The contents of this file are subject to the Mozilla Public License Version
6
+ ! 1.1 (the "License"); you may not use this file except in compliance with
7
+ ! the License. You may obtain a copy of the License at
8
+ ! http://www.mozilla.org/MPL/
9
+ !
10
+ ! Software distributed under the License is distributed on an "AS IS" basis,
11
+ ! WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12
+ ! for the specific language governing rights and limitations under the
13
+ ! License.
14
+ !
15
+ ! The Original Code is Mozilla Communicator client code, released
16
+ ! March 31, 1998.
17
+ !
18
+ ! The Initial Developer of the Original Code is
19
+ ! Netscape Communications Corporation.
20
+ ! Portions created by the Initial Developer are Copyright (C) 1998-1999
21
+ ! the Initial Developer. All Rights Reserved.
22
+ !
23
+ ! Contributor(s):
24
+ !
25
+ ! Alternatively, the contents of this file may be used under the terms of
26
+ ! either the GNU General Public License Version 2 or later (the "GPL"), or
27
+ ! the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28
+ ! in which case the provisions of the GPL or the LGPL are applicable instead
29
+ ! of those above. If you wish to allow use of your version of this file only
30
+ ! under the terms of either the GPL or the LGPL, and not to allow others to
31
+ ! use your version of this file under the terms of the MPL, indicate your
32
+ ! decision by deleting the provisions above and replace them with the notice
33
+ ! and other provisions required by the GPL or the LGPL. If you do not delete
34
+ ! the provisions above, a recipient may use your version of this file under
35
+ ! the terms of any one of the MPL, the GPL or the LGPL.
36
+ !
37
+ ! ***** END LICENSE BLOCK *****
38
+
39
+ !
40
+ ! atomic compare-and-swap routines for V8 sparc
41
+ ! and for V8+ (ultrasparc)
42
+ !
43
+ !
44
+ ! standard asm linkage macros; this module must be compiled
45
+ ! with the -P option (use C preprocessor)
46
+
47
+ #include <sys/asm_linkage.h>
48
+
49
+ ! ======================================================================
50
+ !
51
+ ! Perform the sequence *a = b atomically with respect to previous value
52
+ ! of a (a0). If *a==a0 then assign *a to b, all in one atomic operation.
53
+ ! Returns 1 if assignment happened, and 0 otherwise.
54
+ !
55
+ ! usage : old_val = compare_and_swap(address, oldval, newval)
56
+ !
57
+ ! -----------------------
58
+ ! Note on REGISTER USAGE:
59
+ ! as this is a LEAF procedure, a new stack frame is not created;
60
+ ! we use the caller stack frame so what would normally be %i (input)
61
+ ! registers are actually %o (output registers). Also, we must not
62
+ ! overwrite the contents of %l (local) registers as they are not
63
+ ! assumed to be volatile during calls.
64
+ !
65
+ ! So, the registers used are:
66
+ ! %o0 [input] - the address of the value to increment
67
+ ! %o1 [input] - the old value to compare with
68
+ ! %o2 [input] - the new value to set for [%o0]
69
+ ! %o3 [local] - work register
70
+ ! -----------------------
71
+ #ifndef ULTRA_SPARC
72
+ ! v8
73
+
74
+ ENTRY(compare_and_swap) ! standard assembler/ELF prologue
75
+
76
+ stbar
77
+ mov -1,%o3 ! busy flag
78
+ swap [%o0],%o3 ! get current value
79
+ l1: cmp %o3,-1 ! busy?
80
+ be,a l1 ! if so, spin
81
+ swap [%o0],%o3 ! using branch-delay to swap back value
82
+ cmp %o1,%o3 ! compare old with current
83
+ be,a l2 ! if equal then swap in new value
84
+ swap [%o0],%o2 ! done.
85
+ swap [%o0],%o3 ! otherwise, swap back current value
86
+ retl
87
+ mov 0,%o0 ! return false
88
+ l2: retl
89
+ mov 1,%o0 ! return true
90
+
91
+ SET_SIZE(compare_and_swap) ! standard assembler/ELF epilogue
92
+
93
+ !
94
+ ! end
95
+ !
96
+ #else /* ULTRA_SPARC */
97
+ ! ======================================================================
98
+ !
99
+ ! v9
100
+
101
+ ENTRY(compare_and_swap) ! standard assembler/ELF prologue
102
+
103
+ stbar
104
+ cas [%o0],%o1,%o2 ! compare *w with old value and set to new if equal
105
+ cmp %o1,%o2 ! did we succeed?
106
+ be,a m1 ! yes
107
+ mov 1,%o0 ! return true (annulled when no jump)
108
+ mov 0,%o0 ! return false
109
+ m1: retl
110
+ nop
111
+
112
+ SET_SIZE(compare_and_swap) ! standard assembler/ELF epilogue
113
+
114
+ !
115
+ ! end
116
+ !
117
+ ! ======================================================================
118
+ !
119
+ #endif