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

Issue 2897803002: VM: Constant fold more loads from constants in the optimizer. (Closed)

Created:
3 years, 7 months ago by Vyacheslav Egorov (Google)
Modified:
3 years, 7 months ago
Reviewers:
erikcorry
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

VM: Constant fold more loads from constants in the optimizer. We have limited support for folding away length loads from constant arrays and strings. However we were not folding away loads in code like: enum E { V } isV(flags) => (flags & (1 << E.V.index)) != 0; Here we would emit load index and shift for mask computation instead of simply emitting 1. This change fixes the oversight by enabling folding away loads of final fields from constants. This relands the original commit 746ab58f4623372e1efcfd04644927f16dd0fab7 with a fix for precompiler crashes: ArgumentError.value constructor is added to the precompiler roots. TBR=erikcorry@google.com Committed: https://github.com/dart-lang/sdk/commit/20a0e75ef8f91a282ea453f9ad471e509d5f4ad4

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+83 lines, -40 lines) Patch
M runtime/vm/constant_propagator.cc View 1 chunk +17 lines, -14 lines 0 comments Download
M runtime/vm/intermediate_language.h View 1 chunk +7 lines, -0 lines 0 comments Download
M runtime/vm/intermediate_language.cc View 1 chunk +58 lines, -26 lines 0 comments Download
M runtime/vm/precompiler.cc View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 4 (1 generated)
Vyacheslav Egorov (Google)
Committed patchset #1 (id:1) manually as 20a0e75ef8f91a282ea453f9ad471e509d5f4ad4 (presubmit successful).
3 years, 7 months ago (2017-05-21 17:45:42 UTC) #2
erikcorry
So if ArgumentError was already a root, why was it necessary to add ArgumentError.value?
3 years, 7 months ago (2017-05-22 07:33:42 UTC) #3
Vyacheslav Egorov (Google)
3 years, 7 months ago (2017-05-22 07:54:15 UTC) #4
Message was sent while issue was closed.
Those roots are individual functions, e.g. Argument. and Argument.value are two
different functions.

Powered by Google App Engine
This is Rietveld 408576698