Skip to content

Instantly share code, notes, and snippets.

View JohnTortugo's full-sized avatar
🎯
Focusing

Cesar Soares JohnTortugo

🎯
Focusing
View GitHub Profile
@only 169 156 273 260 258 204 203 251 200 190 99 97 53 42 40 39 27
@only 158 207 202 44 39
0 Root === 0 113 125 136 147 173 271 272 [[ 0 1 3 23 24 25 47 186 185 181 161 142 87 108 115 120 131 275 ]]
1 Con === 0 [[ ]] #top
3 Start === 3 0 [[ 3 5 6 7 8 9 10 11 ]] #{0:control, 1:abIO, 2:memory, 3:rawptr:BotPTR, 4:return_address, 5:int, 6:int}
23 ConI === 0 [[ 190 27 27 143 157 132 121 121 101 183 190 143 143 132 132 121 ]] #int:0
24 ConP === 0 [[ 27 190 ]] #precise TestIncorrectRemat$MyClass: 0x00007ffff04f1578:Constant:exact * Klass:precise TestIncorrectRemat$MyClass: 0x00007ffff04f1578:Constant:exact *
25 ConL === 0 [[ 27 190 ]] #long:16
47 ConI === 0 [[ 251 90 ]] #int:42
@JohnTortugo
JohnTortugo / gist:5efef342fa2b5b712abeed461f9dbec8
Created July 20, 2023 00:33
Investigate RAM issue on Big-endians
diff --git a/src/hotspot/share/code/debugInfo.cpp b/src/hotspot/share/code/debugInfo.cpp
index 55d12448deb..404df71a4a6 100644
--- a/src/hotspot/share/code/debugInfo.cpp
+++ b/src/hotspot/share/code/debugInfo.cpp
@@ -243,7 +243,10 @@ void ObjectValue::print_fields_on(outputStream* st) const {
ObjectValue* ObjectMergeValue::select(frame& fr, RegisterMap& reg_map) {
StackValue* sv_selector = StackValue::create_stack_value(&fr, &reg_map, _selector);
jint selector = sv_selector->get_int();
-
+ tty->print_cr("_selector is location: %d",_selector->is_location());
@JohnTortugo
JohnTortugo / debug.txt
Created June 5, 2023 19:26
Samples of PrintDebugInfo
Compiled method (c2) 504 48 TestObjectClone::test (37 bytes)
total in heap [0x00007f4ba915d110,0x00007f4ba915d568] = 1112
relocation [0x00007f4ba915d280,0x00007f4ba915d2a8] = 40
main code [0x00007f4ba915d2c0,0x00007f4ba915d3d0] = 272
stub code [0x00007f4ba915d3d0,0x00007f4ba915d3e8] = 24
oops [0x00007f4ba915d3e8,0x00007f4ba915d3f8] = 16
metadata [0x00007f4ba915d3f8,0x00007f4ba915d410] = 24
scopes data [0x00007f4ba915d410,0x00007f4ba915d4b0] = 160
scopes pcs [0x00007f4ba915d4b0,0x00007f4ba915d560] = 176
dependencies [0x00007f4ba915d560,0x00007f4ba915d568] = 8

HotSpot Escape Analysis and Scalar Replacement Status

Introduction

Escape Analysis (EA) is a compiler analysis to answer the following questions for a given object O, method M, and thread T.

  • Escapes(O, M): Does object O outlive the execution of method M? This may happen for instance if a reference to O is assigned to a global variable.
  • Escapes(O, T): Does object O escape the current execution thread? This may happen for instance if a reference to O is copied to another thread.

Answers to these questions enable a compiler to perform a few highly effective optimizations, for instance, Stack Allocation (SA), Lock Elision (LE), and Scalar Replacement of Aggregates (SRA). Note that,

/*
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or