• Home
    • View
    • Login
    This page
    • Normal
    • Export PDF
    • Page Information

    Loading...
  1. Dashboard
  2. Undefined Space
  3. HotSpot
  4. StyleGuide

Page History

Versions Compared

Old Version 9

changes.mady.by.user Brian Beck

Saved on Feb 20, 2013

compared with

New Version 10

changes.mady.by.user Iris Clark

Saved on Apr 15, 2013

  • Previous Change: Difference between versions 8 and 9
  • Next Change: Difference between versions 10 and 11
  • View Page History

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Indentation levels are two columns.
  • There is no hard line length limit.
  • Tabs are not allowed in code. Set your editor accordingly. (Emacs: (setq-default indent-tabs-mode nil).)
  • Use braces around substatements. (Relaxable for extremely simple substatements on the same line.)
  • Use good taste to break lines and align corresponding tokens on adjacent lines.
  • Use spaces around operators, especially comparisons and assignments. (Relaxable for boolean expressions and high-precedence operators in classic math-style formulas.)
  • Put spaces on both sides of control flow keywords if, else, for, switch, etc. * Use extra parentheses in expressions whenever operator precedence seems doubtful. Always use parentheses in shift/mask expressions (<<, &, |, { ~}).
  • Use more spaces and blank lines between larger constructs, such as classes or function definitions.
  • If the surrounding code has any sort of vertical organization, adjust new lines horizontally to be consistent with that organization. (E.g., trailing backslashes on long macro definitions often align.)
  • Otherwise, use normal conventions for whitespace in C.
  • Try not to change whitespace unless it improves readability or consistency. (Different editors indent differently, and spurious indentation changes will just make integrations more difficult.)

...

  • Conform new code to style conventions. Avoid unnecessary "esthetic" variations, which are distracting.
  • Use the C++ RAII design pattern to manage bracketed critical sections. See class ResourceMark for an example.
  • +Verbose is used to provide additional output for another flag, but does not enable output by itself.
  • Do not use ints or pointers as booleans with &&, ||, if, while. Instead, compare explicitly != 0 or != NULL, etc. (See #8 above.)
  • Use functions from 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.)
  • Naming JTreg tests
  • More suggestions on factoring.

...

Overview
Content Tools
ThemeBuilder

Terms of Use
• License: GPLv2
• Privacy • Trademarks • Contact Us

Powered by a free Atlassian Confluence Open Source Project License granted to https://www.atlassian.com/software/views/opensource-community-additional-license-offer. Evaluate Confluence today.

  • Kolekti ThemeBuilder Powered by Atlassian Confluence 8.5.23
  • Kolekti ThemeBuilder printed.by.atlassian.confluence
  • Report a bug
  • Atlassian News
Atlassian
Kolekti ThemeBuilder EngineAtlassian Confluence
{"serverDuration": 398, "requestCorrelationId": "f6c0d189effb2cd0"}