global->Set(v8::String::New("print"), printFn);
global->Set(v8::String::New("console"), console);
global->Set(v8::String::New("Qt"), qt);
+ global->Set(v8::String::New("gc"), V8FUNCTION(gc, this));
// XXX mainthread only
m_xmlHttpRequestData = qt_add_qmlxmlhttprequest(this);
test->Run();
}
+void QV8Engine::gc()
+{
+ v8::V8::LowMemoryNotification();
+ while (!v8::V8::IdleNotification()) {}
+}
+
+v8::Handle<v8::Value> QV8Engine::gc(const v8::Arguments &args)
+{
+ gc();
+ return v8::Undefined();
+}
+
v8::Handle<v8::Value> QV8Engine::print(const v8::Arguments &args)
{
QString result;
// Return the list of illegal id names (the names of the properties on the global object)
const QSet<QString> &illegalNames() const;
+ static void gc();
+
private:
QDeclarativeEngine *m_engine;
v8::Persistent<v8::Context> m_context;
void initializeGlobal(v8::Handle<v8::Object>);
void freezeGlobal();
+ static v8::Handle<v8::Value> gc(const v8::Arguments &args);
static v8::Handle<v8::Value> print(const v8::Arguments &args);
static v8::Handle<v8::Value> isQtObject(const v8::Arguments &args);
static v8::Handle<v8::Value> rgba(const v8::Arguments &args);