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

Issue 13472019: - Create an all static TypedDataView class which uses implicit field offset (Closed)

Created:
7 years, 8 months ago by siva
Modified:
7 years, 8 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

- Create an all static TypedDataView class which uses implicit field offset values to get direct access to the fields of a typed data view object. - Added a verification step after class finalization to ensure that the implicit field offsets in TypedDataView match the actual values in the dart instance. Committed: https://code.google.com/p/dart/source/detail?r=20948

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Total comments: 2

Patch Set 5 : #

Total comments: 1

Patch Set 6 : #

Patch Set 7 : #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+156 lines, -15 lines) Patch
M runtime/vm/class_finalizer.h View 1 2 3 4 5 1 chunk +4 lines, -0 lines 0 comments Download
M runtime/vm/class_finalizer.cc View 1 2 3 4 5 2 chunks +55 lines, -0 lines 2 comments Download
M runtime/vm/dart_api_impl.cc View 1 2 3 4 5 1 chunk +17 lines, -15 lines 0 comments Download
M runtime/vm/object.h View 1 2 3 4 5 5 chunks +79 lines, -0 lines 0 comments Download
M runtime/vm/raw_object.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
siva
Florian, I have added this all static TypedDataView class in the VM to get direct ...
7 years, 8 months ago (2013-04-02 23:51:03 UTC) #1
siva
synched up to tot.
7 years, 8 months ago (2013-04-04 01:05:49 UTC) #2
Florian Schneider
LGTM. How is _ByteDataView different from _Uint8ArrayView? Could they maybe be merged? https://codereview.chromium.org/13472019/diff/12001/runtime/vm/class_finalizer.cc File runtime/vm/class_finalizer.cc ...
7 years, 8 months ago (2013-04-04 09:33:14 UTC) #3
siva
If we merged _ByteArrayView and _Uint8ArrayView then all the getInt16, getUint16, getInt32.... and setInt16, setUint16, ...
7 years, 8 months ago (2013-04-05 02:01:56 UTC) #4
Ivan Posva
Please address this comment before committing. -Ivan https://codereview.chromium.org/13472019/diff/18001/runtime/vm/class_finalizer.cc File runtime/vm/class_finalizer.cc (right): https://codereview.chromium.org/13472019/diff/18001/runtime/vm/class_finalizer.cc#newcode1994 runtime/vm/class_finalizer.cc:1994: ASSERT(field.Offset() == ...
7 years, 8 months ago (2013-04-05 04:23:55 UTC) #5
siva
Added verification of field names.
7 years, 8 months ago (2013-04-05 05:07:52 UTC) #6
Ivan Posva
LGTM -ip
7 years, 8 months ago (2013-04-05 05:15:58 UTC) #7
siva
Committed patchset #7 manually as r20948 (presubmit successful).
7 years, 8 months ago (2013-04-05 05:19:43 UTC) #8
regis
https://codereview.chromium.org/13472019/diff/26006/runtime/vm/class_finalizer.cc File runtime/vm/class_finalizer.cc (right): https://codereview.chromium.org/13472019/diff/26006/runtime/vm/class_finalizer.cc#newcode170 runtime/vm/class_finalizer.cc:170: VerifyImplicitFieldOffsets(); I am getting a crash here in the ...
7 years, 8 months ago (2013-04-09 20:27:39 UTC) #9
siva
https://codereview.chromium.org/13472019/diff/26006/runtime/vm/class_finalizer.cc File runtime/vm/class_finalizer.cc (right): https://codereview.chromium.org/13472019/diff/26006/runtime/vm/class_finalizer.cc#newcode170 runtime/vm/class_finalizer.cc:170: VerifyImplicitFieldOffsets(); I guess in your case a type error ...
7 years, 8 months ago (2013-04-09 21:30:29 UTC) #10
regis
7 years, 8 months ago (2013-04-09 22:41:50 UTC) #11
Message was sent while issue was closed.
On 2013/04/09 21:30:29, siva wrote:
>
https://codereview.chromium.org/13472019/diff/26006/runtime/vm/class_finalize...
> File runtime/vm/class_finalizer.cc (right):
> 
>
https://codereview.chromium.org/13472019/diff/26006/runtime/vm/class_finalize...
> runtime/vm/class_finalizer.cc:170: VerifyImplicitFieldOffsets();
> I guess in your case a type error occurred before the classes in
dart:typeddata
> got finalized, as a result of the error the field offsets are not set for the
> typeddata classes and this assertion fails.
> 
Correct.

> We could move the code to the successful case as you indicate, what about the
> other pieces like RemoveOptimizedCode etc. should that be run only of there
are
> no errors?
> 
The only code being executed after finalization is RemoveOptimizedCode, the one
you mention. Since it only refers to classes that were loaded and finalized
before the last run of finalization, I think this is OK to run.

> Another option might be to do the verification only if the dart:typedata
classes
> are marked as being 'finalized'. 
> 
Either way is fine with me. 

> On 2013/04/09 20:27:39, regis wrote:
> > I am getting a crash here in the case class finalization reported an error.
> > Moving this call just after line 162 solves the problem, but is that
correct?
> > Is the system in an inconsistent state after an error is reported?
> > You can reproduce by generating the snapshot with the flag
> > --error_on_malformed_type at r21166, because there is an error in the core
> lib.

Powered by Google App Engine
This is Rietveld 408576698