fix allocator loss when exec large script

This commit is contained in:
王劲鹏 2021-03-31 16:25:11 +08:00 committed by osborn
parent 8bb7fdb66b
commit f6f25f6344
5 changed files with 7 additions and 7 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.14.1, 2021-03-31T10:31:13. -->
<!-- Written by QtCreator 4.14.1, 2021-03-31T15:12:05. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
@ -523,6 +523,7 @@
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default">C:/Users/maverick/Workspace/Doric/doric-Qt/build-doric-Desktop_Qt_6_0_1_MinGW_64_bit-Debug</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>

View File

@ -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,

View File

@ -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();

View File

@ -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();

View File

@ -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;