aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jit/qv4baselineassembler_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jit/qv4baselineassembler_p.h')
-rw-r--r--src/qml/jit/qv4baselineassembler_p.h74
1 files changed, 20 insertions, 54 deletions
diff --git a/src/qml/jit/qv4baselineassembler_p.h b/src/qml/jit/qv4baselineassembler_p.h
index 0aa508ae71..888c402edc 100644
--- a/src/qml/jit/qv4baselineassembler_p.h
+++ b/src/qml/jit/qv4baselineassembler_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QV4BASELINEASSEMBLER_P_H
#define QV4BASELINEASSEMBLER_P_H
@@ -55,21 +19,18 @@
#include <private/qv4function_p.h>
#include <QHash>
+#if QT_CONFIG(qml_jit)
+
QT_BEGIN_NAMESPACE
namespace QV4 {
namespace JIT {
-#define JIT_STRINGIFYx(s) #s
-#define JIT_STRINGIFY(s) JIT_STRINGIFYx(s)
-
#define GENERATE_RUNTIME_CALL(function, destination) \
- callRuntime(JIT_STRINGIFY(function), \
- reinterpret_cast<void *>(&function), \
+ callRuntime(reinterpret_cast<void *>(&Runtime::function::call), \
destination)
#define GENERATE_TAIL_CALL(function) \
- tailCallRuntime(JIT_STRINGIFY(function), \
- reinterpret_cast<void *>(&function))
+ tailCallRuntime(reinterpret_cast<void *>(&function))
class BaselineAssembler {
public:
@@ -135,11 +96,12 @@ public:
void cmpStrictNotEqual(int lhs);
// jumps
- void jump(int offset);
- void jumpTrue(int offset);
- void jumpFalse(int offset);
- void jumpNoException(int offset);
- void jumpNotUndefined(int offset);
+ Q_REQUIRED_RESULT int jump(int offset);
+ Q_REQUIRED_RESULT int jumpTrue(int offset);
+ Q_REQUIRED_RESULT int jumpFalse(int offset);
+ Q_REQUIRED_RESULT int jumpNoException(int offset);
+ Q_REQUIRED_RESULT int jumpNotUndefined(int offset);
+ Q_REQUIRED_RESULT int jumpEqNull(int offset);
// stuff for runtime calls
void prepareCallWithArgCount(int argc);
@@ -150,8 +112,10 @@ public:
void passJSSlotAsArg(int reg, int arg);
void passCppFrameAsArg(int arg);
void passInt32AsArg(int value, int arg);
- void callRuntime(const char *functionName, const void *funcPtr, CallResultDestination dest);
+ void passPointerAsArg(void *ptr, int arg);
+ void callRuntime(const void *funcPtr, CallResultDestination dest);
void saveAccumulatorInFrame();
+ void loadAccumulatorFromFrame();
void jsTailCall(int func, int thisObject, int argc, int argv);
// exception/context stuff
@@ -159,10 +123,10 @@ public:
void gotoCatchException();
void getException();
void setException();
- void setUnwindHandler(int offset);
+ Q_REQUIRED_RESULT int setUnwindHandler(int offset);
void clearUnwindHandler();
void unwindDispatch();
- void unwindToLabel(int level, int offset);
+ Q_REQUIRED_RESULT int unwindToLabel(int level, int offset);
void pushCatchContext(int index, int name);
void popContext();
void deadTemporalZoneCheck(int offsetForSavedIP, int variableName);
@@ -175,7 +139,7 @@ protected:
private:
typedef unsigned(*CmpFunc)(const Value&,const Value&);
- void cmp(int cond, CmpFunc function, const char *functionName, int lhs);
+ void cmp(int cond, CmpFunc function, int lhs);
};
} // namespace JIT
@@ -183,4 +147,6 @@ private:
QT_END_NAMESPACE
+#endif // QT_CONFIG(qml_jit)
+
#endif // QV4BASELINEASSEMBLER_P_H