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

Commit

Permalink
deps: update ChakraCore to chakra-core/ChakraCore@09034518ef
Browse files Browse the repository at this point in the history
[MERGE #4492 @obastemur] Fixes an issue with flaky 262 test

Merge pull request #4492 from obastemur:262_stuff

fixes #4405

Reviewed-By: chakrabot <chakrabot@users.noreply.github.com>
  • Loading branch information
obastemur authored and chakrabot committed Jan 3, 2018
1 parent 29fed89 commit 94af1db
Show file tree
Hide file tree
Showing 10 changed files with 706 additions and 54 deletions.
10 changes: 4 additions & 6 deletions deps/chakrashim/core/bin/ch/262.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------

LR"====(
R"====(
var $262 = {
createRealm: function () {
return WScript.LoadScript('', 'samethread').$262;
},
global: this,
agent: {
start: function (src) {
WScript.LoadScript(
WScript.LoadScript(
`
$262 = {
agent:{
Expand All @@ -28,6 +27,5 @@ var $262 = {
sleep: function (timeout) { WScript.Sleep(timeout); },
getReport: function () { return WScript.GetReport(); },
},
}
)===="
};
)===="
2 changes: 1 addition & 1 deletion deps/chakrashim/core/bin/ch/HostConfigFlagsList.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ FLAG(bool, EnsureCloseJITServer, "JIT process will be force closed wh
FLAG(bool, IgnoreScriptErrorCode, "Don't return error code on script error", false)
FLAG(bool, MuteHostErrorMsg, "Mute host error output, e.g. module load failures", false)
FLAG(bool, TraceHostCallback, "Output traces for host callbacks", false)
FLAG(bool, $262, "load $262 harness", false)
FLAG(bool, Test262, "load Test262 harness", false)
#undef FLAG
#endif
17 changes: 0 additions & 17 deletions deps/chakrashim/core/bin/ch/RuntimeThreadData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,6 @@
//-------------------------------------------------------------------------------------------------------
#include "stdafx.h"

#ifndef _WIN32
HANDLE CreateSemaphoreW(LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, LONG lInitialCount, LONG lMaximumCount, LPCWSTR lpName)
{
// xplat-todo: implement this in PAL
Assert(false);
return INVALID_HANDLE_VALUE;
}
BOOL ReleaseSemaphore(HANDLE hSemaphore, LONG lReleaseCount, LPLONG lpPreviousCount)
{
// xplat-todo: implement this in PAL
Assert(false);
return FALSE;
}

#endif

void RuntimeThreadLocalData::Initialize(RuntimeThreadData* threadData)
{
this->threadData = threadData;
Expand All @@ -29,7 +13,6 @@ void RuntimeThreadLocalData::Uninitialize()
{
}


THREAD_LOCAL RuntimeThreadLocalData threadLocalData;

RuntimeThreadLocalData& GetRuntimeThreadLocalData()
Expand Down
23 changes: 12 additions & 11 deletions deps/chakrashim/core/bin/ch/WScriptJsrt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,10 @@ bool WScriptJsrt::Initialize()

IfJsrtErrorFail(InitializeModuleCallbacks(), false);

if (HostConfigFlags::flags.$262)
// When the command-line argument `-Test262` is set,
// WScript will have the extra support API below and $262 will be
// added to global scope
if (HostConfigFlags::flags.Test262)
{
IfFalseGo(WScriptJsrt::InstallObjectsOnObject(wscript, "Broadcast", BroadcastCallback));
IfFalseGo(WScriptJsrt::InstallObjectsOnObject(wscript, "ReceiveBroadcast", ReceiveBroadcastCallback));
Expand All @@ -947,19 +950,17 @@ bool WScriptJsrt::Initialize()
IfFalseGo(WScriptJsrt::InstallObjectsOnObject(wscript, "Leaving", LeavingCallback));
IfFalseGo(WScriptJsrt::InstallObjectsOnObject(wscript, "Sleep", SleepCallback));


// OSX does build does not support $262 as filename
const wchar_t $262[] =
// $262
const char Test262[] =
#include "262.js"
;
;

JsValueRef $262ScriptRef;
IfJsrtErrorFailLogAndRetFalse(ChakraRTInterface::JsCreateStringUtf16((uint16_t*)$262, _countof($262) - 1, &$262ScriptRef));
JsValueRef Test262ScriptRef;
IfJsrtErrorFailLogAndRetFalse(ChakraRTInterface::JsCreateString(Test262, strlen(Test262), &Test262ScriptRef));

JsValueRef fname;
IfJsrtErrorFailLogAndRetFalse(ChakraRTInterface::JsCreateString("$262", strlen("$262"), &fname));
IfJsrtErrorFailLogAndRetFalse(ChakraRTInterface::JsRun($262ScriptRef, WScriptJsrt::GetNextSourceContext(), fname, JsParseScriptAttributeNone, nullptr));

IfJsrtErrorFailLogAndRetFalse(ChakraRTInterface::JsCreateString("262", strlen("262"), &fname));
IfJsrtErrorFailLogAndRetFalse(ChakraRTInterface::JsRun(Test262ScriptRef, WScriptJsrt::GetNextSourceContext(), fname, JsParseScriptAttributeNone, nullptr));
}

Error:
Expand Down Expand Up @@ -1534,7 +1535,7 @@ HRESULT WScriptJsrt::ModuleMessage::Call(LPCSTR fileName)
specifierFullPath = moduleDirEntry->second;
}
}

specifierFullPath += *specifierStr;
if (_fullpath(fullPath, specifierFullPath.c_str(), _MAX_PATH) == nullptr)
{
Expand Down
1 change: 1 addition & 0 deletions deps/chakrashim/core/pal/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ set(SOURCES
shmemory/shmemory.cpp
synchobj/event.cpp
synchobj/mutex.cpp
synchobj/semaphore.cpp
synchmgr/synchcontrollers.cpp
synchmgr/synchmanager.cpp
synchmgr/wait.cpp
Expand Down
60 changes: 60 additions & 0 deletions deps/chakrashim/core/pal/src/include/pal/semaphore.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//

// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

/*++
Module Name:
semaphore.hpp
Abstract:
Semaphore object structure definition.
--*/

#ifndef _PAL_SEMAPHORE_H_
#define _PAL_SEMAPHORE_H_

#include "corunix.hpp"

namespace CorUnix
{
extern CObjectType otSemaphore;

typedef struct
{
LONG lMaximumCount;
} SemaphoreImmutableData;

PAL_ERROR
InternalCreateSemaphore(
CPalThread *pThread,
LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,
LONG lInitialCount,
LONG lMaximumCount,
LPCWSTR lpName,
HANDLE *phSemaphore
);

PAL_ERROR
InternalReleaseSemaphore(
CPalThread *pThread,
HANDLE hSemaphore,
LONG lReleaseCount,
LPLONG lpPreviousCount
);

}

#endif //_PAL_SEMAPHORE_H_
Loading

0 comments on commit 94af1db

Please sign in to comment.