Skip to content

Commit

Permalink
Update jit to handle changes to ReadOnlySpan indexer
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyAyersMS committed Oct 27, 2017
1 parent d780f9a commit 83f166a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 20 deletions.
10 changes: 5 additions & 5 deletions src/inc/corinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,11 @@ TODO: Talk about initializing strutures before use
#define SELECTANY extern __declspec(selectany)
#endif

SELECTANY const GUID JITEEVersionIdentifier = { /* 8f51c68e-d515-425c-9e04-97e4a8148b07 */
0x8f51c68e,
0xd515,
0x425c,
{0x9e, 0x04, 0x97, 0xe4, 0xa8, 0x14, 0x8b, 0x07}
SELECTANY const GUID JITEEVersionIdentifier = { /* 3c1197a4-2f0f-4048-b09f-859c11242a02 */
0x3c1197a4,
0x2f0f,
0x4048,
{0xb0, 0x9f, 0x85, 0x9c, 0x11, 0x24, 0x2a, 0x02}
};

//////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
18 changes: 3 additions & 15 deletions src/jit/importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3702,10 +3702,7 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis,
// BoundsCheck(index, s->_length)
// s->_pointer + index * sizeof(T)
//
// For ReadOnlySpan<T>
// Comma
// BoundsCheck(index, s->_length)
// *(s->_pointer + index * sizeof(T))
// For ReadOnlySpan<T> -- same expansion, as it now returns a readonly ref
//
// Signature should show one class type parameter, which
// we need to examine.
Expand Down Expand Up @@ -3758,17 +3755,8 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis,

// Prepare result
var_types resultType = JITtype2varType(sig->retType);

if (isReadOnly)
{
result = gtNewOperNode(GT_IND, resultType, result);
}
else
{
assert(resultType == result->TypeGet());
}

retNode = gtNewOperNode(GT_COMMA, resultType, boundsCheck, result);
result = gtNewOperNode(GT_IND, resultType, result);
retNode = gtNewOperNode(GT_COMMA, resultType, boundsCheck, result);

break;
}
Expand Down

0 comments on commit 83f166a

Please sign in to comment.