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

Issue 312153004: Fix Windows build by removing an overly strict assertion. (Closed)

Created:
6 years, 6 months ago by Florian Schneider
Modified:
6 years, 6 months ago
Reviewers:
Ivan Posva
CC:
reviews_dartlang.org, vm-dev_dartlang.org, srdjan
Visibility:
Public.

Description

Fix Windows build by removing an overly strict assertion. The Windows compiler may align members so that the assertion about the size of RawCode and the offset data_ does not match anymore. TBR=iposva@google.com Committed: https://code.google.com/p/dart/source/detail?r=36993

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+0 lines, -1 line) Patch
M runtime/vm/object.h View 1 chunk +0 lines, -1 line 2 comments Download

Messages

Total messages: 4 (0 generated)
Florian Schneider
6 years, 6 months ago (2014-06-04 13:19:37 UTC) #1
Florian Schneider
Committed patchset #1 manually as r36993 (presubmit successful).
6 years, 6 months ago (2014-06-04 13:20:06 UTC) #2
Ivan Posva
https://codereview.chromium.org/312153004/diff/1/runtime/vm/object.h File runtime/vm/object.h (left): https://codereview.chromium.org/312153004/diff/1/runtime/vm/object.h#oldcode3631 runtime/vm/object.h:3631: ASSERT(sizeof(RawCode) == OFFSET_OF(RawCode, data_)); There are too many things ...
6 years, 6 months ago (2014-06-04 15:53:14 UTC) #3
Florian Schneider
6 years, 6 months ago (2014-06-06 09:13:03 UTC) #4
Message was sent while issue was closed.
https://codereview.chromium.org/312153004/diff/1/runtime/vm/object.h
File runtime/vm/object.h (left):

https://codereview.chromium.org/312153004/diff/1/runtime/vm/object.h#oldcode3631
runtime/vm/object.h:3631: ASSERT(sizeof(RawCode) == OFFSET_OF(RawCode, data_));
On 2014/06/04 15:53:14, Ivan Posva wrote:
> There are too many things riding on the assertion that sizeof(RawCode) gives
us
> the correct information. We will have to solve this differently.

Yes, this is fragile: InstanceSize(intptr_t len) needs to be correct. This means
that RoundedAllocationSize must match what the C++ compiler produces. There are
differences betwwen MSVC and g++: sizeof(RawCode) is 72 on my Linux machine, and
80 on Win32.

OFFSET_OF(data_) is 72 on Linux, and 76 on Win32.

In this instance the RoundedAllocationSize would be still 80 since we round up
to multiples of 8 (kObjectAlignment), but there is no guarantee that these
things match.

Powered by Google App Engine
This is Rietveld 408576698