Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8198309

Introduce a BAD_PTR macro in globalDefinitions.hpp for 0xdeadbeef

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P3 P3
    • tbd
    • 10
    • hotspot

      0xdeadbeef is used throughout the JVM. There is potential to consolidate this into a BAD_PTR macro as suggested by David Holmes in JDK-8196884. Assessment is needed to understand all the different conversions that exist when 0xdeadbeef is used to determine if they could all be safely converted to intptr_t.

      os/aix/misc_aix.cpp: int deadbeef = 0xdeadbeef;
      share/gc/cms/freeChunk.cpp:#define deadbeefHeapWord 0xdeadbeef
      share/prims/jni.cpp: jint b = Atomic::xchg((jint) 0xdeadbeef, &a);
      share/prims/jni.cpp: assert(a == (jint) 0xdeadbeef && b == (jint) 0xcafebabe, "Atomic::xchg() works");
      share/opto/output.cpp: debug_only( def = (Node*)((intptr_t)0xdeadbeef); )
      share/opto/regalloc.cpp: _framesize(0xdeadbeef)
      share/opto/node.hpp: debug_only(_out[_outcnt] = (Node *)(uintptr_t)0xdeadbeef);
      share/opto/node.hpp: debug_only(_out[_outcnt] = (Node *)(uintptr_t)0xdeadbeef);
      share/opto/split_if.cpp: Node *prior_n = (Node*)((intptr_t)0xdeadbeef);
      share/opto/split_if.cpp: prior_n = (Node*)((intptr_t)0xdeadbeef); // Reset IDOM walk
      share/opto/idealGraphPrinter.cpp: if (_chaitin && _chaitin != (PhaseChaitin *)((intptr_t)0xdeadbeef)) {
      share/opto/gcm.cpp: _node_latency = (GrowableArray<uint> *)((intptr_t)0xdeadbeef);
      share/opto/buildOopMap.cpp: Block *pred = (Block*)((intptr_t)0xdeadbeef);
      share/opto/compile.cpp: _cfg = (PhaseCFG*)((intptr_t)0xdeadbeef);
      share/opto/compile.cpp: _regalloc = (PhaseChaitin*)((intptr_t)0xdeadbeef);
      cpu/aarch64/stubGenerator_aarch64.cpp: __ mov(rscratch1, (uint64_t)0xdeadbeef);
      cpu/s390/macroAssembler_s390.cpp: z_iilf(scratch, 0xdeadbeef);

            Unassigned Unassigned
            lfoltan Lois Foltan
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: