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

Commit

Permalink
deps: Updated chakracore to 1.1.0.3
Browse files Browse the repository at this point in the history
Includes below bug fixes in chakracore:

* Fix to chakracore that enables chakracore work on windows 7 without IE11.
* field copy-prop bug fix.

See Microsoft/Chakracore [release/1.1](https://github.com/Microsoft/ChakraCore/commits/release/1.1)
for more details.

PR-URL: #25
Reviewed-By: Jianchun Xu <Jianchun.Xu@microsoft.com>
Fixes: #20
  • Loading branch information
kunalspathak authored and orangemocha committed Feb 19, 2016
1 parent 83e078c commit 1992a83
Show file tree
Hide file tree
Showing 28 changed files with 303 additions and 125 deletions.
51 changes: 51 additions & 0 deletions deps/chakrashim/core/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Contributor Code of Conduct

As contributors and maintainers of this project, and in the interest of
fostering an open and welcoming community, we pledge to respect all people who
contribute through reporting issues, posting feature requests, updating
documentation, submitting pull requests or patches, and other activities.

We are committed to making participation in this project a harassment-free
experience for everyone, regardless of level of experience, gender, gender
identity and expression, sexual orientation, disability, personal appearance,
body size, race, ethnicity, age, religion, or nationality. We will
prioritize marginalized people's safety over marginalized people's comfort.

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery
* Personal attacks
* Trolling or insulting/derogatory comments
* Public or private harassment
* Publishing other's private information, such as physical or electronic
addresses, without explicit permission
* Other unethical or unprofessional conduct

Project maintainers have the right _and responsibility_ to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

By adopting this Code of Conduct, project maintainers commit themselves to
fairly and consistently applying these principles to every aspect of managing
this project. Project maintainers who do not follow or enforce the Code of
Conduct may be permanently removed from the project team.

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community.

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting us at [chakracore@microsoft.com][email]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. Maintainers are
obligated to maintain confidentiality with regard to the reporter of an
incident.

This Code of Conduct is adapted from the [Contributor Covenant][homepage] version 1.3.0
and [Open Code of Conduct][opencoc].

[email]: mailto:chakracore@microsoft.com
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/3/0/
[opencoc]: http://todogroup.org/opencodeofconduct/
50 changes: 25 additions & 25 deletions deps/chakrashim/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,36 @@ ChakraCore is the core part of Chakra, the high-performance JavaScript engine th

You can stay up-to-date on progress by following the [MSEdge developer blog](http://blogs.windows.com/msedgedev/).

## Build Status
## [Build Status](https://github.com/Microsoft/ChakraCore/wiki/Build-Status)

| | __Debug__ | __Test__ | __Release__ |
|:-------:|:---------:|:--------:|:-----------:|
| __x86__ | [![x86debug][x86dbgicon]][x86dbglink] | [![x86test][x86testicon]][x86testlink] | [![x86release][x86relicon]][x86rellink] |
| __x64__ | [![x64debug][x64dbgicon]][x64dbglink] | [![x64test][x64testicon]][x64testlink] | [![x64release][x64relicon]][x64rellink] |
| __arm__ | [![armdebug][armdbgicon]][armdbglink] | [![armtest][armtesticon]][armtestlink] | [![armrelease][armrelicon]][armrellink] |

[x86dbgicon]: http://dotnet-ci.cloudapp.net/job/Private/job/Microsoft_ChakraCore_x86_debug/badge/icon
[x86dbglink]: http://dotnet-ci.cloudapp.net/job/Private/job/Microsoft_ChakraCore_x86_debug/
[x86testicon]: http://dotnet-ci.cloudapp.net/job/Private/job/Microsoft_ChakraCore_x86_test/badge/icon
[x86testlink]: http://dotnet-ci.cloudapp.net/job/Private/job/Microsoft_ChakraCore_x86_test/
[x86relicon]: http://dotnet-ci.cloudapp.net/job/Private/job/Microsoft_ChakraCore_x86_release/badge/icon
[x86rellink]: http://dotnet-ci.cloudapp.net/job/Private/job/Microsoft_ChakraCore_x86_release/

[x64dbgicon]: http://dotnet-ci.cloudapp.net/job/Private/job/Microsoft_ChakraCore_x64_debug/badge/icon
[x64dbglink]: http://dotnet-ci.cloudapp.net/job/Private/job/Microsoft_ChakraCore_x64_debug/
[x64testicon]: http://dotnet-ci.cloudapp.net/job/Private/job/Microsoft_ChakraCore_x64_test/badge/icon
[x64testlink]: http://dotnet-ci.cloudapp.net/job/Private/job/Microsoft_ChakraCore_x64_test/
[x64relicon]: http://dotnet-ci.cloudapp.net/job/Private/job/Microsoft_ChakraCore_x64_release/badge/icon
[x64rellink]: http://dotnet-ci.cloudapp.net/job/Private/job/Microsoft_ChakraCore_x64_release/

[armdbgicon]: http://dotnet-ci.cloudapp.net/job/Private/job/Microsoft_ChakraCore_arm_debug/badge/icon
[armdbglink]: http://dotnet-ci.cloudapp.net/job/Private/job/Microsoft_ChakraCore_arm_debug/
[armtesticon]: http://dotnet-ci.cloudapp.net/job/Private/job/Microsoft_ChakraCore_arm_test/badge/icon
[armtestlink]: http://dotnet-ci.cloudapp.net/job/Private/job/Microsoft_ChakraCore_arm_test/
[armrelicon]: http://dotnet-ci.cloudapp.net/job/Private/job/Microsoft_ChakraCore_arm_release/badge/icon
[armrellink]: http://dotnet-ci.cloudapp.net/job/Private/job/Microsoft_ChakraCore_arm_release/

Note: these badges are correct but currently display on GitHub as image not found because of permissions. This will be fixed when the build jobs are public.
[x86dbgicon]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/Microsoft_ChakraCore_x86_debug/badge/icon
[x86dbglink]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/Microsoft_ChakraCore_x86_debug/
[x86testicon]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/Microsoft_ChakraCore_x86_test/badge/icon
[x86testlink]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/Microsoft_ChakraCore_x86_test/
[x86relicon]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/Microsoft_ChakraCore_x86_release/badge/icon
[x86rellink]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/Microsoft_ChakraCore_x86_release/

[x64dbgicon]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/Microsoft_ChakraCore_x64_debug/badge/icon
[x64dbglink]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/Microsoft_ChakraCore_x64_debug/
[x64testicon]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/Microsoft_ChakraCore_x64_test/badge/icon
[x64testlink]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/Microsoft_ChakraCore_x64_test/
[x64relicon]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/Microsoft_ChakraCore_x64_release/badge/icon
[x64rellink]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/Microsoft_ChakraCore_x64_release/

[armdbgicon]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/Microsoft_ChakraCore_arm_debug/badge/icon
[armdbglink]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/Microsoft_ChakraCore_arm_debug/
[armtesticon]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/Microsoft_ChakraCore_arm_test/badge/icon
[armtestlink]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/Microsoft_ChakraCore_arm_test/
[armrelicon]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/Microsoft_ChakraCore_arm_release/badge/icon
[armrellink]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/Microsoft_ChakraCore_arm_release/

Above is a table of our rolling build status. We run additional builds on a daily basis. See [Build Status](https://github.com/Microsoft/ChakraCore/wiki/Build-Status) for the status of all builds.

## Security

Expand Down Expand Up @@ -75,10 +75,10 @@ Contributions to ChakraCore are welcome. Here is how you can contribute to Chak
* [Submit pull requests](https://github.com/Microsoft/ChakraCore/pulls) for bug fixes and features and discuss existing proposals
* Chat about [@ChakraCore](https://twitter.com/ChakraCore) on Twitter

Please refer to [Contribution guidelines](CONTRIBUTING.md) for more details.
Please refer to [Contribution guidelines](CONTRIBUTING.md) and the [Code of Conduct](CODE_OF_CONDUCT.md) for more details.

## Roadmap
For details on our planned features and future direction please refer to our [roadmap](https://github.com/Microsoft/ChakraCore/wiki/Roadmap).

## Contact us
For questions about ChakraCore, please open an [issue](https://github.com/Microsoft/ChakraCore/issues/new) and prefix the issue title with [Question].
For questions about ChakraCore, please open an [issue](https://github.com/Microsoft/ChakraCore/issues/new) and prefix the issue title with [Question].
4 changes: 2 additions & 2 deletions deps/chakrashim/core/jenkins.check_copyright.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@

file_name = sys.argv[1]
if not os.path.isfile(file_name):
print "File does not exist:", file_name
exit(1)
print "File does not exist:", file_name, "(not neccesarily an error)"
exit(0)

with open(file_name, 'r') as sourcefile:
for x in range(0,len(copyright_lines)):
Expand Down
2 changes: 1 addition & 1 deletion deps/chakrashim/core/lib/Backend/Encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ void Encoder::RecordInlineeFrame(Func* inlinee, uint32 currentOffset)
{
// The only restriction for not supporting loop bodies is that inlinee frame map is created on FunctionEntryPointInfo & not
// the base class EntryPointInfo.
if (!this->m_func->IsSimpleJit())
if (!this->m_func->IsLoopBody() && !this->m_func->IsSimpleJit())
{
InlineeFrameRecord* record = nullptr;
if (inlinee->frameInfo && inlinee->m_hasInlineArgsOpt)
Expand Down
12 changes: 6 additions & 6 deletions deps/chakrashim/core/lib/Backend/Func.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,14 @@ Func::Func(JitArenaAllocator *alloc, CodeGenWorkItem* workItem, const Js::Functi
m_workItem->GetEntryPoint()->SetHasJittedStackClosure();
}

if (m_jnFunction->GetDoBackendArgumentsOptimization() && !m_jnFunction->GetHasTry())
{
// doBackendArgumentsOptimization bit is set when there is no eval inside a function
// as determined by the bytecode generator.
SetHasStackArgs(true);
}
if (m_workItem->Type() == JsFunctionType)
{
if (m_jnFunction->GetDoBackendArgumentsOptimization() && !m_jnFunction->GetHasTry())
{
// doBackendArgumentsOptimization bit is set when there is no eval inside a function
// as determined by the bytecode generator.
SetHasStackArgs(true);
}
if (doStackNestedFunc && m_jnFunction->GetNestedCount() != 0)
{
Assert(!(this->IsJitInDebugMode() && !m_jnFunction->GetUtf8SourceInfo()->GetIsLibraryCode()));
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 @@ -1607,6 +1607,7 @@ GlobOpt::CreateFieldSrcValue(PropertySym * sym, PropertySym * originalSym, IR::O
// We don't clear the value when we kill the field.
// Clear it to make sure we don't use the old value.
this->blockData.symToValueMap->Clear(sym->m_id);
this->blockData.symToValueMap->Clear(originalSym->m_id);
}

Assert((*ppOpnd)->AsSymOpnd()->m_sym == sym || this->IsLoopPrePass());
Expand Down
2 changes: 1 addition & 1 deletion deps/chakrashim/core/lib/Backend/InliningDecider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ Js::FunctionInfo *InliningDecider::Inline(Js::FunctionBody *const inliner, Js::F
Js::FunctionProxy * proxy = functionInfo->GetFunctionProxy();
if (proxy && proxy->IsFunctionBody())
{
if (isLoopBody && PHASE_OFF(Js::InlineInJitLoopBodyPhase, this->topFunc))
if (isLoopBody && !PHASE_ON(Js::InlineInJitLoopBodyPhase, this->topFunc))
{
INLINE_TESTTRACE_VERBOSE(L"INLINING: Skip Inline: Jit loop body: %s (%s)\n", this->topFunc->GetDisplayName(),
this->topFunc->GetDebugNumberSet(debugStringBuffer));
Expand Down
1 change: 1 addition & 0 deletions deps/chakrashim/core/lib/Backend/NativeCodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1708,6 +1708,7 @@ NativeCodeGenerator::GatherCodeGenData(
Assert(functionBody);
Assert(jitTimeData);
Assert(IsInlinee == !!runtimeData);
Assert(!IsInlinee || !inliningDecider.GetIsLoopBody());
Assert(topFunctionBody != nullptr && (!entryPoint->GetWorkItem() || entryPoint->GetWorkItem()->GetFunctionBody() == topFunctionBody));
Assert(objTypeSpecFldInfoList != nullptr);

Expand Down
38 changes: 23 additions & 15 deletions deps/chakrashim/core/lib/Parser/CharClassifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -619,28 +619,36 @@ void Js::CharClassifier::initClassifier(ScriptContext * scriptContext, CharClass
if (es6ModeNeeded)
{
HRESULT hr = globalizationAdapter->EnsureDataTextObjectsInitialized(globLibrary);
// Failed to load windows.globalization.dll or jsintl.dll. No unicodeStatics support
// in that case.
if (FAILED(hr))
{
AssertMsg(false, "Failed to initialize COM interfaces, verify correct version of globalization dll is used.");
JavascriptError::MapAndThrowError(scriptContext, hr);
}

this->winGlobCharApi = globalizationAdapter->GetUnicodeStatics();
if (this->winGlobCharApi == nullptr)
{
// No fallback mode, then assert
if (es6FallbackMode == CharClassifierModes::ES6)
{
AssertMsg(false, "Windows::Data::Text::IUnicodeCharactersStatics not initialized");
//Fallback to ES5 just in case for fre builds.
es6FallbackMode = CharClassifierModes::ES5;
}
if (isES6UnicodeVerboseEnabled)
{
Output::Print(L"Windows::Data::Text::IUnicodeCharactersStatics not initialized\r\n");
}
//Default to non-es6
es6Supported = false;
es6FallbackMode = CharClassifierModes::ES5;
}
else
{
this->winGlobCharApi = globalizationAdapter->GetUnicodeStatics();
if (this->winGlobCharApi == nullptr)
{
// No fallback mode, then assert
if (es6FallbackMode == CharClassifierModes::ES6)
{
AssertMsg(false, "Windows::Data::Text::IUnicodeCharactersStatics not initialized");
//Fallback to ES5 just in case for fre builds.
es6FallbackMode = CharClassifierModes::ES5;
}
if (isES6UnicodeVerboseEnabled)
{
Output::Print(L"Windows::Data::Text::IUnicodeCharactersStatics not initialized\r\n");
}
//Default to non-es6
es6Supported = false;
}
}
}
#else
Expand Down
10 changes: 10 additions & 0 deletions deps/chakrashim/core/lib/Runtime/Base/DelayLoadLibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ namespace Js
return E_NOTIMPL;
}

bool DelayLoadWindowsGlobalization::HasGlobalizationDllLoaded()
{
return this->hasGlobalizationDllLoaded;
}

HRESULT DelayLoadWindowsGlobalization::DllGetActivationFactory(
__in HSTRING activatibleClassId,
__out IActivationFactory** factory)
Expand Down Expand Up @@ -268,6 +273,11 @@ namespace Js
m_hModule = LoadLibraryEx(GetWin7LibraryName(), nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32);
}

// Set the flag depending on Windows.globalization.dll or jsintl.dll was loaded successfully or not
if (m_hModule != nullptr)
{
hasGlobalizationDllLoaded = true;
}
this->winRTStringLibrary = winRTStringLibrary;
this->winRTStringsPresent = GetFunction("WindowsDuplicateString") != nullptr;
}
Expand Down
7 changes: 5 additions & 2 deletions deps/chakrashim/core/lib/Runtime/Base/DelayLoadLibrary.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,15 @@ namespace Js
PFNCWDllGetActivationFactory m_pfnFNCWDllGetActivationFactory;

Js::DelayLoadWinRtString *winRTStringLibrary;
BOOL winRTStringsPresent;
bool winRTStringsPresent;
bool hasGlobalizationDllLoaded;

public:
DelayLoadWindowsGlobalization() : DelayLoadWinRtString(),
m_pfnFNCWDllGetActivationFactory(nullptr),
winRTStringLibrary(nullptr),
winRTStringsPresent(false) { }
winRTStringsPresent(false),
hasGlobalizationDllLoaded(false) { }

virtual ~DelayLoadWindowsGlobalization() { }

Expand All @@ -187,6 +189,7 @@ namespace Js
void Ensure(Js::DelayLoadWinRtString *winRTStringLibrary);

HRESULT DllGetActivationFactory(__in HSTRING activatibleClassId, __out IActivationFactory** factory);
bool HasGlobalizationDllLoaded();

HRESULT WindowsCreateString(_In_reads_opt_(length) const WCHAR * sourceString, UINT32 length, _Outptr_result_maybenull_ _Result_nullonfailure_ HSTRING * string) override;
HRESULT WindowsCreateStringReference(_In_reads_opt_(length+1) const WCHAR * sourceString, UINT32 length, _Out_ HSTRING_HEADER * header, _Outptr_result_maybenull_ _Result_nullonfailure_ HSTRING * string) override;
Expand Down
11 changes: 11 additions & 0 deletions deps/chakrashim/core/lib/Runtime/Base/ScriptContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5239,6 +5239,17 @@ void ScriptContext::RegisterPrototypeChainEnsuredToHaveOnlyWritableDataPropertie
return false;
}

bool ScriptContext::IsIntlEnabled()
{
if (GetConfig()->IsIntlEnabled())
{
// This will try to load globalization dlls if not already loaded.
Js::DelayLoadWindowsGlobalization* globLibrary = GetThreadContext()->GetWindowsGlobalizationLibrary();
return globLibrary->HasGlobalizationDllLoaded();
}
return false;
}


#ifdef INLINE_CACHE_STATS
void ScriptContext::LogCacheUsage(Js::PolymorphicInlineCache *cache, bool isGetter, Js::PropertyId propertyId, bool hit, bool collision)
Expand Down
1 change: 1 addition & 0 deletions deps/chakrashim/core/lib/Runtime/Base/ScriptContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,7 @@ namespace Js
void RestoreRegexStacks(UnifiedRegex::RegexStacks *const contStack);

void InitializeGlobalObject();
bool IsIntlEnabled();
JavascriptLibrary* GetLibrary() const { return javascriptLibrary; }
const JavascriptLibraryBase* GetLibraryBase() const { return javascriptLibrary->GetLibraryBase(); }
#if DBG
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4380,9 +4380,9 @@ namespace Js
(Js::JavascriptNumber *)buffer), scriptContext, flags, dValue);
#endif
}
BOOL JavascriptOperators::OP_Memcopy(Var dstInstance, int32 dstStart, Var srcInstance, int32 srcStart, uint32 length, ScriptContext* scriptContext)
BOOL JavascriptOperators::OP_Memcopy(Var dstInstance, int32 dstStart, Var srcInstance, int32 srcStart, int32 length, ScriptContext* scriptContext)
{
if (length == 0)
if (length <= 0)
{
return true;
}
Expand Down Expand Up @@ -4481,9 +4481,9 @@ namespace Js
return returnValue;
}

BOOL JavascriptOperators::OP_Memset(Var instance, int32 start, Var value, uint32 length, ScriptContext* scriptContext)
BOOL JavascriptOperators::OP_Memset(Var instance, int32 start, Var value, int32 length, ScriptContext* scriptContext)
{
if (length == 0)
if (length <= 0)
{
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,8 @@ namespace Js
static Var OP_DeleteElementI(Var instance, Var aElementIndex, ScriptContext* scriptContext, PropertyOperationFlags propertyOperationFlags = PropertyOperation_None);
static Var OP_DeleteElementI_UInt32(Var instance, uint32 aElementIndex, ScriptContext* scriptContext, PropertyOperationFlags propertyOperationFlags = PropertyOperation_None);
static Var OP_DeleteElementI_Int32(Var instance, int aElementIndex, ScriptContext* scriptContext, PropertyOperationFlags propertyOperationFlags = PropertyOperation_None);
static BOOL OP_Memset(Var instance, int32 start, Var value, uint32 length, ScriptContext* scriptContext);
static BOOL OP_Memcopy(Var dstInstance, int32 dstStart, Var srcInstance, int32 srcStart, uint32 length, ScriptContext* scriptContext);
static BOOL OP_Memset(Var instance, int32 start, Var value, int32 length, ScriptContext* scriptContext);
static BOOL OP_Memcopy(Var dstInstance, int32 dstStart, Var srcInstance, int32 srcStart, int32 length, ScriptContext* scriptContext);
static Var OP_GetLength(Var instance, ScriptContext* scriptContext);
static Var OP_GetThis(Var thisVar, int moduleID, ScriptContext* scriptContext);
static Var OP_GetThisNoFastPath(Var thisVar, int moduleID, ScriptContext* scriptContext);
Expand Down
Loading

0 comments on commit 1992a83

Please sign in to comment.