Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b753523
Optimize GetType with known type
MichalPetryka Jun 14, 2023
5862a59
Keep side effects
MichalPetryka Jun 14, 2023
41f70ed
Update importercalls.cpp
MichalPetryka Jun 14, 2023
7448b59
Update importercalls.cpp
MichalPetryka Jun 15, 2023
929d18f
Update importercalls.cpp
MichalPetryka Jun 15, 2023
779a799
Update importercalls.cpp
MichalPetryka Jun 15, 2023
4de198e
Update importercalls.cpp
MichalPetryka Jun 15, 2023
7f44e8f
Check if box is at fault here
MichalPetryka Jun 16, 2023
127bd47
Update importer.cpp
MichalPetryka Jun 16, 2023
0e62429
Sprinkle some asserts
MichalPetryka Jun 21, 2023
cde9a24
Fix building
MichalPetryka Jun 21, 2023
dcf25a8
Update importercalls.cpp
MichalPetryka Jun 23, 2023
6abbd7b
Update importercalls.cpp
MichalPetryka Jun 23, 2023
4b35aa9
Format code
MichalPetryka Jun 23, 2023
eb56645
Merge
MichalPetryka Jun 23, 2023
6a60fc0
Try fixing the r2r test
MichalPetryka Jun 23, 2023
cbe32bf
Update test.cs
MichalPetryka Jun 24, 2023
a128856
Update main.cs
MichalPetryka Jun 24, 2023
f573051
Update newarray.cs
MichalPetryka Jun 24, 2023
f2dad1d
Update generics.cs
MichalPetryka Jun 24, 2023
a1b6fd7
Update gentree.cpp
MichalPetryka Jun 27, 2023
b61f1e1
Update gentree.cpp
MichalPetryka Jun 27, 2023
be56999
Update lclvars.cpp
MichalPetryka Jun 27, 2023
c95231a
Update lclvars.cpp
MichalPetryka Jun 27, 2023
0885714
Merge branch 'dotnet:main' into gettype-exacttype
MichalPetryka Jun 28, 2023
e1514e4
Merge
MichalPetryka Jul 10, 2023
ff1adcd
Revert separated changes
MichalPetryka Jul 10, 2023
cf9e771
Cleanup
MichalPetryka Jul 10, 2023
32c2b3a
Fix the helper
MichalPetryka Jul 11, 2023
75163fd
Update src/coreclr/jit/importer.cpp
MichalPetryka Jul 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix the helper
  • Loading branch information
MichalPetryka committed Jul 11, 2023
commit 32c2b3aa800652ee4f2064ff0e5cef6be9fc1e9d
2 changes: 1 addition & 1 deletion src/coreclr/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -4069,7 +4069,7 @@ class Compiler
unsigned curLevel,
Statement** pAfterStmt DEBUGARG(const char* reason));

CORINFO_CLASS_HANDLE impImportHandleFromTree(GenTree* tree, bool allowShared);
CORINFO_CLASS_HANDLE impImportHandleFromStack(bool allowShared);

GenTree* impStoreStruct(GenTree* store,
unsigned curLevel,
Expand Down
9 changes: 5 additions & 4 deletions src/coreclr/jit/importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2040,18 +2040,18 @@ GenTree* Compiler::impCloneExpr(GenTree* tree,
}

//------------------------------------------------------------------------
// impImportHandleFromTree: Imports a tree that's only used for obtaining a type handle
// to its value
// impImportHandleFromTree: Imports the tree on the top of the stack
// and extracts the handle from it
//
// Arguments:
// tree - imported tree
// allowShared - whether shared types are considered as valid handles
//
// Return Value:
// The extracted handle, or NO_CLASS_HANDLE if no handle could be extracted
//
CORINFO_CLASS_HANDLE Compiler::impImportHandleFromTree(GenTree* tree, bool allowShared)
CORINFO_CLASS_HANDLE Compiler::impImportHandleFromStack(bool allowShared)
{
GenTree* tree = impStackTop().val;
bool isExact = false;
bool notNull = false;
CORINFO_CLASS_HANDLE typeHnd = gtGetClassHandle(tree, &isExact, &notNull);
Expand All @@ -2064,6 +2064,7 @@ CORINFO_CLASS_HANDLE Compiler::impImportHandleFromTree(GenTree* tree, bool allow
}

JITDUMP("Retuning a constant handle from imported tree\n");
impPopStack();
if (!notNull && fgAddrCouldBeNull(tree))
{
impAppendTree(gtNewNullCheck(tree, compCurBB), CHECK_SPILL_ALL, impCurStmtDI);
Expand Down
3 changes: 1 addition & 2 deletions src/coreclr/jit/importercalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3564,11 +3564,10 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis,
// Load handle directly for known types
if (retNode == nullptr)
{
CORINFO_CLASS_HANDLE typeHnd = impImportHandleFromTree(op1, false);
CORINFO_CLASS_HANDLE typeHnd = impImportHandleFromStack(false);
if (typeHnd != NO_CLASS_HANDLE)
{
JITDUMP("Optimizing object.GetType() with known type to typeof\n");
impPopStack();
GenTree* handle = gtNewIconEmbClsHndNode(typeHnd);
retNode = gtNewHelperCallNode(CORINFO_HELP_TYPEHANDLE_TO_RUNTIMETYPE, TYP_REF, handle);
}
Expand Down