- Loading...
...
PRODUCT, use #ifdef PRODUCT for multiple-line inclusions or exclusions.PRODUCT_ONLY and NOT_PRODUCT. But avoid using them with multiple-line arguments, since debuggers do not handle that well.CATCH, THROW, etc. for HotSpot-specific exception processing....
FooBar is going to be used in more than one place, put it a file named fooBar.hpp and fooBar.cpp. If the class is a sidekick to a more important class BazBat, it can go in bazBat.hpp.FooBar::bang into the same file that defined FooBar, or its associated *.cpp file....
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 | ||||
|---|---|---|---|---|
|
Occasionally a guideline mentioned here may be just out of synch with the actual Hotspot code base. That's why we're using a wiki to document the guidelines. If you find that a guideline is consistently contradicted by a large number of counterexamples, please mention it here, to assist the rest of us coders with making an informed decision about coding style. The architectural rule, of course, is "When in Rome do as the Romans". Sometimes in the suburbs of Rome the rules are a little different; these differences can be pointed out here.
...