Skip to content
Permalink
Browse files
8269853: Prefetch::read should accept pointer to const
Reviewed-by: coleenp
  • Loading branch information
Harold Seigel committed Oct 25, 2021
1 parent 97d3280 commit 337a9b73a75981d14eb4125e4354edda8d541361
Showing 13 changed files with 24 additions and 24 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2013 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -29,7 +29,7 @@
#include "runtime/prefetch.hpp"


inline void Prefetch::read(void *loc, intx interval) {
inline void Prefetch::read(const void *loc, intx interval) {
#if !defined(USE_XLC_BUILTINS)
__asm__ __volatile__ (
" dcbt 0, %0 \n"
@@ -30,7 +30,7 @@
#include "runtime/prefetch.hpp"


inline void Prefetch::read (void *loc, intx interval) {
inline void Prefetch::read (const void *loc, intx interval) {
if (interval >= 0)
asm("prfm PLDL1KEEP, [%0, %1]" : : "r"(loc), "r"(interval));
}
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 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
@@ -28,7 +28,7 @@
#include "runtime/prefetch.hpp"


inline void Prefetch::read (void *loc, intx interval) {
inline void Prefetch::read (const void *loc, intx interval) {
#ifdef AMD64
__asm__ ("prefetcht0 (%0,%1,1)" : : "r" (loc), "r" (interval));
#endif // AMD64
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -28,7 +28,7 @@

#include "runtime/prefetch.hpp"

inline void Prefetch::read(void* loc, intx interval) {
inline void Prefetch::read(const void* loc, intx interval) {
}

inline void Prefetch::write(void* loc, intx interval) {
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -29,7 +29,7 @@
#include "runtime/prefetch.hpp"


inline void Prefetch::read (void *loc, intx interval) {
inline void Prefetch::read (const void *loc, intx interval) {
if (interval >= 0)
asm("prfm PLDL1KEEP, [%0, %1]" : : "r"(loc), "r"(interval));
}
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 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
@@ -27,7 +27,7 @@

#include "runtime/prefetch.hpp"

inline void Prefetch::read (void *loc, intx interval) {
inline void Prefetch::read (const void *loc, intx interval) {
#if defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_5TE__)
__asm__ volatile ("pld [%0]" : : "r" (loc));
#endif
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2013 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -29,7 +29,7 @@
#include "runtime/prefetch.hpp"


inline void Prefetch::read(void *loc, intx interval) {
inline void Prefetch::read(const void *loc, intx interval) {
__asm__ __volatile__ (
" dcbt 0, %0 \n"
:
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -28,7 +28,7 @@

#include "runtime/prefetch.hpp"

inline void Prefetch::read(void* loc, intx interval) {
inline void Prefetch::read(const void* loc, intx interval) {
// No prefetch instructions on z/Architecture -> implement trivially.
}

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 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
@@ -28,7 +28,7 @@
#include "runtime/prefetch.hpp"


inline void Prefetch::read (void *loc, intx interval) {
inline void Prefetch::read (const void *loc, intx interval) {
#ifdef AMD64
__asm__ ("prefetcht0 (%0,%1,1)" : : "r" (loc), "r" (interval));
#endif // AMD64
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -28,7 +28,7 @@

#include "runtime/prefetch.hpp"

inline void Prefetch::read(void* loc, intx interval) {
inline void Prefetch::read(const void* loc, intx interval) {
}

inline void Prefetch::write(void* loc, intx interval) {
@@ -28,7 +28,7 @@
#include "runtime/prefetch.hpp"


inline void Prefetch::read (void *loc, intx interval) {
inline void Prefetch::read (const void *loc, intx interval) {
}

inline void Prefetch::write(void *loc, intx interval) {
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 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
@@ -27,7 +27,7 @@

#include "runtime/prefetch.hpp"

inline void Prefetch::read (void *loc, intx interval) {}
inline void Prefetch::read (const void *loc, intx interval) {}
inline void Prefetch::write(void *loc, intx interval) {}

#endif // OS_CPU_WINDOWS_X86_PREFETCH_WINDOWS_X86_INLINE_HPP
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 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
@@ -42,7 +42,7 @@ class Prefetch : AllStatic {
};

// Prefetch anticipating read; must not fault, semantically a no-op
static void read(void* loc, intx interval);
static void read(const void* loc, intx interval);

// Prefetch anticipating write; must not fault, semantically a no-op
static void write(void* loc, intx interval);

1 comment on commit 337a9b7

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 337a9b7 Oct 25, 2021

Choose a reason for hiding this comment

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

Please sign in to comment.