Commit Graph

5 Commits

Author SHA1 Message Date
Zachary Anderson 103881d01c Make header include guards great again
i.e. #ifndef VM_WHATEVER -> #ifndef RUNTIME_VM_WHATEVER

This lets us remove a hack from the PRESUBMIT.py script that existed
for reasons that are no longer valid, and sets us up to add some
presubmit checks for the GN build.

R=asiva@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org/2450713004 .
2016-10-26 00:26:03 -07:00
Vyacheslav Egorov 65f2e015ca VM: Fix race between background compiler and guarded cid update.
Rework how we check guarded state consistency in background compiler.

Background compiler was storing original fields inside guarded fields list. This caused a race during inlining when inliner would copy guarded fields one by one from the callee function into the caller, because ParsedFunction::AddToGuardedFields looks at the guarded_cid to filter out those fields that should not be guarded.

As a result if some guarded field transitioned to unguarded (kDynamicCid) after callee graph construction but before list of guarded fields were copied then AddToGuardedFields would simply skip that field because it now has guarded_cid() == kDynamicCid.

We fix this race by always placing copies into the list of guarded fields and unwrapping them only in FinalizeCode.

Placing the copies also allows us to simplify a lot of code that was trying to verify guarded state consistency before committing the generated optimized code - now that we store copies in the list we can just compare their state to the originals and abort if the state is different.

Additionally fix deduplication check that was comparing original fields with copies - resulting in adding the same field into the list multiple times.

Add an assertion that verifies that we are not trying to access guarded_cid of original field from background compiler.

R=fschneider@google.com
BUG=

Review URL: https://codereview.chromium.org/2006793002 .
2016-05-24 14:52:02 +02:00
Srdjan Mitrovic 1595117898 Investigate & fix issues around usage_count and deoptimization_count
BUG=
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1559653002 .
2016-01-05 09:40:23 -08:00
Srdjan Mitrovic fe4a5d7672 This adds a mechanism to invalidate code that was generated in the background. The invalidation can happen if a relevant event was invoked between background compilation start and installation of code (e.g, field type invalidatet, subclasses added, deferred loading).
We introduce 3 invalidation generation counters: CHA, field and library prefixes. If one of the counters was incremented during compilation, and is relevant for that compilation, the code installation is skipped since that code may have become invalid in the meantime.

Add BackgroundCompilationResult that remembers the 3 invalidation generations.

The generational counter can rollover, which is OK.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1418813008 .
2015-10-30 12:18:52 -07:00
koda@google.com a56293ab7d Break out WeakCodeReferences to own file in preparation to use it outside object.cc.
R=srdjan@google.com

Review URL: https://codereview.chromium.org//603743002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40656 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-24 22:43:05 +00:00