comparison src/share/vm/runtime/os.hpp @ 6152:958bb4b7be49

Merge
author asaha
date Tue, 10 Apr 2012 10:42:34 -0700
parents da4be62fb889
children 7432b9db36ff
comparison
equal deleted inserted replaced
6151:e778c29768e6 6152:958bb4b7be49
1 /* 1 /*
2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
71 enum ThreadPriority { // JLS 20.20.1-3 71 enum ThreadPriority { // JLS 20.20.1-3
72 NoPriority = -1, // Initial non-priority value 72 NoPriority = -1, // Initial non-priority value
73 MinPriority = 1, // Minimum priority 73 MinPriority = 1, // Minimum priority
74 NormPriority = 5, // Normal (non-daemon) priority 74 NormPriority = 5, // Normal (non-daemon) priority
75 NearMaxPriority = 9, // High priority, used for VMThread 75 NearMaxPriority = 9, // High priority, used for VMThread
76 MaxPriority = 10 // Highest priority, used for WatcherThread 76 MaxPriority = 10, // Highest priority, used for WatcherThread
77 // ensures that VMThread doesn't starve profiler 77 // ensures that VMThread doesn't starve profiler
78 CriticalPriority = 11 // Critical thread priority
78 }; 79 };
79 80
80 // Typedef for structured exception handling support 81 // Typedef for structured exception handling support
81 typedef void (*java_call_t)(JavaValue* value, methodHandle* method, JavaCallArguments* args, Thread* thread); 82 typedef void (*java_call_t)(JavaValue* value, methodHandle* method, JavaCallArguments* args, Thread* thread);
82 83
401 402
402 static address current_stack_pointer(); 403 static address current_stack_pointer();
403 static address current_stack_base(); 404 static address current_stack_base();
404 static size_t current_stack_size(); 405 static size_t current_stack_size();
405 406
407 static void verify_stack_alignment() PRODUCT_RETURN;
408
406 static int message_box(const char* title, const char* message); 409 static int message_box(const char* title, const char* message);
407 static char* do_you_want_to_debug(const char* message); 410 static char* do_you_want_to_debug(const char* message);
408 411
409 // run cmd in a separate process and return its exit code; or -1 on failures 412 // run cmd in a separate process and return its exit code; or -1 on failures
410 static int fork_and_exec(char *cmd); 413 static int fork_and_exec(char *cmd);
731 static void print_statistics(); 734 static void print_statistics();
732 735
733 // Thread priority helpers (implemented in OS-specific part) 736 // Thread priority helpers (implemented in OS-specific part)
734 static OSReturn set_native_priority(Thread* thread, int native_prio); 737 static OSReturn set_native_priority(Thread* thread, int native_prio);
735 static OSReturn get_native_priority(const Thread* const thread, int* priority_ptr); 738 static OSReturn get_native_priority(const Thread* const thread, int* priority_ptr);
736 static int java_to_os_priority[MaxPriority + 1]; 739 static int java_to_os_priority[CriticalPriority + 1];
737 // Hint to the underlying OS that a task switch would not be good. 740 // Hint to the underlying OS that a task switch would not be good.
738 // Void return because it's a hint and can fail. 741 // Void return because it's a hint and can fail.
739 static void hint_no_preempt(); 742 static void hint_no_preempt();
740 743
741 // Used at creation if requested by the diagnostic flag PauseAtStartup. 744 // Used at creation if requested by the diagnostic flag PauseAtStartup.