Skip to content

Commit fee26ec

Browse files
committed
update to jdk-20+10
27360: LA port of 8290840: Refactor the "os" class
1 parent 2b121ae commit fee26ec

File tree

3 files changed

+16
-29
lines changed

3 files changed

+16
-29
lines changed

src/hotspot/os_cpu/linux_loongarch/os_linux_loongarch.cpp

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
#include "code/vtableStubs.hpp"
3333
#include "interpreter/interpreter.hpp"
3434
#include "memory/allocation.inline.hpp"
35+
#include "os_linux.hpp"
36+
#include "os_posix.hpp"
3537
#include "prims/jniFastGetField.hpp"
3638
#include "prims/jvm_misc.hpp"
3739
#include "runtime/arguments.hpp"
@@ -313,21 +315,6 @@ int os::Linux::get_fpu_control_word(void) {
313315
void os::Linux::set_fpu_control_word(int fpu_control) {
314316
}
315317

316-
bool os::is_allocatable(size_t bytes) {
317-
318-
if (bytes < 2 * G) {
319-
return true;
320-
}
321-
322-
char* addr = reserve_memory(bytes);
323-
324-
if (addr != NULL) {
325-
release_memory(addr, bytes);
326-
}
327-
328-
return addr != NULL;
329-
}
330-
331318
////////////////////////////////////////////////////////////////////////////////
332319
// thread stack
333320

src/hotspot/os_cpu/linux_loongarch/os_linux_loongarch.hpp renamed to src/hotspot/os_cpu/linux_loongarch/os_linux_loongarch.inline.hpp

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
3-
* Copyright (c) 2015, 2022, Loongson Technology. All rights reserved.
2+
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
3+
* Copyright (c) 2022, Loongson Technology. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
66
* This code is free software; you can redistribute it and/or modify it
@@ -23,16 +23,7 @@
2323
*
2424
*/
2525

26-
#ifndef OS_CPU_LINUX_LOONGARCH_OS_LINUX_LOONGARCH_HPP
27-
#define OS_CPU_LINUX_LOONGARCH_OS_LINUX_LOONGARCH_HPP
26+
#ifndef OS_CPU_LINUX_LOONGARCH_OS_LINUX_LOONGARCH_INLINE_HPP
27+
#define OS_CPU_LINUX_LOONGARCH_OS_LINUX_LOONGARCH_INLINE_HPP
2828

29-
static void setup_fpu();
30-
static bool is_allocatable(size_t bytes);
31-
32-
// Used to register dynamic code cache area with the OS
33-
// Note: Currently only used in 64 bit Windows implementations
34-
static bool register_code_area(char *low, char *high) { return true; }
35-
36-
static bool is_ActiveCoresMP();
37-
38-
#endif // OS_CPU_LINUX_LOONGARCH_OS_LINUX_LOONGARCH_HPP
29+
#endif // OS_CPU_LINUX_LOONGARCH_OS_LINUX_LOONGARCH_INLINE_HPP

src/hotspot/share/runtime/os.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
*
2323
*/
2424

25+
/*
26+
* This file has been modified by Loongson Technology in 2022, These
27+
* modifications are Copyright (c) 2022, Loongson Technology, and are made
28+
* available on the same license terms set forth above.
29+
*/
30+
2531
#ifndef SHARE_RUNTIME_OS_HPP
2632
#define SHARE_RUNTIME_OS_HPP
2733

@@ -311,6 +317,9 @@ class os: AllStatic {
311317
return (_processor_count != 1);
312318
}
313319

320+
// Used only on LoongArch64.
321+
static bool is_ActiveCoresMP();
322+
314323
static julong available_memory();
315324
static julong physical_memory();
316325
static bool has_allocatable_memory_limit(size_t* limit);

0 commit comments

Comments
 (0)