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

Issue 10407019: Extend assembler with ability to produce comments for the generated code. (Closed)

Created:
8 years, 7 months ago by Vyacheslav Egorov (Google)
Modified:
8 years, 7 months ago
Reviewers:
srdjan, Ivan Posva
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Extend assembler with ability to produce comments for the generated code. Extend x64 disassembler with ability to decode and output recorded comments. Example output (currently comments are emitted only by flow graph compiler at block/instruction boundaries, once instruction printing is refactored and supports printing into buffer simple "instruction" comment will be replaced with the actual IL construct): ;; B0 ;; B1 ;; instruction 0x007f0fff812525 00000055 49 bb 21 00 b4 04 10 mov $0x7f1004b40021,%r11 0x007f0fff81252c 0000005c 7f 00 00 0x007f0fff81252f 0000005f 41 53 push %r11 R=srdjan@google.com Committed: https://code.google.com/p/dart/source/detail?r=7723

Patch Set 1 #

Total comments: 44

Patch Set 2 : address Srdjan comments #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+260 lines, -8 lines) Patch
M runtime/vm/assembler_ia32.h View 1 2 chunks +21 lines, -1 line 0 comments Download
M runtime/vm/assembler_ia32.cc View 1 2 chunks +23 lines, -0 lines 0 comments Download
M runtime/vm/assembler_x64.h View 1 3 chunks +21 lines, -1 line 0 comments Download
M runtime/vm/assembler_x64.cc View 1 2 chunks +30 lines, -0 lines 0 comments Download
M runtime/vm/code_generator_ia32.h View 1 chunk +2 lines, -0 lines 0 comments Download
M runtime/vm/code_generator_ia32.cc View 1 1 chunk +5 lines, -0 lines 0 comments Download
M runtime/vm/code_generator_x64.h View 1 chunk +2 lines, -0 lines 0 comments Download
M runtime/vm/compiler.cc View 4 chunks +6 lines, -1 line 0 comments Download
M runtime/vm/disassembler.h View 1 2 chunks +17 lines, -1 line 0 comments Download
M runtime/vm/disassembler_ia32.cc View 1 1 chunk +3 lines, -1 line 1 comment Download
M runtime/vm/disassembler_x64.cc View 1 2 chunks +19 lines, -2 lines 0 comments Download
M runtime/vm/flow_graph_compiler_arm.h View 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/flow_graph_compiler_arm.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M runtime/vm/flow_graph_compiler_ia32.h View 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/flow_graph_compiler_ia32.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M runtime/vm/flow_graph_compiler_x64.h View 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/flow_graph_compiler_x64.cc View 1 2 chunks +7 lines, -0 lines 0 comments Download
M runtime/vm/object.h View 1 1 chunk +33 lines, -0 lines 0 comments Download
M runtime/vm/object.cc View 1 1 chunk +56 lines, -0 lines 1 comment Download
M runtime/vm/raw_object.h View 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 6 (0 generated)
Vyacheslav Egorov (Google)
8 years, 7 months ago (2012-05-17 01:11:20 UTC) #1
Vyacheslav Egorov (Google)
+iposva
8 years, 7 months ago (2012-05-17 15:58:13 UTC) #2
srdjan
First set of comments http://codereview.chromium.org/10407019/diff/1/runtime/vm/assembler_ia32.cc File runtime/vm/assembler_ia32.cc (right): http://codereview.chromium.org/10407019/diff/1/runtime/vm/assembler_ia32.cc#newcode17 runtime/vm/assembler_ia32.cc:17: DEFINE_FLAG(bool, code_comments, false, "Include comments ...
8 years, 7 months ago (2012-05-17 17:22:08 UTC) #3
Vyacheslav Egorov (Google)
comments addressed please take another look http://codereview.chromium.org/10407019/diff/1/runtime/vm/assembler_ia32.cc File runtime/vm/assembler_ia32.cc (right): http://codereview.chromium.org/10407019/diff/1/runtime/vm/assembler_ia32.cc#newcode17 runtime/vm/assembler_ia32.cc:17: DEFINE_FLAG(bool, code_comments, false, ...
8 years, 7 months ago (2012-05-17 21:16:27 UTC) #4
srdjan
LGTM https://chromiumcodereview.appspot.com/10407019/diff/5002/runtime/vm/disassembler_ia32.cc File runtime/vm/disassembler_ia32.cc (right): https://chromiumcodereview.appspot.com/10407019/diff/5002/runtime/vm/disassembler_ia32.cc#newcode1582 runtime/vm/disassembler_ia32.cc:1582: // TODO(vegorov) Decode and display comments. Typically: "TODO(vegorov):" ...
8 years, 7 months ago (2012-05-17 21:30:37 UTC) #5
Ivan Posva
8 years, 7 months ago (2012-05-22 22:40:02 UTC) #6
https://chromiumcodereview.appspot.com/10407019/diff/1/runtime/vm/object.h
File runtime/vm/object.h (right):

https://chromiumcodereview.appspot.com/10407019/diff/1/runtime/vm/object.h#ne...
runtime/vm/object.h:2211: CodeComments comments() const;
On 2012/05/17 21:16:27, Vyacheslav Egorov (Google) wrote:
> On 2012/05/17 17:22:08, srdjan wrote:
> > const CodeComments&
> 
> Done. However both Code::Comments::New and Code::comments started to look
mighty
> ugly in my opinion.
> 

Maybe the real solution should be that the code comment handling does not have
anything to do with objects (except that the data is stored in an ObjectArray).
In reality code comments are something that is used to communicate between the
assembler and disassembler. How about moving it there?

Powered by Google App Engine
This is Rietveld 408576698