Skip to content

Conversation

@rwestrel
Copy link
Contributor

@rwestrel rwestrel commented Feb 1, 2023

With 8297933, a TypeAryPtr is a lot more likely to have a null _klass
and that breaks TypePtr::speculative_type().


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8301630: C2: 8297933 broke type speculation in some cases

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/12368/head:pull/12368
$ git checkout pull/12368

Update a local copy of the PR:
$ git checkout pull/12368
$ git pull https://git.openjdk.org/jdk pull/12368/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 12368

View PR using the GUI difftool:
$ git pr show -t 12368

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/12368.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 1, 2023

👋 Welcome back roland! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Feb 1, 2023

@rwestrel The following label will be automatically applied to this pull request:

  • hotspot-compiler

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Feb 1, 2023
@openjdk openjdk bot added the rfr Pull request is ready for review label Feb 2, 2023
@mlbridge
Copy link

mlbridge bot commented Feb 2, 2023

Webrevs

Copy link
Member

@chhagedorn chhagedorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@openjdk
Copy link

openjdk bot commented Feb 2, 2023

@rwestrel This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8301630: C2: 8297933 broke type speculation in some cases

Reviewed-by: chagedorn, thartmann

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 345 new commits pushed to the master branch:

  • 1bab93b: 8303073: (bf) Temporarily reinstate private DirectByteBuffer(long, int) constructor
  • 221f346: 8303047: avoid NULL after 8301661
  • 23e9d9d: 8302811: NMT.random_reallocs_vm fails if NMT is off
  • fcaf871: 8302028: Port fdlibm atan2 to Java
  • 07e976a: 8303081: Serial: Remove unused VM_MarkSweep
  • 8de841d: 8302667: Improve message format when failing to load symbols or libraries
  • f893d23: 8303024: (fs) WindowsFileSystem.supportedFileAttributeViews can use Set.of
  • d7ada66: 8303084: G1 Heap region liveness verification has inverted return value
  • 5d7e7e2: 8302760: Improve liveness/remembered set verification for G1
  • b0e0f37: 8303067: G1: Remove unimplemented G1FullGCScope::heap_transition
  • ... and 335 more: https://git.openjdk.org/jdk/compare/cae577a7102e97278f3f6880e529a68c1f7b71ab...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Feb 2, 2023
@TobiHartmann
Copy link
Member

TobiHartmann commented Feb 2, 2023

compiler/intrinsics/unsafe/AllocateUninitializedArray.java fails with -XX:TypeProfileLevel=222

# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/workspace/open/src/hotspot/share/opto/type.hpp:1202), pid=57805, tid=23299
#  Error: assert(k != __null || maybe_null) failed


Current CompileTask:
C2:   7286  312       4       compiler.intrinsics.unsafe.AllocateUninitializedArray$$Lambda$38/0x0000000801006c70::call (4 bytes)

Stack: [0x0000700009549000,0x0000700009649000],  sp=0x00007000096466b0,  free space=1013k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.dylib+0x1284c09]  VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x739  (type.hpp:1202)
V  [libjvm.dylib+0x128526b]  VMError::report_and_die(Thread*, void*, char const*, int, char const*, char const*, __va_list_tag*)+0x3b
V  [libjvm.dylib+0x6cfcfd]  report_vm_error(char const*, int, char const*, char const*, ...)+0xdd
V  [libjvm.dylib+0x11ee54a]  TypePtr::speculative_type() const+0x14a
V  [libjvm.dylib+0x11f2d70]  TypeOopPtr::would_improve_type(ciKlass*, int) const+0x40
V  [libjvm.dylib+0x932263]  GraphKit::record_profile_for_speculation(Node*, ciKlass*, ProfilePtrKind)+0xb3
V  [libjvm.dylib+0x932d6d]  GraphKit::record_profiled_return_for_speculation()+0xed
V  [libjvm.dylib+0x78aca3]  Parse::do_call()+0x1303
V  [libjvm.dylib+0xf95d22]  Parse::do_one_bytecode()+0x232
V  [libjvm.dylib+0xf8642c]  Parse::do_one_block()+0x43c
V  [libjvm.dylib+0xf844c9]  Parse::do_all_blocks()+0x3a9
V  [libjvm.dylib+0xf8047b]  Parse::Parse(JVMState*, ciMethod*, float)+0xc1b
V  [libjvm.dylib+0x51b3fa]  ParseGenerator::generate(JVMState*)+0xaa
V  [libjvm.dylib+0x636556]  Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x15b6
V  [libjvm.dylib+0x5190e7]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x167
V  [libjvm.dylib+0x654fab]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x63b
V  [libjvm.dylib+0x654768]  CompileBroker::compiler_thread_loop()+0x288
V  [libjvm.dylib+0xa1673f]  JavaThread::thread_main_inner()+0x1ff
V  [libjvm.dylib+0x11cd647]  Thread::call_run()+0x177
V  [libjvm.dylib+0xf4e4bf]  thread_native_entry(Thread*)+0x14f
C  [libsystem_pthread.dylib+0x6109]  _pthread_start+0x94
C  [libsystem_pthread.dylib+0x1b8b]  thread_start+0xf

@rwestrel
Copy link
Contributor Author

rwestrel commented Feb 6, 2023

compiler/intrinsics/unsafe/AllocateUninitializedArray.java fails with -XX:TypeProfileLevel=222

The reason for that failure is that speculation sees an array type that is exact but of element type top which makes little sense. I added a test case. That happens when an array of some integer type is casted to some other integer type (int[] and short[] in the test case). The result should not be an exact array. I propose fixing TypePtr::meet_aryptr() to address that issue: I tweaked the "Integral array element types" so it follows the "Non integral arrays."

Copy link
Member

@TobiHartmann TobiHartmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I'll re-run testing and report back.

@TobiHartmann
Copy link
Member

All tests passed.

@rwestrel
Copy link
Contributor Author

@TobiHartmann thanks for the review and tests. @chhagedorn 's review was on the previous version of this fix so I'd like another review. Anyone?

Copy link
Member

@chhagedorn chhagedorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The update looks good to me, too!

@rwestrel
Copy link
Contributor Author

rwestrel commented Mar 1, 2023

@chhagedorn thanks for the review.

@rwestrel
Copy link
Contributor Author

rwestrel commented Mar 1, 2023

/integrate

@openjdk
Copy link

openjdk bot commented Mar 1, 2023

Going to push as commit 6b07243.
Since your change was applied there have been 404 commits pushed to the master branch:

  • 3aeefbf: 8303421: [BACKOUT] 8303133: Update ProcessTools.startProcess(...) to exit early if process exit before linePredicate is printed.
  • 1fdaf25: 8303133: Update ProcessTools.startProcess(...) to exit early if process exit before linePredicate is printed.
  • 65da2c5: 8303412: Update linux_x64-to-linux_aarch64 cross compilation devkit at Oracle
  • 7e47d51: 8282319: java.util.Locale method to stream available Locales
  • 8815175: 8303216: Prefer ArrayList to LinkedList in sun.net.httpserver.ServerImpl
  • a10d5ac: 8303130: Document required Accessibility permissions on macOS
  • 50dc041: 8303227: JniObjWithEnv should be NullablePointer compliant
  • 61e8867: 8302040: Port fdlibm sqrt to Java
  • 6423065: 8303261: JFR: jdk/jfr/api/consumer/streaming/TestJVMCrash.java doesn't retry
  • dc5ea6a: 8303350: Fix mistyped {@code}
  • ... and 394 more: https://git.openjdk.org/jdk/compare/cae577a7102e97278f3f6880e529a68c1f7b71ab...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Mar 1, 2023
@openjdk openjdk bot closed this Mar 1, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Mar 1, 2023
@openjdk
Copy link

openjdk bot commented Mar 1, 2023

@rwestrel Pushed as commit 6b07243.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants