godot/modules/gdscript/gdscript_vm.cpp

/**************************************************************************/
/*  gdscript_vm.cpp                                                       */
/**************************************************************************/
/*                         This file is part of:                          */
/*                             GODOT ENGINE                               */
/*                        https://godotengine.org                         */
/**************************************************************************/
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur.                  */
/*                                                                        */
/* Permission is hereby granted, free of charge, to any person obtaining  */
/* a copy of this software and associated documentation files (the        */
/* "Software"), to deal in the Software without restriction, including    */
/* without limitation the rights to use, copy, modify, merge, publish,    */
/* distribute, sublicense, and/or sell copies of the Software, and to     */
/* permit persons to whom the Software is furnished to do so, subject to  */
/* the following conditions:                                              */
/*                                                                        */
/* The above copyright notice and this permission notice shall be         */
/* included in all copies or substantial portions of the Software.        */
/*                                                                        */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,        */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF     */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY   */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,   */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE      */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                 */
/**************************************************************************/

#include "gdscript.h"
#include "gdscript_function.h"
#include "gdscript_lambda_callable.h"

#include "core/os/os.h"

#ifdef DEBUG_ENABLED

static bool _profile_count_as_native(const Object *p_base_obj, const StringName &p_methodname) {}

static String _get_element_type(Variant::Type builtin_type, const StringName &native_type, const Ref<Script> &script_type) {}

static String _get_var_type(const Variant *p_var) {}

void GDScriptFunction::_profile_native_call(uint64_t p_t_taken, const String &p_func_name, const String &p_instance_class_name) {}

#endif // DEBUG_ENABLED

Variant GDScriptFunction::_get_default_variant_for_data_type(const GDScriptDataType &p_data_type) {}

String GDScriptFunction::_get_call_error(const String &p_where, const Variant **p_argptrs, const Variant &p_ret, const Callable::CallError &p_err) const {}

void (*type_init_function_table[])(Variant *) =;

#if defined(__GNUC__) || defined(__clang__)
#define OPCODES_TABLE

#define OPCODE(m_op)
#define OPCODE_WHILE(m_test)
#define OPCODES_END
#define OPCODES_OUT
#define OPCODE_SWITCH(m_test)

#ifdef DEBUG_ENABLED
#define DISPATCH_OPCODE
#else // !DEBUG_ENABLED
#define DISPATCH_OPCODE
#endif // DEBUG_ENABLED

#define OPCODE_BREAK
#define OPCODE_OUT
#else // !(defined(__GNUC__) || defined(__clang__))
#define OPCODES_TABLE
#define OPCODE
#define OPCODE_WHILE
#define OPCODES_END
#define OPCODES_OUT
#define DISPATCH_OPCODE

#ifdef _MSC_VER
#define OPCODE_SWITCH
#else // !_MSC_VER
#define OPCODE_SWITCH
#endif // _MSC_VER

#define OPCODE_BREAK
#define OPCODE_OUT
#endif // defined(__GNUC__) || defined(__clang__)

// Helpers for VariantInternal methods in macros.
#define OP_GET_BOOL
#define OP_GET_INT
#define OP_GET_FLOAT
#define OP_GET_VECTOR2
#define OP_GET_VECTOR2I
#define OP_GET_VECTOR3
#define OP_GET_VECTOR3I
#define OP_GET_RECT2
#define OP_GET_VECTOR4
#define OP_GET_VECTOR4I
#define OP_GET_RECT2I
#define OP_GET_QUATERNION
#define OP_GET_COLOR
#define OP_GET_STRING
#define OP_GET_STRING_NAME
#define OP_GET_NODE_PATH
#define OP_GET_CALLABLE
#define OP_GET_SIGNAL
#define OP_GET_ARRAY
#define OP_GET_DICTIONARY
#define OP_GET_PACKED_BYTE_ARRAY
#define OP_GET_PACKED_INT32_ARRAY
#define OP_GET_PACKED_INT64_ARRAY
#define OP_GET_PACKED_FLOAT32_ARRAY
#define OP_GET_PACKED_FLOAT64_ARRAY
#define OP_GET_PACKED_STRING_ARRAY
#define OP_GET_PACKED_VECTOR2_ARRAY
#define OP_GET_PACKED_VECTOR3_ARRAY
#define OP_GET_PACKED_COLOR_ARRAY
#define OP_GET_PACKED_VECTOR4_ARRAY
#define OP_GET_TRANSFORM3D
#define OP_GET_TRANSFORM2D
#define OP_GET_PROJECTION
#define OP_GET_PLANE
#define OP_GET_AABB
#define OP_GET_BASIS
#define OP_GET_RID

#define METHOD_CALL_ON_NULL_VALUE_ERROR(method_pointer)
#define METHOD_CALL_ON_FREED_INSTANCE_ERROR(method_pointer)

Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_args, int p_argcount, Callable::CallError &r_err, CallState *p_state) {}