- Loading...
Excerpt |
---|
How will my new code best fit in with the Hotspot code base? Here are some guidelines. |
...
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
assert(...)
, guarantee(...)
, ShouldNotReachHere()
, Unimplemented()
and comments wherever needed. (Performance is almost never a reason to omit asserts.)Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
bool
for booleans (not int), use true
& false
(not 1 & 0); use NULL
for pointers (not 0).Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
LP64
). They must be used to manage header files, in the pattern found at the top of every source file. They should be used mainly for major build features, including PRODUCT
, ASSERT
, _LP64
, SERIALGC
, COMPILER1
, etc....
FooBar
).foo_bar
). (For these, avoid mixing in upper case letters.)static const
". (Historically, enums have been also been used.)get_
" noise word. Boolean getters can also begin with "is_
" or "has_
".set_
" to the getter name._oop
") except in cases required above. (Names with leading underscores can cause portability problems.)...
ResourceMark
for an example.+Verbose
is used to provide additional output for another flag, but does not enable output by itself.&&
, ||
, if
, while
. Instead, compare explicitly != 0
or != NULL
, etc. (See #8 above.)globalDefinitions.hpp
when performing bitwise operations on integers. Do not code directly as C operators, unless they are extremely simple. (Examples: round_to
, is_power_of_2
, exact_log2
.)Anchor | ||||
---|---|---|---|---|
|
...