< prev index next >

src/hotspot/cpu/x86/compressedKlass_x86.cpp

Print this page
*** 1,6 ***
! /*
   * Copyright (c) 2023, 2025, Red Hat, Inc. All rights reserved.
   * Copyright (c) 2023, 2025, 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
--- 1,6 ---
!  /*
   * Copyright (c) 2023, 2025, Red Hat, Inc. All rights reserved.
   * Copyright (c) 2023, 2025, 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

*** 32,11 ***
  char* CompressedKlassPointers::reserve_address_space_for_compressed_classes(size_t size, bool aslr, bool optimize_for_zero_base) {
  
    char* result = nullptr;
  
    assert(CompressedKlassPointers::narrow_klass_pointer_bits() == 32 ||
!          CompressedKlassPointers::narrow_klass_pointer_bits() == 22, "Rethink if we ever use different nKlass bit sizes");
  
    // Unconditionally attempting to reserve in lower 4G first makes always sense:
    // -CDS -COH: Try to get unscaled mode (zero base, zero shift)
    // +CDS -COH: No zero base possible (CDS prevents it); but we still benefit from small base pointers (imm32 movabs)
    // -CDS +COH: No zero base possible (22bit nKlass + zero base zero shift = 4MB encoding range, way too small);
--- 32,11 ---
  char* CompressedKlassPointers::reserve_address_space_for_compressed_classes(size_t size, bool aslr, bool optimize_for_zero_base) {
  
    char* result = nullptr;
  
    assert(CompressedKlassPointers::narrow_klass_pointer_bits() == 32 ||
!          CompressedKlassPointers::narrow_klass_pointer_bits() == 19, "Rethink if we ever use different nKlass bit sizes");
  
    // Unconditionally attempting to reserve in lower 4G first makes always sense:
    // -CDS -COH: Try to get unscaled mode (zero base, zero shift)
    // +CDS -COH: No zero base possible (CDS prevents it); but we still benefit from small base pointers (imm32 movabs)
    // -CDS +COH: No zero base possible (22bit nKlass + zero base zero shift = 4MB encoding range, way too small);
< prev index next >