]> git.wh0rd.org - ICEs.git/blame - 571482/jsxml.ii.9
more
[ICEs.git] / 571482 / jsxml.ii.9
CommitLineData
bd3239d2
MF
1typedef union {
2 long int asBits;
3} jsval_layout;
4static jsval_layout STRING_TO_JSVAL_IMPL()
5{
6}
7
8typedef __attribute__ ((aligned(8)))
9long int jsval;
10class Value {
11 public:void setString()
12{
13 data = STRING_TO_JSVAL_IMPL();
14} jsval_layout data;
15}
16
17__attribute__ ((aligned(8)));
18static Value StringValue()
19{
20 Value v;
21 v.setString();
22 return v;
23}
24
25static const jsval & Jsvalify(const Value & v)
26{
27 return (const jsval &)v;
28}
29
30static Value *Valueify(jsval * v)
31{
32 return (Value *)v;
33}
34
35struct JSObject {
36 void getQNameLocalName();
37};
38static Value IdToValue(int id)
39{
40 if (id)
41 return StringValue();
42}
43
44static jsval IdToJsval(int id)
45{
46 return Jsvalify(IdToValue(id));
47}
48
49class AutoGCRooter;
50struct JSContext {
51 AutoGCRooter *autoGCRooters;
52};
53class AutoGCRooter {
54 public:
55AutoGCRooter(JSContext *cx)
56{
57 }
58};
59
60class AutoArrayRooter : AutoGCRooter {
61 public:AutoArrayRooter(JSContext *cx, Value *vec):
62AutoGCRooter(cx)
63{
64array = vec;
65cx->autoGCRooters = this;
66 }
67 Value *array;
68};
69
70static void PutProperty(JSContext * cx, int id, jsval * vp)
71{
72 JSObject *nameobj;
73 jsval roots[3];
74 roots[1] = IdToJsval(id);
75 roots[2] = *vp;
76 AutoArrayRooter tvr(cx, Valueify(roots));
77 nameobj->getQNameLocalName();
78}
79
80void xml_defineProperty(JSContext * cx, int id, const Value * v)
81{
82 jsval tmp = Jsvalify(*v);
83 PutProperty(cx, id, &tmp);
84}