fix allocator loss when exec large script
This commit is contained in:
@@ -102,6 +102,7 @@ QJSValue DoricJSEngine::invokeDoricMethod(QString method,
|
||||
void DoricJSEngine::loadBuiltinJS(QString assetName) {
|
||||
QString script = DoricUtils::readAssetFile("/doric", assetName);
|
||||
QString result = mJSE->loadJS(script, "Assets://" + assetName);
|
||||
qDebug() << result;
|
||||
}
|
||||
|
||||
QString DoricJSEngine::packageContextScript(QString contextId,
|
||||
|
@@ -2,13 +2,13 @@
|
||||
#define NATIVE_JSE_H
|
||||
|
||||
#include "DoricInterfaceJSE.h"
|
||||
#include "native/NativeExecutor.h"
|
||||
//#include "native/NativeExecutor.h"
|
||||
#include "v8/V8Executor.h"
|
||||
|
||||
class DoricNativeJSE : public DoricInterfaceJSE {
|
||||
private:
|
||||
V8Executor *v8Executor;
|
||||
NativeExecutor *nativeExecutor;
|
||||
// NativeExecutor *nativeExecutor;
|
||||
|
||||
public:
|
||||
DoricNativeJSE();
|
||||
|
@@ -1,10 +1,7 @@
|
||||
#include "V8Executor.h"
|
||||
#include "JSValueHelper.h"
|
||||
|
||||
#include <QThread>
|
||||
|
||||
V8Executor::V8Executor() {
|
||||
std::unique_ptr<v8::Platform> platform = v8::platform::NewDefaultPlatform();
|
||||
V8Executor::V8Executor() : platform(v8::platform::NewDefaultPlatform()) {
|
||||
v8::V8::InitializePlatform(platform.get());
|
||||
v8::V8::Initialize();
|
||||
|
||||
|
@@ -10,6 +10,7 @@
|
||||
class V8Executor {
|
||||
|
||||
private:
|
||||
std::unique_ptr<v8::Platform> platform;
|
||||
v8::Isolate::CreateParams create_params;
|
||||
v8::Isolate *m_isolate;
|
||||
v8::Isolate::Scope *m_isolate_scope;
|
||||
|
Reference in New Issue
Block a user