Skip to content

Inline deep #3316

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .jvmopts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-Xss1m
-Xms512m
-Xmx1200m
-XX:MaxInlineLevel=35
7 changes: 5 additions & 2 deletions compiler/src/dotty/tools/dotc/core/tasty/TastyBuffer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ import util.Util.dble
object TastyBuffer {

/** The number of digits of the natural number `nat`, written in base 128 format. */
def natSize(nat: Int): Int =
if (nat < 128) 1 else natSize(nat >>> 7) + 1
def natSize(nat: Int): Int = {
def loop(n: Int, acc: Int): Int =
if (n < 128) acc else loop(n >>> 7, acc + 1)
loop(nat, 1)
}

/** An address pointing to an index in a Tasty buffer's byte array */
case class Addr(index: Int) extends AnyVal {
Expand Down