Projects
Essentials
lightspark
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 84
View file
lightspark.spec
Changed
@@ -1,7 +1,7 @@ # # spec file for package lightspark # -# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -15,23 +15,22 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # -%if %packman_bs + +%if %{packman_bs} %bcond_without ffmpeg %bcond_without rtmp %else %bcond_with ffmpeg %bcond_with rtmp %endif - Name: lightspark -Version: 0.7.2.99+git20150927.1629 +Version: 0.7.2.99+git20151003.1109 Release: 0 Summary: Modern, free, open-source flash player implementation License: LGPL-3.0+ Group: Productivity/Multimedia/Other Url: https://launchpad.net/lightspark/ Source0: lightspark.tar.xz -Patch: build.patch BuildRequires: boost-devel BuildRequires: cmake BuildRequires: desktop-file-utils @@ -58,14 +57,15 @@ BuildRequires: pkgconfig(pango) BuildRequires: pkgconfig(pangocairo) BuildRequires: pkgconfig(sdl) +BuildRequires: pkgconfig(x11) +BuildRequires: pkgconfig(zlib) +Recommends: %{_bindir}/gnash %if 0%{?suse_version} > 1310 BuildRequires: pkgconfig(tinfo) %endif -BuildRequires: pkgconfig(x11) -BuildRequires: pkgconfig(zlib) %if %{with rtmp} -BuildRequires: pkgconfig(librtmp) BuildRequires: pkgconfig(libcrypto) +BuildRequires: pkgconfig(librtmp) BuildRequires: pkgconfig(libssl) %endif %if %{with ffmpeg} @@ -74,7 +74,6 @@ #BuildRequires: pkgconfig(libavutil) BuildRequires: libffmpeg-devel %endif -Recommends: %{_bindir}/gnash %description Lightspark is a modern, free, open-source flash player implementation. @@ -92,7 +91,6 @@ %prep %setup -q -n %{name} -%patch -p1 %build export CFLAGS='%{optflags}' @@ -107,7 +105,7 @@ -DPLUGIN_DIRECTORY=%{_libdir}/browser-plugins \ -DENABLE_LIBAVCODEC=%{?with_ffmpeg:YES}%{!?with_ffmpeg:NO} \ -DENABLE_RTMP=%{?with_rtmp:YES}%{!?with_rtmp:NO} .. -make %{?jobs:-j%jobs} +make %{?_smp_mflags} %install cd build
View file
build.patch
Deleted
@@ -1,1780 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 81b6d9d..0b9790d 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -247,6 +247,9 @@ ENDIF(${LLVM_STRING_VERSION} VERSION_GREATER 3.4) - IF(NOT (${LLVM_STRING_VERSION} VERSION_LESS 3.6)) - ADD_DEFINITIONS(-DLLVM_36) - ENDIF(NOT (${LLVM_STRING_VERSION} VERSION_LESS 3.6)) -+IF(NOT ${LLVM_STRING_VERSION} VERSION_LESS 3.7) -+ ADD_DEFINITIONS(-DLLVM_37) -+ENDIF(NOT ${LLVM_STRING_VERSION} VERSION_LESS 3.7) - INCLUDE(FindZLIB REQUIRED) - INCLUDE(FindFreetype REQUIRED) - IF(NOT(ENABLE_GLES2)) -@@ -312,6 +315,8 @@ IF(ENABLE_LIBAVCODEC) - CHECK_FUNCTION_EXISTS(avcodec_open2 HAVE_AVCODEC_OPEN2) - CHECK_FUNCTION_EXISTS(avformat_close_input HAVE_AVFORMAT_CLOSE_INPUT) - CHECK_FUNCTION_EXISTS(avformat_find_stream_info HAVE_AVFORMAT_FIND_STREAM_INFO) -+ CHECK_FUNCTION_EXISTS(av_frame_alloc HAVE_AV_FRAME_ALLOC) -+ CHECK_FUNCTION_EXISTS(av_frame_unref HAVE_AV_FRAME_UNREF) - CHECK_C_SOURCE_COMPILES("#include <libavcodec/avcodec.h>\nint main() { enum AVCodecID c; return 0; }" HAVE_AVCODECID) - - SET(CMAKE_REQUIRED_FLAGS) -@@ -347,6 +352,12 @@ IF(ENABLE_LIBAVCODEC) - IF(LIBAVRESAMPLE_FOUND) - ADD_DEFINITIONS(-DHAVE_LIBAVRESAMPLE) - ENDIF(LIBAVRESAMPLE_FOUND) -+ IF(HAVE_AV_FRAME_ALLOC) -+ ADD_DEFINITIONS(-DHAVE_AV_FRAME_ALLOC) -+ ENDIF(HAVE_AV_FRAME_ALLOC) -+ IF(HAVE_AV_FRAME_UNREF) -+ ADD_DEFINITIONS(-DHAVE_AV_FRAME_UNREF) -+ ENDIF(HAVE_AV_FRAME_UNREF) - ADD_DEFINITIONS(-DENABLE_LIBAVCODEC) - ENDIF(ENABLE_LIBAVCODEC) - -diff --git a/conf/FindLLVM.cmake b/conf/FindLLVM.cmake -index e60dd4a..0f4f950 100644 ---- a/conf/FindLLVM.cmake -+++ b/conf/FindLLVM.cmake -@@ -57,6 +57,7 @@ else (LLVM_INCLUDE_DIR) - /usr/lib/llvm-3.4/bin - /usr/lib/llvm-3.5/bin - /usr/lib/llvm-3.6/bin -+ /usr/lib/llvm-3.7/bin - ) - - find_program(LLVM_GCC_EXECUTABLE -@@ -177,10 +178,12 @@ else (LLVM_INCLUDE_DIR) - check_include_file_cxx("llvm/DataLayout.h" HAVE_DATALAYOUT_H) - check_include_file_cxx("llvm/IR/DataLayout.h" HAVE_IR_DATALAYOUT_H) - check_include_file_cxx("llvm/IR/Verifier.h" HAVE_IR_VERIFIER_H) -+ check_include_file_cxx("llvm/PassManager.h" HAVE_PASSMANAGER_H) - unset(CMAKE_REQUIRED_INCLUDES) - MESSAGE(STATUS "HAVE_DATALAYOUT_H: " ${HAVE_DATALAYOUT_H}) - MESSAGE(STATUS "HAVE_IR_DATALAYOUT_H: " ${HAVE_IR_DATALAYOUT_H}) - MESSAGE(STATUS "HAVE_IR_VERIFIER_H: " ${HAVE_IR_VERIFIER_H}) -+ MESSAGE(STATUS "HAVE_PASSMANAGER_H: " ${HAVE_PASSMANAGER_H}) - IF(HAVE_DATALAYOUT_H) - ADD_DEFINITIONS(-DHAVE_DATALAYOUT_H) - ENDIF(HAVE_DATALAYOUT_H) -@@ -190,6 +193,9 @@ else (LLVM_INCLUDE_DIR) - IF(HAVE_IR_VERIFIER_H) - ADD_DEFINITIONS(-DHAVE_IR_VERIFIER_H) - ENDIF(HAVE_IR_VERIFIER_H) -+ IF(HAVE_PASSMANAGER_H) -+ ADD_DEFINITIONS(-DHAVE_PASSMANAGER_H) -+ ENDIF(HAVE_PASSMANAGER_H) - - exec_program(${LLVM_CONFIG_EXECUTABLE} ARGS --cxxflags OUTPUT_VARIABLE LLVM_COMPILE_FLAGS ) - MESSAGE(STATUS "LLVM CXX flags: " ${LLVM_COMPILE_FLAGS}) -diff --git a/src/backends/decoder.cpp b/src/backends/decoder.cpp -index fbdfcdb..98151c4 100755 ---- a/src/backends/decoder.cpp -+++ b/src/backends/decoder.cpp -@@ -30,6 +30,14 @@ - #define AVMEDIA_TYPE_AUDIO CODEC_TYPE_AUDIO - #endif - -+#ifndef HAVE_AV_FRAME_ALLOC -+#define av_frame_alloc avcodec_alloc_frame -+#endif -+ -+#ifndef HAVE_AV_FRAME_UNREF -+#define av_frame_unref avcodec_get_frame_defaults -+#endif -+ - using namespace lightspark; - using namespace std; - -@@ -166,7 +174,7 @@ FFMpegVideoDecoder::FFMpegVideoDecoder(LS_VIDEO_CODEC codecId, uint8_t* initdata - else - status=INIT; - -- frameIn=avcodec_alloc_frame(); -+ frameIn=av_frame_alloc(); - } - - FFMpegVideoDecoder::FFMpegVideoDecoder(AVCodecContext* _c, double frameRateHint): -@@ -201,7 +209,7 @@ FFMpegVideoDecoder::FFMpegVideoDecoder(AVCodecContext* _c, double frameRateHint) - if(fillDataAndCheckValidity()) - status=VALID; - -- frameIn=avcodec_alloc_frame(); -+ frameIn=av_frame_alloc(); - } - - FFMpegVideoDecoder::~FFMpegVideoDecoder() -@@ -476,7 +484,7 @@ FFMpegAudioDecoder::FFMpegAudioDecoder(LS_AUDIO_CODEC audioCodec, uint8_t* initd - else - status=INIT; - #if HAVE_AVCODEC_DECODE_AUDIO4 -- frameIn=avcodec_alloc_frame(); -+ frameIn=av_frame_alloc(); - #endif - } - -@@ -502,7 +510,7 @@ FFMpegAudioDecoder::FFMpegAudioDecoder(LS_AUDIO_CODEC lscodec, int sampleRate, i - if(fillDataAndCheckValidity()) - status=VALID; - #if HAVE_AVCODEC_DECODE_AUDIO4 -- frameIn=avcodec_alloc_frame(); -+ frameIn=av_frame_alloc(); - #endif - } - -@@ -522,7 +530,7 @@ FFMpegAudioDecoder::FFMpegAudioDecoder(AVCodecContext* _c):ownedContext(false),c - if(fillDataAndCheckValidity()) - status=VALID; - #if HAVE_AVCODEC_DECODE_AUDIO4 -- frameIn=avcodec_alloc_frame(); -+ frameIn=av_frame_alloc(); - #endif - } - -@@ -607,7 +615,7 @@ uint32_t FFMpegAudioDecoder::decodeData(uint8_t* data, int32_t datalen, uint32_t - } - - #if HAVE_AVCODEC_DECODE_AUDIO4 -- avcodec_get_frame_defaults(frameIn); -+ av_frame_unref(frameIn); - int frameOk=0; - int32_t ret=avcodec_decode_audio4(codecContext, frameIn, &frameOk, &pkt); - if(frameOk==0) -@@ -664,7 +672,7 @@ uint32_t FFMpegAudioDecoder::decodePacket(AVPacket* pkt, uint32_t time) - int maxLen=AVCODEC_MAX_AUDIO_FRAME_SIZE; - - #if HAVE_AVCODEC_DECODE_AUDIO4 -- avcodec_get_frame_defaults(frameIn); -+ av_frame_unref(frameIn); - int frameOk=0; - int ret=avcodec_decode_audio4(codecContext, frameIn, &frameOk, pkt); - if(frameOk==0) -diff --git a/src/backends/security.cpp b/src/backends/security.cpp -index 7cd8236..6eeffd7 100644 ---- a/src/backends/security.cpp -+++ b/src/backends/security.cpp -@@ -1298,7 +1298,7 @@ bool SocketPolicyFile::retrievePolicyFile(vector<unsigned char>& outData) - const char *socket_policy_cmd = "<policy-file-request/>\0"; - unsigned int socket_policy_cmd_len = strlen(socket_policy_cmd)+1; - ssize_t nbytes = sock.sendAll(socket_policy_cmd, socket_policy_cmd_len); -- if (nbytes != socket_policy_cmd_len) -+ if (nbytes != (int)socket_policy_cmd_len) - { - return false; - } -diff --git a/src/scripting/abc.cpp b/src/scripting/abc.cpp -index f159a73..6ce3235 100644 ---- a/src/scripting/abc.cpp -+++ b/src/scripting/abc.cpp -@@ -1641,7 +1641,7 @@ void ABCVm::Run(ABCVm* th) - #else - llvm::JITExceptionHandling = true; - #endif --#ifndef NDEBUG -+#if defined(NDEBUG) && !defined(LLVM_37) - #ifdef LLVM_31 - Opts.JITEmitDebugInfo = true; - #else -@@ -1665,7 +1665,9 @@ void ABCVm::Run(ABCVm* th) - - #ifdef LLVM_36 - th->FPM=new llvm::legacy::FunctionPassManager(th->module); -+#ifndef LLVM_37 - th->FPM->add(new llvm::DataLayoutPass()); -+#endif - #else - th->FPM=new llvm::FunctionPassManager(th->module); - #ifdef LLVM_35 -diff --git a/src/scripting/abc_codesynt.cpp b/src/scripting/abc_codesynt.cpp -index 2eb28fe..d07ccd6 100644 ---- a/src/scripting/abc_codesynt.cpp -+++ b/src/scripting/abc_codesynt.cpp -@@ -26,7 +26,11 @@ - - #include "compat.h" - #include <llvm/ExecutionEngine/ExecutionEngine.h> --#include <llvm/PassManager.h> -+#ifdef HAVE_PASSMANAGER_H -+# include <llvm/PassManager.h> -+#else -+# include <llvm/IR/LegacyPassManager.h> -+#endif - #ifdef HAVE_IR_DATALAYOUT_H - # include <llvm/IR/Constants.h> - # include <llvm/IR/DerivedTypes.h> -@@ -819,13 +823,25 @@ inline llvm::Value* getMultiname(llvm::ExecutionEngine* ex,llvm::IRBuilder<>& Bu - stack_entry rt1=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); - - /*if(rt1.second==STACK_INT) //TODO: for them, first parameter is call_context, not ABCContext -+#ifdef LLVM_37 -+ name = Builder.CreateCall(ex->FindFunctionNamed("getMultiname_i"), {context, rt1.first, mindx}); -+#else - name = Builder.CreateCall3(ex->FindFunctionNamed("getMultiname_i"), context, rt1.first, mindx); -+#endif - else if(rt1.second==STACK_NUMBER) -+#ifdef LLVM_37 -+ name = Builder.CreateCall(ex->FindFunctionNamed("getMultiname_d"), {context, rt1.first, mindx}); -+#else - name = Builder.CreateCall3(ex->FindFunctionNamed("getMultiname_d"), context, rt1.first, mindx); -+#endif - else*/ - { - abstract_value(ex,Builder,rt1); -+#ifdef LLVM_37 -+ name = Builder.CreateCall(ex->FindFunctionNamed("getMultiname"), {context, rt1.first, constnull, mindx}); -+#else - name = Builder.CreateCall4(ex->FindFunctionNamed("getMultiname"), context, rt1.first, constnull, mindx); -+#endif - } - } - else if(rtdata==2) -@@ -834,7 +850,11 @@ inline llvm::Value* getMultiname(llvm::ExecutionEngine* ex,llvm::IRBuilder<>& Bu - stack_entry rt2=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); - abstract_value(ex,Builder,rt1); - abstract_value(ex,Builder,rt2); -+#ifdef LLVM_37 -+ name = Builder.CreateCall(ex->FindFunctionNamed("getMultiname"), {context, rt1.first, rt2.first, mindx}); -+#else - name = Builder.CreateCall4(ex->FindFunctionNamed("getMultiname"), context, rt1.first, rt2.first, mindx); -+#endif - } - else - assert(false); -@@ -1868,7 +1888,11 @@ SyntheticFunction::synt_function method_info::synt_method() - llvm::Value* context=it; - - //let's give access to local data storage -- value=Builder.CreateStructGEP(context,0); -+ value=Builder.CreateStructGEP( -+#ifdef LLVM_37 -+ nullptr, -+#endif -+ context,0); - llvm::Value* locals=Builder.CreateLoad(value); - - //the stack is statically handled as much as possible to allow llvm optimizations -@@ -1876,12 +1900,24 @@ SyntheticFunction::synt_function method_info::synt_method() - vector<stack_entry> static_stack; - static_stack.reserve(body->max_stack); - //Get the pointer to the dynamic stack -- value=Builder.CreateStructGEP(context,1); -+ value=Builder.CreateStructGEP( -+#ifdef LLVM_37 -+ nullptr, -+#endif -+ context,1); - llvm::Value* dynamic_stack=Builder.CreateLoad(value); - //Get the index of the dynamic stack -- llvm::Value* dynamic_stack_index=Builder.CreateStructGEP(context,2); -+ llvm::Value* dynamic_stack_index=Builder.CreateStructGEP( -+#ifdef LLVM_37 -+ nullptr, -+#endif -+ context,2); - -- llvm::Value* exec_pos=Builder.CreateStructGEP(context,3); -+ llvm::Value* exec_pos=Builder.CreateStructGEP( -+#ifdef LLVM_37 -+ nullptr, -+#endif -+ context,3); - - /* //Allocate a fast dynamic stack based on LLVM alloca instruction - //This is used on branches -@@ -2098,7 +2134,11 @@ SyntheticFunction::synt_function method_info::synt_method() - u30 t; - code >> t; - constant = llvm::ConstantInt::get(int_type, t); -+#ifdef LLVM_37 -+ Builder.CreateCall(ex->FindFunctionNamed("getSuper"), {context, constant}); -+#else - Builder.CreateCall2(ex->FindFunctionNamed("getSuper"), context, constant); -+#endif - break; - } - case 0x05: -@@ -2109,7 +2149,11 @@ SyntheticFunction::synt_function method_info::synt_method() - u30 t; - code >> t; - constant = llvm::ConstantInt::get(int_type, t); -+#ifdef LLVM_37 -+ Builder.CreateCall(ex->FindFunctionNamed("setSuper"), {context, constant}); -+#else - Builder.CreateCall2(ex->FindFunctionNamed("setSuper"), context, constant); -+#endif - break; - } - case 0x06: -@@ -2119,7 +2163,11 @@ SyntheticFunction::synt_function method_info::synt_method() - u30 t; - code >> t; - constant = llvm::ConstantInt::get(int_type, t); -+#ifdef LLVM_37 -+ Builder.CreateCall(ex->FindFunctionNamed("dxns"), {context, constant}); -+#else - Builder.CreateCall2(ex->FindFunctionNamed("dxns"), context, constant); -+#endif - break; - } - case 0x07: -@@ -2128,7 +2176,11 @@ SyntheticFunction::synt_function method_info::synt_method() - LOG(LOG_TRACE, _("synt dxnslate") ); - stack_entry v=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); - abstract_value(ex,Builder,v); -+#ifdef LLVM_37 -+ Builder.CreateCall(ex->FindFunctionNamed("dxns"), {context, v.first}); -+#else - Builder.CreateCall2(ex->FindFunctionNamed("dxns"), context, v.first); -+#endif - break; - } - case 0x08: -@@ -2179,7 +2231,11 @@ SyntheticFunction::synt_function method_info::synt_method() - { - abstract_value(ex,Builder,v1); - abstract_value(ex,Builder,v2); -+#ifdef LLVM_37 -+ cond=Builder.CreateCall(ex->FindFunctionNamed("ifNLT"), {v1.first, v2.first}); -+#else - cond=Builder.CreateCall2(ex->FindFunctionNamed("ifNLT"), v1.first, v2.first); -+#endif - } - - syncStacks(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index); -@@ -2212,7 +2268,11 @@ SyntheticFunction::synt_function method_info::synt_method() - - abstract_value(ex,Builder,v1); - abstract_value(ex,Builder,v2); -+#ifdef LLVM_37 -+ llvm::Value* cond=Builder.CreateCall(ex->FindFunctionNamed("ifNLE"), {v1.first, v2.first}); -+#else - llvm::Value* cond=Builder.CreateCall2(ex->FindFunctionNamed("ifNLE"), v1.first, v2.first); -+#endif - - syncStacks(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index); - -@@ -2245,7 +2305,11 @@ SyntheticFunction::synt_function method_info::synt_method() - - abstract_value(ex,Builder,v1); - abstract_value(ex,Builder,v2); -+#ifdef LLVM_37 -+ llvm::Value* cond=Builder.CreateCall(ex->FindFunctionNamed("ifNGT"), {v1.first, v2.first}); -+#else - llvm::Value* cond=Builder.CreateCall2(ex->FindFunctionNamed("ifNGT"), v1.first, v2.first); -+#endif - - syncStacks(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index); - -@@ -2278,7 +2342,11 @@ SyntheticFunction::synt_function method_info::synt_method() - - abstract_value(ex,Builder,v1); - abstract_value(ex,Builder,v2); -+#ifdef LLVM_37 -+ llvm::Value* cond=Builder.CreateCall(ex->FindFunctionNamed("ifNGE"), {v1.first, v2.first}); -+#else - llvm::Value* cond=Builder.CreateCall2(ex->FindFunctionNamed("ifNGE"), v1.first, v2.first); -+#endif - - syncStacks(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index); - -@@ -2401,7 +2469,11 @@ SyntheticFunction::synt_function method_info::synt_method() - llvm::Value* cond; - //Make comparision - if(v1.second==STACK_OBJECT && v2.second==STACK_OBJECT) -+#ifdef LLVM_37 -+ cond=Builder.CreateCall(ex->FindFunctionNamed("ifEq"), {v1.first, v2.first}); -+#else - cond=Builder.CreateCall2(ex->FindFunctionNamed("ifEq"), v1.first, v2.first); -+#endif - else if(v1.second==STACK_INT && v2.second==STACK_NUMBER) - { - v1.first=Builder.CreateSIToFP(v1.first,number_type); -@@ -2411,7 +2483,11 @@ SyntheticFunction::synt_function method_info::synt_method() - { - abstract_value(ex,Builder,v1); - abstract_value(ex,Builder,v2); -+#ifdef LLVM_37 -+ cond=Builder.CreateCall(ex->FindFunctionNamed("ifEq"), {v1.first, v2.first}); -+#else - cond=Builder.CreateCall2(ex->FindFunctionNamed("ifEq"), v1.first, v2.first); -+#endif - } - - syncStacks(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index); -@@ -2444,9 +2520,17 @@ SyntheticFunction::synt_function method_info::synt_method() - stack_entry v2= static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); - llvm::Value* cond; - if(v1.second==STACK_INT && v2.second==STACK_OBJECT) -+#ifdef LLVM_37 -+ cond=Builder.CreateCall(ex->FindFunctionNamed("ifNE_oi"), {v2.first, v1.first}); -+#else - cond=Builder.CreateCall2(ex->FindFunctionNamed("ifNE_oi"), v2.first, v1.first); -+#endif - else if(v1.second==STACK_OBJECT && v2.second==STACK_INT) -+#ifdef LLVM_37 -+ cond=Builder.CreateCall(ex->FindFunctionNamed("ifNE_oi"), {v1.first, v2.first}); -+#else - cond=Builder.CreateCall2(ex->FindFunctionNamed("ifNE_oi"), v1.first, v2.first); -+#endif - else if(v1.second==STACK_INT && v2.second==STACK_NUMBER) - { - v1.first=Builder.CreateSIToFP(v1.first,number_type); -@@ -2461,7 +2545,11 @@ SyntheticFunction::synt_function method_info::synt_method() - //Abstract default - abstract_value(ex,Builder,v1); - abstract_value(ex,Builder,v2); -+#ifdef LLVM_37 -+ cond=Builder.CreateCall(ex->FindFunctionNamed("ifNE"), {v1.first, v2.first}); -+#else - cond=Builder.CreateCall2(ex->FindFunctionNamed("ifNE"), v1.first, v2.first); -+#endif - } - - syncStacks(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index); -@@ -2494,18 +2582,34 @@ SyntheticFunction::synt_function method_info::synt_method() - stack_entry v2= static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); - llvm::Value* cond; - if(v1.second==STACK_OBJECT && v2.second==STACK_OBJECT) -+#ifdef LLVM_37 -+ cond=Builder.CreateCall(ex->FindFunctionNamed("ifLT"), {v1.first, v2.first}); -+#else - cond=Builder.CreateCall2(ex->FindFunctionNamed("ifLT"), v1.first, v2.first); -+#endif - else if(v1.second==STACK_INT && v2.second==STACK_OBJECT) -+#ifdef LLVM_37 -+ cond=Builder.CreateCall(ex->FindFunctionNamed("ifLT_io"), {v1.first, v2.first}); -+#else - cond=Builder.CreateCall2(ex->FindFunctionNamed("ifLT_io"), v1.first, v2.first); -+#endif - else if(v1.second==STACK_OBJECT && v2.second==STACK_INT) -+#ifdef LLVM_37 -+ cond=Builder.CreateCall(ex->FindFunctionNamed("ifLT_oi"), {v1.first, v2.first}); -+#else - cond=Builder.CreateCall2(ex->FindFunctionNamed("ifLT_oi"), v1.first, v2.first); -+#endif - else if(v1.second==STACK_INT && v2.second==STACK_INT) - cond=Builder.CreateICmpSLT(v2.first,v1.first); - else - { - abstract_value(ex,Builder,v1); - abstract_value(ex,Builder,v2); -+#ifdef LLVM_37 -+ cond=Builder.CreateCall(ex->FindFunctionNamed("ifLT"), {v1.first, v2.first}); -+#else - cond=Builder.CreateCall2(ex->FindFunctionNamed("ifLT"), v1.first, v2.first); -+#endif - } - - syncStacks(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index); -@@ -2538,12 +2642,20 @@ SyntheticFunction::synt_function method_info::synt_method() - stack_entry v2=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); - llvm::Value* cond; - if(v1.second==STACK_OBJECT && v2.second==STACK_OBJECT) -+#ifdef LLVM_37 -+ cond=Builder.CreateCall(ex->FindFunctionNamed("ifLE"), {v1.first, v2.first}); -+#else - cond=Builder.CreateCall2(ex->FindFunctionNamed("ifLE"), v1.first, v2.first); -+#endif - else - { - abstract_value(ex,Builder,v1); - abstract_value(ex,Builder,v2); -+#ifdef LLVM_37 -+ cond=Builder.CreateCall(ex->FindFunctionNamed("ifLE"), {v1.first, v2.first}); -+#else - cond=Builder.CreateCall2(ex->FindFunctionNamed("ifLE"), v1.first, v2.first); -+#endif - } - - syncStacks(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index); -@@ -2578,7 +2690,11 @@ SyntheticFunction::synt_function method_info::synt_method() - - abstract_value(ex,Builder,v1); - abstract_value(ex,Builder,v2); -+#ifdef LLVM_37 -+ cond=Builder.CreateCall(ex->FindFunctionNamed("ifGT"), {v1.first, v2.first}); -+#else - cond=Builder.CreateCall2(ex->FindFunctionNamed("ifGT"), v1.first, v2.first); -+#endif - - syncStacks(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index); - -@@ -2612,7 +2728,11 @@ SyntheticFunction::synt_function method_info::synt_method() - - abstract_value(ex,Builder,v1); - abstract_value(ex,Builder,v2); -+#ifdef LLVM_37 -+ cond=Builder.CreateCall(ex->FindFunctionNamed("ifGE"), {v1.first, v2.first}); -+#else - cond=Builder.CreateCall2(ex->FindFunctionNamed("ifGE"), v1.first, v2.first); -+#endif - - syncStacks(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index); - -@@ -2644,7 +2764,11 @@ SyntheticFunction::synt_function method_info::synt_method() - static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index).first; - llvm::Value* v2= - static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index).first; -+#ifdef LLVM_37 -+ llvm::Value* cond=Builder.CreateCall(ex->FindFunctionNamed("ifStrictEq"), {v1, v2}); -+#else - llvm::Value* cond=Builder.CreateCall2(ex->FindFunctionNamed("ifStrictEq"), v1, v2); -+#endif - - syncStacks(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index); - -@@ -2677,7 +2801,11 @@ SyntheticFunction::synt_function method_info::synt_method() - - abstract_value(ex,Builder,v1); - abstract_value(ex,Builder,v2); -+#ifdef LLVM_37 -+ cond=Builder.CreateCall(ex->FindFunctionNamed("ifStrictNE"), {v1.first, v2.first}); -+#else - cond=Builder.CreateCall2(ex->FindFunctionNamed("ifStrictNE"), v1.first, v2.first); -+#endif - - syncStacks(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index); - -@@ -2771,7 +2899,11 @@ SyntheticFunction::synt_function method_info::synt_method() - llvm::Value* v2= - static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index).first; - -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("nextName"), {v1, v2}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("nextName"), v1, v2); -+#endif - static_stack_push(static_stack,stack_entry(value,STACK_OBJECT)); - break; - } -@@ -2800,7 +2932,11 @@ SyntheticFunction::synt_function method_info::synt_method() - llvm::Value* v2= - static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index).first; - -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("nextValue"), {v1, v2}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("nextValue"), v1, v2); -+#endif - static_stack_push(static_stack,stack_entry(value,STACK_OBJECT)); - break; - } -@@ -2898,7 +3034,11 @@ SyntheticFunction::synt_function method_info::synt_method() - u30 t; - code >> t; - constant = llvm::ConstantInt::get(int_type, t); -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("pushString"), {context, constant}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("pushString"), context, constant); -+#endif - static_stack_push(static_stack,stack_entry(value,STACK_OBJECT)); - break; - } -@@ -2911,7 +3051,11 @@ SyntheticFunction::synt_function method_info::synt_method() - if(Log::getLevel()>=LOG_CALLS) - { - constant = llvm::ConstantInt::get(int_type, t); -+#ifdef LLVM_37 -+ Builder.CreateCall(ex->FindFunctionNamed("pushInt"), {context, constant}); -+#else - Builder.CreateCall2(ex->FindFunctionNamed("pushInt"), context, constant); -+#endif - } - s32 i=this->context->constant_pool.integer[t]; - constant = llvm::ConstantInt::get(int_type, i); -@@ -2927,7 +3071,11 @@ SyntheticFunction::synt_function method_info::synt_method() - if(Log::getLevel()>=LOG_CALLS) - { - constant = llvm::ConstantInt::get(int_type, t); -+#ifdef LLVM_37 -+ Builder.CreateCall(ex->FindFunctionNamed("pushUInt"), {context, constant}); -+#else - Builder.CreateCall2(ex->FindFunctionNamed("pushUInt"), context, constant); -+#endif - } - u32 i=this->context->constant_pool.uinteger[t]; - constant = llvm::ConstantInt::get(int_type, i); -@@ -2944,7 +3092,11 @@ SyntheticFunction::synt_function method_info::synt_method() - if(Log::getLevel()>=LOG_CALLS) - { - constant = llvm::ConstantInt::get(int_type, t); -+#ifdef LLVM_37 -+ Builder.CreateCall(ex->FindFunctionNamed("pushDouble"), {context, constant}); -+#else - Builder.CreateCall2(ex->FindFunctionNamed("pushDouble"), context, constant); -+#endif - } - number_t d=this->context->constant_pool.doubles[t]; - constant = llvm::ConstantFP::get(number_type,d); -@@ -2966,7 +3118,11 @@ SyntheticFunction::synt_function method_info::synt_method() - u30 t; - code >> t; - constant = llvm::ConstantInt::get(int_type, t); -+#ifdef LLVM_37 -+ value = Builder.CreateCall(ex->FindFunctionNamed("pushNamespace"), {context, constant}); -+#else - value = Builder.CreateCall2(ex->FindFunctionNamed("pushNamespace"), context, constant); -+#endif - static_stack_push(static_stack, stack_entry(value,STACK_OBJECT)); - break; - } -@@ -3000,7 +3156,11 @@ SyntheticFunction::synt_function method_info::synt_method() - static_locals[t2].second=STACK_NONE; - } - -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("hasNext2"), {context, constant, constant2}); -+#else - value=Builder.CreateCall3(ex->FindFunctionNamed("hasNext2"), context, constant, constant2); -+#endif - static_stack_push(static_stack,stack_entry(value,STACK_BOOLEAN)); - break; - } -@@ -3011,7 +3171,11 @@ SyntheticFunction::synt_function method_info::synt_method() - u30 t; - code >> t; - constant = llvm::ConstantInt::get(int_type, t); -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("newFunction"), {context, constant}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("newFunction"), context, constant); -+#endif - static_stack_push(static_stack,stack_entry(value,STACK_OBJECT)); - break; - } -@@ -3024,7 +3188,11 @@ SyntheticFunction::synt_function method_info::synt_method() - code >> t; - constant = llvm::ConstantInt::get(int_type, t); - constant2 = llvm::ConstantInt::get(int_type, 0); -+#ifdef LLVM_37 -+ Builder.CreateCall(ex->FindFunctionNamed("call"), {context, constant, constant2}); -+#else - Builder.CreateCall3(ex->FindFunctionNamed("call"), context, constant, constant2); -+#endif - break; - } - case 0x42: -@@ -3035,7 +3203,11 @@ SyntheticFunction::synt_function method_info::synt_method() - u30 t; - code >> t; - constant = llvm::ConstantInt::get(int_type, t); -+#ifdef LLVM_37 -+ Builder.CreateCall(ex->FindFunctionNamed("construct"), {context, constant}); -+#else - Builder.CreateCall2(ex->FindFunctionNamed("construct"), context, constant); -+#endif - break; - } - case 0x45: -@@ -3050,7 +3222,11 @@ SyntheticFunction::synt_function method_info::synt_method() - constant2 = llvm::ConstantInt::get(int_type, t); - constant3 = llvm::ConstantInt::get(int_type, 0); - constant4 = llvm::ConstantInt::get(bool_type, 1); -+#ifdef LLVM_37 -+ Builder.CreateCall(ex->FindFunctionNamed("callSuper"), {context, constant, constant2, constant3, constant4}); -+#else - Builder.CreateCall5(ex->FindFunctionNamed("callSuper"), context, constant, constant2, constant3, constant4); -+#endif - break; - } - case 0x4c: //callproplex -@@ -3072,7 +3248,11 @@ SyntheticFunction::synt_function method_info::synt_method() - for(int i=0;i<t;i++) - args[t-i]=static_stack_pop(Builder,static_stack,m).first;*/ - //Call the function resolver, static case could be resolved at this time (TODO) -+#ifdef LLVM_37 -+ Builder.CreateCall(ex->FindFunctionNamed("callProperty"), {context, constant, constant2, constant3, constant4}); -+#else - Builder.CreateCall5(ex->FindFunctionNamed("callProperty"), context, constant, constant2, constant3, constant4); -+#endif - /* //Pop the function object, and then the object itself - llvm::Value* fun=static_stack_pop(Builder,static_stack,m).first; - -@@ -3141,7 +3321,11 @@ SyntheticFunction::synt_function method_info::synt_method() - u30 t; - code >> t; - constant = llvm::ConstantInt::get(int_type, t); -+#ifdef LLVM_37 -+ Builder.CreateCall(ex->FindFunctionNamed("constructSuper"), {context, constant}); -+#else - Builder.CreateCall2(ex->FindFunctionNamed("constructSuper"), context, constant); -+#endif - break; - } - case 0x4a: -@@ -3154,7 +3338,11 @@ SyntheticFunction::synt_function method_info::synt_method() - constant = llvm::ConstantInt::get(int_type, t); - code >> t; - constant2 = llvm::ConstantInt::get(int_type, t); -+#ifdef LLVM_37 -+ Builder.CreateCall(ex->FindFunctionNamed("constructProp"), {context, constant, constant2}); -+#else - Builder.CreateCall3(ex->FindFunctionNamed("constructProp"), context, constant, constant2); -+#endif - break; - } - case 0x4e: -@@ -3169,7 +3357,11 @@ SyntheticFunction::synt_function method_info::synt_method() - constant2 = llvm::ConstantInt::get(int_type, t); - constant3 = llvm::ConstantInt::get(int_type, 0); - constant4 = llvm::ConstantInt::get(bool_type, 0); -+#ifdef LLVM_37 -+ Builder.CreateCall(ex->FindFunctionNamed("callSuper"), {context, constant, constant2, constant3, constant4}); -+#else - Builder.CreateCall5(ex->FindFunctionNamed("callSuper"), context, constant, constant2, constant3, constant4); -+#endif - break; - } - case 0x4f: -@@ -3184,7 +3376,11 @@ SyntheticFunction::synt_function method_info::synt_method() - constant2 = llvm::ConstantInt::get(int_type, t); - constant3 = llvm::ConstantInt::get(int_type, 0); - constant4 = llvm::ConstantInt::get(bool_type, 0); -+#ifdef LLVM_37 -+ Builder.CreateCall(ex->FindFunctionNamed("callProperty"), {context, constant, constant2, constant3, constant4}); -+#else - Builder.CreateCall5(ex->FindFunctionNamed("callProperty"), context, constant, constant2, constant3, constant4); -+#endif - break; - } - case 0x53: -@@ -3195,7 +3391,11 @@ SyntheticFunction::synt_function method_info::synt_method() - u30 t; - code >> t; - constant = llvm::ConstantInt::get(int_type, t); -+#ifdef LLVM_37 -+ Builder.CreateCall(ex->FindFunctionNamed("constructGenericType"), {context, constant}); -+#else - Builder.CreateCall2(ex->FindFunctionNamed("constructGenericType"), context, constant); -+#endif - break; - } - case 0x55: -@@ -3206,7 +3406,11 @@ SyntheticFunction::synt_function method_info::synt_method() - u30 t; - code >> t; - constant = llvm::ConstantInt::get(int_type, t); -+#ifdef LLVM_37 -+ Builder.CreateCall(ex->FindFunctionNamed("newObject"), {context, constant}); -+#else - Builder.CreateCall2(ex->FindFunctionNamed("newObject"), context, constant); -+#endif - break; - } - case 0x56: -@@ -3217,14 +3421,22 @@ SyntheticFunction::synt_function method_info::synt_method() - u30 t; - code >> t; - constant = llvm::ConstantInt::get(int_type, t); -+#ifdef LLVM_37 -+ Builder.CreateCall(ex->FindFunctionNamed("newArray"), {context, constant}); -+#else - Builder.CreateCall2(ex->FindFunctionNamed("newArray"), context, constant); -+#endif - break; - } - case 0x57: - { - //newactivation - LOG(LOG_TRACE, _("synt newactivation") ); -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("newActivation"), {context, th}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("newActivation"), context, th); -+#endif - static_stack_push(static_stack,stack_entry(value,STACK_OBJECT)); - break; - } -@@ -3236,7 +3448,11 @@ SyntheticFunction::synt_function method_info::synt_method() - u30 t; - code >> t; - constant = llvm::ConstantInt::get(int_type, t); -+#ifdef LLVM_37 -+ Builder.CreateCall(ex->FindFunctionNamed("newClass"), {context, constant}); -+#else - Builder.CreateCall2(ex->FindFunctionNamed("newClass"), context, constant); -+#endif - break; - } - case 0x59: -@@ -3247,7 +3463,11 @@ SyntheticFunction::synt_function method_info::synt_method() - u30 t; - code >> t; - constant = llvm::ConstantInt::get(int_type, t); -+#ifdef LLVM_37 -+ Builder.CreateCall(ex->FindFunctionNamed("getDescendants"), {context, constant}); -+#else - Builder.CreateCall2(ex->FindFunctionNamed("getDescendants"), context, constant); -+#endif - break; - } - case 0x5a: -@@ -3257,7 +3477,11 @@ SyntheticFunction::synt_function method_info::synt_method() - u30 t; - code >> t; - constant = llvm::ConstantInt::get(int_type, t); -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("newCatch"), {context, constant}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("newCatch"), context, constant); -+#endif - static_stack_push(static_stack,stack_entry(value,STACK_OBJECT)); - break; - } -@@ -3268,7 +3492,11 @@ SyntheticFunction::synt_function method_info::synt_method() - u30 t; - code >> t; - llvm::Value* name = getMultiname(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index,this->context,t); -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("findPropStrict"), {context, name}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("findPropStrict"), context, name); -+#endif - static_stack_push(static_stack,stack_entry(value,STACK_OBJECT)); - break; - } -@@ -3279,7 +3507,11 @@ SyntheticFunction::synt_function method_info::synt_method() - u30 t; - code >> t; - llvm::Value* name = getMultiname(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index,this->context,t); -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("findProperty"), {context, name}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("findProperty"), context, name); -+#endif - static_stack_push(static_stack,stack_entry(value,STACK_OBJECT)); - break; - } -@@ -3291,7 +3523,11 @@ SyntheticFunction::synt_function method_info::synt_method() - u30 t; - code >> t; - constant = llvm::ConstantInt::get(int_type, t); -+#ifdef LLVM_37 -+ Builder.CreateCall(ex->FindFunctionNamed("getLex"), {context, constant}); -+#else - Builder.CreateCall2(ex->FindFunctionNamed("getLex"), context, constant); -+#endif - break; - } - case 0x61: -@@ -3304,11 +3540,19 @@ SyntheticFunction::synt_function method_info::synt_method() - llvm::Value* name = getMultiname(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index,this->context,t); - stack_entry obj=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); - if(value.second==STACK_INT) -+#ifdef LLVM_37 -+ Builder.CreateCall(ex->FindFunctionNamed("setProperty_i"),{value.first, obj.first, name}); -+#else - Builder.CreateCall3(ex->FindFunctionNamed("setProperty_i"),value.first, obj.first, name); -+#endif - else - { - abstract_value(ex,Builder,value); -+#ifdef LLVM_37 -+ Builder.CreateCall(ex->FindFunctionNamed("setProperty"),{value.first, obj.first, name}); -+#else - Builder.CreateCall3(ex->FindFunctionNamed("setProperty"),value.first, obj.first, name); -+#endif - } - break; - } -@@ -3331,7 +3575,11 @@ SyntheticFunction::synt_function method_info::synt_method() - Builder.CreateCall(ex->FindFunctionNamed("incRef"), t); - Builder.CreateCall(ex->FindFunctionNamed("incRef"), t); - if(Log::getLevel()>=LOG_CALLS) -+#ifdef LLVM_37 -+ Builder.CreateCall(ex->FindFunctionNamed("getLocal"), {t, constant}); -+#else - Builder.CreateCall2(ex->FindFunctionNamed("getLocal"), t, constant); -+#endif - - } - else if(static_locals[i].second==STACK_OBJECT) -@@ -3339,14 +3587,22 @@ SyntheticFunction::synt_function method_info::synt_method() - Builder.CreateCall(ex->FindFunctionNamed("incRef"), static_locals[i].first); - static_stack_push(static_stack,static_locals[i]); - if(Log::getLevel()>=LOG_CALLS) -+#ifdef LLVM_37 -+ Builder.CreateCall(ex->FindFunctionNamed("getLocal"), {static_locals[i].first, constant}); -+#else - Builder.CreateCall2(ex->FindFunctionNamed("getLocal"), static_locals[i].first, constant); -+#endif - } - else if(static_locals[i].second==STACK_INT - || static_locals[i].second==STACK_UINT) - { - static_stack_push(static_stack,static_locals[i]); - if(Log::getLevel()>=LOG_CALLS) -+#ifdef LLVM_37 -+ Builder.CreateCall(ex->FindFunctionNamed("getLocal_int"), {constant, static_locals[i].first}); -+#else - Builder.CreateCall2(ex->FindFunctionNamed("getLocal_int"), constant, static_locals[i].first); -+#endif - } - else if(static_locals[i].second==STACK_NUMBER || - static_locals[i].second==STACK_BOOLEAN) -@@ -3375,7 +3631,11 @@ SyntheticFunction::synt_function method_info::synt_method() - u30 t; - code >> t; - constant = llvm::ConstantInt::get(int_type, t); -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("getScopeObject"), {context, constant}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("getScopeObject"), context, constant); -+#endif - static_stack_push(static_stack,stack_entry(value,STACK_OBJECT)); - break; - } -@@ -3389,17 +3649,29 @@ SyntheticFunction::synt_function method_info::synt_method() - - stack_entry obj=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); - abstract_value(ex,Builder,obj); -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("getProperty"), {obj.first, name}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("getProperty"), obj.first, name); -+#endif - static_stack_push(static_stack,stack_entry(value,STACK_OBJECT)); - /*if(cur_block->push_types[local_ip]==STACK_OBJECT || - cur_block->push_types[local_ip]==STACK_BOOLEAN) - { -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("getProperty"), {obj.first, name}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("getProperty"), obj.first, name); -+#endif - static_stack_push(static_stack,stack_entry(value,STACK_OBJECT)); - } - else if(cur_block->push_types[local_ip]==STACK_INT) - { -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("getProperty_i"), {obj.first, name}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("getProperty_i"), obj.first, name); -+#endif - static_stack_push(static_stack,stack_entry(value,STACK_INT)); - } - else -@@ -3417,7 +3689,11 @@ SyntheticFunction::synt_function method_info::synt_method() - stack_entry val=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); - llvm::Value* name = getMultiname(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index,this->context,t); - stack_entry obj=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); -+#ifdef LLVM_37 -+ Builder.CreateCall(ex->FindFunctionNamed("initProperty"), {obj.first, val.first, name}); -+#else - Builder.CreateCall3(ex->FindFunctionNamed("initProperty"), obj.first, val.first, name); -+#endif - break; - } - case 0x6a: -@@ -3429,7 +3705,11 @@ SyntheticFunction::synt_function method_info::synt_method() - llvm::Value* name = getMultiname(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index,this->context,t); - stack_entry v=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); - abstract_value(ex,Builder,v); -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("deleteProperty"), {v.first, name}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("deleteProperty"), v.first, name); -+#endif - static_stack_push(static_stack,stack_entry(value,STACK_BOOLEAN)); - break; - } -@@ -3442,7 +3722,11 @@ SyntheticFunction::synt_function method_info::synt_method() - constant = llvm::ConstantInt::get(int_type, t); - llvm::Value* v1= - static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index).first; -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("getSlot"), {v1, constant}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("getSlot"), v1, constant); -+#endif - static_stack_push(static_stack,stack_entry(value,STACK_OBJECT)); - break; - } -@@ -3458,7 +3742,11 @@ SyntheticFunction::synt_function method_info::synt_method() - - abstract_value(ex,Builder,v1); - abstract_value(ex,Builder,v2); -+#ifdef LLVM_37 -+ Builder.CreateCall(ex->FindFunctionNamed("setSlot"), {v1.first, v2.first, constant}); -+#else - Builder.CreateCall3(ex->FindFunctionNamed("setSlot"), v1.first, v2.first, constant); -+#endif - break; - } - case 0x70: -@@ -3551,7 +3839,11 @@ SyntheticFunction::synt_function method_info::synt_method() - u30 t; - code >> t; - constant = llvm::ConstantInt::get(int_type, t); -+#ifdef LLVM_37 -+ Builder.CreateCall(ex->FindFunctionNamed("coerce"), {context, constant}); -+#else - Builder.CreateCall2(ex->FindFunctionNamed("coerce"), context, constant); -+#endif - break; - } - case 0x82: -@@ -3585,7 +3877,11 @@ SyntheticFunction::synt_function method_info::synt_method() - stack_entry v1=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); - stack_entry v2=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); - assert_and_throw(v1.second==STACK_OBJECT && v2.second==STACK_OBJECT); -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("asTypelate"),{v1.first,v2.first}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("asTypelate"),v1.first,v2.first); -+#endif - static_stack_push(static_stack,stack_entry(value,STACK_OBJECT)); - break; - } -@@ -3673,19 +3969,31 @@ SyntheticFunction::synt_function method_info::synt_method() - stack_entry v2=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); - if(v1.second==STACK_OBJECT && v2.second==STACK_INT) - { -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("add_oi"), {v1.first, v2.first}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("add_oi"), v1.first, v2.first); -+#endif - static_stack_push(static_stack,stack_entry(value,STACK_OBJECT)); - } - else if(v1.second==STACK_OBJECT && v2.second==STACK_NUMBER) - { -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("add_od"), {v1.first, v2.first}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("add_od"), v1.first, v2.first); -+#endif - static_stack_push(static_stack,stack_entry(value,STACK_OBJECT)); - } - else if(v1.second==STACK_OBJECT || v2.second==STACK_OBJECT) - { - abstract_value(ex,Builder,v1); - abstract_value(ex,Builder,v2); -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("add"), {v1.first, v2.first}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("add"), v1.first, v2.first); -+#endif - static_stack_push(static_stack,stack_entry(value,STACK_OBJECT)); - } - else /* v1 and v2 are BOOLEAN, UINT, INT or NUMBER */ -@@ -3726,24 +4034,40 @@ SyntheticFunction::synt_function method_info::synt_method() - } - else if(v1.second==STACK_OBJECT && v2.second==STACK_INT) - { -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("subtract_oi"), {v1.first, v2.first}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("subtract_oi"), v1.first, v2.first); -+#endif - static_stack_push(static_stack,stack_entry(value,STACK_NUMBER)); - } - else if(v1.second==STACK_NUMBER && v2.second==STACK_OBJECT) - { -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("subtract_do"), {v1.first, v2.first}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("subtract_do"), v1.first, v2.first); -+#endif - static_stack_push(static_stack,stack_entry(value,STACK_NUMBER)); - } - else if(v1.second==STACK_INT && v2.second==STACK_OBJECT) - { -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("subtract_io"), {v1.first, v2.first}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("subtract_io"), v1.first, v2.first); -+#endif - static_stack_push(static_stack,stack_entry(value,STACK_NUMBER)); - } - else - { - abstract_value(ex,Builder,v1); - abstract_value(ex,Builder,v2); -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("subtract"), {v1.first, v2.first}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("subtract"), v1.first, v2.first); -+#endif - static_stack_push(static_stack,stack_entry(value,STACK_NUMBER)); - } - -@@ -3757,12 +4081,20 @@ SyntheticFunction::synt_function method_info::synt_method() - stack_entry v2= static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); - if(v1.second==STACK_INT && v2.second==STACK_OBJECT) - { -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("multiply_oi"), {v2.first, v1.first}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("multiply_oi"), v2.first, v1.first); -+#endif - static_stack_push(static_stack,stack_entry(value,STACK_NUMBER)); - } - else if(v1.second==STACK_OBJECT && v2.second==STACK_INT) - { -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("multiply_oi"), {v1.first, v2.first}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("multiply_oi"), v1.first, v2.first); -+#endif - static_stack_push(static_stack,stack_entry(value,STACK_NUMBER)); - } - else if(v1.second==STACK_INT && v2.second==STACK_INT) -@@ -3791,7 +4123,11 @@ SyntheticFunction::synt_function method_info::synt_method() - { - abstract_value(ex,Builder,v1); - abstract_value(ex,Builder,v2); -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("multiply"), {v1.first, v2.first}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("multiply"), v1.first, v2.first); -+#endif - static_stack_push(static_stack,stack_entry(value,STACK_NUMBER)); - } - -@@ -3822,7 +4158,11 @@ SyntheticFunction::synt_function method_info::synt_method() - { - abstract_value(ex,Builder,v1); - abstract_value(ex,Builder,v2); -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("divide"), {v1.first, v2.first}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("divide"), v1.first, v2.first); -+#endif - } - static_stack_push(static_stack,stack_entry(value,STACK_NUMBER)); - break; -@@ -3846,7 +4186,11 @@ SyntheticFunction::synt_function method_info::synt_method() - stack_entry v1=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); - stack_entry v2=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); - if(v1.second==STACK_INT && v2.second==STACK_OBJECT) -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("lShift_io"), {v1.first, v2.first}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("lShift_io"), v1.first, v2.first); -+#endif - else if(v1.second==STACK_INT && v2.second==STACK_INT) - { - constant = llvm::ConstantInt::get(int_type, 31); //Mask for v1 -@@ -3857,7 +4201,11 @@ SyntheticFunction::synt_function method_info::synt_method() - { - abstract_value(ex,Builder,v1); - abstract_value(ex,Builder,v2); -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("lShift"), {v1.first, v2.first}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("lShift"), v1.first, v2.first); -+#endif - } - - static_stack_push(static_stack,stack_entry(value,STACK_INT)); -@@ -3872,7 +4220,11 @@ SyntheticFunction::synt_function method_info::synt_method() - - abstract_value(ex,Builder,v1); - abstract_value(ex,Builder,v2); -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("rShift"), {v1.first, v2.first}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("rShift"), v1.first, v2.first); -+#endif - - static_stack_push(static_stack,make_pair(value,STACK_INT)); - break; -@@ -3884,7 +4236,11 @@ SyntheticFunction::synt_function method_info::synt_method() - stack_entry v1=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); - stack_entry v2=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); - if(v1.second==STACK_INT && v2.second==STACK_OBJECT) -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("urShift_io"), {v1.first, v2.first}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("urShift_io"), v1.first, v2.first); -+#endif - else if(v1.second==STACK_INT && v2.second==STACK_INT) - { - v2.first=Builder.CreateIntCast(v2.first,int_type,false); -@@ -3901,7 +4257,11 @@ SyntheticFunction::synt_function method_info::synt_method() - { - abstract_value(ex,Builder,v1); - abstract_value(ex,Builder,v2); -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("urShift"), {v1.first, v2.first}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("urShift"), v1.first, v2.first); -+#endif - } - - static_stack_push(static_stack,stack_entry(value,STACK_INT)); -@@ -3915,9 +4275,17 @@ SyntheticFunction::synt_function method_info::synt_method() - stack_entry v2=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); - - if(v1.second==STACK_INT && v2.second==STACK_OBJECT) -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("bitAnd_oi"), {v2.first, v1.first}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("bitAnd_oi"), v2.first, v1.first); -+#endif - else if(v1.second==STACK_OBJECT && v2.second==STACK_INT) -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("bitAnd_oi"), {v1.first, v2.first}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("bitAnd_oi"), v1.first, v2.first); -+#endif - else if(v1.second==STACK_INT && v2.second==STACK_INT) - value=Builder.CreateAnd(v1.first,v2.first); - else if(v1.second==STACK_NUMBER && v2.second==STACK_INT) -@@ -3934,7 +4302,11 @@ SyntheticFunction::synt_function method_info::synt_method() - { - abstract_value(ex,Builder,v1); - abstract_value(ex,Builder,v2); -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("bitAnd_oo"), {v1.first, v2.first}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("bitAnd_oo"), v1.first, v2.first); -+#endif - } - - static_stack_push(static_stack,stack_entry(value,STACK_INT)); -@@ -3949,14 +4321,26 @@ SyntheticFunction::synt_function method_info::synt_method() - if(v1.second==STACK_INT && v2.second==STACK_INT) - value=Builder.CreateOr(v1.first,v2.first); - else if(v1.second==STACK_OBJECT && v2.second==STACK_INT) -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("bitOr_oi"), {v1.first, v2.first}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("bitOr_oi"), v1.first, v2.first); -+#endif - else if(v1.second==STACK_INT && v2.second==STACK_OBJECT) -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("bitOr_oi"), {v2.first, v1.first}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("bitOr_oi"), v2.first, v1.first); -+#endif - else - { - abstract_value(ex,Builder,v1); - abstract_value(ex,Builder,v2); -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("bitOr"), {v1.first, v2.first}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("bitOr"), v1.first, v2.first); -+#endif - } - - static_stack_push(static_stack,stack_entry(value,STACK_INT)); -@@ -3974,7 +4358,11 @@ SyntheticFunction::synt_function method_info::synt_method() - { - abstract_value(ex,Builder,v1); - abstract_value(ex,Builder,v2); -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("bitXor"), {v1.first, v2.first}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("bitXor"), v1.first, v2.first); -+#endif - } - - static_stack_push(static_stack,stack_entry(value,STACK_INT)); -@@ -3992,7 +4380,11 @@ SyntheticFunction::synt_function method_info::synt_method() - { - abstract_value(ex,Builder,v1); - abstract_value(ex,Builder,v2); -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("equals"), {v1.first, v2.first}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("equals"), v1.first, v2.first); -+#endif - } - static_stack_push(static_stack,stack_entry(value,STACK_BOOLEAN)); - break; -@@ -4005,7 +4397,11 @@ SyntheticFunction::synt_function method_info::synt_method() - stack_entry v2=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); - abstract_value(ex,Builder,v1); - abstract_value(ex,Builder,v2); -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("strictEquals"), {v1.first, v2.first}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("strictEquals"), v1.first, v2.first); -+#endif - static_stack_push(static_stack,stack_entry(value,STACK_BOOLEAN)); - break; - } -@@ -4018,7 +4414,11 @@ SyntheticFunction::synt_function method_info::synt_method() - - abstract_value(ex,Builder,v1); - abstract_value(ex,Builder,v2); -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("lessThan"), {v1.first, v2.first}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("lessThan"), v1.first, v2.first); -+#endif - static_stack_push(static_stack,stack_entry(value,STACK_BOOLEAN)); - break; - } -@@ -4031,7 +4431,11 @@ SyntheticFunction::synt_function method_info::synt_method() - - abstract_value(ex,Builder,v1); - abstract_value(ex,Builder,v2); -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("lessEquals"), {v1.first, v2.first}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("lessEquals"), v1.first, v2.first); -+#endif - static_stack_push(static_stack,stack_entry(value,STACK_BOOLEAN)); - break; - } -@@ -4044,7 +4448,11 @@ SyntheticFunction::synt_function method_info::synt_method() - - abstract_value(ex,Builder,v1); - abstract_value(ex,Builder,v2); -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("greaterThan"), {v1.first, v2.first}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("greaterThan"), v1.first, v2.first); -+#endif - static_stack_push(static_stack,stack_entry(value,STACK_BOOLEAN)); - break; - } -@@ -4057,7 +4465,11 @@ SyntheticFunction::synt_function method_info::synt_method() - - abstract_value(ex,Builder,v1); - abstract_value(ex,Builder,v2); -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("greaterEquals"), {v1.first, v2.first}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("greaterEquals"), v1.first, v2.first); -+#endif - static_stack_push(static_stack,stack_entry(value,STACK_BOOLEAN)); - break; - } -@@ -4070,7 +4482,11 @@ SyntheticFunction::synt_function method_info::synt_method() - - abstract_value(ex,Builder,v1); - abstract_value(ex,Builder,v2); -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("instanceOf"), {v1.first, v2.first}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("instanceOf"), v1.first, v2.first); -+#endif - static_stack_push(static_stack,stack_entry(value,STACK_BOOLEAN)); - break; - } -@@ -4082,7 +4498,11 @@ SyntheticFunction::synt_function method_info::synt_method() - stack_entry v2=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); - abstract_value(ex,Builder,v1); - abstract_value(ex,Builder,v2); -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("isTypelate"),{v1.first,v2.first}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("isTypelate"),v1.first,v2.first); -+#endif - static_stack_push(static_stack,stack_entry(value,STACK_BOOLEAN)); - break; - } -@@ -4094,7 +4514,11 @@ SyntheticFunction::synt_function method_info::synt_method() - static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index).first; - llvm::Value* v2= - static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index).first; -+#ifdef LLVM_37 -+ value=Builder.CreateCall(ex->FindFunctionNamed("in"), {v1, v2}); -+#else - value=Builder.CreateCall2(ex->FindFunctionNamed("in"), v1, v2); -+#endif - static_stack_push(static_stack,stack_entry(value,STACK_BOOLEAN)); - break; - } -@@ -4150,7 +4574,11 @@ SyntheticFunction::synt_function method_info::synt_method() - Builder.CreateStore(static_locals[t].first,gep); - static_locals[t].second=STACK_NONE; - } -+#ifdef LLVM_37 -+ Builder.CreateCall(ex->FindFunctionNamed("incLocal_i"), {context, constant}); -+#else - Builder.CreateCall2(ex->FindFunctionNamed("incLocal_i"), context, constant); -+#endif - break; - } - case 0x63: //setlocal -@@ -4172,9 +4600,17 @@ SyntheticFunction::synt_function method_info::synt_method() - { - constant = llvm::ConstantInt::get(int_type, i); - if(e.second==STACK_INT) -+#ifdef LLVM_37 -+ Builder.CreateCall(ex->FindFunctionNamed("setLocal_int"), {constant, e.first}); -+#else - Builder.CreateCall2(ex->FindFunctionNamed("setLocal_int"), constant, e.first); -+#endif - else if(e.second==STACK_OBJECT) -+#ifdef LLVM_37 -+ Builder.CreateCall(ex->FindFunctionNamed("setLocal_obj"), {constant, e.first}); -+#else - Builder.CreateCall2(ex->FindFunctionNamed("setLocal_obj"), constant, e.first); -+#endif - else - Builder.CreateCall(ex->FindFunctionNamed("setLocal"), constant); - } -diff --git a/src/scripting/avmplus/avmplus.cpp b/src/scripting/avmplus/avmplus.cpp -index 199d679..f525405 100644 ---- a/src/scripting/avmplus/avmplus.cpp -+++ b/src/scripting/avmplus/avmplus.cpp -@@ -56,7 +56,7 @@ ASFUNCTIONBODY(avmplusFile,write) - } - ASFUNCTIONBODY(avmplusFile,readByteArray) - { -- avmplusFile* th=static_cast<avmplusFile*>(obj); -+ //avmplusFile* th=static_cast<avmplusFile*>(obj); - tiny_string filename; - ARG_UNPACK(filename); - -diff --git a/src/scripting/flash/display/BitmapData.cpp b/src/scripting/flash/display/BitmapData.cpp -index b3d3a7e..0292aea 100644 ---- a/src/scripting/flash/display/BitmapData.cpp -+++ b/src/scripting/flash/display/BitmapData.cpp -@@ -141,7 +141,7 @@ ASFUNCTIONBODY(BitmapData,_constructor) - uint8_t *alpha=reinterpret_cast<uint8_t *>(&c); - *alpha=0xFF; - } -- for(uint32_t i=0; i<width*height; i++) -+ for(uint32_t i=0; i<(uint32_t)(width*height); i++) - pixelArray[i]=c; - th->pixels->fromRGB(reinterpret_cast<uint8_t *>(pixelArray), width, height, BitmapContainer::ARGB32); - th->transparent=transparent; -@@ -842,8 +842,6 @@ ASFUNCTIONBODY(BitmapData,compare) - - ASFUNCTIONBODY(BitmapData,applyFilter) - { -- BitmapData* th = obj->as<BitmapData>(); -- - _NR<BitmapData> sourceBitmapData; - _NR<Rectangle> sourceRect; - _NR<Point> destPoint; -@@ -852,9 +850,9 @@ ASFUNCTIONBODY(BitmapData,applyFilter) - LOG(LOG_NOT_IMPLEMENTED,"BitmapData.applyFilter not implemented"); - return NULL; - } -+ - ASFUNCTIONBODY(BitmapData,noise) - { -- BitmapData* th = obj->as<BitmapData>(); - int randomSeed; - uint low; - uint high; -diff --git a/src/scripting/flash/events/flashevents.cpp b/src/scripting/flash/events/flashevents.cpp -index 3e514f0..164810d 100644 ---- a/src/scripting/flash/events/flashevents.cpp -+++ b/src/scripting/flash/events/flashevents.cpp -@@ -189,13 +189,13 @@ ASFUNCTIONBODY(Event,clone) - - ASFUNCTIONBODY(Event,stopPropagation) - { -- Event* th=static_cast<Event*>(obj); -+ //Event* th=static_cast<Event*>(obj); - LOG(LOG_NOT_IMPLEMENTED,"Event.stopPropagation not implemented"); - return NULL; - } - ASFUNCTIONBODY(Event,stopImmediatePropagation) - { -- Event* th=static_cast<Event*>(obj); -+ //Event* th=static_cast<Event*>(obj); - LOG(LOG_NOT_IMPLEMENTED,"Event.stopImmediatePropagation not implemented"); - return NULL; - } -@@ -1420,8 +1420,8 @@ void UncaughtErrorEvents::sinit(Class_base* c) - - ASFUNCTIONBODY(UncaughtErrorEvents, _constructor) - { -- EventDispatcher::_constructor(obj, NULL, 0); -- UncaughtErrorEvents* th=Class<UncaughtErrorEvents>::cast(obj); -+ //EventDispatcher::_constructor(obj, NULL, 0); -+ //UncaughtErrorEvents* th=Class<UncaughtErrorEvents>::cast(obj); - LOG(LOG_NOT_IMPLEMENTED,"UncaughtErrorEvents is not implemented"); - return NULL; - } -diff --git a/src/scripting/flash/filesystem/flashfilesystem.cpp b/src/scripting/flash/filesystem/flashfilesystem.cpp -index 1106815..fb56486 100644 ---- a/src/scripting/flash/filesystem/flashfilesystem.cpp -+++ b/src/scripting/flash/filesystem/flashfilesystem.cpp -@@ -36,7 +36,7 @@ void FileStream::sinit(Class_base* c) - ASFUNCTIONBODY(FileStream, _constructor) - { - EventDispatcher::_constructor(obj, NULL, 0); -- FileStream* th=Class<FileStream>::cast(obj); -+ //FileStream* th=Class<FileStream>::cast(obj); - LOG(LOG_NOT_IMPLEMENTED,"FileStream is not implemented"); - return NULL; - } -diff --git a/src/scripting/flash/filters/flashfilters.cpp b/src/scripting/flash/filters/flashfilters.cpp -index d230db4..4797809 100644 ---- a/src/scripting/flash/filters/flashfilters.cpp -+++ b/src/scripting/flash/filters/flashfilters.cpp -@@ -178,15 +178,14 @@ void GradientGlowFilter::sinit(Class_base* c) - - ASFUNCTIONBODY(GradientGlowFilter, _constructor) - { -- GradientGlowFilter *th = obj->as<GradientGlowFilter>(); -+ //GradientGlowFilter *th = obj->as<GradientGlowFilter>(); - LOG(LOG_NOT_IMPLEMENTED,"GradientGlowFilter is not implemented"); - return NULL; - } - - BitmapFilter* GradientGlowFilter::cloneImpl() const - { -- GradientGlowFilter *cloned = Class<GradientGlowFilter>::getInstanceS(); -- return cloned; -+ return Class<GradientGlowFilter>::getInstanceS(); - } - - BevelFilter::BevelFilter(Class_base* c): -@@ -201,15 +200,14 @@ void BevelFilter::sinit(Class_base* c) - - ASFUNCTIONBODY(BevelFilter, _constructor) - { -- BevelFilter *th = obj->as<BevelFilter>(); -+ //BevelFilter *th = obj->as<BevelFilter>(); - LOG(LOG_NOT_IMPLEMENTED,"GradientGlowFilter is not implemented"); - return NULL; - } - - BitmapFilter* BevelFilter::cloneImpl() const - { -- BevelFilter *cloned = Class<BevelFilter>::getInstanceS(); -- return cloned; -+ return Class<BevelFilter>::getInstanceS(); - } - ColorMatrixFilter::ColorMatrixFilter(Class_base* c): - BitmapFilter(c),matrix(NULL) -@@ -253,15 +251,14 @@ void BlurFilter::sinit(Class_base* c) - - ASFUNCTIONBODY(BlurFilter, _constructor) - { -- BlurFilter *th = obj->as<BlurFilter>(); -+ //BlurFilter *th = obj->as<BlurFilter>(); - LOG(LOG_NOT_IMPLEMENTED,"BlurFilter is not implemented"); - return NULL; - } - - BitmapFilter* BlurFilter::cloneImpl() const - { -- BlurFilter *cloned = Class<BlurFilter>::getInstanceS(); -- return cloned; -+ return Class<BlurFilter>::getInstanceS(); - } - - ConvolutionFilter::ConvolutionFilter(Class_base* c): -@@ -276,15 +273,14 @@ void ConvolutionFilter::sinit(Class_base* c) - - ASFUNCTIONBODY(ConvolutionFilter, _constructor) - { -- ConvolutionFilter *th = obj->as<ConvolutionFilter>(); -+ //ConvolutionFilter *th = obj->as<ConvolutionFilter>(); - LOG(LOG_NOT_IMPLEMENTED,"ConvolutionFilter is not implemented"); - return NULL; - } - - BitmapFilter* ConvolutionFilter::cloneImpl() const - { -- ConvolutionFilter *cloned = Class<ConvolutionFilter>::getInstanceS(); -- return cloned; -+ return Class<ConvolutionFilter>::getInstanceS(); - } - - DisplacementMapFilter::DisplacementMapFilter(Class_base* c): -@@ -299,15 +295,14 @@ void DisplacementMapFilter::sinit(Class_base* c) - - ASFUNCTIONBODY(DisplacementMapFilter, _constructor) - { -- DisplacementMapFilter *th = obj->as<DisplacementMapFilter>(); -+ //DisplacementMapFilter *th = obj->as<DisplacementMapFilter>(); - LOG(LOG_NOT_IMPLEMENTED,"DisplacementMapFilter is not implemented"); - return NULL; - } - - BitmapFilter* DisplacementMapFilter::cloneImpl() const - { -- DisplacementMapFilter *cloned = Class<DisplacementMapFilter>::getInstanceS(); -- return cloned; -+ return Class<DisplacementMapFilter>::getInstanceS(); - } - - GradientBevelFilter::GradientBevelFilter(Class_base* c): -@@ -322,15 +317,14 @@ void GradientBevelFilter::sinit(Class_base* c) - - ASFUNCTIONBODY(GradientBevelFilter, _constructor) - { -- GradientBevelFilter *th = obj->as<GradientBevelFilter>(); -+ //GradientBevelFilter *th = obj->as<GradientBevelFilter>(); - LOG(LOG_NOT_IMPLEMENTED,"GradientBevelFilter is not implemented"); - return NULL; - } - - BitmapFilter* GradientBevelFilter::cloneImpl() const - { -- GradientBevelFilter *cloned = Class<GradientBevelFilter>::getInstanceS(); -- return cloned; -+ return Class<GradientBevelFilter>::getInstanceS(); - } - - ShaderFilter::ShaderFilter(Class_base* c): -@@ -345,15 +339,14 @@ void ShaderFilter::sinit(Class_base* c) - - ASFUNCTIONBODY(ShaderFilter, _constructor) - { -- ShaderFilter *th = obj->as<ShaderFilter>(); -+ //ShaderFilter *th = obj->as<ShaderFilter>(); - LOG(LOG_NOT_IMPLEMENTED,"ShaderFilter is not implemented"); - return NULL; - } - - BitmapFilter* ShaderFilter::cloneImpl() const - { -- ShaderFilter *cloned = Class<ShaderFilter>::getInstanceS(); -- return cloned; -+ return Class<ShaderFilter>::getInstanceS(); - } - - void BitmapFilterQuality::sinit(Class_base* c) -diff --git a/src/scripting/flash/geom/flashgeom.cpp b/src/scripting/flash/geom/flashgeom.cpp -index 8d93cd9..79268d5 100644 ---- a/src/scripting/flash/geom/flashgeom.cpp -+++ b/src/scripting/flash/geom/flashgeom.cpp -@@ -987,7 +987,7 @@ ASFUNCTIONBODY(Transform,_setColorTransform) - - ASFUNCTIONBODY(Transform,_getConcatenatedMatrix) - { -- Transform* th=Class<Transform>::cast(obj); -+ //Transform* th=Class<Transform>::cast(obj); - LOG(LOG_NOT_IMPLEMENTED,"contcatenatedMAtrix not implemented"); - return Class<Matrix>::getInstanceS(); - } -@@ -1721,7 +1721,7 @@ void Matrix3D::sinit(Class_base* c) - - ASFUNCTIONBODY(Matrix3D,_constructor) - { -- Matrix3D * th=static_cast<Matrix3D*>(obj); -+ //Matrix3D * th=static_cast<Matrix3D*>(obj); - LOG(LOG_NOT_IMPLEMENTED,"Matrix3D is not implemented"); - return NULL; - } -@@ -1733,7 +1733,7 @@ void PerspectiveProjection::sinit(Class_base* c) - - ASFUNCTIONBODY(PerspectiveProjection,_constructor) - { -- PerspectiveProjection * th=static_cast<PerspectiveProjection*>(obj); -+ //PerspectiveProjection * th=static_cast<PerspectiveProjection*>(obj); - LOG(LOG_NOT_IMPLEMENTED,"PerspectiveProjection is not implemented"); - return NULL; - } -diff --git a/src/scripting/flash/net/XMLSocket.cpp b/src/scripting/flash/net/XMLSocket.cpp -index 8fe5abd..0f0aa2f 100644 ---- a/src/scripting/flash/net/XMLSocket.cpp -+++ b/src/scripting/flash/net/XMLSocket.cpp -@@ -507,10 +507,16 @@ void XMLSocketThread::sendData(const tiny_string& data) - - tiny_string *packet = new tiny_string(data); - g_async_queue_push(sendQueue, packet); -+#pragma GCC diagnostic push -+#pragma GCC diagnostic ignored "-Wunused-result" - write(signalEmitter, &SOCKET_COMMAND_SEND, 1); -+#pragma GCC diagnostic pop - } - - void XMLSocketThread::requestClose() - { -+#pragma GCC diagnostic push -+#pragma GCC diagnostic ignored "-Wunused-result" - write(signalEmitter, &SOCKET_COMMAND_CLOSE, 1); -+#pragma GCC diagnostic pop - } -diff --git a/src/scripting/flash/net/flashnet.cpp b/src/scripting/flash/net/flashnet.cpp -index b9639d2..ea8e6fc 100644 ---- a/src/scripting/flash/net/flashnet.cpp -+++ b/src/scripting/flash/net/flashnet.cpp -@@ -1031,8 +1031,8 @@ void NetStreamAppendBytesAction::sinit(Class_base* c) - - NetStream::NetStream(Class_base* c):EventDispatcher(c),tickStarted(false),paused(false),closed(true), - streamTime(0),frameRate(0),connection(),downloader(NULL),videoDecoder(NULL), -- audioDecoder(NULL),audioStream(NULL),datagenerationfile(NULL),datagenerationthreadstarted(false),framesdecoded(0), -- client(NullRef),oldVolume(-1.0),checkPolicyFile(false),rawAccessAllowed(false),playbackBytesPerSecond(0), -+ audioDecoder(NULL),audioStream(NULL),datagenerationfile(NULL),datagenerationthreadstarted(false),client(NullRef), -+ oldVolume(-1.0),checkPolicyFile(false),rawAccessAllowed(false),framesdecoded(0),playbackBytesPerSecond(0), - backBufferLength(0),backBufferTime(30),bufferLength(0),bufferTime(0.1),bufferTimeMax(0), - maxPauseBufferTime(0) - { -@@ -2135,31 +2135,31 @@ ASFUNCTIONBODY(LocalConnection, _constructor) - } - ASFUNCTIONBODY(LocalConnection, allowDomain) - { -- LocalConnection* th=Class<LocalConnection>::cast(obj); -+ //LocalConnection* th=Class<LocalConnection>::cast(obj); - LOG(LOG_NOT_IMPLEMENTED,"LocalConnection::allowDomain is not implemented"); - return NULL; - } - ASFUNCTIONBODY(LocalConnection, allowInsecureDomain) - { -- LocalConnection* th=Class<LocalConnection>::cast(obj); -+ //LocalConnection* th=Class<LocalConnection>::cast(obj); - LOG(LOG_NOT_IMPLEMENTED,"LocalConnection::allowInsecureDomain is not implemented"); - return NULL; - } - ASFUNCTIONBODY(LocalConnection, send) - { -- LocalConnection* th=Class<LocalConnection>::cast(obj); -+ //LocalConnection* th=Class<LocalConnection>::cast(obj); - LOG(LOG_NOT_IMPLEMENTED,"LocalConnection::send is not implemented"); - return NULL; - } - ASFUNCTIONBODY(LocalConnection, connect) - { -- LocalConnection* th=Class<LocalConnection>::cast(obj); -+ //LocalConnection* th=Class<LocalConnection>::cast(obj); - LOG(LOG_NOT_IMPLEMENTED,"LocalConnection::connect is not implemented"); - return NULL; - } - ASFUNCTIONBODY(LocalConnection, close) - { -- LocalConnection* th=Class<LocalConnection>::cast(obj); -+ //LocalConnection* th=Class<LocalConnection>::cast(obj); - LOG(LOG_NOT_IMPLEMENTED,"LocalConnection::close is not implemented"); - return NULL; - } -@@ -2177,7 +2177,7 @@ void NetGroup::sinit(Class_base* c) - ASFUNCTIONBODY(NetGroup, _constructor) - { - EventDispatcher::_constructor(obj, NULL, 0); -- NetGroup* th=Class<NetGroup>::cast(obj); -+ //NetGroup* th=Class<NetGroup>::cast(obj); - LOG(LOG_NOT_IMPLEMENTED,"NetGroup is not implemented"); - return NULL; - } -@@ -2196,7 +2196,7 @@ void ASSocket::sinit(Class_base* c) - ASFUNCTIONBODY(ASSocket, _constructor) - { - EventDispatcher::_constructor(obj, NULL, 0); -- ASSocket* th=Class<ASSocket>::cast(obj); -+ //ASSocket* th=Class<ASSocket>::cast(obj); - LOG(LOG_NOT_IMPLEMENTED,"ASSocket is not implemented"); - return NULL; - } -diff --git a/src/scripting/flash/printing/flashprinting.cpp b/src/scripting/flash/printing/flashprinting.cpp -index 2d46b4b..f1ba9a7 100644 ---- a/src/scripting/flash/printing/flashprinting.cpp -+++ b/src/scripting/flash/printing/flashprinting.cpp -@@ -39,7 +39,7 @@ ASFUNCTIONBODY_GETTER(PrintJob, isSupported); - ASFUNCTIONBODY(PrintJob, _constructor) - { - EventDispatcher::_constructor(obj, NULL, 0); -- PrintJob* th=Class<PrintJob>::cast(obj); -+ //PrintJob* th=Class<PrintJob>::cast(obj); - LOG(LOG_NOT_IMPLEMENTED,"PrintJob is not implemented"); - return NULL; - } -@@ -56,7 +56,7 @@ void PrintJobOptions::sinit(Class_base* c) - - ASFUNCTIONBODY(PrintJobOptions, _constructor) - { -- PrintJobOptions* th=Class<PrintJobOptions>::cast(obj); -+ //PrintJobOptions* th=Class<PrintJobOptions>::cast(obj); - LOG(LOG_NOT_IMPLEMENTED,"PrintJobOptions is not implemented"); - return NULL; - }
View file
lightspark.tar.xz/CMakeLists.txt
Changed
@@ -247,6 +247,9 @@ IF(NOT (${LLVM_STRING_VERSION} VERSION_LESS 3.6)) ADD_DEFINITIONS(-DLLVM_36) ENDIF(NOT (${LLVM_STRING_VERSION} VERSION_LESS 3.6)) +IF(NOT ${LLVM_STRING_VERSION} VERSION_LESS 3.7) + ADD_DEFINITIONS(-DLLVM_37) +ENDIF(NOT ${LLVM_STRING_VERSION} VERSION_LESS 3.7) INCLUDE(FindZLIB REQUIRED) INCLUDE(FindFreetype REQUIRED) IF(NOT(ENABLE_GLES2)) @@ -312,6 +315,8 @@ CHECK_FUNCTION_EXISTS(avcodec_open2 HAVE_AVCODEC_OPEN2) CHECK_FUNCTION_EXISTS(avformat_close_input HAVE_AVFORMAT_CLOSE_INPUT) CHECK_FUNCTION_EXISTS(avformat_find_stream_info HAVE_AVFORMAT_FIND_STREAM_INFO) + CHECK_FUNCTION_EXISTS(av_frame_alloc HAVE_AV_FRAME_ALLOC) + CHECK_FUNCTION_EXISTS(av_frame_unref HAVE_AV_FRAME_UNREF) CHECK_C_SOURCE_COMPILES("#include <libavcodec/avcodec.h>\nint main() { enum AVCodecID c; return 0; }" HAVE_AVCODECID) SET(CMAKE_REQUIRED_FLAGS) @@ -347,6 +352,12 @@ IF(LIBAVRESAMPLE_FOUND) ADD_DEFINITIONS(-DHAVE_LIBAVRESAMPLE) ENDIF(LIBAVRESAMPLE_FOUND) + IF(HAVE_AV_FRAME_ALLOC) + ADD_DEFINITIONS(-DHAVE_AV_FRAME_ALLOC) + ENDIF(HAVE_AV_FRAME_ALLOC) + IF(HAVE_AV_FRAME_UNREF) + ADD_DEFINITIONS(-DHAVE_AV_FRAME_UNREF) + ENDIF(HAVE_AV_FRAME_UNREF) ADD_DEFINITIONS(-DENABLE_LIBAVCODEC) ENDIF(ENABLE_LIBAVCODEC)
View file
lightspark.tar.xz/conf/FindLLVM.cmake
Changed
@@ -57,6 +57,7 @@ /usr/lib/llvm-3.4/bin /usr/lib/llvm-3.5/bin /usr/lib/llvm-3.6/bin + /usr/lib/llvm-3.7/bin ) find_program(LLVM_GCC_EXECUTABLE @@ -177,10 +178,12 @@ check_include_file_cxx("llvm/DataLayout.h" HAVE_DATALAYOUT_H) check_include_file_cxx("llvm/IR/DataLayout.h" HAVE_IR_DATALAYOUT_H) check_include_file_cxx("llvm/IR/Verifier.h" HAVE_IR_VERIFIER_H) + check_include_file_cxx("llvm/PassManager.h" HAVE_PASSMANAGER_H) unset(CMAKE_REQUIRED_INCLUDES) MESSAGE(STATUS "HAVE_DATALAYOUT_H: " ${HAVE_DATALAYOUT_H}) MESSAGE(STATUS "HAVE_IR_DATALAYOUT_H: " ${HAVE_IR_DATALAYOUT_H}) MESSAGE(STATUS "HAVE_IR_VERIFIER_H: " ${HAVE_IR_VERIFIER_H}) + MESSAGE(STATUS "HAVE_PASSMANAGER_H: " ${HAVE_PASSMANAGER_H}) IF(HAVE_DATALAYOUT_H) ADD_DEFINITIONS(-DHAVE_DATALAYOUT_H) ENDIF(HAVE_DATALAYOUT_H) @@ -190,6 +193,9 @@ IF(HAVE_IR_VERIFIER_H) ADD_DEFINITIONS(-DHAVE_IR_VERIFIER_H) ENDIF(HAVE_IR_VERIFIER_H) + IF(HAVE_PASSMANAGER_H) + ADD_DEFINITIONS(-DHAVE_PASSMANAGER_H) + ENDIF(HAVE_PASSMANAGER_H) exec_program(${LLVM_CONFIG_EXECUTABLE} ARGS --cxxflags OUTPUT_VARIABLE LLVM_COMPILE_FLAGS ) MESSAGE(STATUS "LLVM CXX flags: " ${LLVM_COMPILE_FLAGS})
View file
lightspark.tar.xz/src/asobject.cpp
Changed
@@ -1537,6 +1537,7 @@ std::map<const ASObject*, uint32_t>& objMap, std::map<const Class_base*, uint32_t>& traitsMap) const { + bool amf0 = out->getObjectEncoding() == ObjectEncoding::AMF0; //Pairs of name, value auto it=Variables.begin(); for(;it!=Variables.end();it++) @@ -1545,26 +1546,41 @@ continue; //Dynamic traits always have empty namespace assert(it->first.ns.hasEmptyName()); - out->writeStringVR(stringMap,getSys()->getStringFromUniqueId(it->first.nameId)); + if (amf0) + out->writeStringAMF0(getSys()->getStringFromUniqueId(it->first.nameId)); + else + out->writeStringVR(stringMap,getSys()->getStringFromUniqueId(it->first.nameId)); it->second.var->serialize(out, stringMap, objMap, traitsMap); } //The empty string closes the object - out->writeStringVR(stringMap, ""); + if (!amf0) out->writeStringVR(stringMap, ""); } void ASObject::serialize(ByteArray* out, std::map<tiny_string, uint32_t>& stringMap, std::map<const ASObject*, uint32_t>& objMap, std::map<const Class_base*, uint32_t>& traitsMap) { - //0x0A -> object marker - out->writeByte(object_marker); + bool amf0 = out->getObjectEncoding() == ObjectEncoding::AMF0; + if (amf0) + out->writeByte(amf0_object_marker); + else + out->writeByte(object_marker); //Check if the object has been already serialized to send it by reference auto it=objMap.find(this); if(it!=objMap.end()) { - //The least significant bit is 0 to signal a reference - out->writeU29(it->second << 1); + if (amf0) + { + out->writeByte(amf0_reference_marker); + out->writeShort(it->second); + } + else + { + //The least significant bit is 0 to signal a reference + out->writeU29(it->second << 1); + } return; + } Class_base* type=getClass(); @@ -1590,6 +1606,13 @@ //Custom serialization necessary if(!serializeTraits) throwError<TypeError>(kInvalidParamError); + if (amf0) + { + LOG(LOG_NOT_IMPLEMENTED,"serializing IExternalizable in AMF0 not implemented"); + out->writeShort(0); + out->writeByte(amf0_object_end_marker); + return; + } out->writeU29(0x7); out->writeStringVR(stringMap, alias); @@ -1618,6 +1641,35 @@ const variables_map::const_var_iterator endIt = Variables.Variables.end(); //Check if the class traits has been already serialized to send it by reference auto it2=traitsMap.find(type); + + if (amf0) + { + LOG(LOG_NOT_IMPLEMENTED,"serializing ASObject in AMF0 not completely implemented"); + if(it2!=traitsMap.end()) + { + out->writeByte(amf0_reference_marker); + out->writeShort(it2->second); + for(variables_map::const_var_iterator varIt=beginIt; varIt != endIt; ++varIt) + { + if(varIt->second.kind==DECLARED_TRAIT) + { + if(!varIt->first.ns.hasEmptyName()) + { + //Skip variable with a namespace, like protected ones + continue; + } + out->writeStringAMF0(getSys()->getStringFromUniqueId(varIt->first.nameId)); + varIt->second.var->serialize(out, stringMap, objMap, traitsMap); + } + } + } + if(!type->isSealed) + serializeDynamicProperties(out, stringMap, objMap, traitsMap); + out->writeShort(0); + out->writeByte(amf0_object_end_marker); + return; + } + if(it2!=traitsMap.end()) out->writeU29((it2->second << 2) | 1); else
View file
lightspark.tar.xz/src/backends/decoder.cpp
Changed
@@ -30,6 +30,14 @@ #define AVMEDIA_TYPE_AUDIO CODEC_TYPE_AUDIO #endif +#ifndef HAVE_AV_FRAME_ALLOC +#define av_frame_alloc avcodec_alloc_frame +#endif + +#ifndef HAVE_AV_FRAME_UNREF +#define av_frame_unref avcodec_get_frame_defaults +#endif + using namespace lightspark; using namespace std; @@ -166,7 +174,7 @@ else status=INIT; - frameIn=avcodec_alloc_frame(); + frameIn=av_frame_alloc(); } FFMpegVideoDecoder::FFMpegVideoDecoder(AVCodecContext* _c, double frameRateHint): @@ -201,7 +209,7 @@ if(fillDataAndCheckValidity()) status=VALID; - frameIn=avcodec_alloc_frame(); + frameIn=av_frame_alloc(); } FFMpegVideoDecoder::~FFMpegVideoDecoder() @@ -476,7 +484,7 @@ else status=INIT; #if HAVE_AVCODEC_DECODE_AUDIO4 - frameIn=avcodec_alloc_frame(); + frameIn=av_frame_alloc(); #endif } @@ -502,7 +510,7 @@ if(fillDataAndCheckValidity()) status=VALID; #if HAVE_AVCODEC_DECODE_AUDIO4 - frameIn=avcodec_alloc_frame(); + frameIn=av_frame_alloc(); #endif } @@ -522,7 +530,7 @@ if(fillDataAndCheckValidity()) status=VALID; #if HAVE_AVCODEC_DECODE_AUDIO4 - frameIn=avcodec_alloc_frame(); + frameIn=av_frame_alloc(); #endif } @@ -607,7 +615,7 @@ } #if HAVE_AVCODEC_DECODE_AUDIO4 - avcodec_get_frame_defaults(frameIn); + av_frame_unref(frameIn); int frameOk=0; int32_t ret=avcodec_decode_audio4(codecContext, frameIn, &frameOk, &pkt); if(frameOk==0) @@ -664,7 +672,7 @@ int maxLen=AVCODEC_MAX_AUDIO_FRAME_SIZE; #if HAVE_AVCODEC_DECODE_AUDIO4 - avcodec_get_frame_defaults(frameIn); + av_frame_unref(frameIn); int frameOk=0; int ret=avcodec_decode_audio4(codecContext, frameIn, &frameOk, pkt); if(frameOk==0)
View file
lightspark.tar.xz/src/backends/security.cpp
Changed
@@ -1298,7 +1298,7 @@ const char *socket_policy_cmd = "<policy-file-request/>\0"; unsigned int socket_policy_cmd_len = strlen(socket_policy_cmd)+1; ssize_t nbytes = sock.sendAll(socket_policy_cmd, socket_policy_cmd_len); - if (nbytes != socket_policy_cmd_len) + if (nbytes != (int)socket_policy_cmd_len) { return false; }
View file
lightspark.tar.xz/src/scripting/abc.cpp
Changed
@@ -1376,8 +1376,9 @@ ASObject* derived_class=root->applicationDomain->getVariableByString(s,target); if(derived_class==NULL) { - LOG(LOG_ERROR,_("Class ") << s << _(" not found in global for ")<<root->getOrigin()); - throw RunTimeException("Class not found in global"); + //LOG(LOG_ERROR,_("Class ") << s << _(" not found in global for ")<<root->getOrigin()); + //throw RunTimeException("Class not found in global"); + return NULL; } assert_and_throw(derived_class->getObjectType()==T_CLASS); @@ -1641,7 +1642,7 @@ #else llvm::JITExceptionHandling = true; #endif -#ifndef NDEBUG +#if defined(NDEBUG) && !defined(LLVM_37) #ifdef LLVM_31 Opts.JITEmitDebugInfo = true; #else @@ -1665,7 +1666,9 @@ #ifdef LLVM_36 th->FPM=new llvm::legacy::FunctionPassManager(th->module); +#ifndef LLVM_37 th->FPM->add(new llvm::DataLayoutPass()); +#endif #else th->FPM=new llvm::FunctionPassManager(th->module); #ifdef LLVM_35
View file
lightspark.tar.xz/src/scripting/abc_codesynt.cpp
Changed
@@ -26,7 +26,11 @@ #include "compat.h" #include <llvm/ExecutionEngine/ExecutionEngine.h> -#include <llvm/PassManager.h> +#ifdef HAVE_PASSMANAGER_H +# include <llvm/PassManager.h> +#else +# include <llvm/IR/LegacyPassManager.h> +#endif #ifdef HAVE_IR_DATALAYOUT_H # include <llvm/IR/Constants.h> # include <llvm/IR/DerivedTypes.h> @@ -819,13 +823,25 @@ stack_entry rt1=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); /*if(rt1.second==STACK_INT) //TODO: for them, first parameter is call_context, not ABCContext +#ifdef LLVM_37 + name = Builder.CreateCall(ex->FindFunctionNamed("getMultiname_i"), {context, rt1.first, mindx}); +#else name = Builder.CreateCall3(ex->FindFunctionNamed("getMultiname_i"), context, rt1.first, mindx); +#endif else if(rt1.second==STACK_NUMBER) +#ifdef LLVM_37 + name = Builder.CreateCall(ex->FindFunctionNamed("getMultiname_d"), {context, rt1.first, mindx}); +#else name = Builder.CreateCall3(ex->FindFunctionNamed("getMultiname_d"), context, rt1.first, mindx); +#endif else*/ { abstract_value(ex,Builder,rt1); +#ifdef LLVM_37 + name = Builder.CreateCall(ex->FindFunctionNamed("getMultiname"), {context, rt1.first, constnull, mindx}); +#else name = Builder.CreateCall4(ex->FindFunctionNamed("getMultiname"), context, rt1.first, constnull, mindx); +#endif } } else if(rtdata==2) @@ -834,7 +850,11 @@ stack_entry rt2=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); abstract_value(ex,Builder,rt1); abstract_value(ex,Builder,rt2); +#ifdef LLVM_37 + name = Builder.CreateCall(ex->FindFunctionNamed("getMultiname"), {context, rt1.first, rt2.first, mindx}); +#else name = Builder.CreateCall4(ex->FindFunctionNamed("getMultiname"), context, rt1.first, rt2.first, mindx); +#endif } else assert(false); @@ -1868,7 +1888,11 @@ llvm::Value* context=it; //let's give access to local data storage - value=Builder.CreateStructGEP(context,0); + value=Builder.CreateStructGEP( +#ifdef LLVM_37 + nullptr, +#endif + context,0); llvm::Value* locals=Builder.CreateLoad(value); //the stack is statically handled as much as possible to allow llvm optimizations @@ -1876,12 +1900,24 @@ vector<stack_entry> static_stack; static_stack.reserve(body->max_stack); //Get the pointer to the dynamic stack - value=Builder.CreateStructGEP(context,1); + value=Builder.CreateStructGEP( +#ifdef LLVM_37 + nullptr, +#endif + context,1); llvm::Value* dynamic_stack=Builder.CreateLoad(value); //Get the index of the dynamic stack - llvm::Value* dynamic_stack_index=Builder.CreateStructGEP(context,2); + llvm::Value* dynamic_stack_index=Builder.CreateStructGEP( +#ifdef LLVM_37 + nullptr, +#endif + context,2); - llvm::Value* exec_pos=Builder.CreateStructGEP(context,3); + llvm::Value* exec_pos=Builder.CreateStructGEP( +#ifdef LLVM_37 + nullptr, +#endif + context,3); /* //Allocate a fast dynamic stack based on LLVM alloca instruction //This is used on branches @@ -2098,7 +2134,11 @@ u30 t; code >> t; constant = llvm::ConstantInt::get(int_type, t); +#ifdef LLVM_37 + Builder.CreateCall(ex->FindFunctionNamed("getSuper"), {context, constant}); +#else Builder.CreateCall2(ex->FindFunctionNamed("getSuper"), context, constant); +#endif break; } case 0x05: @@ -2109,7 +2149,11 @@ u30 t; code >> t; constant = llvm::ConstantInt::get(int_type, t); +#ifdef LLVM_37 + Builder.CreateCall(ex->FindFunctionNamed("setSuper"), {context, constant}); +#else Builder.CreateCall2(ex->FindFunctionNamed("setSuper"), context, constant); +#endif break; } case 0x06: @@ -2119,7 +2163,11 @@ u30 t; code >> t; constant = llvm::ConstantInt::get(int_type, t); +#ifdef LLVM_37 + Builder.CreateCall(ex->FindFunctionNamed("dxns"), {context, constant}); +#else Builder.CreateCall2(ex->FindFunctionNamed("dxns"), context, constant); +#endif break; } case 0x07: @@ -2128,7 +2176,11 @@ LOG(LOG_TRACE, _("synt dxnslate") ); stack_entry v=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); abstract_value(ex,Builder,v); +#ifdef LLVM_37 + Builder.CreateCall(ex->FindFunctionNamed("dxns"), {context, v.first}); +#else Builder.CreateCall2(ex->FindFunctionNamed("dxns"), context, v.first); +#endif break; } case 0x08: @@ -2179,7 +2231,11 @@ { abstract_value(ex,Builder,v1); abstract_value(ex,Builder,v2); +#ifdef LLVM_37 + cond=Builder.CreateCall(ex->FindFunctionNamed("ifNLT"), {v1.first, v2.first}); +#else cond=Builder.CreateCall2(ex->FindFunctionNamed("ifNLT"), v1.first, v2.first); +#endif } syncStacks(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index); @@ -2212,7 +2268,11 @@ abstract_value(ex,Builder,v1); abstract_value(ex,Builder,v2); +#ifdef LLVM_37 + llvm::Value* cond=Builder.CreateCall(ex->FindFunctionNamed("ifNLE"), {v1.first, v2.first}); +#else llvm::Value* cond=Builder.CreateCall2(ex->FindFunctionNamed("ifNLE"), v1.first, v2.first); +#endif syncStacks(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index); @@ -2245,7 +2305,11 @@ abstract_value(ex,Builder,v1); abstract_value(ex,Builder,v2); +#ifdef LLVM_37 + llvm::Value* cond=Builder.CreateCall(ex->FindFunctionNamed("ifNGT"), {v1.first, v2.first}); +#else llvm::Value* cond=Builder.CreateCall2(ex->FindFunctionNamed("ifNGT"), v1.first, v2.first); +#endif syncStacks(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index); @@ -2278,7 +2342,11 @@ abstract_value(ex,Builder,v1); abstract_value(ex,Builder,v2); +#ifdef LLVM_37 + llvm::Value* cond=Builder.CreateCall(ex->FindFunctionNamed("ifNGE"), {v1.first, v2.first}); +#else llvm::Value* cond=Builder.CreateCall2(ex->FindFunctionNamed("ifNGE"), v1.first, v2.first); +#endif syncStacks(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index); @@ -2401,7 +2469,11 @@ llvm::Value* cond; //Make comparision if(v1.second==STACK_OBJECT && v2.second==STACK_OBJECT) +#ifdef LLVM_37 + cond=Builder.CreateCall(ex->FindFunctionNamed("ifEq"), {v1.first, v2.first}); +#else cond=Builder.CreateCall2(ex->FindFunctionNamed("ifEq"), v1.first, v2.first); +#endif else if(v1.second==STACK_INT && v2.second==STACK_NUMBER) { v1.first=Builder.CreateSIToFP(v1.first,number_type); @@ -2411,7 +2483,11 @@ { abstract_value(ex,Builder,v1); abstract_value(ex,Builder,v2); +#ifdef LLVM_37 + cond=Builder.CreateCall(ex->FindFunctionNamed("ifEq"), {v1.first, v2.first}); +#else cond=Builder.CreateCall2(ex->FindFunctionNamed("ifEq"), v1.first, v2.first); +#endif } syncStacks(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index); @@ -2444,9 +2520,17 @@ stack_entry v2= static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); llvm::Value* cond; if(v1.second==STACK_INT && v2.second==STACK_OBJECT) +#ifdef LLVM_37 + cond=Builder.CreateCall(ex->FindFunctionNamed("ifNE_oi"), {v2.first, v1.first}); +#else cond=Builder.CreateCall2(ex->FindFunctionNamed("ifNE_oi"), v2.first, v1.first); +#endif else if(v1.second==STACK_OBJECT && v2.second==STACK_INT) +#ifdef LLVM_37 + cond=Builder.CreateCall(ex->FindFunctionNamed("ifNE_oi"), {v1.first, v2.first}); +#else cond=Builder.CreateCall2(ex->FindFunctionNamed("ifNE_oi"), v1.first, v2.first); +#endif else if(v1.second==STACK_INT && v2.second==STACK_NUMBER) { v1.first=Builder.CreateSIToFP(v1.first,number_type); @@ -2461,7 +2545,11 @@ //Abstract default abstract_value(ex,Builder,v1); abstract_value(ex,Builder,v2); +#ifdef LLVM_37 + cond=Builder.CreateCall(ex->FindFunctionNamed("ifNE"), {v1.first, v2.first}); +#else cond=Builder.CreateCall2(ex->FindFunctionNamed("ifNE"), v1.first, v2.first); +#endif } syncStacks(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index); @@ -2494,18 +2582,34 @@ stack_entry v2= static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); llvm::Value* cond; if(v1.second==STACK_OBJECT && v2.second==STACK_OBJECT) +#ifdef LLVM_37 + cond=Builder.CreateCall(ex->FindFunctionNamed("ifLT"), {v1.first, v2.first}); +#else cond=Builder.CreateCall2(ex->FindFunctionNamed("ifLT"), v1.first, v2.first); +#endif else if(v1.second==STACK_INT && v2.second==STACK_OBJECT) +#ifdef LLVM_37 + cond=Builder.CreateCall(ex->FindFunctionNamed("ifLT_io"), {v1.first, v2.first}); +#else cond=Builder.CreateCall2(ex->FindFunctionNamed("ifLT_io"), v1.first, v2.first); +#endif else if(v1.second==STACK_OBJECT && v2.second==STACK_INT) +#ifdef LLVM_37 + cond=Builder.CreateCall(ex->FindFunctionNamed("ifLT_oi"), {v1.first, v2.first}); +#else cond=Builder.CreateCall2(ex->FindFunctionNamed("ifLT_oi"), v1.first, v2.first); +#endif else if(v1.second==STACK_INT && v2.second==STACK_INT) cond=Builder.CreateICmpSLT(v2.first,v1.first); else { abstract_value(ex,Builder,v1); abstract_value(ex,Builder,v2); +#ifdef LLVM_37 + cond=Builder.CreateCall(ex->FindFunctionNamed("ifLT"), {v1.first, v2.first}); +#else cond=Builder.CreateCall2(ex->FindFunctionNamed("ifLT"), v1.first, v2.first); +#endif } syncStacks(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index); @@ -2538,12 +2642,20 @@ stack_entry v2=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); llvm::Value* cond; if(v1.second==STACK_OBJECT && v2.second==STACK_OBJECT) +#ifdef LLVM_37 + cond=Builder.CreateCall(ex->FindFunctionNamed("ifLE"), {v1.first, v2.first}); +#else cond=Builder.CreateCall2(ex->FindFunctionNamed("ifLE"), v1.first, v2.first); +#endif else { abstract_value(ex,Builder,v1); abstract_value(ex,Builder,v2); +#ifdef LLVM_37 + cond=Builder.CreateCall(ex->FindFunctionNamed("ifLE"), {v1.first, v2.first}); +#else cond=Builder.CreateCall2(ex->FindFunctionNamed("ifLE"), v1.first, v2.first); +#endif } syncStacks(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index); @@ -2578,7 +2690,11 @@ abstract_value(ex,Builder,v1); abstract_value(ex,Builder,v2); +#ifdef LLVM_37 + cond=Builder.CreateCall(ex->FindFunctionNamed("ifGT"), {v1.first, v2.first}); +#else cond=Builder.CreateCall2(ex->FindFunctionNamed("ifGT"), v1.first, v2.first); +#endif syncStacks(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index); @@ -2612,7 +2728,11 @@ abstract_value(ex,Builder,v1); abstract_value(ex,Builder,v2); +#ifdef LLVM_37 + cond=Builder.CreateCall(ex->FindFunctionNamed("ifGE"), {v1.first, v2.first}); +#else cond=Builder.CreateCall2(ex->FindFunctionNamed("ifGE"), v1.first, v2.first); +#endif syncStacks(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index); @@ -2644,7 +2764,11 @@ static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index).first; llvm::Value* v2= static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index).first; +#ifdef LLVM_37 + llvm::Value* cond=Builder.CreateCall(ex->FindFunctionNamed("ifStrictEq"), {v1, v2}); +#else llvm::Value* cond=Builder.CreateCall2(ex->FindFunctionNamed("ifStrictEq"), v1, v2); +#endif syncStacks(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index); @@ -2677,7 +2801,11 @@ abstract_value(ex,Builder,v1); abstract_value(ex,Builder,v2); +#ifdef LLVM_37 + cond=Builder.CreateCall(ex->FindFunctionNamed("ifStrictNE"), {v1.first, v2.first}); +#else cond=Builder.CreateCall2(ex->FindFunctionNamed("ifStrictNE"), v1.first, v2.first); +#endif syncStacks(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index); @@ -2771,7 +2899,11 @@ llvm::Value* v2= static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index).first; +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("nextName"), {v1, v2}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("nextName"), v1, v2); +#endif static_stack_push(static_stack,stack_entry(value,STACK_OBJECT)); break; } @@ -2800,7 +2932,11 @@ llvm::Value* v2= static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index).first; +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("nextValue"), {v1, v2}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("nextValue"), v1, v2); +#endif static_stack_push(static_stack,stack_entry(value,STACK_OBJECT)); break; } @@ -2898,7 +3034,11 @@ u30 t; code >> t; constant = llvm::ConstantInt::get(int_type, t); +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("pushString"), {context, constant}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("pushString"), context, constant); +#endif static_stack_push(static_stack,stack_entry(value,STACK_OBJECT)); break; } @@ -2911,7 +3051,11 @@ if(Log::getLevel()>=LOG_CALLS) { constant = llvm::ConstantInt::get(int_type, t); +#ifdef LLVM_37 + Builder.CreateCall(ex->FindFunctionNamed("pushInt"), {context, constant}); +#else Builder.CreateCall2(ex->FindFunctionNamed("pushInt"), context, constant); +#endif } s32 i=this->context->constant_pool.integer[t]; constant = llvm::ConstantInt::get(int_type, i); @@ -2927,7 +3071,11 @@ if(Log::getLevel()>=LOG_CALLS) { constant = llvm::ConstantInt::get(int_type, t); +#ifdef LLVM_37 + Builder.CreateCall(ex->FindFunctionNamed("pushUInt"), {context, constant}); +#else Builder.CreateCall2(ex->FindFunctionNamed("pushUInt"), context, constant); +#endif } u32 i=this->context->constant_pool.uinteger[t]; constant = llvm::ConstantInt::get(int_type, i); @@ -2944,7 +3092,11 @@ if(Log::getLevel()>=LOG_CALLS) { constant = llvm::ConstantInt::get(int_type, t); +#ifdef LLVM_37 + Builder.CreateCall(ex->FindFunctionNamed("pushDouble"), {context, constant}); +#else Builder.CreateCall2(ex->FindFunctionNamed("pushDouble"), context, constant); +#endif } number_t d=this->context->constant_pool.doubles[t]; constant = llvm::ConstantFP::get(number_type,d); @@ -2966,7 +3118,11 @@ u30 t; code >> t; constant = llvm::ConstantInt::get(int_type, t); +#ifdef LLVM_37 + value = Builder.CreateCall(ex->FindFunctionNamed("pushNamespace"), {context, constant}); +#else value = Builder.CreateCall2(ex->FindFunctionNamed("pushNamespace"), context, constant); +#endif static_stack_push(static_stack, stack_entry(value,STACK_OBJECT)); break; } @@ -3000,7 +3156,11 @@ static_locals[t2].second=STACK_NONE; } +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("hasNext2"), {context, constant, constant2}); +#else value=Builder.CreateCall3(ex->FindFunctionNamed("hasNext2"), context, constant, constant2); +#endif static_stack_push(static_stack,stack_entry(value,STACK_BOOLEAN)); break; } @@ -3011,7 +3171,11 @@ u30 t; code >> t; constant = llvm::ConstantInt::get(int_type, t); +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("newFunction"), {context, constant}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("newFunction"), context, constant); +#endif static_stack_push(static_stack,stack_entry(value,STACK_OBJECT)); break; } @@ -3024,7 +3188,11 @@ code >> t; constant = llvm::ConstantInt::get(int_type, t); constant2 = llvm::ConstantInt::get(int_type, 0); +#ifdef LLVM_37 + Builder.CreateCall(ex->FindFunctionNamed("call"), {context, constant, constant2}); +#else Builder.CreateCall3(ex->FindFunctionNamed("call"), context, constant, constant2); +#endif break; } case 0x42: @@ -3035,7 +3203,11 @@ u30 t; code >> t; constant = llvm::ConstantInt::get(int_type, t); +#ifdef LLVM_37 + Builder.CreateCall(ex->FindFunctionNamed("construct"), {context, constant}); +#else Builder.CreateCall2(ex->FindFunctionNamed("construct"), context, constant); +#endif break; } case 0x45: @@ -3050,7 +3222,11 @@ constant2 = llvm::ConstantInt::get(int_type, t); constant3 = llvm::ConstantInt::get(int_type, 0); constant4 = llvm::ConstantInt::get(bool_type, 1); +#ifdef LLVM_37 + Builder.CreateCall(ex->FindFunctionNamed("callSuper"), {context, constant, constant2, constant3, constant4}); +#else Builder.CreateCall5(ex->FindFunctionNamed("callSuper"), context, constant, constant2, constant3, constant4); +#endif break; } case 0x4c: //callproplex @@ -3072,7 +3248,11 @@ for(int i=0;i<t;i++) args[t-i]=static_stack_pop(Builder,static_stack,m).first;*/ //Call the function resolver, static case could be resolved at this time (TODO) +#ifdef LLVM_37 + Builder.CreateCall(ex->FindFunctionNamed("callProperty"), {context, constant, constant2, constant3, constant4}); +#else Builder.CreateCall5(ex->FindFunctionNamed("callProperty"), context, constant, constant2, constant3, constant4); +#endif /* //Pop the function object, and then the object itself llvm::Value* fun=static_stack_pop(Builder,static_stack,m).first; @@ -3141,7 +3321,11 @@ u30 t; code >> t; constant = llvm::ConstantInt::get(int_type, t); +#ifdef LLVM_37 + Builder.CreateCall(ex->FindFunctionNamed("constructSuper"), {context, constant}); +#else Builder.CreateCall2(ex->FindFunctionNamed("constructSuper"), context, constant); +#endif break; } case 0x4a: @@ -3154,7 +3338,11 @@ constant = llvm::ConstantInt::get(int_type, t); code >> t; constant2 = llvm::ConstantInt::get(int_type, t); +#ifdef LLVM_37 + Builder.CreateCall(ex->FindFunctionNamed("constructProp"), {context, constant, constant2}); +#else Builder.CreateCall3(ex->FindFunctionNamed("constructProp"), context, constant, constant2); +#endif break; } case 0x4e: @@ -3169,7 +3357,11 @@ constant2 = llvm::ConstantInt::get(int_type, t); constant3 = llvm::ConstantInt::get(int_type, 0); constant4 = llvm::ConstantInt::get(bool_type, 0); +#ifdef LLVM_37 + Builder.CreateCall(ex->FindFunctionNamed("callSuper"), {context, constant, constant2, constant3, constant4}); +#else Builder.CreateCall5(ex->FindFunctionNamed("callSuper"), context, constant, constant2, constant3, constant4); +#endif break; } case 0x4f: @@ -3184,7 +3376,11 @@ constant2 = llvm::ConstantInt::get(int_type, t); constant3 = llvm::ConstantInt::get(int_type, 0); constant4 = llvm::ConstantInt::get(bool_type, 0); +#ifdef LLVM_37 + Builder.CreateCall(ex->FindFunctionNamed("callProperty"), {context, constant, constant2, constant3, constant4}); +#else Builder.CreateCall5(ex->FindFunctionNamed("callProperty"), context, constant, constant2, constant3, constant4); +#endif break; } case 0x53: @@ -3195,7 +3391,11 @@ u30 t; code >> t; constant = llvm::ConstantInt::get(int_type, t); +#ifdef LLVM_37 + Builder.CreateCall(ex->FindFunctionNamed("constructGenericType"), {context, constant}); +#else Builder.CreateCall2(ex->FindFunctionNamed("constructGenericType"), context, constant); +#endif break; } case 0x55: @@ -3206,7 +3406,11 @@ u30 t; code >> t; constant = llvm::ConstantInt::get(int_type, t); +#ifdef LLVM_37 + Builder.CreateCall(ex->FindFunctionNamed("newObject"), {context, constant}); +#else Builder.CreateCall2(ex->FindFunctionNamed("newObject"), context, constant); +#endif break; } case 0x56: @@ -3217,14 +3421,22 @@ u30 t; code >> t; constant = llvm::ConstantInt::get(int_type, t); +#ifdef LLVM_37 + Builder.CreateCall(ex->FindFunctionNamed("newArray"), {context, constant}); +#else Builder.CreateCall2(ex->FindFunctionNamed("newArray"), context, constant); +#endif break; } case 0x57: { //newactivation LOG(LOG_TRACE, _("synt newactivation") ); +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("newActivation"), {context, th}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("newActivation"), context, th); +#endif static_stack_push(static_stack,stack_entry(value,STACK_OBJECT)); break; } @@ -3236,7 +3448,11 @@ u30 t; code >> t; constant = llvm::ConstantInt::get(int_type, t); +#ifdef LLVM_37 + Builder.CreateCall(ex->FindFunctionNamed("newClass"), {context, constant}); +#else Builder.CreateCall2(ex->FindFunctionNamed("newClass"), context, constant); +#endif break; } case 0x59: @@ -3247,7 +3463,11 @@ u30 t; code >> t; constant = llvm::ConstantInt::get(int_type, t); +#ifdef LLVM_37 + Builder.CreateCall(ex->FindFunctionNamed("getDescendants"), {context, constant}); +#else Builder.CreateCall2(ex->FindFunctionNamed("getDescendants"), context, constant); +#endif break; } case 0x5a: @@ -3257,7 +3477,11 @@ u30 t; code >> t; constant = llvm::ConstantInt::get(int_type, t); +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("newCatch"), {context, constant}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("newCatch"), context, constant); +#endif static_stack_push(static_stack,stack_entry(value,STACK_OBJECT)); break; } @@ -3268,7 +3492,11 @@ u30 t; code >> t; llvm::Value* name = getMultiname(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index,this->context,t); +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("findPropStrict"), {context, name}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("findPropStrict"), context, name); +#endif static_stack_push(static_stack,stack_entry(value,STACK_OBJECT)); break; } @@ -3279,7 +3507,11 @@ u30 t; code >> t; llvm::Value* name = getMultiname(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index,this->context,t); +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("findProperty"), {context, name}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("findProperty"), context, name); +#endif static_stack_push(static_stack,stack_entry(value,STACK_OBJECT)); break; } @@ -3291,7 +3523,11 @@ u30 t; code >> t; constant = llvm::ConstantInt::get(int_type, t); +#ifdef LLVM_37 + Builder.CreateCall(ex->FindFunctionNamed("getLex"), {context, constant}); +#else Builder.CreateCall2(ex->FindFunctionNamed("getLex"), context, constant); +#endif break; } case 0x61: @@ -3304,11 +3540,19 @@ llvm::Value* name = getMultiname(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index,this->context,t); stack_entry obj=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); if(value.second==STACK_INT) +#ifdef LLVM_37 + Builder.CreateCall(ex->FindFunctionNamed("setProperty_i"),{value.first, obj.first, name}); +#else Builder.CreateCall3(ex->FindFunctionNamed("setProperty_i"),value.first, obj.first, name); +#endif else { abstract_value(ex,Builder,value); +#ifdef LLVM_37 + Builder.CreateCall(ex->FindFunctionNamed("setProperty"),{value.first, obj.first, name}); +#else Builder.CreateCall3(ex->FindFunctionNamed("setProperty"),value.first, obj.first, name); +#endif } break; } @@ -3331,7 +3575,11 @@ Builder.CreateCall(ex->FindFunctionNamed("incRef"), t); Builder.CreateCall(ex->FindFunctionNamed("incRef"), t); if(Log::getLevel()>=LOG_CALLS) +#ifdef LLVM_37 + Builder.CreateCall(ex->FindFunctionNamed("getLocal"), {t, constant}); +#else Builder.CreateCall2(ex->FindFunctionNamed("getLocal"), t, constant); +#endif } else if(static_locals[i].second==STACK_OBJECT) @@ -3339,14 +3587,22 @@ Builder.CreateCall(ex->FindFunctionNamed("incRef"), static_locals[i].first); static_stack_push(static_stack,static_locals[i]); if(Log::getLevel()>=LOG_CALLS) +#ifdef LLVM_37 + Builder.CreateCall(ex->FindFunctionNamed("getLocal"), {static_locals[i].first, constant}); +#else Builder.CreateCall2(ex->FindFunctionNamed("getLocal"), static_locals[i].first, constant); +#endif } else if(static_locals[i].second==STACK_INT || static_locals[i].second==STACK_UINT) { static_stack_push(static_stack,static_locals[i]); if(Log::getLevel()>=LOG_CALLS) +#ifdef LLVM_37 + Builder.CreateCall(ex->FindFunctionNamed("getLocal_int"), {constant, static_locals[i].first}); +#else Builder.CreateCall2(ex->FindFunctionNamed("getLocal_int"), constant, static_locals[i].first); +#endif } else if(static_locals[i].second==STACK_NUMBER || static_locals[i].second==STACK_BOOLEAN) @@ -3375,7 +3631,11 @@ u30 t; code >> t; constant = llvm::ConstantInt::get(int_type, t); +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("getScopeObject"), {context, constant}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("getScopeObject"), context, constant); +#endif static_stack_push(static_stack,stack_entry(value,STACK_OBJECT)); break; } @@ -3389,17 +3649,29 @@ stack_entry obj=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); abstract_value(ex,Builder,obj); +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("getProperty"), {obj.first, name}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("getProperty"), obj.first, name); +#endif static_stack_push(static_stack,stack_entry(value,STACK_OBJECT)); /*if(cur_block->push_types[local_ip]==STACK_OBJECT || cur_block->push_types[local_ip]==STACK_BOOLEAN) { +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("getProperty"), {obj.first, name}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("getProperty"), obj.first, name); +#endif static_stack_push(static_stack,stack_entry(value,STACK_OBJECT)); } else if(cur_block->push_types[local_ip]==STACK_INT) { +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("getProperty_i"), {obj.first, name}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("getProperty_i"), obj.first, name); +#endif static_stack_push(static_stack,stack_entry(value,STACK_INT)); } else @@ -3417,7 +3689,11 @@ stack_entry val=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); llvm::Value* name = getMultiname(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index,this->context,t); stack_entry obj=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); +#ifdef LLVM_37 + Builder.CreateCall(ex->FindFunctionNamed("initProperty"), {obj.first, val.first, name}); +#else Builder.CreateCall3(ex->FindFunctionNamed("initProperty"), obj.first, val.first, name); +#endif break; } case 0x6a: @@ -3429,7 +3705,11 @@ llvm::Value* name = getMultiname(ex,Builder,static_stack,dynamic_stack,dynamic_stack_index,this->context,t); stack_entry v=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); abstract_value(ex,Builder,v); +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("deleteProperty"), {v.first, name}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("deleteProperty"), v.first, name); +#endif static_stack_push(static_stack,stack_entry(value,STACK_BOOLEAN)); break; } @@ -3442,7 +3722,11 @@ constant = llvm::ConstantInt::get(int_type, t); llvm::Value* v1= static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index).first; +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("getSlot"), {v1, constant}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("getSlot"), v1, constant); +#endif static_stack_push(static_stack,stack_entry(value,STACK_OBJECT)); break; } @@ -3458,7 +3742,11 @@ abstract_value(ex,Builder,v1); abstract_value(ex,Builder,v2); +#ifdef LLVM_37 + Builder.CreateCall(ex->FindFunctionNamed("setSlot"), {v1.first, v2.first, constant}); +#else Builder.CreateCall3(ex->FindFunctionNamed("setSlot"), v1.first, v2.first, constant); +#endif break; } case 0x70: @@ -3551,7 +3839,11 @@ u30 t; code >> t; constant = llvm::ConstantInt::get(int_type, t); +#ifdef LLVM_37 + Builder.CreateCall(ex->FindFunctionNamed("coerce"), {context, constant}); +#else Builder.CreateCall2(ex->FindFunctionNamed("coerce"), context, constant); +#endif break; } case 0x82: @@ -3585,7 +3877,11 @@ stack_entry v1=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); stack_entry v2=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); assert_and_throw(v1.second==STACK_OBJECT && v2.second==STACK_OBJECT); +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("asTypelate"),{v1.first,v2.first}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("asTypelate"),v1.first,v2.first); +#endif static_stack_push(static_stack,stack_entry(value,STACK_OBJECT)); break; } @@ -3673,19 +3969,31 @@ stack_entry v2=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); if(v1.second==STACK_OBJECT && v2.second==STACK_INT) { +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("add_oi"), {v1.first, v2.first}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("add_oi"), v1.first, v2.first); +#endif static_stack_push(static_stack,stack_entry(value,STACK_OBJECT)); } else if(v1.second==STACK_OBJECT && v2.second==STACK_NUMBER) { +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("add_od"), {v1.first, v2.first}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("add_od"), v1.first, v2.first); +#endif static_stack_push(static_stack,stack_entry(value,STACK_OBJECT)); } else if(v1.second==STACK_OBJECT || v2.second==STACK_OBJECT) { abstract_value(ex,Builder,v1); abstract_value(ex,Builder,v2); +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("add"), {v1.first, v2.first}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("add"), v1.first, v2.first); +#endif static_stack_push(static_stack,stack_entry(value,STACK_OBJECT)); } else /* v1 and v2 are BOOLEAN, UINT, INT or NUMBER */ @@ -3726,24 +4034,40 @@ } else if(v1.second==STACK_OBJECT && v2.second==STACK_INT) { +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("subtract_oi"), {v1.first, v2.first}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("subtract_oi"), v1.first, v2.first); +#endif static_stack_push(static_stack,stack_entry(value,STACK_NUMBER)); } else if(v1.second==STACK_NUMBER && v2.second==STACK_OBJECT) { +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("subtract_do"), {v1.first, v2.first}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("subtract_do"), v1.first, v2.first); +#endif static_stack_push(static_stack,stack_entry(value,STACK_NUMBER)); } else if(v1.second==STACK_INT && v2.second==STACK_OBJECT) { +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("subtract_io"), {v1.first, v2.first}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("subtract_io"), v1.first, v2.first); +#endif static_stack_push(static_stack,stack_entry(value,STACK_NUMBER)); } else { abstract_value(ex,Builder,v1); abstract_value(ex,Builder,v2); +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("subtract"), {v1.first, v2.first}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("subtract"), v1.first, v2.first); +#endif static_stack_push(static_stack,stack_entry(value,STACK_NUMBER)); } @@ -3757,12 +4081,20 @@ stack_entry v2= static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); if(v1.second==STACK_INT && v2.second==STACK_OBJECT) { +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("multiply_oi"), {v2.first, v1.first}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("multiply_oi"), v2.first, v1.first); +#endif static_stack_push(static_stack,stack_entry(value,STACK_NUMBER)); } else if(v1.second==STACK_OBJECT && v2.second==STACK_INT) { +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("multiply_oi"), {v1.first, v2.first}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("multiply_oi"), v1.first, v2.first); +#endif static_stack_push(static_stack,stack_entry(value,STACK_NUMBER)); } else if(v1.second==STACK_INT && v2.second==STACK_INT) @@ -3791,7 +4123,11 @@ { abstract_value(ex,Builder,v1); abstract_value(ex,Builder,v2); +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("multiply"), {v1.first, v2.first}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("multiply"), v1.first, v2.first); +#endif static_stack_push(static_stack,stack_entry(value,STACK_NUMBER)); } @@ -3822,7 +4158,11 @@ { abstract_value(ex,Builder,v1); abstract_value(ex,Builder,v2); +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("divide"), {v1.first, v2.first}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("divide"), v1.first, v2.first); +#endif } static_stack_push(static_stack,stack_entry(value,STACK_NUMBER)); break; @@ -3846,7 +4186,11 @@ stack_entry v1=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); stack_entry v2=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); if(v1.second==STACK_INT && v2.second==STACK_OBJECT) +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("lShift_io"), {v1.first, v2.first}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("lShift_io"), v1.first, v2.first); +#endif else if(v1.second==STACK_INT && v2.second==STACK_INT) { constant = llvm::ConstantInt::get(int_type, 31); //Mask for v1 @@ -3857,7 +4201,11 @@ { abstract_value(ex,Builder,v1); abstract_value(ex,Builder,v2); +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("lShift"), {v1.first, v2.first}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("lShift"), v1.first, v2.first); +#endif } static_stack_push(static_stack,stack_entry(value,STACK_INT)); @@ -3872,7 +4220,11 @@ abstract_value(ex,Builder,v1); abstract_value(ex,Builder,v2); +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("rShift"), {v1.first, v2.first}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("rShift"), v1.first, v2.first); +#endif static_stack_push(static_stack,make_pair(value,STACK_INT)); break; @@ -3884,7 +4236,11 @@ stack_entry v1=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); stack_entry v2=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); if(v1.second==STACK_INT && v2.second==STACK_OBJECT) +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("urShift_io"), {v1.first, v2.first}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("urShift_io"), v1.first, v2.first); +#endif else if(v1.second==STACK_INT && v2.second==STACK_INT) { v2.first=Builder.CreateIntCast(v2.first,int_type,false); @@ -3901,7 +4257,11 @@ { abstract_value(ex,Builder,v1); abstract_value(ex,Builder,v2); +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("urShift"), {v1.first, v2.first}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("urShift"), v1.first, v2.first); +#endif } static_stack_push(static_stack,stack_entry(value,STACK_INT)); @@ -3915,9 +4275,17 @@ stack_entry v2=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); if(v1.second==STACK_INT && v2.second==STACK_OBJECT) +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("bitAnd_oi"), {v2.first, v1.first}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("bitAnd_oi"), v2.first, v1.first); +#endif else if(v1.second==STACK_OBJECT && v2.second==STACK_INT) +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("bitAnd_oi"), {v1.first, v2.first}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("bitAnd_oi"), v1.first, v2.first); +#endif else if(v1.second==STACK_INT && v2.second==STACK_INT) value=Builder.CreateAnd(v1.first,v2.first); else if(v1.second==STACK_NUMBER && v2.second==STACK_INT) @@ -3934,7 +4302,11 @@ { abstract_value(ex,Builder,v1); abstract_value(ex,Builder,v2); +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("bitAnd_oo"), {v1.first, v2.first}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("bitAnd_oo"), v1.first, v2.first); +#endif } static_stack_push(static_stack,stack_entry(value,STACK_INT)); @@ -3949,14 +4321,26 @@ if(v1.second==STACK_INT && v2.second==STACK_INT) value=Builder.CreateOr(v1.first,v2.first); else if(v1.second==STACK_OBJECT && v2.second==STACK_INT) +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("bitOr_oi"), {v1.first, v2.first}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("bitOr_oi"), v1.first, v2.first); +#endif else if(v1.second==STACK_INT && v2.second==STACK_OBJECT) +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("bitOr_oi"), {v2.first, v1.first}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("bitOr_oi"), v2.first, v1.first); +#endif else { abstract_value(ex,Builder,v1); abstract_value(ex,Builder,v2); +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("bitOr"), {v1.first, v2.first}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("bitOr"), v1.first, v2.first); +#endif } static_stack_push(static_stack,stack_entry(value,STACK_INT)); @@ -3974,7 +4358,11 @@ { abstract_value(ex,Builder,v1); abstract_value(ex,Builder,v2); +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("bitXor"), {v1.first, v2.first}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("bitXor"), v1.first, v2.first); +#endif } static_stack_push(static_stack,stack_entry(value,STACK_INT)); @@ -3992,7 +4380,11 @@ { abstract_value(ex,Builder,v1); abstract_value(ex,Builder,v2); +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("equals"), {v1.first, v2.first}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("equals"), v1.first, v2.first); +#endif } static_stack_push(static_stack,stack_entry(value,STACK_BOOLEAN)); break; @@ -4005,7 +4397,11 @@ stack_entry v2=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); abstract_value(ex,Builder,v1); abstract_value(ex,Builder,v2); +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("strictEquals"), {v1.first, v2.first}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("strictEquals"), v1.first, v2.first); +#endif static_stack_push(static_stack,stack_entry(value,STACK_BOOLEAN)); break; } @@ -4018,7 +4414,11 @@ abstract_value(ex,Builder,v1); abstract_value(ex,Builder,v2); +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("lessThan"), {v1.first, v2.first}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("lessThan"), v1.first, v2.first); +#endif static_stack_push(static_stack,stack_entry(value,STACK_BOOLEAN)); break; } @@ -4031,7 +4431,11 @@ abstract_value(ex,Builder,v1); abstract_value(ex,Builder,v2); +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("lessEquals"), {v1.first, v2.first}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("lessEquals"), v1.first, v2.first); +#endif static_stack_push(static_stack,stack_entry(value,STACK_BOOLEAN)); break; } @@ -4044,7 +4448,11 @@ abstract_value(ex,Builder,v1); abstract_value(ex,Builder,v2); +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("greaterThan"), {v1.first, v2.first}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("greaterThan"), v1.first, v2.first); +#endif static_stack_push(static_stack,stack_entry(value,STACK_BOOLEAN)); break; } @@ -4057,7 +4465,11 @@ abstract_value(ex,Builder,v1); abstract_value(ex,Builder,v2); +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("greaterEquals"), {v1.first, v2.first}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("greaterEquals"), v1.first, v2.first); +#endif static_stack_push(static_stack,stack_entry(value,STACK_BOOLEAN)); break; } @@ -4070,7 +4482,11 @@ abstract_value(ex,Builder,v1); abstract_value(ex,Builder,v2); +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("instanceOf"), {v1.first, v2.first}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("instanceOf"), v1.first, v2.first); +#endif static_stack_push(static_stack,stack_entry(value,STACK_BOOLEAN)); break; } @@ -4082,7 +4498,11 @@ stack_entry v2=static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index); abstract_value(ex,Builder,v1); abstract_value(ex,Builder,v2); +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("isTypelate"),{v1.first,v2.first}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("isTypelate"),v1.first,v2.first); +#endif static_stack_push(static_stack,stack_entry(value,STACK_BOOLEAN)); break; } @@ -4094,7 +4514,11 @@ static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index).first; llvm::Value* v2= static_stack_pop(Builder,static_stack,dynamic_stack,dynamic_stack_index).first; +#ifdef LLVM_37 + value=Builder.CreateCall(ex->FindFunctionNamed("in"), {v1, v2}); +#else value=Builder.CreateCall2(ex->FindFunctionNamed("in"), v1, v2); +#endif static_stack_push(static_stack,stack_entry(value,STACK_BOOLEAN)); break; } @@ -4150,7 +4574,11 @@ Builder.CreateStore(static_locals[t].first,gep); static_locals[t].second=STACK_NONE; } +#ifdef LLVM_37 + Builder.CreateCall(ex->FindFunctionNamed("incLocal_i"), {context, constant}); +#else Builder.CreateCall2(ex->FindFunctionNamed("incLocal_i"), context, constant); +#endif break; } case 0x63: //setlocal @@ -4172,9 +4600,17 @@ { constant = llvm::ConstantInt::get(int_type, i); if(e.second==STACK_INT) +#ifdef LLVM_37 + Builder.CreateCall(ex->FindFunctionNamed("setLocal_int"), {constant, e.first}); +#else Builder.CreateCall2(ex->FindFunctionNamed("setLocal_int"), constant, e.first); +#endif else if(e.second==STACK_OBJECT) +#ifdef LLVM_37 + Builder.CreateCall(ex->FindFunctionNamed("setLocal_obj"), {constant, e.first}); +#else Builder.CreateCall2(ex->FindFunctionNamed("setLocal_obj"), constant, e.first); +#endif else Builder.CreateCall(ex->FindFunctionNamed("setLocal"), constant); }
View file
lightspark.tar.xz/src/scripting/avmplus/avmplus.cpp
Changed
@@ -56,7 +56,7 @@ } ASFUNCTIONBODY(avmplusFile,readByteArray) { - avmplusFile* th=static_cast<avmplusFile*>(obj); + //avmplusFile* th=static_cast<avmplusFile*>(obj); tiny_string filename; ARG_UNPACK(filename);
View file
lightspark.tar.xz/src/scripting/flash/display/BitmapData.cpp
Changed
@@ -141,7 +141,7 @@ uint8_t *alpha=reinterpret_cast<uint8_t *>(&c); *alpha=0xFF; } - for(uint32_t i=0; i<width*height; i++) + for(uint32_t i=0; i<(uint32_t)(width*height); i++) pixelArray[i]=c; th->pixels->fromRGB(reinterpret_cast<uint8_t *>(pixelArray), width, height, BitmapContainer::ARGB32); th->transparent=transparent; @@ -842,8 +842,6 @@ ASFUNCTIONBODY(BitmapData,applyFilter) { - BitmapData* th = obj->as<BitmapData>(); - _NR<BitmapData> sourceBitmapData; _NR<Rectangle> sourceRect; _NR<Point> destPoint; @@ -852,9 +850,9 @@ LOG(LOG_NOT_IMPLEMENTED,"BitmapData.applyFilter not implemented"); return NULL; } + ASFUNCTIONBODY(BitmapData,noise) { - BitmapData* th = obj->as<BitmapData>(); int randomSeed; uint low; uint high;
View file
lightspark.tar.xz/src/scripting/flash/events/flashevents.cpp
Changed
@@ -189,13 +189,13 @@ ASFUNCTIONBODY(Event,stopPropagation) { - Event* th=static_cast<Event*>(obj); + //Event* th=static_cast<Event*>(obj); LOG(LOG_NOT_IMPLEMENTED,"Event.stopPropagation not implemented"); return NULL; } ASFUNCTIONBODY(Event,stopImmediatePropagation) { - Event* th=static_cast<Event*>(obj); + //Event* th=static_cast<Event*>(obj); LOG(LOG_NOT_IMPLEMENTED,"Event.stopImmediatePropagation not implemented"); return NULL; } @@ -1420,8 +1420,8 @@ ASFUNCTIONBODY(UncaughtErrorEvents, _constructor) { - EventDispatcher::_constructor(obj, NULL, 0); - UncaughtErrorEvents* th=Class<UncaughtErrorEvents>::cast(obj); + //EventDispatcher::_constructor(obj, NULL, 0); + //UncaughtErrorEvents* th=Class<UncaughtErrorEvents>::cast(obj); LOG(LOG_NOT_IMPLEMENTED,"UncaughtErrorEvents is not implemented"); return NULL; }
View file
lightspark.tar.xz/src/scripting/flash/filesystem/flashfilesystem.cpp
Changed
@@ -36,7 +36,7 @@ ASFUNCTIONBODY(FileStream, _constructor) { EventDispatcher::_constructor(obj, NULL, 0); - FileStream* th=Class<FileStream>::cast(obj); + //FileStream* th=Class<FileStream>::cast(obj); LOG(LOG_NOT_IMPLEMENTED,"FileStream is not implemented"); return NULL; }
View file
lightspark.tar.xz/src/scripting/flash/filters/flashfilters.cpp
Changed
@@ -178,15 +178,14 @@ ASFUNCTIONBODY(GradientGlowFilter, _constructor) { - GradientGlowFilter *th = obj->as<GradientGlowFilter>(); + //GradientGlowFilter *th = obj->as<GradientGlowFilter>(); LOG(LOG_NOT_IMPLEMENTED,"GradientGlowFilter is not implemented"); return NULL; } BitmapFilter* GradientGlowFilter::cloneImpl() const { - GradientGlowFilter *cloned = Class<GradientGlowFilter>::getInstanceS(); - return cloned; + return Class<GradientGlowFilter>::getInstanceS(); } BevelFilter::BevelFilter(Class_base* c): @@ -201,15 +200,14 @@ ASFUNCTIONBODY(BevelFilter, _constructor) { - BevelFilter *th = obj->as<BevelFilter>(); + //BevelFilter *th = obj->as<BevelFilter>(); LOG(LOG_NOT_IMPLEMENTED,"GradientGlowFilter is not implemented"); return NULL; } BitmapFilter* BevelFilter::cloneImpl() const { - BevelFilter *cloned = Class<BevelFilter>::getInstanceS(); - return cloned; + return Class<BevelFilter>::getInstanceS(); } ColorMatrixFilter::ColorMatrixFilter(Class_base* c): BitmapFilter(c),matrix(NULL) @@ -253,15 +251,14 @@ ASFUNCTIONBODY(BlurFilter, _constructor) { - BlurFilter *th = obj->as<BlurFilter>(); + //BlurFilter *th = obj->as<BlurFilter>(); LOG(LOG_NOT_IMPLEMENTED,"BlurFilter is not implemented"); return NULL; } BitmapFilter* BlurFilter::cloneImpl() const { - BlurFilter *cloned = Class<BlurFilter>::getInstanceS(); - return cloned; + return Class<BlurFilter>::getInstanceS(); } ConvolutionFilter::ConvolutionFilter(Class_base* c): @@ -276,15 +273,14 @@ ASFUNCTIONBODY(ConvolutionFilter, _constructor) { - ConvolutionFilter *th = obj->as<ConvolutionFilter>(); + //ConvolutionFilter *th = obj->as<ConvolutionFilter>(); LOG(LOG_NOT_IMPLEMENTED,"ConvolutionFilter is not implemented"); return NULL; } BitmapFilter* ConvolutionFilter::cloneImpl() const { - ConvolutionFilter *cloned = Class<ConvolutionFilter>::getInstanceS(); - return cloned; + return Class<ConvolutionFilter>::getInstanceS(); } DisplacementMapFilter::DisplacementMapFilter(Class_base* c): @@ -299,15 +295,14 @@ ASFUNCTIONBODY(DisplacementMapFilter, _constructor) { - DisplacementMapFilter *th = obj->as<DisplacementMapFilter>(); + //DisplacementMapFilter *th = obj->as<DisplacementMapFilter>(); LOG(LOG_NOT_IMPLEMENTED,"DisplacementMapFilter is not implemented"); return NULL; } BitmapFilter* DisplacementMapFilter::cloneImpl() const { - DisplacementMapFilter *cloned = Class<DisplacementMapFilter>::getInstanceS(); - return cloned; + return Class<DisplacementMapFilter>::getInstanceS(); } GradientBevelFilter::GradientBevelFilter(Class_base* c): @@ -322,15 +317,14 @@ ASFUNCTIONBODY(GradientBevelFilter, _constructor) { - GradientBevelFilter *th = obj->as<GradientBevelFilter>(); + //GradientBevelFilter *th = obj->as<GradientBevelFilter>(); LOG(LOG_NOT_IMPLEMENTED,"GradientBevelFilter is not implemented"); return NULL; } BitmapFilter* GradientBevelFilter::cloneImpl() const { - GradientBevelFilter *cloned = Class<GradientBevelFilter>::getInstanceS(); - return cloned; + return Class<GradientBevelFilter>::getInstanceS(); } ShaderFilter::ShaderFilter(Class_base* c): @@ -345,15 +339,14 @@ ASFUNCTIONBODY(ShaderFilter, _constructor) { - ShaderFilter *th = obj->as<ShaderFilter>(); + //ShaderFilter *th = obj->as<ShaderFilter>(); LOG(LOG_NOT_IMPLEMENTED,"ShaderFilter is not implemented"); return NULL; } BitmapFilter* ShaderFilter::cloneImpl() const { - ShaderFilter *cloned = Class<ShaderFilter>::getInstanceS(); - return cloned; + return Class<ShaderFilter>::getInstanceS(); } void BitmapFilterQuality::sinit(Class_base* c)
View file
lightspark.tar.xz/src/scripting/flash/geom/flashgeom.cpp
Changed
@@ -987,7 +987,7 @@ ASFUNCTIONBODY(Transform,_getConcatenatedMatrix) { - Transform* th=Class<Transform>::cast(obj); + //Transform* th=Class<Transform>::cast(obj); LOG(LOG_NOT_IMPLEMENTED,"contcatenatedMAtrix not implemented"); return Class<Matrix>::getInstanceS(); } @@ -1721,7 +1721,7 @@ ASFUNCTIONBODY(Matrix3D,_constructor) { - Matrix3D * th=static_cast<Matrix3D*>(obj); + //Matrix3D * th=static_cast<Matrix3D*>(obj); LOG(LOG_NOT_IMPLEMENTED,"Matrix3D is not implemented"); return NULL; } @@ -1733,7 +1733,7 @@ ASFUNCTIONBODY(PerspectiveProjection,_constructor) { - PerspectiveProjection * th=static_cast<PerspectiveProjection*>(obj); + //PerspectiveProjection * th=static_cast<PerspectiveProjection*>(obj); LOG(LOG_NOT_IMPLEMENTED,"PerspectiveProjection is not implemented"); return NULL; }
View file
lightspark.tar.xz/src/scripting/flash/net/URLStream.cpp
Changed
@@ -90,6 +90,8 @@ // Don't send any events if the thread is aborting if(success && !threadAborting) { + loader->incRef(); + getVm()->addEvent(loader,_MR(Class<ProgressEvent>::getInstanceS(downloader->getLength(),downloader->getLength()))); //Send a complete event for this object loader->incRef(); getVm()->addEvent(loader,_MR(Class<Event>::getInstanceS("complete")));
View file
lightspark.tar.xz/src/scripting/flash/net/XMLSocket.cpp
Changed
@@ -507,10 +507,16 @@ tiny_string *packet = new tiny_string(data); g_async_queue_push(sendQueue, packet); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-result" write(signalEmitter, &SOCKET_COMMAND_SEND, 1); +#pragma GCC diagnostic pop } void XMLSocketThread::requestClose() { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-result" write(signalEmitter, &SOCKET_COMMAND_CLOSE, 1); +#pragma GCC diagnostic pop }
View file
lightspark.tar.xz/src/scripting/flash/net/flashnet.cpp
Changed
@@ -1031,8 +1031,8 @@ NetStream::NetStream(Class_base* c):EventDispatcher(c),tickStarted(false),paused(false),closed(true), streamTime(0),frameRate(0),connection(),downloader(NULL),videoDecoder(NULL), - audioDecoder(NULL),audioStream(NULL),datagenerationfile(NULL),datagenerationthreadstarted(false),framesdecoded(0), - client(NullRef),oldVolume(-1.0),checkPolicyFile(false),rawAccessAllowed(false),playbackBytesPerSecond(0), + audioDecoder(NULL),audioStream(NULL),datagenerationfile(NULL),datagenerationthreadstarted(false),client(NullRef), + oldVolume(-1.0),checkPolicyFile(false),rawAccessAllowed(false),framesdecoded(0),playbackBytesPerSecond(0), backBufferLength(0),backBufferTime(30),bufferLength(0),bufferTime(0.1),bufferTimeMax(0), maxPauseBufferTime(0) { @@ -2135,31 +2135,31 @@ } ASFUNCTIONBODY(LocalConnection, allowDomain) { - LocalConnection* th=Class<LocalConnection>::cast(obj); + //LocalConnection* th=Class<LocalConnection>::cast(obj); LOG(LOG_NOT_IMPLEMENTED,"LocalConnection::allowDomain is not implemented"); return NULL; } ASFUNCTIONBODY(LocalConnection, allowInsecureDomain) { - LocalConnection* th=Class<LocalConnection>::cast(obj); + //LocalConnection* th=Class<LocalConnection>::cast(obj); LOG(LOG_NOT_IMPLEMENTED,"LocalConnection::allowInsecureDomain is not implemented"); return NULL; } ASFUNCTIONBODY(LocalConnection, send) { - LocalConnection* th=Class<LocalConnection>::cast(obj); + //LocalConnection* th=Class<LocalConnection>::cast(obj); LOG(LOG_NOT_IMPLEMENTED,"LocalConnection::send is not implemented"); return NULL; } ASFUNCTIONBODY(LocalConnection, connect) { - LocalConnection* th=Class<LocalConnection>::cast(obj); + //LocalConnection* th=Class<LocalConnection>::cast(obj); LOG(LOG_NOT_IMPLEMENTED,"LocalConnection::connect is not implemented"); return NULL; } ASFUNCTIONBODY(LocalConnection, close) { - LocalConnection* th=Class<LocalConnection>::cast(obj); + //LocalConnection* th=Class<LocalConnection>::cast(obj); LOG(LOG_NOT_IMPLEMENTED,"LocalConnection::close is not implemented"); return NULL; } @@ -2177,7 +2177,7 @@ ASFUNCTIONBODY(NetGroup, _constructor) { EventDispatcher::_constructor(obj, NULL, 0); - NetGroup* th=Class<NetGroup>::cast(obj); + //NetGroup* th=Class<NetGroup>::cast(obj); LOG(LOG_NOT_IMPLEMENTED,"NetGroup is not implemented"); return NULL; } @@ -2196,7 +2196,7 @@ ASFUNCTIONBODY(ASSocket, _constructor) { EventDispatcher::_constructor(obj, NULL, 0); - ASSocket* th=Class<ASSocket>::cast(obj); + //ASSocket* th=Class<ASSocket>::cast(obj); LOG(LOG_NOT_IMPLEMENTED,"ASSocket is not implemented"); return NULL; }
View file
lightspark.tar.xz/src/scripting/flash/printing/flashprinting.cpp
Changed
@@ -39,7 +39,7 @@ ASFUNCTIONBODY(PrintJob, _constructor) { EventDispatcher::_constructor(obj, NULL, 0); - PrintJob* th=Class<PrintJob>::cast(obj); + //PrintJob* th=Class<PrintJob>::cast(obj); LOG(LOG_NOT_IMPLEMENTED,"PrintJob is not implemented"); return NULL; } @@ -56,7 +56,7 @@ ASFUNCTIONBODY(PrintJobOptions, _constructor) { - PrintJobOptions* th=Class<PrintJobOptions>::cast(obj); + //PrintJobOptions* th=Class<PrintJobOptions>::cast(obj); LOG(LOG_NOT_IMPLEMENTED,"PrintJobOptions is not implemented"); return NULL; }
View file
lightspark.tar.xz/src/scripting/flash/utils/ByteArray.cpp
Changed
@@ -552,14 +552,6 @@ { //Return the length of the serialized object - //TODO: support AMF0 - - if (objectEncoding==ObjectEncoding::AMF0) - { - LOG(LOG_NOT_IMPLEMENTED,"ByteArray.writeObject: writing AMF0 objects not implemented"); - //return 0; - } - //assert_and_throw(objectEncoding==ObjectEncoding::AMF3); //TODO: support custom serialization map<tiny_string, uint32_t> stringMap; map<const ASObject*, uint32_t> objMap; @@ -1178,6 +1170,23 @@ } } +void ByteArray::writeStringAMF0(const tiny_string& s) +{ + const uint32_t len=s.numBytes(); + if(len <= 0xffff) + { + writeUTF(s); + } + else + { + getBuffer(position+len+4,true); + uint32_t numBytes=endianIn((uint32_t)len); + memcpy(bytes+position,&numBytes,4); + memcpy(bytes+position+4,s.raw_buf(),len); + position+=len+4; + } +} + void ByteArray::writeXMLString(std::map<const ASObject*, uint32_t>& objMap, ASObject *xml, const tiny_string& xmlstr) @@ -1463,6 +1472,11 @@ std::map<const ASObject*, uint32_t>& objMap, std::map<const Class_base*, uint32_t>& traitsMap) { + if (out->getObjectEncoding() == ObjectEncoding::AMF0) + { + LOG(LOG_NOT_IMPLEMENTED,"serializing ByteArray in AMF0 not implemented"); + return; + } assert_and_throw(objMap.find(this)==objMap.end()); out->writeByte(byte_array_marker); //Check if the bytearray has been already serialized
View file
lightspark.tar.xz/src/scripting/flash/utils/ByteArray.h
Changed
@@ -62,6 +62,7 @@ void writeUTF(const tiny_string& str); uint32_t writeObject(ASObject* obj); void writeStringVR(std::map<tiny_string, uint32_t>& stringMap, const tiny_string& s); + void writeStringAMF0(const tiny_string& s); void writeXMLString(std::map<const ASObject*, uint32_t>& objMap, ASObject *xml, const tiny_string& s); void writeU29(uint32_t val); @@ -73,6 +74,7 @@ void append(std::streambuf* data, int length); + uint8_t getObjectEncoding() const { return objectEncoding; } uint8_t getCurrentObjectEncoding() const { return currentObjectEncoding; } void setCurrentObjectEncoding(uint8_t encoding) { currentObjectEncoding = encoding; }
View file
lightspark.tar.xz/src/scripting/flash/utils/Dictionary.cpp
Changed
@@ -357,6 +357,11 @@ std::map<const ASObject*, uint32_t>& objMap, std::map<const Class_base*, uint32_t>& traitsMap) { + if (out->getObjectEncoding() == ObjectEncoding::AMF0) + { + LOG(LOG_NOT_IMPLEMENTED,"serializing Dictionary in AMF0 not implemented"); + return; + } assert_and_throw(objMap.find(this)==objMap.end()); out->writeByte(dictionary_marker); //Check if the dictionary has been already serialized
View file
lightspark.tar.xz/src/scripting/flash/xml/flashxml.cpp
Changed
@@ -309,6 +309,11 @@ std::map<const ASObject*, uint32_t>& objMap, std::map<const Class_base*, uint32_t>& traitsMap) { + if (out->getObjectEncoding() == ObjectEncoding::AMF0) + { + LOG(LOG_NOT_IMPLEMENTED,"serializing XMLDocument in AMF0 not implemented"); + return; + } out->writeByte(xml_doc_marker); out->writeXMLString(objMap, this, toString()); }
View file
lightspark.tar.xz/src/scripting/toplevel/ASString.cpp
Changed
@@ -585,8 +585,16 @@ std::map<const ASObject*, uint32_t>& objMap, std::map<const Class_base*, uint32_t>& traitsMap) { - out->writeByte(string_marker); - out->writeStringVR(stringMap, data); + if (out->getObjectEncoding() == ObjectEncoding::AMF0) + { + out->writeByte(amf0_string_marker); + out->writeStringAMF0(data); + } + else + { + out->writeByte(string_marker); + out->writeStringVR(stringMap, data); + } } ASFUNCTIONBODY(ASString,slice)
View file
lightspark.tar.xz/src/scripting/toplevel/Array.cpp
Changed
@@ -1573,6 +1573,11 @@ std::map<const ASObject*, uint32_t>& objMap, std::map<const Class_base*, uint32_t>& traitsMap) { + if (out->getObjectEncoding() == ObjectEncoding::AMF0) + { + LOG(LOG_NOT_IMPLEMENTED,"serializing Array in AMF0 not implemented"); + return; + } assert_and_throw(objMap.find(this)==objMap.end()); out->writeByte(array_marker); //Check if the array has been already serialized
View file
lightspark.tar.xz/src/scripting/toplevel/Boolean.cpp
Changed
@@ -126,10 +126,13 @@ std::map<const ASObject*, uint32_t>& objMap, std::map<const Class_base*, uint32_t>& traitsMap) { - if(val) - out->writeByte(true_marker); + if (out->getObjectEncoding() == ObjectEncoding::AMF0) + { + out->writeByte(amf0_boolean_marker); + out->writeByte(val ? 1:0); + } else - out->writeByte(false_marker); + out->writeByte(val ? true_marker : false_marker); } bool Boolean::isEqual(ASObject* r)
View file
lightspark.tar.xz/src/scripting/toplevel/Date.cpp
Changed
@@ -1133,6 +1133,11 @@ std::map<const ASObject*, uint32_t>& objMap, std::map<const Class_base*, uint32_t>& traitsMap) { + if (out->getObjectEncoding() == ObjectEncoding::AMF0) + { + LOG(LOG_NOT_IMPLEMENTED,"serializing Date in AMF0 not implemented"); + return; + } number_t val = getMsSinceEpoch(); out->writeByte(date_marker); auto it=objMap.find(this);
View file
lightspark.tar.xz/src/scripting/toplevel/Integer.cpp
Changed
@@ -213,6 +213,13 @@ std::map<const ASObject*, uint32_t>& objMap, std::map<const Class_base*, uint32_t>& traitsMap) { + if (out->getObjectEncoding() == ObjectEncoding::AMF0) + { + // write as double + out->writeByte(amf0_number_marker); + out->serializeDouble(val); + return; + } if(val>=0x40000000 || val<=(int32_t)0xbfffffff) { // write as double @@ -247,8 +254,19 @@ //Skip leading zeroes if (radix == 0) { + int count=0; while(*cur=='0') + { cur++; + count++; + } + + //The string consisted of all zeroes + if(count>0 && *cur=='\0') + { + ret = 0; + return true; + } } errno=0;
View file
lightspark.tar.xz/src/scripting/toplevel/Number.cpp
Changed
@@ -529,6 +529,12 @@ std::map<const ASObject*, uint32_t>& objMap, std::map<const Class_base*, uint32_t>& traitsMap) { + if (out->getObjectEncoding() == ObjectEncoding::AMF0) + { + out->writeByte(amf0_number_marker); + out->serializeDouble(val); + return; + } out->writeByte(double_marker); out->serializeDouble(val); }
View file
lightspark.tar.xz/src/scripting/toplevel/UInteger.cpp
Changed
@@ -211,6 +211,12 @@ std::map<const ASObject*, uint32_t>& objMap, std::map<const Class_base*, uint32_t>& traitsMap) { + if (out->getObjectEncoding() == ObjectEncoding::AMF0) + { + out->writeByte(amf0_number_marker); + out->serializeDouble(val); + return; + } if(val>=0x40000000) { // write as double
View file
lightspark.tar.xz/src/scripting/toplevel/Vector.cpp
Changed
@@ -1158,6 +1158,11 @@ std::map<const ASObject*, uint32_t>& objMap, std::map<const Class_base*, uint32_t>& traitsMap) { + if (out->getObjectEncoding() == ObjectEncoding::AMF0) + { + LOG(LOG_NOT_IMPLEMENTED,"serializing Vector in AMF0 not implemented"); + return; + } uint8_t marker = 0; if (vec_type == Class<Integer>::getClass()) marker = vector_int_marker;
View file
lightspark.tar.xz/src/scripting/toplevel/XML.cpp
Changed
@@ -2402,6 +2402,12 @@ std::map<const ASObject*, uint32_t>& objMap, std::map<const Class_base*, uint32_t>& traitsMap) { + if (out->getObjectEncoding() == ObjectEncoding::AMF0) + { + LOG(LOG_NOT_IMPLEMENTED,"serializing XML in AMF0 not implemented"); + return; + } + out->writeByte(xml_marker); out->writeXMLString(objMap, this, toString()); }
View file
lightspark.tar.xz/src/scripting/toplevel/toplevel.cpp
Changed
@@ -117,7 +117,10 @@ std::map<const ASObject*, uint32_t>& objMap, std::map<const Class_base*, uint32_t>& traitsMap) { - out->writeByte(undefined_marker); + if (out->getObjectEncoding() == ObjectEncoding::AMF0) + out->writeByte(amf0_undefined_marker); + else + out->writeByte(undefined_marker); } void Undefined::setVariableByMultiname(const multiname& name, ASObject* o, CONST_ALLOWED_FLAG allowConst) @@ -662,7 +665,10 @@ std::map<const ASObject*, uint32_t>& objMap, std::map<const Class_base*, uint32_t>& traitsMap) { - out->writeByte(null_marker); + if (out->getObjectEncoding() == ObjectEncoding::AMF0) + out->writeByte(amf0_null_marker); + else + out->writeByte(null_marker); } void Null::setVariableByMultiname(const multiname& name, ASObject* o, CONST_ALLOWED_FLAG allowConst)
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.