source: webkit/trunk/JavaScriptCore/kjs/JSGlobalObject.cpp@ 34659

Last change on this file since 34659 was 34659, checked in by [email protected], 17 years ago

Reviewed by Darin.

Prepare JavaScript heap for being per-thread.

  • Property svn:eol-style set to native
File size: 20.1 KB
Line 
1/*
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Cameron Zwarich ([email protected])
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
15 * its contributors may be used to endorse or promote products derived
16 * from this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
19 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
22 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
30#include "config.h"
31#include "JSGlobalObject.h"
32
33#include "CodeBlock.h"
34#include "ArrayPrototype.h"
35#include "BooleanObject.h"
36#include "date_object.h"
37#include "debugger.h"
38#include "error_object.h"
39#include "FunctionPrototype.h"
40#include "MathObject.h"
41#include "NumberObject.h"
42#include "object_object.h"
43#include "RegExpObject.h"
44#include "ScopeChainMark.h"
45#include "string_object.h"
46
47#if HAVE(SYS_TIME_H)
48#include <sys/time.h>
49#endif
50
51#if PLATFORM(WIN_OS)
52#include <windows.h>
53#endif
54
55#if PLATFORM(QT)
56#include <QDateTime>
57#endif
58
59namespace KJS {
60
61// Default number of ticks before a timeout check should be done.
62static const int initialTickCountThreshold = 255;
63
64// Preferred number of milliseconds between each timeout check
65static const int preferredScriptCheckTimeInterval = 1000;
66
67static inline void markIfNeeded(JSValue* v)
68{
69 if (v && !v->marked())
70 v->mark();
71}
72
73// Returns the current time in milliseconds
74// It doesn't matter what "current time" is here, just as long as
75// it's possible to measure the time difference correctly.
76static inline unsigned getCurrentTime()
77{
78#if HAVE(SYS_TIME_H)
79 struct timeval tv;
80 gettimeofday(&tv, 0);
81 return tv.tv_sec * 1000 + tv.tv_usec / 1000;
82#elif PLATFORM(QT)
83 QDateTime t = QDateTime::currentDateTime();
84 return t.toTime_t() * 1000 + t.time().msec();
85#elif PLATFORM(WIN_OS)
86 return timeGetTime();
87#else
88#error Platform does not have getCurrentTime function
89#endif
90}
91
92JSGlobalObject::~JSGlobalObject()
93{
94 if (d()->debugger)
95 d()->debugger->detach(this);
96
97 d()->next->d()->prev = d()->prev;
98 d()->prev->d()->next = d()->next;
99 JSGlobalObject*& headObject = head();
100 if (headObject == this)
101 headObject = d()->next;
102 if (headObject == this)
103 headObject = 0;
104
105 HashSet<ProgramCodeBlock*>::const_iterator end = codeBlocks().end();
106 for (HashSet<ProgramCodeBlock*>::const_iterator it = codeBlocks().begin(); it != end; ++it)
107 (*it)->globalObject = 0;
108
109 delete d();
110}
111
112void JSGlobalObject::init(JSObject* thisValue)
113{
114 ASSERT(JSLock::currentThreadIsHoldingLock());
115
116 if (JSGlobalObject*& headObject = head()) {
117 d()->prev = headObject;
118 d()->next = headObject->d()->next;
119 headObject->d()->next->d()->prev = this;
120 headObject->d()->next = this;
121 } else
122 headObject = d()->next = d()->prev = this;
123
124 resetTimeoutCheck();
125 d()->timeoutTime = 0;
126 d()->timeoutCheckCount = 0;
127
128 d()->recursion = 0;
129 d()->debugger = 0;
130
131 d()->globalData = &JSGlobalData::threadInstance();
132
133 d()->globalExec.set(new ExecState(this, thisValue, d()->globalScopeChain.node()));
134
135 d()->pageGroupIdentifier = 0;
136
137 reset(prototype());
138}
139
140void JSGlobalObject::put(ExecState* exec, const Identifier& propertyName, JSValue* value)
141{
142 ASSERT(!Heap::heap(value) || Heap::heap(value) == Heap::heap(this));
143
144 if (symbolTablePut(propertyName, value))
145 return;
146 return JSVariableObject::put(exec, propertyName, value);
147}
148
149void JSGlobalObject::putWithAttributes(ExecState* exec, const Identifier& propertyName, JSValue* value, unsigned attributes)
150{
151 if (symbolTablePutWithAttributes(propertyName, value, attributes))
152 return;
153
154 JSValue* valueBefore = getDirect(propertyName);
155 JSVariableObject::put(exec, propertyName, value);
156 if (!valueBefore) {
157 if (JSValue* valueAfter = getDirect(propertyName))
158 putDirect(propertyName, valueAfter, attributes);
159 }
160}
161
162void JSGlobalObject::defineGetter(ExecState* exec, const Identifier& propertyName, JSObject* getterFunc)
163{
164 PropertySlot slot;
165 if (!symbolTableGet(propertyName, slot))
166 JSVariableObject::defineGetter(exec, propertyName, getterFunc);
167}
168
169void JSGlobalObject::defineSetter(ExecState* exec, const Identifier& propertyName, JSObject* setterFunc)
170{
171 PropertySlot slot;
172 if (!symbolTableGet(propertyName, slot))
173 JSVariableObject::defineSetter(exec, propertyName, setterFunc);
174}
175
176static inline JSObject* lastInPrototypeChain(JSObject* object)
177{
178 JSObject* o = object;
179 while (o->prototype()->isObject())
180 o = static_cast<JSObject*>(o->prototype());
181 return o;
182}
183
184void JSGlobalObject::reset(JSValue* prototype)
185{
186 // Clear before inititalizing, to avoid calling mark() on stale pointers --
187 // which would be wasteful -- or uninitialized pointers -- which would be
188 // dangerous. (The allocations below may cause a GC.)
189
190 _prop.clear();
191 registerFileStack().current()->clear();
192 registerFileStack().current()->addGlobalSlots(1);
193 symbolTable().clear();
194
195 // Prototypes
196 d()->functionPrototype = 0;
197 d()->objectPrototype = 0;
198
199 d()->arrayPrototype = 0;
200 d()->stringPrototype = 0;
201 d()->booleanPrototype = 0;
202 d()->numberPrototype = 0;
203 d()->datePrototype = 0;
204 d()->regExpPrototype = 0;
205 d()->errorPrototype = 0;
206
207 d()->evalErrorPrototype = 0;
208 d()->rangeErrorPrototype = 0;
209 d()->referenceErrorPrototype = 0;
210 d()->syntaxErrorPrototype = 0;
211 d()->typeErrorPrototype = 0;
212 d()->URIErrorPrototype = 0;
213
214 // Constructors
215 d()->objectConstructor = 0;
216 d()->functionConstructor = 0;
217 d()->arrayConstructor = 0;
218 d()->stringConstructor = 0;
219 d()->booleanConstructor = 0;
220 d()->numberConstructor = 0;
221 d()->dateConstructor = 0;
222 d()->regExpConstructor = 0;
223 d()->errorConstructor = 0;
224
225 d()->evalErrorConstructor = 0;
226 d()->rangeErrorConstructor = 0;
227 d()->referenceErrorConstructor = 0;
228 d()->syntaxErrorConstructor = 0;
229 d()->typeErrorConstructor = 0;
230 d()->URIErrorConstructor = 0;
231
232 d()->evalFunction = 0;
233
234 ExecState* exec = d()->globalExec.get();
235
236 // Prototypes
237 d()->functionPrototype = new (exec) FunctionPrototype(exec);
238 d()->objectPrototype = new (exec) ObjectPrototype(exec, d()->functionPrototype);
239 d()->functionPrototype->setPrototype(d()->objectPrototype);
240
241 d()->arrayPrototype = new (exec) ArrayPrototype(exec, d()->objectPrototype);
242 d()->stringPrototype = new (exec) StringPrototype(exec, d()->objectPrototype);
243 d()->booleanPrototype = new (exec) BooleanPrototype(exec, d()->objectPrototype, d()->functionPrototype);
244 d()->numberPrototype = new (exec) NumberPrototype(exec, d()->objectPrototype, d()->functionPrototype);
245 d()->datePrototype = new (exec) DatePrototype(exec, d()->objectPrototype);
246 d()->regExpPrototype = new (exec) RegExpPrototype(exec, d()->objectPrototype, d()->functionPrototype);
247 d()->errorPrototype = new (exec) ErrorPrototype(exec, d()->objectPrototype, d()->functionPrototype);
248
249 d()->evalErrorPrototype = new (exec) NativeErrorPrototype(exec, d()->errorPrototype, "EvalError", "EvalError");
250 d()->rangeErrorPrototype = new (exec) NativeErrorPrototype(exec, d()->errorPrototype, "RangeError", "RangeError");
251 d()->referenceErrorPrototype = new (exec) NativeErrorPrototype(exec, d()->errorPrototype, "ReferenceError", "ReferenceError");
252 d()->syntaxErrorPrototype = new (exec) NativeErrorPrototype(exec, d()->errorPrototype, "SyntaxError", "SyntaxError");
253 d()->typeErrorPrototype = new (exec) NativeErrorPrototype(exec, d()->errorPrototype, "TypeError", "TypeError");
254 d()->URIErrorPrototype = new (exec) NativeErrorPrototype(exec, d()->errorPrototype, "URIError", "URIError");
255
256 // Constructors
257 d()->objectConstructor = new (exec) ObjectConstructor(exec, d()->objectPrototype, d()->functionPrototype);
258 d()->functionConstructor = new (exec) FunctionConstructor(exec, d()->functionPrototype);
259 d()->arrayConstructor = new (exec) ArrayConstructor(exec, d()->functionPrototype, d()->arrayPrototype);
260 d()->stringConstructor = new (exec) StringConstructor(exec, d()->functionPrototype, d()->stringPrototype);
261 d()->booleanConstructor = new (exec) BooleanConstructor(exec, d()->functionPrototype, d()->booleanPrototype);
262 d()->numberConstructor = new (exec) NumberConstructor(exec, d()->functionPrototype, d()->numberPrototype);
263 d()->dateConstructor = new (exec) DateConstructor(exec, d()->functionPrototype, d()->datePrototype);
264 d()->regExpConstructor = new (exec) RegExpConstructor(exec, d()->functionPrototype, d()->regExpPrototype);
265 d()->errorConstructor = new (exec) ErrorConstructor(exec, d()->functionPrototype, d()->errorPrototype);
266
267 d()->evalErrorConstructor = new (exec) NativeErrorConstructor(exec, d()->functionPrototype, d()->evalErrorPrototype);
268 d()->rangeErrorConstructor = new (exec) NativeErrorConstructor(exec, d()->functionPrototype, d()->rangeErrorPrototype);
269 d()->referenceErrorConstructor = new (exec) NativeErrorConstructor(exec, d()->functionPrototype, d()->referenceErrorPrototype);
270 d()->syntaxErrorConstructor = new (exec) NativeErrorConstructor(exec, d()->functionPrototype, d()->syntaxErrorPrototype);
271 d()->typeErrorConstructor = new (exec) NativeErrorConstructor(exec, d()->functionPrototype, d()->typeErrorPrototype);
272 d()->URIErrorConstructor = new (exec) NativeErrorConstructor(exec, d()->functionPrototype, d()->URIErrorPrototype);
273
274 d()->functionPrototype->putDirect(exec->propertyNames().constructor, d()->functionConstructor, DontEnum);
275
276 d()->objectPrototype->putDirect(exec->propertyNames().constructor, d()->objectConstructor, DontEnum);
277 d()->functionPrototype->putDirect(exec->propertyNames().constructor, d()->functionConstructor, DontEnum);
278 d()->arrayPrototype->putDirect(exec->propertyNames().constructor, d()->arrayConstructor, DontEnum);
279 d()->booleanPrototype->putDirect(exec->propertyNames().constructor, d()->booleanConstructor, DontEnum);
280 d()->stringPrototype->putDirect(exec->propertyNames().constructor, d()->stringConstructor, DontEnum);
281 d()->numberPrototype->putDirect(exec->propertyNames().constructor, d()->numberConstructor, DontEnum);
282 d()->datePrototype->putDirect(exec->propertyNames().constructor, d()->dateConstructor, DontEnum);
283 d()->regExpPrototype->putDirect(exec->propertyNames().constructor, d()->regExpConstructor, DontEnum);
284 d()->errorPrototype->putDirect(exec->propertyNames().constructor, d()->errorConstructor, DontEnum);
285 d()->evalErrorPrototype->putDirect(exec->propertyNames().constructor, d()->evalErrorConstructor, DontEnum);
286 d()->rangeErrorPrototype->putDirect(exec->propertyNames().constructor, d()->rangeErrorConstructor, DontEnum);
287 d()->referenceErrorPrototype->putDirect(exec->propertyNames().constructor, d()->referenceErrorConstructor, DontEnum);
288 d()->syntaxErrorPrototype->putDirect(exec->propertyNames().constructor, d()->syntaxErrorConstructor, DontEnum);
289 d()->typeErrorPrototype->putDirect(exec->propertyNames().constructor, d()->typeErrorConstructor, DontEnum);
290 d()->URIErrorPrototype->putDirect(exec->propertyNames().constructor, d()->URIErrorConstructor, DontEnum);
291
292 // Set global constructors
293
294 // FIXME: These properties could be handled by a static hash table.
295
296 putDirect(Identifier(exec, "Object"), d()->objectConstructor, DontEnum);
297 putDirect(Identifier(exec, "Function"), d()->functionConstructor, DontEnum);
298 putDirect(Identifier(exec, "Array"), d()->arrayConstructor, DontEnum);
299 putDirect(Identifier(exec, "Boolean"), d()->booleanConstructor, DontEnum);
300 putDirect(Identifier(exec, "String"), d()->stringConstructor, DontEnum);
301 putDirect(Identifier(exec, "Number"), d()->numberConstructor, DontEnum);
302 putDirect(Identifier(exec, "Date"), d()->dateConstructor, DontEnum);
303 putDirect(Identifier(exec, "RegExp"), d()->regExpConstructor, DontEnum);
304 putDirect(Identifier(exec, "Error"), d()->errorConstructor, DontEnum);
305 putDirect(Identifier(exec, "EvalError"), d()->evalErrorConstructor);
306 putDirect(Identifier(exec, "RangeError"), d()->rangeErrorConstructor);
307 putDirect(Identifier(exec, "ReferenceError"), d()->referenceErrorConstructor);
308 putDirect(Identifier(exec, "SyntaxError"), d()->syntaxErrorConstructor);
309 putDirect(Identifier(exec, "TypeError"), d()->typeErrorConstructor);
310 putDirect(Identifier(exec, "URIError"), d()->URIErrorConstructor);
311
312 // Set global values.
313 GlobalPropertyInfo staticGlobals[] = {
314 GlobalPropertyInfo(Identifier(exec, "Math"), new (exec) MathObject(exec, d()->objectPrototype), DontEnum | DontDelete),
315 GlobalPropertyInfo(Identifier(exec, "NaN"), jsNaN(exec), DontEnum | DontDelete),
316 GlobalPropertyInfo(Identifier(exec, "Infinity"), jsNumber(exec, Inf), DontEnum | DontDelete),
317 GlobalPropertyInfo(Identifier(exec, "undefined"), jsUndefined(), DontEnum | DontDelete)
318 };
319
320 addStaticGlobals(staticGlobals, sizeof(staticGlobals) / sizeof(GlobalPropertyInfo));
321
322 // Set global functions.
323
324 d()->evalFunction = new (exec) PrototypeReflexiveFunction(exec, d()->functionPrototype, 1, exec->propertyNames().eval, globalFuncEval, this);
325 putDirectFunction(d()->evalFunction, DontEnum);
326 putDirectFunction(new (exec) PrototypeFunction(exec, d()->functionPrototype, 2, Identifier(exec, "parseInt"), globalFuncParseInt), DontEnum);
327 putDirectFunction(new (exec) PrototypeFunction(exec, d()->functionPrototype, 1, Identifier(exec, "parseFloat"), globalFuncParseFloat), DontEnum);
328 putDirectFunction(new (exec) PrototypeFunction(exec, d()->functionPrototype, 1, Identifier(exec, "isNaN"), globalFuncIsNaN), DontEnum);
329 putDirectFunction(new (exec) PrototypeFunction(exec, d()->functionPrototype, 1, Identifier(exec, "isFinite"), globalFuncIsFinite), DontEnum);
330 putDirectFunction(new (exec) PrototypeFunction(exec, d()->functionPrototype, 1, Identifier(exec, "escape"), globalFuncEscape), DontEnum);
331 putDirectFunction(new (exec) PrototypeFunction(exec, d()->functionPrototype, 1, Identifier(exec, "unescape"), globalFuncUnescape), DontEnum);
332 putDirectFunction(new (exec) PrototypeFunction(exec, d()->functionPrototype, 1, Identifier(exec, "decodeURI"), globalFuncDecodeURI), DontEnum);
333 putDirectFunction(new (exec) PrototypeFunction(exec, d()->functionPrototype, 1, Identifier(exec, "decodeURIComponent"), globalFuncDecodeURIComponent), DontEnum);
334 putDirectFunction(new (exec) PrototypeFunction(exec, d()->functionPrototype, 1, Identifier(exec, "encodeURI"), globalFuncEncodeURI), DontEnum);
335 putDirectFunction(new (exec) PrototypeFunction(exec, d()->functionPrototype, 1, Identifier(exec, "encodeURIComponent"), globalFuncEncodeURIComponent), DontEnum);
336#ifndef NDEBUG
337 putDirectFunction(new (exec) PrototypeFunction(exec, d()->functionPrototype, 1, Identifier(exec, "kjsprint"), globalFuncKJSPrint), DontEnum);
338#endif
339
340 // Set prototype, and also insert the object prototype at the end of the chain.
341
342 setPrototype(prototype);
343 lastInPrototypeChain(this)->setPrototype(d()->objectPrototype);
344}
345
346void JSGlobalObject::startTimeoutCheck()
347{
348 if (!d()->timeoutCheckCount)
349 resetTimeoutCheck();
350
351 ++d()->timeoutCheckCount;
352}
353
354void JSGlobalObject::stopTimeoutCheck()
355{
356 --d()->timeoutCheckCount;
357}
358
359void JSGlobalObject::resetTimeoutCheck()
360{
361 d()->tickCount = 0;
362 d()->ticksUntilNextTimeoutCheck = initialTickCountThreshold;
363 d()->timeAtLastCheckTimeout = 0;
364 d()->timeExecuting = 0;
365}
366
367bool JSGlobalObject::checkTimeout()
368{
369 d()->tickCount = 0;
370
371 unsigned currentTime = getCurrentTime();
372
373 if (!d()->timeAtLastCheckTimeout) {
374 // Suspicious amount of looping in a script -- start timing it
375 d()->timeAtLastCheckTimeout = currentTime;
376 return false;
377 }
378
379 unsigned timeDiff = currentTime - d()->timeAtLastCheckTimeout;
380
381 if (timeDiff == 0)
382 timeDiff = 1;
383
384 d()->timeExecuting += timeDiff;
385 d()->timeAtLastCheckTimeout = currentTime;
386
387 // Adjust the tick threshold so we get the next checkTimeout call in the interval specified in
388 // preferredScriptCheckTimeInterval
389 d()->ticksUntilNextTimeoutCheck = (unsigned)((float)preferredScriptCheckTimeInterval / timeDiff) * d()->ticksUntilNextTimeoutCheck;
390
391 // If the new threshold is 0 reset it to the default threshold. This can happen if the timeDiff is higher than the
392 // preferred script check time interval.
393 if (d()->ticksUntilNextTimeoutCheck == 0)
394 d()->ticksUntilNextTimeoutCheck = initialTickCountThreshold;
395
396 if (d()->timeoutTime && d()->timeExecuting > d()->timeoutTime) {
397 if (shouldInterruptScript())
398 return true;
399
400 resetTimeoutCheck();
401 }
402
403 return false;
404}
405
406void JSGlobalObject::mark()
407{
408 JSVariableObject::mark();
409
410 HashSet<ProgramCodeBlock*>::const_iterator end = codeBlocks().end();
411 for (HashSet<ProgramCodeBlock*>::const_iterator it = codeBlocks().begin(); it != end; ++it)
412 (*it)->mark();
413
414 registerFileStack().mark(globalData()->heap);
415
416 markIfNeeded(d()->globalExec->exception());
417
418 markIfNeeded(d()->objectConstructor);
419 markIfNeeded(d()->functionConstructor);
420 markIfNeeded(d()->arrayConstructor);
421 markIfNeeded(d()->booleanConstructor);
422 markIfNeeded(d()->stringConstructor);
423 markIfNeeded(d()->numberConstructor);
424 markIfNeeded(d()->dateConstructor);
425 markIfNeeded(d()->regExpConstructor);
426 markIfNeeded(d()->errorConstructor);
427 markIfNeeded(d()->evalErrorConstructor);
428 markIfNeeded(d()->rangeErrorConstructor);
429 markIfNeeded(d()->referenceErrorConstructor);
430 markIfNeeded(d()->syntaxErrorConstructor);
431 markIfNeeded(d()->typeErrorConstructor);
432 markIfNeeded(d()->URIErrorConstructor);
433
434 markIfNeeded(d()->evalFunction);
435
436 markIfNeeded(d()->objectPrototype);
437 markIfNeeded(d()->functionPrototype);
438 markIfNeeded(d()->arrayPrototype);
439 markIfNeeded(d()->booleanPrototype);
440 markIfNeeded(d()->stringPrototype);
441 markIfNeeded(d()->numberPrototype);
442 markIfNeeded(d()->datePrototype);
443 markIfNeeded(d()->regExpPrototype);
444 markIfNeeded(d()->errorPrototype);
445 markIfNeeded(d()->evalErrorPrototype);
446 markIfNeeded(d()->rangeErrorPrototype);
447 markIfNeeded(d()->referenceErrorPrototype);
448 markIfNeeded(d()->syntaxErrorPrototype);
449 markIfNeeded(d()->typeErrorPrototype);
450 markIfNeeded(d()->URIErrorPrototype);
451}
452
453JSGlobalObject* JSGlobalObject::toGlobalObject(ExecState*) const
454{
455 return const_cast<JSGlobalObject*>(this);
456}
457
458ExecState* JSGlobalObject::globalExec()
459{
460 return d()->globalExec.get();
461}
462
463bool JSGlobalObject::isDynamicScope() const
464{
465 return true;
466}
467
468void* JSGlobalObject::operator new(size_t size)
469{
470#ifdef JAVASCRIPTCORE_BUILDING_ALL_IN_ONE_FILE
471 return JSGlobalData::threadInstance().heap->inlineAllocate(size);
472#else
473 return JSGlobalData::threadInstance().heap->allocate(size);
474#endif
475}
476
477void* JSGlobalObject::operator new(size_t size, SharedTag)
478{
479#ifdef JAVASCRIPTCORE_BUILDING_ALL_IN_ONE_FILE
480 return JSGlobalData::sharedInstance().heap->inlineAllocate(size);
481#else
482 return JSGlobalData::sharedInstance().heap->allocate(size);
483#endif
484}
485
486} // namespace KJS
Note: See TracBrowser for help on using the repository browser.