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

Issue 2525623002: VM: [Kernel] Split kernel API into 3 steps: ([read binary], parse-binary, bootstrap, load program) (Closed)

Created:
4 years, 1 month ago by kustermann
Modified:
4 years, 1 month ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

VM: [Kernel] Split kernel API into 3 steps: ([read binary], parse-binary, bootstrap, load program) This avoids reading and parsing the kernel binary multiple times and avois having it multiple times in memory (we don't free the 'kernel::Program*' object ATM). R=kmillikin@google.com Committed: https://github.com/dart-lang/sdk/commit/1aff626804d424d97d76161e100955ad11a7605f

Patch Set 1 #

Total comments: 11

Patch Set 2 : addressed comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+130 lines, -143 lines) Patch
M runtime/bin/gen_snapshot.cc View 1 2 chunks +10 lines, -4 lines 0 comments Download
M runtime/bin/loader.cc View 1 chunk +0 lines, -2 lines 0 comments Download
M runtime/bin/main.cc View 1 2 chunks +9 lines, -13 lines 0 comments Download
M runtime/include/dart_api.h View 1 3 chunks +22 lines, -8 lines 0 comments Download
M runtime/vm/bootstrap.h View 1 chunk +9 lines, -7 lines 0 comments Download
M runtime/vm/bootstrap.cc View 3 chunks +6 lines, -18 lines 0 comments Download
M runtime/vm/bootstrap_nocore.cc View 3 chunks +5 lines, -17 lines 0 comments Download
M runtime/vm/dart.h View 2 chunks +4 lines, -1 line 0 comments Download
M runtime/vm/dart.cc View 1 4 chunks +5 lines, -11 lines 0 comments Download
M runtime/vm/dart_api_impl.cc View 1 5 chunks +33 lines, -18 lines 0 comments Download
M runtime/vm/kernel_reader.h View 2 chunks +3 lines, -19 lines 0 comments Download
M runtime/vm/kernel_reader.cc View 1 chunk +15 lines, -16 lines 0 comments Download
M runtime/vm/object.h View 2 chunks +5 lines, -3 lines 0 comments Download
M runtime/vm/object.cc View 1 2 chunks +4 lines, -6 lines 0 comments Download

Messages

Total messages: 7 (2 generated)
kustermann
4 years, 1 month ago (2016-11-22 13:10:35 UTC) #2
kustermann
https://codereview.chromium.org/2525623002/diff/1/runtime/bin/loader.cc File runtime/bin/loader.cc (left): https://codereview.chromium.org/2525623002/diff/1/runtime/bin/loader.cc#oldcode374 runtime/bin/loader.cc:374: dart_result = Dart_LoadKernel(payload, payload_length); We cannot hit this code ...
4 years, 1 month ago (2016-11-22 13:11:45 UTC) #3
Kevin Millikin (Google)
LGTM, nice cleanup. https://codereview.chromium.org/2525623002/diff/1/runtime/include/dart_api.h File runtime/include/dart_api.h (right): https://codereview.chromium.org/2525623002/diff/1/runtime/include/dart_api.h#newcode2845 runtime/include/dart_api.h:2845: * \param kernel_program The `dart::kernel::Program` object ...
4 years, 1 month ago (2016-11-22 15:51:18 UTC) #4
kustermann
Committed patchset #2 (id:20001) manually as 1aff626804d424d97d76161e100955ad11a7605f (presubmit successful).
4 years, 1 month ago (2016-11-23 08:26:23 UTC) #6
kustermann
4 years, 1 month ago (2016-11-23 08:31:46 UTC) #7
Message was sent while issue was closed.
Thanks.

https://codereview.chromium.org/2525623002/diff/1/runtime/include/dart_api.h
File runtime/include/dart_api.h (right):

https://codereview.chromium.org/2525623002/diff/1/runtime/include/dart_api.h#...
runtime/include/dart_api.h:2845: * \param kernel_program The
`dart::kernel::Program` object returned by .
On 2016/11/22 15:51:17, Kevin Millikin (Google) wrote:
> Missing the name of the function that returns the program.

Done.

https://codereview.chromium.org/2525623002/diff/1/runtime/include/dart_api.h#...
runtime/include/dart_api.h:2856: * Lonstructs a kernel program form a binary.
On 2016/11/22 15:51:17, Kevin Millikin (Google) wrote:
> Lonstructs == Load + constructs?

Precisely!

Done

https://codereview.chromium.org/2525623002/diff/1/runtime/include/dart_api.h#...
runtime/include/dart_api.h:2863: DART_EXPORT void* Dart_ParseKernelBinary(const
uint8_t* buffer,
On 2016/11/22 15:51:17, Kevin Millikin (Google) wrote:
> I don't think of this as parsing.  Deserializing, but maybe that's too long. 
> "ReadKernelBinary"?  "LoadKernelBinary"?

Then I'll go with ReadKernelBinary ("load" is already used for loading libraries
from the kernel program into the isolate)

https://codereview.chromium.org/2525623002/diff/1/runtime/vm/dart.cc
File runtime/vm/dart.cc (right):

https://codereview.chromium.org/2525623002/diff/1/runtime/vm/dart.cc#newcode515
runtime/vm/dart.cc:515: if (kernel_program != NULL) {
On 2016/11/22 15:51:17, Kevin Millikin (Google) wrote:
> Here you can just unconditionally call Object::Init(I, kernel_program).

Done.

https://codereview.chromium.org/2525623002/diff/1/runtime/vm/dart_api_impl.cc
File runtime/vm/dart_api_impl.cc (right):

https://codereview.chromium.org/2525623002/diff/1/runtime/vm/dart_api_impl.cc...
runtime/vm/dart_api_impl.cc:5387: // free it because (similar to the token
stream) it will be used to run our
On 2016/11/22 15:51:17, Kevin Millikin (Google) wrote:
> "used to repeatedly run the `kernel::FlowGraphBuilder`."

Done.

Powered by Google App Engine
This is Rietveld 408576698