Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Issue 1820653002: VM library tweaks to avoid megamorphic calls in dart2js (Closed)

Created:
4 years, 9 months ago by sra1
Modified:
4 years, 9 months ago
Reviewers:
srdjan, kevmoo
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Base URL:
https://github.com/dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

VM library tweaks to avoid megamorphic calls in dart2js Problems this addresses: 1. dart2js has hashCode functions like get hashCode = this.x.hashCode + 17 * this.y.hashCode When x and y are ints or bools VM optimizing compiler inlined the call to Object.hashCode and generated MegamorphicLookups for Object._identityHashCode. 2. HashMaps with _Smi keys had a double MegamorphicLookup: The hash table reasonably calls MegamorphicLookup(get:hashCode) which returns Object.hashCode; the compiled Object.hashCode is essentially MegamorphicLookup(get:_identityHashCode), which returns _Smi._identityHashCode which finally returns 'this'. 3. _interpolateSingle's call to o.toString() is megamorphic. We can avoid it for the common case of String arguments, this is often comming from StringBuffer.write() with a literal or interpolated argument. R=srdjan@google.com Committed: https://github.com/dart-lang/sdk/commit/dce10bba79f388932e5fb912db4c78701343c57b

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -6 lines) Patch
M runtime/lib/bool_patch.dart View 1 chunk +1 line, -0 lines 0 comments Download
M runtime/lib/integers.dart View 2 chunks +4 lines, -6 lines 0 comments Download
M runtime/lib/string_patch.dart View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 7 (3 generated)
sra1
4 years, 9 months ago (2016-03-19 23:43:03 UTC) #2
kevmoo
DBC: out of curiosity tried this with pop-pop-win. 4% speed improvement. Cool!
4 years, 9 months ago (2016-03-21 14:32:19 UTC) #4
srdjan
lgtm
4 years, 9 months ago (2016-03-21 14:54:38 UTC) #5
sra1
4 years, 9 months ago (2016-03-21 16:38:28 UTC) #7
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
dce10bba79f388932e5fb912db4c78701343c57b (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698