Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
chakrashim: Updated ChakraCore to release/2.0
Browse files Browse the repository at this point in the history
Updated ChakraCore to chakra-core/ChakraCore@aafd252

PR-URL: #232
Reviewed-By: Kunal Pathak <Kunal.Pathak@microsoft.com>
Reviewed-By: Mark Marron <marron@microsoft.com>
  • Loading branch information
kfarnung committed May 2, 2017
1 parent 97002d0 commit 7f33b4c
Show file tree
Hide file tree
Showing 194 changed files with 7,613 additions and 5,559 deletions.
5 changes: 0 additions & 5 deletions deps/chakrashim/core/.gitattributes

This file was deleted.

2 changes: 2 additions & 0 deletions deps/chakrashim/core/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ tags
*.a
*.gch
*.o
*.so
*.dylib
Makefile
pal/src/config.h
DbgController.js.h
Expand Down
2 changes: 1 addition & 1 deletion deps/chakrashim/core/Build/NuGet/.pack-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.2
1.4.3
11 changes: 10 additions & 1 deletion deps/chakrashim/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ endif()

if(CC_TARGETS_AMD64_SH)
set(CC_TARGETS_AMD64 1)
elseif (CC_TARGETS_ARM_SH)
elseif(CC_TARGETS_ARM_SH)
set(CC_TARGETS_ARM 1)
add_definitions(-D_ARM_=1)
set(CMAKE_SYSTEM_PROCESSOR "armv7l")
Expand All @@ -51,6 +51,15 @@ unset(CC_TARGETS_ARM_SH CACHE)
unset(CC_TARGETS_X86_SH CACHE)
unset(CC_TARGETS_AMD64_SH CACHE)

if(ENABLE_VALGRIND_SH)
unset(ENABLE_VALGRIND_SH CACHE)
if(NOT CC_TARGETS_X86)
# Enable Valgrind is not needed for x86 builds. Already <= 32Gb address space
set(ENABLE_VALGRIND 1)
add_definitions(-DENABLE_VALGRIND=1)
endif()
endif()

if(ICU_SETTINGS_RESET)
unset(ICU_SETTINGS_RESET CACHE)
unset(ICU_INCLUDE_PATH CACHE)
Expand Down
2 changes: 1 addition & 1 deletion deps/chakrashim/core/bin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
if(NOT CC_LIBS_ONLY_BUILD)
if(NOT CC_TARGET_OS_ANDROID)
if(NOT (CC_TARGET_OS_ANDROID OR ENABLE_VALGRIND))
add_subdirectory (GCStress)
endif()

Expand Down
1 change: 1 addition & 0 deletions deps/chakrashim/core/bin/ChakraCore/ChakraCore.def
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ JsTTDPauseTimeTravelBeforeRuntimeOperation
JsTTDReStartTimeTravelAfterRuntimeOperation

JsTTDNotifyYield
JsTTDNotifyLongLivedReferenceAdd
JsTTDHostExit
JsTTDRawBufferCopySyncIndirect
JsTTDRawBufferModifySyncIndirect
Expand Down
7 changes: 6 additions & 1 deletion deps/chakrashim/core/bin/ch/ch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ void __stdcall PrintUsage()

void __stdcall PrintChVersion()
{
wprintf(_u("%s version %d.%d.%d.0\n"), hostName, CHAKRA_CORE_MAJOR_VERSION, CHAKRA_CORE_MINOR_VERSION, CHAKRA_CORE_PATCH_VERSION);
#if CHAKRA_CORE_VERSION_RELEASE
wprintf(_u("%s version %d.%d.%d.0\n"),
#else
wprintf(_u("%s version %d.%d.%d.0-beta\n"),
#endif
hostName, CHAKRA_CORE_MAJOR_VERSION, CHAKRA_CORE_MINOR_VERSION, CHAKRA_CORE_PATCH_VERSION);
}

#ifdef _WIN32
Expand Down
140 changes: 82 additions & 58 deletions deps/chakrashim/core/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ ERROR_EXIT() {
fi
}

ERROR_CLANG() {
echo "ERROR: clang++ not found."
echo -e "\nYou could use clang++ from a custom location.\n"
PRINT_USAGE
exit 1
}

PRINT_USAGE() {
echo ""
echo "[ChakraCore Build Script Help]"
Expand Down Expand Up @@ -52,15 +59,18 @@ PRINT_USAGE() {
echo " --trace Enables experimental built-in trace."
echo " --xcode Generate XCode project."
echo " --without=FEATURE,FEATURE,..."
echo " Disable FEATUREs from JSRT experimental"
echo " features."
echo " Disable FEATUREs from JSRT experimental features."
echo " --valgrind Enable Valgrind support"
echo " !!! Disables Concurrent GC (lower performance)"
echo " -v, --verbose Display verbose output including all options"
echo " --wb-check CPPFILE"
echo " Write-barrier check given CPPFILE (git path)"
echo " --wb-analyze CPPFILE"
echo " Write-barrier analyze given CPPFILE (git path)"
echo " --wb-args=PLUGIN_ARGS"
echo " Write-barrier clang plugin args"
echo " -y Automatically answer Yes to questions asked by \
script (at your own risk)"
echo ""
echo "example:"
echo " ./build.sh --cxx=/path/to/clang++ --cc=/path/to/clang -j"
Expand Down Expand Up @@ -94,9 +104,12 @@ WB_CHECK=
WB_ANALYZE=
WB_ARGS=
TARGET_PATH=0
VALGRIND=0
# -DCMAKE_EXPORT_COMPILE_COMMANDS=ON useful for clang-query tool
CMAKE_EXPORT_COMPILE_COMMANDS="-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
LIBS_ONLY_BUILD=
SHOULD_EMBED_ICU=0
ALWAYS_YES=0

if [ -f "/proc/version" ]; then
OS_LINUX=1
Expand Down Expand Up @@ -142,48 +155,9 @@ while [[ $# -gt 0 ]]; do
;;

--embed-icu)
if [ ! -d "${CHAKRACORE_DIR}/deps/icu/source/output" ]; then
ICU_URL="http://source.icu-project.org/repos/icu/icu/tags/release-57-1"
echo -e "\n----------------------------------------------------------------"
echo -e "\nThis script will download ICU-LIB from\n${ICU_URL}\n"
echo "It is licensed to you by its publisher, not Microsoft."
echo "Microsoft is not responsible for the software."
echo "Your installation and use of ICU-LIB is subject to the publisher’s terms available here:"
echo -e "http://www.unicode.org/copyright.html#License\n"
echo -e "----------------------------------------------------------------\n"
echo "If you don't agree, press Ctrl+C to terminate"
read -t 10 -p "Hit ENTER to continue (or wait 10 seconds)"
SAFE_RUN `mkdir -p ${CHAKRACORE_DIR}/deps/`
cd "${CHAKRACORE_DIR}/deps/";
ABS_DIR=`pwd`
if [ ! -d "${ABS_DIR}/icu/" ]; then
echo "Downloading ICU ${ICU_URL}"
if [ ! -f "/usr/bin/svn" ]; then
echo -e "\nYou should install 'svn' client in order to use this feature"
if [ $OS_APT_GET == 1 ]; then
echo "tip: Try 'sudo apt-get install subversion'"
fi
exit 1
fi
svn export -q $ICU_URL icu
ERROR_EXIT "rm -rf ${ABS_DIR}/icu/"
fi

cd "${ABS_DIR}/icu/source";./configure --with-data-packaging=static\
--prefix="${ABS_DIR}/icu/source/output/"\
--enable-static --disable-shared --with-library-bits=64\
--disable-icuio --disable-layout\
CXXFLAGS="-fPIC" CFLAGS="-fPIC"

ERROR_EXIT "rm -rf ${ABS_DIR}/icu/source/output/"
make STATICCFLAGS="-fPIC" STATICCXXFLAGS="-fPIC" STATICCPPFLAGS="-DPIC" install
ERROR_EXIT "rm -rf ${ABS_DIR}/icu/source/output/"
cd "${ABS_DIR}/../"
fi
ICU_PATH="-DCC_EMBED_ICU_SH=1"
SHOULD_EMBED_ICU=1
;;


-t | --test-build)
BUILD_TYPE="Test"
;;
Expand Down Expand Up @@ -325,6 +299,10 @@ while [[ $# -gt 0 ]]; do
WB_ARGS=${WB_ARGS// /;} # replace space with ; to generate a cmake list
;;

--valgrind)
VALGRIND="-DENABLE_VALGRIND_SH=1"
;;

*)
echo "Unknown option $1"
PRINT_USAGE
Expand All @@ -335,9 +313,52 @@ while [[ $# -gt 0 ]]; do
shift
done

if [ "${HAS_LTO}${OS_LINUX}" == "11" ]; then
echo "lto: ranlib disabled"
export RANLIB=/bin/true
if [[ $SHOULD_EMBED_ICU == 1 ]]; then
if [ ! -d "${CHAKRACORE_DIR}/deps/icu/source/output" ]; then
ICU_URL="http://source.icu-project.org/repos/icu/icu/tags/release-57-1"
echo -e "\n----------------------------------------------------------------"
echo -e "\nThis script will download ICU-LIB from\n${ICU_URL}\n"
echo "It is licensed to you by its publisher, not Microsoft."
echo "Microsoft is not responsible for the software."
echo "Your installation and use of ICU-LIB is subject to the publisher’s terms available here:"
echo -e "http://www.unicode.org/copyright.html#License\n"
echo -e "----------------------------------------------------------------\n"
echo "If you don't agree, press Ctrl+C to terminate"
WAIT_QUESTION="Hit ENTER to continue (or wait 10 seconds)"
if [[ $ALWAYS_YES == 1 ]]; then
echo "$WAIT_QUESTION : Y"
else
read -t 10 -p "$WAIT_QUESTION"
fi

SAFE_RUN `mkdir -p ${CHAKRACORE_DIR}/deps/`
cd "${CHAKRACORE_DIR}/deps/";
ABS_DIR=`pwd`
if [ ! -d "${ABS_DIR}/icu/" ]; then
echo "Downloading ICU ${ICU_URL}"
if [ ! -f "/usr/bin/svn" ]; then
echo -e "\nYou should install 'svn' client in order to use this feature"
if [ $OS_APT_GET == 1 ]; then
echo "tip: Try 'sudo apt-get install subversion'"
fi
exit 1
fi
svn export -q $ICU_URL icu
ERROR_EXIT "rm -rf ${ABS_DIR}/icu/"
fi

cd "${ABS_DIR}/icu/source";./configure --with-data-packaging=static\
--prefix="${ABS_DIR}/icu/source/output/"\
--enable-static --disable-shared --with-library-bits=64\
--disable-icuio --disable-layout\
CXXFLAGS="-fPIC" CFLAGS="-fPIC"

ERROR_EXIT "rm -rf ${ABS_DIR}/icu/source/output/"
make STATICCFLAGS="-fPIC" STATICCXXFLAGS="-fPIC" STATICCPPFLAGS="-DPIC" install
ERROR_EXIT "rm -rf ${ABS_DIR}/icu/source/output/"
cd "${ABS_DIR}/../"
fi
ICU_PATH="-DCC_EMBED_ICU_SH=1"
fi

if [[ ${#_VERBOSE} > 0 ]]; then
Expand All @@ -360,12 +381,10 @@ if [[ $HAS_LTO == 1 && -f cc-toolchain/build/bin/clang++ ]]; then
_CC="$SELF/cc-toolchain/build/bin/clang"
fi

ERROR_CLANG() {
echo "ERROR: clang++ not found."
echo -e "\nYou could use clang++ from a custom location.\n"
PRINT_USAGE
exit 1
}
if [ "${HAS_LTO}${OS_LINUX}" == "11" ]; then
echo "lto: ranlib disabled"
export RANLIB=/bin/true
fi

CLANG_PATH=
if [[ ${#_CXX} > 0 || ${#_CC} > 0 ]]; then
Expand Down Expand Up @@ -424,6 +443,7 @@ if [[ ${#_CXX} > 0 ]]; then
CC_PREFIX="-DCMAKE_CXX_COMPILER=$_CXX -DCMAKE_C_COMPILER=$_CC"
fi

RELATIVE_BUILD_PATH="../.."
if [[ $TARGET_PATH == 0 ]]; then
TARGET_PATH="$CHAKRACORE_DIR/out"
else
Expand All @@ -432,9 +452,14 @@ else
echo -e "\nAborting Build."
exit 1
fi
echo "Build path: ${TARGET_PATH}/${BUILD_TYPE:0}"
fi

BUILD_DIRECTORY="${TARGET_PATH}/${BUILD_TYPE:0}"
echo "Build path: ${BUILD_DIRECTORY}"

BUILD_RELATIVE_DIRECTORY=$(python -c "import os.path;print \
os.path.relpath('${CHAKRACORE_DIR}', '$BUILD_DIRECTORY')")

################# Write-barrier check/analyze run #################
WB_FLAG=
WB_TARGET=
Expand Down Expand Up @@ -493,11 +518,10 @@ if [[ $? != 0 ]]; then
exit 1
fi

build_directory="${TARGET_PATH}/${BUILD_TYPE:0}"
if [ ! -d "$build_directory" ]; then
SAFE_RUN `mkdir -p $build_directory`
if [ ! -d "$BUILD_DIRECTORY" ]; then
SAFE_RUN `mkdir -p $BUILD_DIRECTORY`
fi
pushd $build_directory > /dev/null
pushd $BUILD_DIRECTORY > /dev/null

if [[ $ARCH =~ "x86" ]]; then
ARCH="-DCC_TARGETS_X86_SH=1"
Expand All @@ -516,7 +540,7 @@ echo Generating $BUILD_TYPE makefiles
cmake $CMAKE_GEN $CC_PREFIX $ICU_PATH $LTO $STATIC_LIBRARY $ARCH $TARGET_OS \
$ENABLE_CC_XPLAT_TRACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE $SANITIZE $NO_JIT \
$WITHOUT_FEATURES $WB_FLAG $WB_ARGS $CMAKE_EXPORT_COMPILE_COMMANDS $LIBS_ONLY_BUILD\
../..
$VALGRIND $BUILD_RELATIVE_DIRECTORY

_RET=$?
if [[ $? == 0 ]]; then
Expand Down Expand Up @@ -555,7 +579,7 @@ else
dpkg-deb --build $DEB_FOLDER
_RET=$?
if [[ $_RET == 0 ]]; then
echo ".deb package is available under $build_directory"
echo ".deb package is available under $BUILD_DIRECTORY"
fi
fi
fi
Expand Down
1 change: 1 addition & 0 deletions deps/chakrashim/core/jenkins/check_tabs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ rm -f $ERRFILE
git diff --name-only `git merge-base origin/master HEAD` HEAD |
xargs grep -P -l "\t" |
grep -v -E '^pal/' |
grep -v -E '\Makefile$' |
grep -v -E '\.sln$' |
grep -v -E '\.js$' |
grep -v -E '\.baseline$' |
Expand Down
2 changes: 2 additions & 0 deletions deps/chakrashim/core/lib/Backend/Chakra.Backend.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
</AdditionalIncludeDirectories>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>BackEnd.h</PrecompiledHeaderFile>
<!-- # Check out https://osgwiki.com/wiki/Dev_14_Migration for more details about -Zc:implicitNoexcept- -->
<AdditionalOptions>-Zc:implicitNoexcept- %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(OptimizedBuild)'!='true'">
Expand Down
1 change: 1 addition & 0 deletions deps/chakrashim/core/lib/Backend/GlobOptFields.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2215,6 +2215,7 @@ GlobOpt::FinishOptPropOp(IR::Instr *instr, IR::PropertySymOpnd *opnd, BasicBlock
// changed by the addition of a property.

SymID opndId = opnd->HasObjectTypeSym() ? opnd->GetObjectTypeSym()->m_id : -1;

if (!isObjTypeChecked)
{
if (block->globOptData.maybeWrittenTypeSyms == nullptr)
Expand Down
4 changes: 4 additions & 0 deletions deps/chakrashim/core/lib/Backend/IR.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ class Instr
m_src2(nullptr),
#if DBG_DUMP
globOptInstrString(nullptr),
#endif
#if _CONTROL_FLOW_GUARD_SHADOW_STACK
isFsBased(false),
#endif
dstIsTempNumber(false),
dstIsTempNumberTransferred(false),
Expand Down Expand Up @@ -468,6 +471,7 @@ class Instr
Js::OpCode m_opcode;
uint8 ignoreOverflowBitCount; // Number of bits after which ovf matters. Currently used for MULs.

bool isFsBased : 1; // TEMP : just for BS testing
bool dstIsTempNumber : 1;
bool dstIsTempNumberTransferred : 1;
bool dstIsTempObject : 1;
Expand Down
1 change: 0 additions & 1 deletion deps/chakrashim/core/lib/Backend/Inline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2341,7 +2341,6 @@ IR::Instr* Inline::InlineApply(IR::Instr *callInstr, const FunctionJITTimeInfo *
*pIsInlined = false;
return callInstr;
}

*pIsInlined = true;

#if defined(ENABLE_DEBUG_CONFIG_OPTIONS)
Expand Down
Loading

0 comments on commit 7f33b4c

Please sign in to comment.