Ignore:
Timestamp:
May 2, 2008, 3:07:53 AM (17 years ago)
Author:
[email protected]
Message:

Reviewed by Geoffrey Garen.

https://bugs.webkit.org/show_bug.cgi?id=18826
Make JavaScript heap per-thread

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/testkjs.cpp

    r31404 r32807  
    132132GlobalObject::GlobalObject(Vector<UString>& arguments)
    133133{
    134     putDirectFunction(new PrototypeFunction(globalExec(), functionPrototype(), 1, "debug", functionDebug));
    135     putDirectFunction(new PrototypeFunction(globalExec(), functionPrototype(), 1, "print", functionPrint));
    136     putDirectFunction(new PrototypeFunction(globalExec(), functionPrototype(), 0, "quit", functionQuit));
    137     putDirectFunction(new PrototypeFunction(globalExec(), functionPrototype(), 0, "gc", functionGC));
    138     putDirectFunction(new PrototypeFunction(globalExec(), functionPrototype(), 1, "version", functionVersion));
    139     putDirectFunction(new PrototypeFunction(globalExec(), functionPrototype(), 1, "run", functionRun));
    140     putDirectFunction(new PrototypeFunction(globalExec(), functionPrototype(), 1, "load", functionLoad));
    141     putDirectFunction(new PrototypeFunction(globalExec(), functionPrototype(), 0, "readline", functionReadline));
     134    putDirectFunction(new (globalExec()) PrototypeFunction(globalExec(), functionPrototype(), 1, "debug", functionDebug));
     135    putDirectFunction(new (globalExec()) PrototypeFunction(globalExec(), functionPrototype(), 1, "print", functionPrint));
     136    putDirectFunction(new (globalExec()) PrototypeFunction(globalExec(), functionPrototype(), 0, "quit", functionQuit));
     137    putDirectFunction(new (globalExec()) PrototypeFunction(globalExec(), functionPrototype(), 0, "gc", functionGC));
     138    putDirectFunction(new (globalExec()) PrototypeFunction(globalExec(), functionPrototype(), 1, "version", functionVersion));
     139    putDirectFunction(new (globalExec()) PrototypeFunction(globalExec(), functionPrototype(), 1, "run", functionRun));
     140    putDirectFunction(new (globalExec()) PrototypeFunction(globalExec(), functionPrototype(), 1, "load", functionLoad));
     141    putDirectFunction(new (globalExec()) PrototypeFunction(globalExec(), functionPrototype(), 0, "readline", functionReadline));
    142142
    143143    JSObject* array = arrayConstructor()->construct(globalExec(), globalExec()->emptyList());
    144144    for (size_t i = 0; i < arguments.size(); ++i)
    145         array->put(globalExec(), i, jsString(arguments[i]));
     145        array->put(globalExec(), i, jsString(globalExec(), arguments[i]));
    146146    putDirect("arguments", array);
    147147
     
    162162}
    163163
    164 JSValue* functionGC(ExecState*, JSObject*, const List&)
     164JSValue* functionGC(ExecState* exec, JSObject*, const List&)
    165165{
    166166    JSLock lock;
    167     Collector::collect();
     167    exec->heap()->collect();
    168168    return jsUndefined();
    169169}
     
    188188    stopWatch.stop();
    189189
    190     return jsNumber(stopWatch.getElapsedMS());
     190    return jsNumber(exec, stopWatch.getElapsedMS());
    191191}
    192192
     
    203203}
    204204
    205 JSValue* functionReadline(ExecState*, JSObject*, const List&)
     205JSValue* functionReadline(ExecState* exec, JSObject*, const List&)
    206206{
    207207    Vector<char, 256> line;
     
    214214    }
    215215    line.append('\0');
    216     return jsString(line.data());
     216    return jsString(exec, line.data());
    217217}
    218218
     
    346346
    347347#ifndef NDEBUG
    348     Collector::collect();
     348    Heap::threadHeap()->collect();
    349349#endif
    350350
Note: See TracChangeset for help on using the changeset viewer.