Skip to content

Commit c669dcb

Browse files
Merge branch 'master' into array-copyWithin-assert
2 parents 5ba6731 + 13358c6 commit c669dcb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+823
-150
lines changed

.github/ISSUE_TEMPLATE/01-bug.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Bug report
2+
description: Report a general bug in ChakraCore
3+
title: '[Bug]: '
4+
labels:
5+
- Bug
6+
body:
7+
- type: input
8+
attributes:
9+
label: ChakraCore Version
10+
description: Specify the version of ChakraCore you are using
11+
placeholder: Version / Commit id
12+
validations:
13+
required: true
14+
- type: textarea
15+
attributes:
16+
label: Steps to reproduce
17+
description: Provide steps to reproduce the problem
18+
placeholder: Instructions used to build and execute / Project setup
19+
validations:
20+
required: true
21+
- type: textarea
22+
attributes:
23+
label: Proof of concept
24+
description: Your POC code
25+
render: js
26+
validations:
27+
required: true
28+
- type: textarea
29+
attributes:
30+
label: Exception or Error
31+
description: Provide error logs / console output
32+
render: text
33+
validations:
34+
required: true
35+
- type: textarea
36+
attributes:
37+
label: Additional Context
+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Build Issue
2+
description: Report a build issue
3+
title: '[Build]: '
4+
labels:
5+
- Build Break
6+
body:
7+
- type: input
8+
attributes:
9+
label: Operating System
10+
description: Specify the OS (with version) you are using
11+
placeholder: Name + Version
12+
validations:
13+
required: true
14+
- type: input
15+
attributes:
16+
label: Compiler
17+
description: Specify the compiler (with version) you are using
18+
placeholder: Name + Version
19+
validations:
20+
required: true
21+
- type: input
22+
attributes:
23+
label: ChakraCore Version
24+
description: Specify the version of ChakraCore you are using
25+
placeholder: Version / Commit id
26+
validations:
27+
required: true
28+
- type: textarea
29+
attributes:
30+
label: Compiler output
31+
render: shell
32+
validations:
33+
required: true
34+
- type: textarea
35+
attributes:
36+
label: Additional Context
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Api Bug
2+
description: Report a bug with the embedding api
3+
title: '[Api]: '
4+
labels:
5+
- APIs
6+
- Bug
7+
body:
8+
- type: input
9+
attributes:
10+
label: Operating System
11+
description: Specify the OS (with version) you are using
12+
placeholder: Name + Version
13+
validations:
14+
required: true
15+
- type: input
16+
attributes:
17+
label: ChakraCore Version
18+
description: Specify the version of ChakraCore you are using
19+
placeholder: Version / Commit id
20+
validations:
21+
required: true
22+
- type: textarea
23+
attributes:
24+
label: Steps to reproduce
25+
description: Please describe how your project is set-up
26+
validations:
27+
required: true
28+
- type: textarea
29+
attributes:
30+
label: Proof of concept
31+
description: Add some minimal poc that triggers the bug
32+
render: cpp
33+
validations:
34+
required: true
35+
- type: textarea
36+
attributes:
37+
label: Additional context
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Api Feature Request
2+
description: Propose a new feature to the embedding api
3+
title: '[Api]: '
4+
labels:
5+
- APIs
6+
- Feature Request
7+
body:
8+
- type: textarea
9+
attributes:
10+
label: Description
11+
description: A clear and concise description of the problem or missing capability
12+
validations:
13+
required: true
14+
- type: textarea
15+
attributes:
16+
label: Describe the solution you'd like
17+
description: If you have a solution in mind, please describe it.
18+
- type: textarea
19+
attributes:
20+
label: Describe alternatives you've considered
21+
description: Have you considered any alternative solutions or workarounds?
22+
- type: textarea
23+
attributes:
24+
label: Additional context
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Implement tc39 proposal
2+
description: Request the implementation of a tc39 proposal
3+
title: '[Proposal]: '
4+
labels:
5+
- ECMAScript Spec
6+
- Feature Request
7+
body:
8+
- type: input
9+
attributes:
10+
label: Link to proposal
11+
placeholder: https://github.com/tc39/...
12+
validations:
13+
required: true
14+
- type: dropdown
15+
attributes:
16+
label: Proposal stage
17+
options:
18+
- Stage 4
19+
- Stage 3
20+
- Stage 2.7
21+
- Stage 2
22+
validations:
23+
required: true
24+
- type: textarea
25+
attributes:
26+
label: Additional Context

.github/ISSUE_TEMPLATE/config.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: Discord
4+
url: https://discord.gg/dgRawPdNuC
5+
about: If you have any questions, feel free to join our Discord server.

CMakeLists.txt

+9-4
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ else(NOT CHAKRACORE_BUILD_SH)
3939
unset(LIBS_ONLY_BUILD_SH CACHE)
4040
set(CC_LIBS_ONLY_BUILD 1)
4141
endif()
42+
43+
if (CLANG_SANITIZE_SH)
44+
set(CLANG_SANITIZE ${CLANG_SANITIZE_SH})
45+
unset(CLANG_SANITIZE_SH CACHE)
46+
endif()
47+
4248
endif(NOT CHAKRACORE_BUILD_SH)
4349

4450
if(CC_USES_SYSTEM_ARCH_SH OR NOT CHAKRACORE_BUILD_SH)
@@ -573,12 +579,11 @@ endif()
573579
include_directories(SYSTEM /usr/local/include)
574580
include(pal/src/configure.cmake)
575581

576-
# this should be after `detect feature` to not to affect feature detection
577-
# Clang -fsanitize.
578-
if (CLANG_SANITIZE_SH)
582+
# Clang sanitizer support, this should be after `detect feature` to not to
583+
# affect feature detection
584+
if (CLANG_SANITIZE)
579585
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=${CLANG_SANITIZE_SH}")
580586
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -fsanitize=${CLANG_SANITIZE_SH}")
581-
unset(CLANG_SANITIZE_SH CACHE) # don't cache
582587
endif()
583588

584589
add_subdirectory (pal)

azure-pipelines.yml

+15
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ jobs:
102102
ninja
103103
displayName: 'Build'
104104
105+
- publish: $(System.DefaultWorkingDirectory)/build/bin
106+
artifact: $(Agent.JobName)
107+
105108
- script: |
106109
cd build
107110
ninja check
@@ -119,62 +122,71 @@ jobs:
119122
special_build: ''
120123
do_test: true
121124
test_tags: ''
125+
build_outdir_suffix: ''
122126
x86.Test:
123127
image_name: 'windows-2022'
124128
build_type: 'test'
125129
target: 'x86'
126130
special_build: ''
127131
do_test: true
128132
test_tags: '--include-slow'
133+
build_outdir_suffix: ''
129134
x86.NoJit:
130135
image_name: 'windows-2022'
131136
build_type: 'debug'
132137
target: 'x86'
133138
special_build: '"/p:BuildJIT=false"'
134139
do_test: true
135140
test_tags: '-disablejit'
141+
build_outdir_suffix: '.NoJIT'
136142
x86.Release:
137143
image_name: 'windows-2022'
138144
build_type: 'release'
139145
target: 'x86'
140146
special_build: ''
141147
do_test: false
142148
test_tags: ''
149+
build_outdir_suffix: ''
143150
x64.Debug:
144151
image_name: 'windows-2022'
145152
build_type: 'debug'
146153
target: 'x64'
147154
special_build: ''
148155
do_test: true
149156
test_tags: ''
157+
build_outdir_suffix: ''
150158
x64.Test:
151159
image_name: 'windows-2022'
152160
build_type: 'test'
153161
target: 'x64'
154162
special_build: ''
155163
do_test: true
156164
test_tags: '--include-slow'
165+
build_outdir_suffix: ''
157166
x64.Release:
158167
image_name: 'windows-2022'
159168
build_type: 'release'
160169
target: 'x64'
161170
special_build: ''
162171
do_test: false
163172
test_tags: ''
173+
build_outdir_suffix: ''
164174
win19.x86.Release:
165175
image_name: 'windows-2019'
166176
build_type: 'release'
167177
target: 'x86'
168178
special_build: ''
169179
do_test: false
170180
test_tags: ''
181+
build_outdir_suffix: ''
171182
win19.x64.Release:
172183
image_name: 'windows-2019'
173184
build_type: 'release'
174185
target: 'x64'
175186
special_build: ''
176187
do_test: false
177188
test_tags: ''
189+
build_outdir_suffix: ''
178190
pool:
179191
vmImage: $(image_name)
180192

@@ -186,6 +198,9 @@ jobs:
186198
BUILD: $(build_type)
187199
SPECIAL: $(special_build)
188200

201+
- publish: $(System.DefaultWorkingDirectory)/Build/VcBuild$(build_outdir_suffix)/bin
202+
artifact: $(Agent.JobName)
203+
189204
- script: test\ci.testone.cmd %TARGET% %BUILD% %TEST_TAGS%
190205
displayName: 'Test'
191206
condition: eq(variables['do_test'], true)

bin/NativeTests/stdafx.h

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//-------------------------------------------------------------------------------------------------------
22
// Copyright (C) Microsoft. All rights reserved.
3+
// Copyright (c) ChakraCore Project Contributors. All rights reserved.
34
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
45
//-------------------------------------------------------------------------------------------------------
56

@@ -25,11 +26,16 @@
2526

2627
#define DebugOnly(x) x
2728

29+
#if !defined(CHAKRACORE_STRINGIZE)
30+
#define CHAKRACORE_STRINGIZE_IMPL(x) #x
31+
#define CHAKRACORE_STRINGIZE(x) CHAKRACORE_STRINGIZE_IMPL(x)
32+
#endif
33+
2834
#define AssertMsg(exp, comment) \
2935
do { \
3036
if (!(exp)) \
3137
{ \
32-
fprintf(stderr, "ASSERTION (%s, line %d) %s %s\n", __FILE__, __LINE__, _STRINGIZE(exp), comment); \
38+
fprintf(stderr, "ASSERTION (%s, line %d) %s %s\n", __FILE__, __LINE__, CHAKRACORE_STRINGIZE(exp), comment); \
3339
fflush(stderr); \
3440
DebugBreak(); \
3541
} \

bin/ch/stdafx.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//-------------------------------------------------------------------------------------------------------
22
// Copyright (C) Microsoft. All rights reserved.
3-
// Copyright (c) 2021 ChakraCore Project Contributors. All rights reserved.
3+
// Copyright (c) ChakraCore Project Contributors. All rights reserved.
44
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
55
//-------------------------------------------------------------------------------------------------------
66
#pragma once
@@ -57,16 +57,16 @@
5757

5858
#if defined(DBG)
5959

60-
#define _STRINGIZE_(x) #x
61-
#if !defined(_STRINGIZE)
62-
#define _STRINGIZE(x) _STRINGIZE_(x)
60+
#if !defined(CHAKRACORE_STRINGIZE)
61+
#define CHAKRACORE_STRINGIZE_IMPL(x) #x
62+
#define CHAKRACORE_STRINGIZE(x) CHAKRACORE_STRINGIZE_IMPL(x)
6363
#endif
6464

6565
#define AssertMsg(exp, comment) \
6666
do { \
6767
if (!(exp)) \
6868
{ \
69-
fprintf(stderr, "ASSERTION (%s, line %d) %s %s\n", __FILE__, __LINE__, _STRINGIZE(exp), comment); \
69+
fprintf(stderr, "ASSERTION (%s, line %d) %s %s\n", __FILE__, __LINE__, CHAKRACORE_STRINGIZE(exp), comment); \
7070
fflush(stderr); \
7171
DebugBreak(); \
7272
} \

lib/Backend/IRBuilder.cpp

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//-------------------------------------------------------------------------------------------------------
22
// Copyright (C) Microsoft. All rights reserved.
3-
// Copyright (c) 2021 ChakraCore Project Contributors. All rights reserved.
3+
// Copyright (c) ChakraCore Project Contributors. All rights reserved.
44
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
55
//-------------------------------------------------------------------------------------------------------
66
#include "Backend.h"
@@ -118,7 +118,7 @@ IRBuilder::DoBailOnNoProfile()
118118
return false;
119119
}
120120

121-
if (m_func->GetTopFunc()->GetJITFunctionBody()->IsCoroutine())
121+
if (m_func->GetTopFunc()->GetJITFunctionBody()->IsCoroutine() && !m_func->IsLoopBody())
122122
{
123123
return false;
124124
}
@@ -441,7 +441,7 @@ IRBuilder::Build()
441441
// Note that for generators, we insert the bailout after the jump table to allow
442442
// the generator's execution to proceed before bailing out. Otherwise, we would always
443443
// bail to the beginning of the function in the interpreter, creating an infinite loop.
444-
if (m_func->IsJitInDebugMode() && !this->m_func->GetJITFunctionBody()->IsCoroutine())
444+
if (m_func->IsJitInDebugMode() && (!this->m_func->GetJITFunctionBody()->IsCoroutine() || this->IsLoopBody()))
445445
{
446446
this->InsertBailOutForDebugger(m_functionStartOffset, IR::BailOutForceByFlag | IR::BailOutBreakPointInFunction | IR::BailOutStep, nullptr);
447447
}
@@ -1880,6 +1880,9 @@ IRBuilder::BuildReg2(Js::OpCode newOpcode, uint32 offset, Js::RegSlot R0, Js::Re
18801880
break;
18811881

18821882
case Js::OpCode::Yield:
1883+
// Jitting Loop Bodies containing Yield is not possible, blocked at callsites of GenerateLoopBody
1884+
AssertMsg(!this->IsLoopBody(), "Attempting to JIT loop body containing Yield");
1885+
18831886
instr = IR::Instr::New(newOpcode, dstOpnd, src1Opnd, m_func);
18841887
this->AddInstr(instr, offset);
18851888
IR::Instr* yieldInstr = instr->ConvertToBailOutInstr(instr, IR::BailOutForGeneratorYield);
@@ -7849,6 +7852,7 @@ IRBuilder::GeneratorJumpTable::GeneratorJumpTable(Func* func, IRBuilder* irBuild
78497852
IR::Instr*
78507853
IRBuilder::GeneratorJumpTable::BuildJumpTable()
78517854
{
7855+
AssertMsg(!this->m_func->IsLoopBody(), "Coroutine Loop Bodies can be jitted but should follow a different path");
78527856
if (!this->m_func->GetJITFunctionBody()->IsCoroutine())
78537857
{
78547858
return this->m_irBuilder->m_lastInstr;

0 commit comments

Comments
 (0)