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

Commit

Permalink
[Merge chakra-core/ChakraCore@c2f92dd01e] [MERGE #3840 @dilijev] Intl…
Browse files Browse the repository at this point in the history
…-ICU: Merge branch `intl-icu`: Intl.NumberFormat and node-cc build integration into branch `release/1.7`

Merge pull request #3840 from dilijev:intl-icu

Includes the following PRs merged to branch `intl-icu`

* [MERGE #3809 @dilijev] Intl-ICU: implement Intl.NumberFormat under ICU
* [MERGE #3820 @jackhorton] Implements ICU version of getDefaultLocale, fixes up ICU extension handling
* [MERGE #3822 @obastemur] xplat: fix the path for i18n
* [MERGE #3750 @jackhorton] Expose platform.winglob to Intl.js to detect which i18n lib we are using in the native code.
  • Loading branch information
chakrabot authored and kfarnung committed Jan 9, 2018
1 parent 7d2cd6d commit b122e1a
Show file tree
Hide file tree
Showing 53 changed files with 20,368 additions and 17,923 deletions.
1 change: 1 addition & 0 deletions deps/chakrashim/core/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ test/benchmarks/*.dpl
test/benchmarks/*.txt
testout*
packages.config
lib/wabt/built/

# CMake Files
cmake_install.cmake
Expand Down
7 changes: 6 additions & 1 deletion deps/chakrashim/core/Build/Chakra.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@
<RuntimeLibrary Condition="'$(Configuration)'=='Debug' AND '$(RuntimeLib)'=='static_library'">MultiThreadedDebug</RuntimeLibrary>
<AdditionalIncludeDirectories>
$(ChakraCoreRootDirectory)\lib\common\placeholder;
$(IntDir)..\CoreManifests\
$(IntDir)..\CoreManifests;
%(AdditionalIncludeDirectories)
</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(IntlICU)'=='true'">
$(IcuIncludeDir)\common;
$(IcuIncludeDir)\i18n;
%(AdditionalIncludeDirectories)
</AdditionalIncludeDirectories>
</ClCompile>
Expand Down
36 changes: 24 additions & 12 deletions deps/chakrashim/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,24 @@ function(clr_unknown_arch)
message(FATAL_ERROR "Only AMD64, ARM and I386 are supported")
endfunction()

if(INTL_ICU_SH)
unset(INTL_ICU_SH CACHE) # don't cache
add_definitions(-DINTL_ICU=1)
set(ICU_INTL_ENABLED 1)
endif()

if(ICU_INCLUDE_PATH)
add_definitions(-DHAS_REAL_ICU=1)
set(ICU_CC_PATH "${ICU_INCLUDE_PATH}/../lib/")
find_library(ICUUC icuuc PATHS ${ICU_CC_PATH} NO_DEFAULT_PATH)
find_library(ICU18 icui18n PATHS ${ICU_CC_PATH} NO_DEFAULT_PATH)
if(ICU_INTL_ENABLED)
find_library(ICU18 icui18n PATHS ${ICU_CC_PATH} NO_DEFAULT_PATH)
# icu header files are either located under the same folder or i18n is under a relative path
# TODO (unlikely): shall we add `--icu-intl` to build.sh ?
set(ICU_INCLUDE_PATH
"${ICU_INCLUDE_PATH}"
"${ICU_INCLUDE_PATH}/../i18n/")
endif()
if(ICUUC)
message("-- found ICU libs: ${ICU_CC_PATH}")
find_library(ICUDATA icudata PATHS ${ICU_CC_PATH} NO_DEFAULT_PATH)
Expand Down Expand Up @@ -187,12 +200,17 @@ endif()

if(CC_TARGET_OS_LINUX OR CC_TARGET_OS_ANDROID)
if(NOT ICULIB)
if(NOT NO_ICU_PATH_GIVEN)
if(NOT CC_EMBED_ICU)
set(ICULIB "icuuc")
if(NOT NO_ICU_PATH_GIVEN)
if(NOT CC_EMBED_ICU)
set(ICULIB "icuuc")
if(ICU_INTL_ENABLED)
set(ICULIB
"${ICULIB}"
"icui18n")
endif()
endif()
add_definitions(-DHAS_REAL_ICU=1)
endif()
add_definitions(-DHAS_REAL_ICU=1)
endif()
endif()

set(CLR_CMAKE_PLATFORM_LINUX 1)
Expand Down Expand Up @@ -396,12 +414,6 @@ else()
set(BuildJIT 1)
endif()

if(INTL_ICU_SH)
unset(INTL_ICU_SH CACHE) # don't cache
add_definitions(-DINTL_ICU=1)
set(IntlICU 1)
endif()

if(WITHOUT_FEATURES_SH)
add_definitions(${WITHOUT_FEATURES_SH})
unset(WITHOUT_FEATURES_SH CACHE) # don't cache
Expand Down
6 changes: 2 additions & 4 deletions deps/chakrashim/core/bin/ChakraCore/ChakraCore.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
$(ChakraCoreRootDirectory)Lib\Jsrt;
$(IntDir);
$(ChakraJITIDLIntDir);
$(IcuIncludeDir)\common;
$(MSBuildThisFileDirectory)..\..\lib\JITClient;
%(AdditionalIncludeDirectories);
</AdditionalIncludeDirectories>
Expand All @@ -56,10 +55,9 @@
<AdditionalDependencies Condition="'$(IntlICU)'=='true'">
%(AdditionalDependencies);
<!-- TODO cleanup: we do need to link to ICU libraries in ChakraCore, but we probably will not need all of them -->
<!--$(IcuLibDir)\icudata.lib;-->
<!--$(IcuLibDir)\icui18n.lib;-->
<!--$(IcuLibDir)\icustubdata.lib;-->
$(IcuLibDir)\icutools.lib;
$(IcuLibDir)\icui18n.lib;
<!--$(IcuLibDir)\icudata.lib;-->
<!--$(IcuLibDir)\icuucx.lib;-->
</AdditionalDependencies>
<DelayLoadDLLs>%(DelayLoadDLLs);oleaut32.dll</DelayLoadDLLs>
Expand Down
3 changes: 1 addition & 2 deletions deps/chakrashim/core/lib/Backend/Chakra.Backend.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
$(MSBuildThisFileDirectory)..\Parser;
$(MSBuildThisFileDirectory)..\WasmReader;
$(ChakraJITIDLIntDir);
$(IcuIncludeDir)\common;
%(AdditionalIncludeDirectories)
</AdditionalIncludeDirectories>
<PrecompiledHeader>Use</PrecompiledHeader>
Expand Down Expand Up @@ -483,4 +482,4 @@
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets" />
<Import Project="$(BuildConfig_ARMASM_Path)armasm.targets" />
</ImportGroup>
</Project>
</Project>
1 change: 1 addition & 0 deletions deps/chakrashim/core/lib/Common/CommonDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
#if defined(_WIN32) || defined(INTL_ICU)
#define ENABLE_INTL_OBJECT // Intl support
#endif
//#define INTL_ICU 1 // NOTE: uncomment this to allow the IDE to see INTL_ICU blocks
#ifdef INTL_ICU
#ifdef DBG
//#define INTL_ICU_DEBUG 1 // NOTE: uncomment this to display INTL_ICU-specific debug output
Expand Down
3 changes: 3 additions & 0 deletions deps/chakrashim/core/lib/Common/Core/AllocSizeMath.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------

#pragma once

class AllocSizeMath
{
static const size_t MaxMemory = static_cast<size_t>(-1);
Expand Down
6 changes: 1 addition & 5 deletions deps/chakrashim/core/lib/Common/PlatformAgnostic/DateTime.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------

#ifndef RUNTIME_PLATFORM_AGNOSTIC_COMMON_DATETIME
#define RUNTIME_PLATFORM_AGNOSTIC_COMMON_DATETIME
#pragma once

#include "PlatformAgnostic/DateTimeInternal.h"

Expand Down Expand Up @@ -77,5 +75,3 @@ namespace DateTime

} // namespace DateTime
} // namespace PlatformAgnostic

#endif // RUNTIME_PLATFORM_AGNOSTIC_COMMON_DATETIME
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------

#ifndef RUNTIME_PLATFORM_AGNOSTIC_DATETIME_INTERNAL
#define RUNTIME_PLATFORM_AGNOSTIC_DATETIME_INTERNAL
#pragma once

#include "Core/CommonTypedefs.h"

Expand Down Expand Up @@ -107,5 +105,3 @@ namespace DateTime

} // namespace DateTime
} // namespace PlatformAgnostic

#endif // RUNTIME_PLATFORM_AGNOSTIC_DATETIME_INTERNAL
6 changes: 1 addition & 5 deletions deps/chakrashim/core/lib/Common/PlatformAgnostic/Debugger.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------

#ifndef RUNTIME_PLATFORM_AGNOSTIC_DEBUGGER
#define RUNTIME_PLATFORM_AGNOSTIC_DEBUGGER
#pragma once

#ifndef _WIN32

Expand Down Expand Up @@ -131,5 +129,3 @@ class IActiveScriptProfilerCallback
#define IActiveScriptProfilerCallback3 IActiveScriptProfilerCallback

#endif // !_WIN32

#endif // RUNTIME_PLATFORM_AGNOSTIC_DEBUGGER
6 changes: 1 addition & 5 deletions deps/chakrashim/core/lib/Common/PlatformAgnostic/Numbers.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------

#ifndef RUNTIME_PLATFORM_AGNOSTIC_COMMON_NUMBERS
#define RUNTIME_PLATFORM_AGNOSTIC_COMMON_NUMBERS
#pragma once

namespace PlatformAgnostic
{
Expand Down Expand Up @@ -51,5 +49,3 @@ namespace Numbers
};
} // namespace Numbers
} // namespace PlatformAgnostic

#endif // RUNTIME_PLATFORM_AGNOSTIC_COMMON_NUMBERS
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------

#ifndef RUNTIME_PLATFORM_AGNOSTIC_COMMON_SYSTEMINFO
#define RUNTIME_PLATFORM_AGNOSTIC_COMMON_SYSTEMINFO
#pragma once

namespace PlatformAgnostic
{
Expand Down Expand Up @@ -80,5 +78,3 @@ namespace PlatformAgnostic
#endif
};
} // namespace PlatformAgnostic

#endif // RUNTIME_PLATFORM_AGNOSTIC_COMMON_SYSTEMINFO
6 changes: 1 addition & 5 deletions deps/chakrashim/core/lib/Common/PlatformAgnostic/Thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------

#ifndef RUNTIME_PLATFORM_AGNOSTIC_COMMON_THREAD
#define RUNTIME_PLATFORM_AGNOSTIC_COMMON_THREAD
#pragma once

namespace PlatformAgnostic
{
Expand All @@ -26,5 +24,3 @@ class Thread
ThreadInitFlag init_flag);
};
} // namespace PlatformAgnostic

#endif // RUNTIME_PLATFORM_AGNOSTIC_COMMON_THREAD
3 changes: 1 addition & 2 deletions deps/chakrashim/core/lib/JITServer/Chakra.JITServer.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
$(MSBuildThisFileDirectory)..\Backend\$(PlatformPathNameAlt);
$(MSBuildThisFileDirectory)..\Backend;
$(ChakraJITIDLIntDir);
$(IcuIncludeDir)\common;
%(AdditionalIncludeDirectories)
</AdditionalIncludeDirectories>
<PrecompiledHeader>Use</PrecompiledHeader>
Expand All @@ -57,4 +56,4 @@
</ItemDefinitionGroup>
<Import Project="$(BuildConfigPropsPath)Chakra.Build.targets" Condition="exists('$(BuildConfigPropsPath)Chakra.Build.targets')" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>
</Project>
3 changes: 1 addition & 2 deletions deps/chakrashim/core/lib/Jsrt/Chakra.Jsrt.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
$(MSBuildThisFileDirectory);
$(MSBuildThisFileDirectory)..\Runtime;
$(ChakraJITIDLIntDir);
$(IcuIncludeDir)\common;
$(MSBuildThisFileDirectory)..\JITClient;
$(MSBuildThisFileDirectory)..\Runtime\ByteCode;
$(MSBuildThisFileDirectory)..\Common;
Expand Down Expand Up @@ -91,4 +90,4 @@
</ItemGroup>
<Import Project="$(BuildConfigPropsPath)Chakra.Build.targets" Condition="exists('$(BuildConfigPropsPath)Chakra.Build.targets')" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>
</Project>
3 changes: 1 addition & 2 deletions deps/chakrashim/core/lib/Jsrt/Core/Chakra.Jsrt.Core.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
$(MSBuildThisFileDirectory)..;
$(MSBuildThisFileDirectory)..\..\Runtime;
$(ChakraJITIDLIntDir);
$(IcuIncludeDir)\common;
$(MSBuildThisFileDirectory)..\..\JITClient;
$(MSBuildThisFileDirectory)..\..\Runtime\ByteCode;
$(MSBuildThisFileDirectory)..\..\Common;
Expand All @@ -50,4 +49,4 @@
</ItemGroup>
<Import Project="$(BuildConfigPropsPath)Chakra.Build.targets" Condition="exists('$(BuildConfigPropsPath)Chakra.Build.targets')" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>
</Project>
1 change: 0 additions & 1 deletion deps/chakrashim/core/lib/Parser/Chakra.Parser.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
$(MSBuildThisFileDirectory)..\Runtime;
$(MSBuildThisFileDirectory)..\Runtime\ByteCode;
$(ChakraJITIDLIntDir);
$(IcuIncludeDir)\common;
$(ChakraManifestsIncludeDirectory);
%(AdditionalIncludeDirectories)
</AdditionalIncludeDirectories>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
$(MSBuildThisFileDirectory)..\..\Runtime\ByteCode;
$(MSBuildThisFileDirectory)..\..\WasmReader;
$(ChakraJITIDLIntDir);
$(IcuIncludeDir)\common;
$(MSBuildThisFileDirectory)..\..\JITClient;
%(AdditionalIncludeDirectories)
</AdditionalIncludeDirectories>
Expand Down
1 change: 1 addition & 0 deletions deps/chakrashim/core/lib/Runtime/Base/JnDirectFields.h
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,7 @@ ENTRY(enqueueTask)
ENTRY(Common)
ENTRY(Promise)
ENTRY(MissingProperty)
ENTRY(winglob)

// These are ES5/6/7+ builtins that are tracked for telemetry purposes, but currently not implemented by Chakra or are otherwise special.
// IMPORTANT NOTE: See notes at top of this file regarding GenByteCode and test failures after changing this list.
Expand Down
Loading

0 comments on commit b122e1a

Please sign in to comment.