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

Commit 94af1db

Browse files
obastemurchakrabot
authored andcommitted
deps: update ChakraCore to chakra-core/ChakraCore@09034518ef
[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>
1 parent 29fed89 commit 94af1db

File tree

10 files changed

+706
-54
lines changed

10 files changed

+706
-54
lines changed

deps/chakrashim/core/bin/ch/262.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,15 @@
33
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
44
//-------------------------------------------------------------------------------------------------------
55

6-
LR"====(
7-
6+
R"====(
87
var $262 = {
98
createRealm: function () {
109
return WScript.LoadScript('', 'samethread').$262;
1110
},
1211
global: this,
1312
agent: {
1413
start: function (src) {
15-
WScript.LoadScript(
14+
WScript.LoadScript(
1615
`
1716
$262 = {
1817
agent:{
@@ -28,6 +27,5 @@ var $262 = {
2827
sleep: function (timeout) { WScript.Sleep(timeout); },
2928
getReport: function () { return WScript.GetReport(); },
3029
},
31-
}
32-
33-
)===="
30+
};
31+
)===="

deps/chakrashim/core/bin/ch/HostConfigFlagsList.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ FLAG(bool, EnsureCloseJITServer, "JIT process will be force closed wh
1414
FLAG(bool, IgnoreScriptErrorCode, "Don't return error code on script error", false)
1515
FLAG(bool, MuteHostErrorMsg, "Mute host error output, e.g. module load failures", false)
1616
FLAG(bool, TraceHostCallback, "Output traces for host callbacks", false)
17-
FLAG(bool, $262, "load $262 harness", false)
17+
FLAG(bool, Test262, "load Test262 harness", false)
1818
#undef FLAG
1919
#endif

deps/chakrashim/core/bin/ch/RuntimeThreadData.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,6 @@
44
//-------------------------------------------------------------------------------------------------------
55
#include "stdafx.h"
66

7-
#ifndef _WIN32
8-
HANDLE CreateSemaphoreW(LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, LONG lInitialCount, LONG lMaximumCount, LPCWSTR lpName)
9-
{
10-
// xplat-todo: implement this in PAL
11-
Assert(false);
12-
return INVALID_HANDLE_VALUE;
13-
}
14-
BOOL ReleaseSemaphore(HANDLE hSemaphore, LONG lReleaseCount, LPLONG lpPreviousCount)
15-
{
16-
// xplat-todo: implement this in PAL
17-
Assert(false);
18-
return FALSE;
19-
}
20-
21-
#endif
22-
237
void RuntimeThreadLocalData::Initialize(RuntimeThreadData* threadData)
248
{
259
this->threadData = threadData;
@@ -29,7 +13,6 @@ void RuntimeThreadLocalData::Uninitialize()
2913
{
3014
}
3115

32-
3316
THREAD_LOCAL RuntimeThreadLocalData threadLocalData;
3417

3518
RuntimeThreadLocalData& GetRuntimeThreadLocalData()

deps/chakrashim/core/bin/ch/WScriptJsrt.cpp

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,10 @@ bool WScriptJsrt::Initialize()
938938

939939
IfJsrtErrorFail(InitializeModuleCallbacks(), false);
940940

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

950-
951-
// OSX does build does not support $262 as filename
952-
const wchar_t $262[] =
953+
// $262
954+
const char Test262[] =
953955
#include "262.js"
954-
;
956+
;
955957

956-
JsValueRef $262ScriptRef;
957-
IfJsrtErrorFailLogAndRetFalse(ChakraRTInterface::JsCreateStringUtf16((uint16_t*)$262, _countof($262) - 1, &$262ScriptRef));
958+
JsValueRef Test262ScriptRef;
959+
IfJsrtErrorFailLogAndRetFalse(ChakraRTInterface::JsCreateString(Test262, strlen(Test262), &Test262ScriptRef));
958960

959961
JsValueRef fname;
960-
IfJsrtErrorFailLogAndRetFalse(ChakraRTInterface::JsCreateString("$262", strlen("$262"), &fname));
961-
IfJsrtErrorFailLogAndRetFalse(ChakraRTInterface::JsRun($262ScriptRef, WScriptJsrt::GetNextSourceContext(), fname, JsParseScriptAttributeNone, nullptr));
962-
962+
IfJsrtErrorFailLogAndRetFalse(ChakraRTInterface::JsCreateString("262", strlen("262"), &fname));
963+
IfJsrtErrorFailLogAndRetFalse(ChakraRTInterface::JsRun(Test262ScriptRef, WScriptJsrt::GetNextSourceContext(), fname, JsParseScriptAttributeNone, nullptr));
963964
}
964965

965966
Error:
@@ -1534,7 +1535,7 @@ HRESULT WScriptJsrt::ModuleMessage::Call(LPCSTR fileName)
15341535
specifierFullPath = moduleDirEntry->second;
15351536
}
15361537
}
1537-
1538+
15381539
specifierFullPath += *specifierStr;
15391540
if (_fullpath(fullPath, specifierFullPath.c_str(), _MAX_PATH) == nullptr)
15401541
{

deps/chakrashim/core/pal/src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ set(SOURCES
158158
shmemory/shmemory.cpp
159159
synchobj/event.cpp
160160
synchobj/mutex.cpp
161+
synchobj/semaphore.cpp
161162
synchmgr/synchcontrollers.cpp
162163
synchmgr/synchmanager.cpp
163164
synchmgr/wait.cpp
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
4+
//
5+
6+
// Licensed to the .NET Foundation under one or more agreements.
7+
// The .NET Foundation licenses this file to you under the MIT license.
8+
// See the LICENSE file in the project root for more information.
9+
10+
/*++
11+
12+
13+
14+
Module Name:
15+
16+
semaphore.hpp
17+
18+
Abstract:
19+
20+
Semaphore object structure definition.
21+
22+
23+
24+
--*/
25+
26+
#ifndef _PAL_SEMAPHORE_H_
27+
#define _PAL_SEMAPHORE_H_
28+
29+
#include "corunix.hpp"
30+
31+
namespace CorUnix
32+
{
33+
extern CObjectType otSemaphore;
34+
35+
typedef struct
36+
{
37+
LONG lMaximumCount;
38+
} SemaphoreImmutableData;
39+
40+
PAL_ERROR
41+
InternalCreateSemaphore(
42+
CPalThread *pThread,
43+
LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,
44+
LONG lInitialCount,
45+
LONG lMaximumCount,
46+
LPCWSTR lpName,
47+
HANDLE *phSemaphore
48+
);
49+
50+
PAL_ERROR
51+
InternalReleaseSemaphore(
52+
CPalThread *pThread,
53+
HANDLE hSemaphore,
54+
LONG lReleaseCount,
55+
LPLONG lpPreviousCount
56+
);
57+
58+
}
59+
60+
#endif //_PAL_SEMAPHORE_H_

0 commit comments

Comments
 (0)