~ubuntu-branches/ubuntu/lucid/webkit/lucid-updates

« back to all changes in this revision

Viewing changes to JavaScriptCore/runtime/JSCell.h

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo Noronha Silva
  • Date: 2010-01-06 21:25:06 UTC
  • mfrom: (1.2.6 upstream) (4.3.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100106212506-gd0czn4zrwf1j19l
* New upstream release
- adds basic Content-Encoding support, thanks to soup
  (Closes: #529271)
- fixes over-advertising content types as supported by
  the media player (Closes: #559420)
* debian/control:
- updated libsoup build requirement (>= 2.28.2)
* debian/libwebkit-1.0-2.symbols:
- updated with new symbols
* debian/copyright:
- updated information since 1.1.17
* Imported patch from https://bugs.webkit.org/show_bug.cgi?id=30623
- I am shipping this patch because I believe it is correct, it is the
  way to go, it fixes a race, and it needs testing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
        friend class JSString;
43
43
        friend class JSValue;
44
44
        friend class JSAPIValueWrapper;
 
45
        friend class JSZombie;
45
46
        friend struct VPtrSet;
46
47
 
47
48
    private:
48
49
        explicit JSCell(Structure*);
49
 
        JSCell(); // Only used for initializing Collector blocks.
50
50
        virtual ~JSCell();
51
51
 
52
52
    public:
 
53
        static PassRefPtr<Structure> createDummyStructure()
 
54
        {
 
55
            return Structure::create(jsNull(), TypeInfo(UnspecifiedType));
 
56
        }
 
57
 
53
58
        // Querying the type.
54
59
#if USE(JSVALUE32)
55
60
        bool isNumber() const;
64
69
        Structure* structure() const;
65
70
 
66
71
        // Extracting the value.
67
 
        bool getString(UString&) const;
68
 
        UString getString() const; // null string if not a string
 
72
        bool getString(ExecState* exec, UString&) const;
 
73
        UString getString(ExecState* exec) const; // null string if not a string
69
74
        JSObject* getObject(); // NULL if not an object
70
75
        const JSObject* getObject() const; // NULL if not an object
71
76
        
90
95
        void* operator new(size_t, void* placementNewDestination) { return placementNewDestination; }
91
96
 
92
97
        virtual void markChildren(MarkStack&);
 
98
#if ENABLE(JSC_ZOMBIES)
 
99
        virtual bool isZombie() const { return false; }
 
100
#endif
93
101
 
94
102
        // Object operations, with the toObject operation included.
95
103
        virtual const ClassInfo* classInfo() const;
118
126
    {
119
127
    }
120
128
 
121
 
    // Only used for initializing Collector blocks.
122
 
    inline JSCell::JSCell()
123
 
    {
124
 
    }
125
 
 
126
129
    inline JSCell::~JSCell()
127
130
    {
128
131
    }
130
133
#if USE(JSVALUE32)
131
134
    inline bool JSCell::isNumber() const
132
135
    {
133
 
        return Heap::isNumber(const_cast<JSCell*>(this));
 
136
        return m_structure->typeInfo().type() == NumberType;
134
137
    }
135
138
#endif
136
139
 
158
161
        return globalData->heap.allocate(size);
159
162
    }
160
163
 
 
164
    inline void* JSCell::operator new(size_t size, ExecState* exec)
 
165
    {
 
166
        return exec->heap()->allocate(size);
 
167
    }
 
168
 
161
169
    // --- JSValue inlines ----------------------------
162
170
 
163
171
    inline bool JSValue::isString() const
175
183
        return isCell() && asCell()->isObject();
176
184
    }
177
185
 
178
 
    inline bool JSValue::getString(UString& s) const
 
186
    inline bool JSValue::getString(ExecState* exec, UString& s) const
179
187
    {
180
 
        return isCell() && asCell()->getString(s);
 
188
        return isCell() && asCell()->getString(exec, s);
181
189
    }
182
190
 
183
 
    inline UString JSValue::getString() const
 
191
    inline UString JSValue::getString(ExecState* exec) const
184
192
    {
185
 
        return isCell() ? asCell()->getString() : UString();
 
193
        return isCell() ? asCell()->getString(exec) : UString();
186
194
    }
187
195
 
188
196
    inline JSObject* JSValue::getObject() const
342
350
    {
343
351
        return cellBlock(c)->heap;
344
352
    }
345
 
 
 
353
    
 
354
#if ENABLE(JSC_ZOMBIES)
 
355
    inline bool JSValue::isZombie() const
 
356
    {
 
357
        return isCell() && asCell() && asCell()->isZombie();
 
358
    }
 
359
#endif
346
360
} // namespace JSC
347
361
 
348
362
#endif // JSCell_h