Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 8c398b2

Browse files
committed
Merge branch 'master' of https://github.com/dotnet/coreclr into SpanRefReadOnly
2 parents d540fdb + 7f8496d commit 8c398b2

34 files changed

+321
-216
lines changed

ILAsmVersion.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.1.0-preview1-26014-01
1+
2.1.0-preview1-26014-04

build.cmd

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,6 @@ if /i "%1" == "-ibcinstrument" (set __IbcTuning=/Tuning&set processedArgs=
209209
if /i "%1" == "-toolset_dir" (set __ToolsetDir=%2&set __PassThroughArgs=%__PassThroughArgs% %2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop)
210210
if /i "%1" == "-crossgenaltjit" (set __CrossgenAltJit=%2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop)
211211

212-
REM Temporarily eat old -altjitcrossgen flag until CI system is updated.
213-
if /i "%1" == "-altjitcrossgen" (set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
214-
215212
REM TODO these are deprecated remove them eventually
216213
REM don't add more, use the - syntax instead
217214
if /i "%1" == "freebsdmscorlib" (set __BuildSOS=0&set __BuildNativeCoreLib=0&set __BuildNative=0&set __BuildTests=0&set __BuildPackages=0&set __BuildOS=FreeBSD&set __SkipNugetPackage=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)

dependencies.props

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@
2323

2424
<!-- Source of truth for dependency tooling: the commit hash of the dotnet/versions master branch as of the last auto-upgrade. -->
2525
<PropertyGroup>
26-
<CoreFxCurrentRef>989f186ee14ff134221cc3467e7bc14de19dd6c3</CoreFxCurrentRef>
27-
<CoreClrCurrentRef>989f186ee14ff134221cc3467e7bc14de19dd6c3</CoreClrCurrentRef>
26+
<CoreFxCurrentRef>5b1be3516eb28ccbf8a8933b505d8c0c4810f4a2</CoreFxCurrentRef>
27+
<CoreClrCurrentRef>5b1be3516eb28ccbf8a8933b505d8c0c4810f4a2</CoreClrCurrentRef>
2828
<BuildToolsCurrentRef>a06a5cab76b48bdef868dcc2c53f9f03595bbba3</BuildToolsCurrentRef>
29-
<PgoDataCurrentRef>9462d818e6299f541e95610f5e7ca4f455e6de3e</PgoDataCurrentRef>
29+
<PgoDataCurrentRef>5b1be3516eb28ccbf8a8933b505d8c0c4810f4a2</PgoDataCurrentRef>
3030
</PropertyGroup>
3131

3232
<!-- Tests/infrastructure dependency versions. -->
3333
<PropertyGroup>
34-
<MicrosoftPrivateCoreFxNETCoreAppPackageVersion>4.5.0-preview1-26013-12</MicrosoftPrivateCoreFxNETCoreAppPackageVersion>
35-
<MicrosoftNETCorePlatformsPackageVersion>2.1.0-preview1-26013-12</MicrosoftNETCorePlatformsPackageVersion>
36-
<PgoDataPackageVersion>99.99.99-master-20171213-0045</PgoDataPackageVersion>
37-
<MicrosoftNETCoreRuntimeCoreCLRPackageVersion>2.1.0-preview1-26014-01</MicrosoftNETCoreRuntimeCoreCLRPackageVersion>
34+
<MicrosoftPrivateCoreFxNETCoreAppPackageVersion>4.5.0-preview1-26014-03</MicrosoftPrivateCoreFxNETCoreAppPackageVersion>
35+
<MicrosoftNETCorePlatformsPackageVersion>2.1.0-preview1-26014-03</MicrosoftNETCorePlatformsPackageVersion>
36+
<PgoDataPackageVersion>99.99.99-master-20171214-0043</PgoDataPackageVersion>
37+
<MicrosoftNETCoreRuntimeCoreCLRPackageVersion>2.1.0-preview1-26014-04</MicrosoftNETCoreRuntimeCoreCLRPackageVersion>
3838
<XunitPackageVersion>2.2.0-beta2-build3300</XunitPackageVersion>
3939
<XunitConsoleNetcorePackageVersion>1.0.2-prerelease-00177</XunitConsoleNetcorePackageVersion>
4040
<XunitPerformanceApiPackageVersion>1.0.0-beta-build0012</XunitPerformanceApiPackageVersion>

src/gc/env/common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <stdint.h>
1717
#include <stddef.h>
1818
#include <stdio.h>
19+
#include <stdlib.h>
1920
#include <string.h>
2021
#include <wchar.h>
2122
#include <assert.h>

src/gc/env/gcenv.base.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,11 @@ inline void* ALIGN_DOWN(void* ptr, size_t alignment)
320320
return reinterpret_cast<void*>(ALIGN_DOWN(as_size_t, alignment));
321321
}
322322

323+
inline int GetRandomInt(int max)
324+
{
325+
return rand() % max;
326+
}
327+
323328
typedef struct _PROCESSOR_NUMBER {
324329
uint16_t Group;
325330
uint8_t Number;

src/gc/env/gcenv.ee.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ class GCToEEInterface
8080
static bool IsGCThread();
8181
static bool WasCurrentThreadCreatedByGC();
8282
static bool CreateThread(void (*threadStart)(void*), void* arg, bool is_suspendable, const char* name);
83+
static void WalkAsyncPinnedForPromotion(Object* object, ScanContext* sc, promote_func* callback);
84+
static void WalkAsyncPinned(Object* object, void* context, void(*callback)(Object*, Object*, void*));
8385
};
8486

8587
#endif // __GCENV_EE_H__

src/gc/gcenv.ee.standalone.inl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,5 +258,16 @@ inline bool GCToEEInterface::CreateThread(void (*threadStart)(void*), void* arg,
258258
return g_theGCToCLR->CreateThread(threadStart, arg, is_suspendable, name);
259259
}
260260

261+
inline void GCToEEInterface::WalkAsyncPinnedForPromotion(Object* object, ScanContext* sc, promote_func* callback)
262+
{
263+
assert(g_theGCToCLR != nullptr);
264+
return g_theGCToCLR->WalkAsyncPinnedForPromotion(object, sc, callback);
265+
}
266+
267+
inline void GCToEEInterface::WalkAsyncPinned(Object* object, void* context, void(*callback)(Object*, Object*, void*))
268+
{
269+
assert(g_theGCToCLR != nullptr);
270+
return g_theGCToCLR->WalkAsyncPinned(object, context, callback);
271+
}
261272

262273
#endif // __GCTOENV_EE_STANDALONE_INL__

src/gc/gchandletable.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ OBJECTHANDLE GCHandleStore::CreateDependentHandle(Object* primary, Object* secon
5757
return handle;
5858
}
5959

60-
void GCHandleStore::RelocateAsyncPinnedHandles(IGCHandleStore* pTarget)
60+
void GCHandleStore::RelocateAsyncPinnedHandles(IGCHandleStore* pTarget, void (*clearIfComplete)(Object*), void (*setHandle)(Object*, OBJECTHANDLE))
6161
{
6262
// assumption - the IGCHandleStore is an instance of GCHandleStore
6363
GCHandleStore* other = static_cast<GCHandleStore*>(pTarget);
64-
::Ref_RelocateAsyncPinHandles(&_underlyingBucket, &other->_underlyingBucket);
64+
::Ref_RelocateAsyncPinHandles(&_underlyingBucket, &other->_underlyingBucket, clearIfComplete, setHandle);
6565
}
6666

6767
bool GCHandleStore::EnumerateAsyncPinnedHandles(async_pin_enum_fn callback, void* context)

src/gc/gchandletableimpl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class GCHandleStore : public IGCHandleStore
2323

2424
virtual OBJECTHANDLE CreateDependentHandle(Object* primary, Object* secondary);
2525

26-
virtual void RelocateAsyncPinnedHandles(IGCHandleStore* pTarget);
26+
virtual void RelocateAsyncPinnedHandles(IGCHandleStore* pTarget, void (*clearIfCompleteCallback)(Object* object), void (*setHandle)(Object* object, OBJECTHANDLE handle));
2727

2828
virtual bool EnumerateAsyncPinnedHandles(async_pin_enum_fn callback, void* context);
2929

src/gc/gcinterface.ee.h

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,38 @@ class IGCToCLR {
219219
// or a server GC thread.
220220
virtual
221221
bool WasCurrentThreadCreatedByGC() = 0;
222+
223+
// Given an object, if this object is an instance of `System.Threading.OverlappedData`,
224+
// and the runtime treats instances of this class specially, traverses the objects that
225+
// are directly or (once) indirectly pinned by this object and reports them to the GC for
226+
// the purposes of relocation and promotion.
227+
//
228+
// Overlapped objects are very special and as such the objects they wrap can't be promoted in
229+
// the same manner as normal objects. This callback gives the EE the opportunity to hide these
230+
// details, if they are implemented at all.
231+
//
232+
// This function is a no-op if "object" is not an OverlappedData object.
233+
virtual
234+
void WalkAsyncPinnedForPromotion(Object* object, ScanContext* sc, promote_func* callback) = 0;
235+
236+
// Given an object, if this object is an instance of `System.Threading.OverlappedData` and the
237+
// runtime treats instances of this class specially, traverses the objects that are directly
238+
// or once indirectly pinned by this object and invokes the given callback on them. The callback
239+
// is passed the following arguments:
240+
// Object* "from" - The object that "caused" the "to" object to be pinned. If a single object
241+
// is pinned directly by this OverlappedData, this object will be the
242+
// OverlappedData object itself. If an array is pinned by this OverlappedData,
243+
// this object will be the pinned array.
244+
// Object* "to" - The object that is pinned by the "from" object. If a single object is pinned
245+
// by an OverlappedData, "to" will be that single object. If an array is pinned
246+
// by an OverlappedData, the callback will be invoked on all elements of that
247+
// array and each element will be a "to" object.
248+
// void* "context" - Passed verbatim from "WalkOverlappedObject" to the callback function.
249+
// The "context" argument will be passed directly to the callback without modification or inspection.
250+
//
251+
// This function is a no-op if "object" is not an OverlappedData object.
252+
virtual
253+
void WalkAsyncPinned(Object* object, void* context, void(*callback)(Object*, Object*, void*)) = 0;
222254
};
223255

224256
#endif // _GCINTERFACE_EE_H_

0 commit comments

Comments
 (0)