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

Issue 2411823003: VM support for running Kernel binaries. (Closed)

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

Description

Patch Set 1 #

Total comments: 65

Patch Set 2 : Address initial review comments #

Total comments: 26

Patch Set 3 : Address comments #

Total comments: 32

Patch Set 4 : Address more comments #

Total comments: 3

Patch Set 5 : Address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+15162 lines, -144 lines) Patch
M runtime/bin/dartutils.h View 1 2 3 chunks +19 lines, -5 lines 0 comments Download
M runtime/bin/dartutils.cc View 1 2 3 3 chunks +73 lines, -22 lines 0 comments Download
M runtime/bin/gen_snapshot.cc View 1 2 chunks +23 lines, -4 lines 0 comments Download
M runtime/bin/loader.cc View 1 2 chunks +6 lines, -7 lines 0 comments Download
M runtime/include/dart_api.h View 1 2 3 2 chunks +13 lines, -1 line 0 comments Download
M runtime/vm/compiler.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/compiler.cc View 1 2 6 chunks +67 lines, -8 lines 0 comments Download
M runtime/vm/dart_api_impl.cc View 1 2 3 2 chunks +38 lines, -0 lines 0 comments Download
M runtime/vm/dart_entry.h View 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/dart_entry.cc View 1 chunk +8 lines, -0 lines 0 comments Download
M runtime/vm/flag_list.h View 1 2 3 4 1 chunk +3 lines, -1 line 0 comments Download
M runtime/vm/flow_graph_compiler.cc View 1 2 3 1 chunk +20 lines, -22 lines 0 comments Download
M runtime/vm/flow_graph_inliner.cc View 1 2 3 4 chunks +38 lines, -17 lines 0 comments Download
M runtime/vm/hash_map.h View 1 1 chunk +21 lines, -0 lines 0 comments Download
M runtime/vm/intermediate_language.h View 10 chunks +56 lines, -32 lines 0 comments Download
M runtime/vm/intermediate_language_arm.cc View 1 chunk +33 lines, -6 lines 0 comments Download
M runtime/vm/intermediate_language_x64.cc View 1 chunk +44 lines, -6 lines 0 comments Download
A runtime/vm/kernel.h View 1 2 3 1 chunk +3243 lines, -0 lines 0 comments Download
A runtime/vm/kernel.cc View 1 2 1 chunk +1205 lines, -0 lines 0 comments Download
A runtime/vm/kernel_binary.cc View 1 2 3 4 1 chunk +2902 lines, -0 lines 0 comments Download
A runtime/vm/kernel_reader.h View 1 2 1 chunk +120 lines, -0 lines 0 comments Download
A runtime/vm/kernel_reader.cc View 1 2 3 1 chunk +716 lines, -0 lines 0 comments Download
A runtime/vm/kernel_to_il.h View 1 2 3 1 chunk +830 lines, -0 lines 0 comments Download
A runtime/vm/kernel_to_il.cc View 1 2 3 4 1 chunk +5567 lines, -0 lines 0 comments Download
M runtime/vm/object.h View 1 2 2 chunks +29 lines, -0 lines 0 comments Download
M runtime/vm/object.cc View 1 2 8 chunks +13 lines, -2 lines 0 comments Download
M runtime/vm/parser.h View 1 2 5 chunks +14 lines, -1 line 0 comments Download
M runtime/vm/parser.cc View 1 2 4 chunks +27 lines, -4 lines 0 comments Download
M runtime/vm/raw_object.h View 1 2 2 chunks +2 lines, -0 lines 0 comments Download
M runtime/vm/raw_object_snapshot.cc View 1 2 2 chunks +2 lines, -0 lines 0 comments Download
M runtime/vm/redundancy_elimination.cc View 1 chunk +9 lines, -4 lines 0 comments Download
M runtime/vm/scopes.h View 1 2 3 4 4 chunks +10 lines, -1 line 0 comments Download
M runtime/vm/scopes.cc View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M runtime/vm/vm_sources.gypi View 1 2 1 chunk +7 lines, -0 lines 0 comments Download

Messages

Total messages: 27 (6 generated)
Vyacheslav Egorov (Google)
This is preliminary CL for running Kernel binaries so that people can start evaluating it ...
4 years, 2 months ago (2016-10-11 18:07:09 UTC) #2
Cutch
https://codereview.chromium.org/2411823003/diff/1/runtime/bin/dartutils.cc File runtime/bin/dartutils.cc (right): https://codereview.chromium.org/2411823003/diff/1/runtime/bin/dartutils.cc#newcode497 runtime/bin/dartutils.cc:497: const uint8_t* DartUtils::SniffForMagicNumber(const uint8_t* text_buffer, Alternatively this could take ...
4 years, 2 months ago (2016-10-11 18:40:12 UTC) #4
Florian Schneider
First round of comments https://codereview.chromium.org/2411823003/diff/1/runtime/vm/compiler.cc File runtime/vm/compiler.cc (right): https://codereview.chromium.org/2411823003/diff/1/runtime/vm/compiler.cc#newcode90 runtime/vm/compiler.cc:90: bool UseDilFrontEndFor(ParsedFunction* parsed_function) { I ...
4 years, 2 months ago (2016-10-11 19:50:33 UTC) #6
Kevin Millikin (Google)
https://codereview.chromium.org/2411823003/diff/1/runtime/vm/compiler.cc File runtime/vm/compiler.cc (right): https://codereview.chromium.org/2411823003/diff/1/runtime/vm/compiler.cc#newcode1734 runtime/vm/compiler.cc:1734: // kImplicitStaticFinalGetter is used for both implicit static getters ...
4 years, 2 months ago (2016-10-12 12:11:47 UTC) #8
Florian Schneider
https://codereview.chromium.org/2411823003/diff/1/runtime/vm/dil.h File runtime/vm/dil.h (right): https://codereview.chromium.org/2411823003/diff/1/runtime/vm/dil.h#newcode1 runtime/vm/dil.h:1: // Copyright (c) 2016, the Dart project authors. Please ...
4 years, 2 months ago (2016-10-12 16:17:37 UTC) #9
Vyacheslav Egorov (Google)
I have addressed some of the comments. Please send more. I am looking into two ...
4 years, 2 months ago (2016-10-12 16:45:57 UTC) #10
Florian Schneider
https://codereview.chromium.org/2411823003/diff/1/runtime/vm/intermediate_language_x64.cc File runtime/vm/intermediate_language_x64.cc (right): https://codereview.chromium.org/2411823003/diff/1/runtime/vm/intermediate_language_x64.cc#newcode2604 runtime/vm/intermediate_language_x64.cc:2604: __ movq(CTX, Address(RBP, closure_parameter->index() * kWordSize)); On 2016/10/12 16:45:57, ...
4 years, 2 months ago (2016-10-12 17:30:46 UTC) #11
rmacnak
https://chromiumcodereview.appspot.com/2411823003/diff/20001/runtime/bin/dartutils.h File runtime/bin/dartutils.h (right): https://chromiumcodereview.appspot.com/2411823003/diff/20001/runtime/bin/dartutils.h#newcode41 runtime/bin/dartutils.h:41: bool TryReadKernel(const char* script_uri, General question: Why does the ...
4 years, 2 months ago (2016-10-13 00:56:39 UTC) #13
Kevin Millikin (Google)
https://chromiumcodereview.appspot.com/2411823003/diff/20001/runtime/bin/dartutils.h File runtime/bin/dartutils.h (right): https://chromiumcodereview.appspot.com/2411823003/diff/20001/runtime/bin/dartutils.h#newcode41 runtime/bin/dartutils.h:41: bool TryReadKernel(const char* script_uri, On 2016/10/13 00:56:39, rmacnak wrote: ...
4 years, 2 months ago (2016-10-13 04:29:41 UTC) #14
Kevin Millikin (Google)
https://chromiumcodereview.appspot.com/2411823003/diff/20001/runtime/vm/raw_object.h File runtime/vm/raw_object.h (right): https://chromiumcodereview.appspot.com/2411823003/diff/20001/runtime/vm/raw_object.h#newcode876 runtime/vm/raw_object.h:876: NOT_IN_PRECOMPILED(intptr_t dil_function_); On 2016/10/13 00:56:39, rmacnak wrote: > void* ...
4 years, 2 months ago (2016-10-13 04:38:35 UTC) #15
Cutch
https://codereview.chromium.org/2411823003/diff/1/runtime/vm/dart_api_impl.cc File runtime/vm/dart_api_impl.cc (right): https://codereview.chromium.org/2411823003/diff/1/runtime/vm/dart_api_impl.cc#newcode5412 runtime/vm/dart_api_impl.cc:5412: // TODO(kustermann): Memory leak! On 2016/10/12 16:45:56, Vyacheslav Egorov ...
4 years, 2 months ago (2016-10-13 13:59:12 UTC) #16
Cutch
On 2016/10/13 04:29:41, Kevin Millikin (Google) wrote: > https://chromiumcodereview.appspot.com/2411823003/diff/20001/runtime/bin/dartutils.h > File runtime/bin/dartutils.h (right): > > ...
4 years, 2 months ago (2016-10-13 14:01:47 UTC) #17
Vyacheslav Egorov (Google)
I addressed most of the comments. Please take another look. - I have ensured that ...
4 years, 2 months ago (2016-10-13 14:37:58 UTC) #18
siva
lgtm with some comments. https://codereview.chromium.org/2411823003/diff/40001/runtime/bin/dartutils.cc File runtime/bin/dartutils.cc (right): https://codereview.chromium.org/2411823003/diff/40001/runtime/bin/dartutils.cc#newcode77 runtime/bin/dartutils.cc:77: // Do not free buffer ...
4 years, 2 months ago (2016-10-13 23:02:59 UTC) #19
siva
https://codereview.chromium.org/2411823003/diff/40001/runtime/vm/dart_api_impl.cc File runtime/vm/dart_api_impl.cc (right): https://codereview.chromium.org/2411823003/diff/40001/runtime/vm/dart_api_impl.cc#newcode5419 runtime/vm/dart_api_impl.cc:5419: // TODO(kustermann): Memory leak! On 2016/10/13 23:02:59, siva wrote: ...
4 years, 2 months ago (2016-10-13 23:15:58 UTC) #20
Florian Schneider
https://codereview.chromium.org/2411823003/diff/1/runtime/vm/intermediate_language_x64.cc File runtime/vm/intermediate_language_x64.cc (right): https://codereview.chromium.org/2411823003/diff/1/runtime/vm/intermediate_language_x64.cc#newcode2604 runtime/vm/intermediate_language_x64.cc:2604: __ movq(CTX, Address(RBP, closure_parameter->index() * kWordSize)); On 2016/10/13 14:37:57, ...
4 years, 2 months ago (2016-10-13 23:47:10 UTC) #21
Kevin Millikin (Google)
https://codereview.chromium.org/2411823003/diff/40001/runtime/vm/dart_api_impl.cc File runtime/vm/dart_api_impl.cc (right): https://codereview.chromium.org/2411823003/diff/40001/runtime/vm/dart_api_impl.cc#newcode5426 runtime/vm/dart_api_impl.cc:5426: library.set_debuggable(false); On 2016/10/13 23:02:59, siva wrote: > I presume ...
4 years, 2 months ago (2016-10-14 05:18:34 UTC) #22
Vyacheslav Egorov (Google)
Thank you for your comments! Given that I have an LGTM I am planning to ...
4 years, 2 months ago (2016-10-14 11:55:27 UTC) #23
Florian Schneider
Few more comments to clean things up. Otherwise lgtm. https://codereview.chromium.org/2411823003/diff/1/runtime/vm/dil.h File runtime/vm/dil.h (right): https://codereview.chromium.org/2411823003/diff/1/runtime/vm/dil.h#newcode1 runtime/vm/dil.h:1: ...
4 years, 2 months ago (2016-10-14 21:26:48 UTC) #24
Vyacheslav Egorov (Google)
Committed patchset #5 (id:80001) manually as f67ce210689987a20fae57345a68cc40511cba4f (presubmit successful).
4 years, 2 months ago (2016-10-15 20:48:53 UTC) #26
Vyacheslav Egorov (Google)
4 years, 2 months ago (2016-10-15 20:50:47 UTC) #27
Message was sent while issue was closed.
Thanks! Landing it now.

https://codereview.chromium.org/2411823003/diff/1/runtime/vm/dil.h
File runtime/vm/dil.h (right):

https://codereview.chromium.org/2411823003/diff/1/runtime/vm/dil.h#newcode1
runtime/vm/dil.h:1: // Copyright (c) 2016, the Dart project authors.  Please see
the AUTHORS file
On 2016/10/14 21:26:47, Florian Schneider wrote:
> On 2016/10/12 16:45:56, Vyacheslav Egorov (Google) wrote:
> > On 2016/10/12 16:17:36, Florian Schneider wrote:
> > > Please make sure that nothing from dil*.h/.cc ends up linked into
> > > dart_precompiled_runtime to keep snapshot size from growing.
> > 
> > I will check that.
> 
> I noticed an 16K size increase for the stripped dart_precompiled_runtime
binary.
> I wonder if something from the front-end is still pulled into the runtime
> accidentally.

binary size analysis does not show anything from Kernel sources, similary
"explain" tool does not show anything:

https://gist.github.com/mraleph/0ed37eefa67c834e381dd50cce4437d6

I will make an issue to follow up on this after landing.

https://codereview.chromium.org/2411823003/diff/40001/runtime/vm/kernel_to_il.cc
File runtime/vm/kernel_to_il.cc (right):

https://codereview.chromium.org/2411823003/diff/40001/runtime/vm/kernel_to_il...
runtime/vm/kernel_to_il.cc:2967: #if 0
On 2016/10/14 21:26:47, Florian Schneider wrote:
> Is the code below needed?

Removed.

https://codereview.chromium.org/2411823003/diff/40001/runtime/vm/scopes.h
File runtime/vm/scopes.h (right):

https://codereview.chromium.org/2411823003/diff/40001/runtime/vm/scopes.h#new...
runtime/vm/scopes.h:59: bool is_forced_stack() const { return is_forced_stack_;
}
On 2016/10/14 21:26:47, Florian Schneider wrote:
> On 2016/10/14 11:55:27, Vyacheslav Egorov (Google) wrote:
> > On 2016/10/13 23:47:10, Florian Schneider wrote:
> > > What does is_forced_stack() mean?
> > 
> > Added a comment. 
> > 
> > It is used to prevent capturing local variable indiscriminately in
> > CaptureLocalVariables - which captures all local variables in the scope
chain
> > between current scope and target scope.
> > 
> > CaptureLocalVariables(...) actually contains a black list:
> > 
> > (variable->name().raw() == Symbols::StackTraceVar().raw()) ||
> >           (variable->name().raw() == Symbols::ExceptionVar().raw()) ||
> >           (variable->name().raw() == Symbols::SavedTryContextVar().raw())
> > 
> > We thought that manually adding variables to the black list is tedious - so
> > instead we introduced a bit on the variable itself.
> > 
> > I just noticed that I accidentally omitted the code from
CaptureLocalVariables
> > that uses this field. Thanks not spotting. 
> 
> That's why I asked: I noticed that it was unused. Having both, a black-list
and
> this flag is not good. Please add a TODO to clean this up.

Added TODO

https://codereview.chromium.org/2411823003/diff/60001/runtime/vm/kernel_binar...
File runtime/vm/kernel_binary.cc (right):

https://codereview.chromium.org/2411823003/diff/60001/runtime/vm/kernel_binar...
runtime/vm/kernel_binary.cc:11: #if 0
On 2016/10/14 21:26:48, Florian Schneider wrote:
> For stuf like this we do
> 
> #ifdef DEBUG, and add a debug-mode only --trace... flag (see flag_list.h)
> 
> Or remove code if not needed anymore.

Done.

https://codereview.chromium.org/2411823003/diff/60001/runtime/vm/kernel_binar...
runtime/vm/kernel_binary.cc:11: #if 0
On 2016/10/14 21:26:48, Florian Schneider wrote:
> For stuf like this we do
> 
> #ifdef DEBUG, and add a debug-mode only --trace... flag (see flag_list.h)
> 
> Or remove code if not needed anymore.

Done.

Powered by Google App Engine
This is Rietveld 408576698