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

Issue 1241863002: VM: Refactor allocation stats code and remove duplicate code. (Closed)

Created:
5 years, 5 months ago by Florian Schneider
Modified:
5 years, 5 months ago
Reviewers:
koda, Cutch
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Base URL:
git@github.com:dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

VM: Refactor allocation stats code and remove duplicate code. Make context allocation stub shared between isolates. The fast-path used in optimized code still has isolate-specific addresses inlined for performance reasons. Common functions are moved into class_table.h/.cc. This is a preparation for adding an isolate-independent version of the allocation code and allocation tracking code. BUG= R=johnmccutchan@google.com Committed: https://github.com/dart-lang/sdk/commit/0cf617ef1392d206b2f5484927de29d541b13119

Patch Set 1 #

Patch Set 2 : make context allocation isolate-independent #

Total comments: 2

Patch Set 3 : addressed comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+503 lines, -484 lines) Patch
M runtime/vm/assembler_arm.h View 1 1 chunk +2 lines, -2 lines 0 comments Download
M runtime/vm/assembler_arm.cc View 1 2 4 chunks +19 lines, -16 lines 0 comments Download
M runtime/vm/assembler_arm64.h View 1 1 chunk +4 lines, -2 lines 0 comments Download
M runtime/vm/assembler_arm64.cc View 1 2 2 chunks +63 lines, -73 lines 0 comments Download
M runtime/vm/assembler_ia32.h View 1 2 1 chunk +6 lines, -3 lines 0 comments Download
M runtime/vm/assembler_ia32.cc View 1 2 3 chunks +54 lines, -68 lines 0 comments Download
M runtime/vm/assembler_mips.h View 1 1 chunk +4 lines, -2 lines 0 comments Download
M runtime/vm/assembler_mips.cc View 1 2 2 chunks +63 lines, -75 lines 0 comments Download
M runtime/vm/assembler_x64.h View 1 2 2 chunks +6 lines, -5 lines 0 comments Download
M runtime/vm/assembler_x64.cc View 1 2 2 chunks +41 lines, -73 lines 0 comments Download
M runtime/vm/class_table.h View 1 2 1 chunk +14 lines, -7 lines 0 comments Download
M runtime/vm/class_table.cc View 1 2 1 chunk +44 lines, -0 lines 0 comments Download
M runtime/vm/dart_api_impl_test.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/heap.h View 1 5 chunks +10 lines, -9 lines 0 comments Download
M runtime/vm/heap.cc View 1 20 chunks +98 lines, -82 lines 0 comments Download
M runtime/vm/intrinsifier_arm.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M runtime/vm/pages.h View 1 2 chunks +4 lines, -2 lines 0 comments Download
M runtime/vm/pages.cc View 1 2 chunks +3 lines, -2 lines 0 comments Download
M runtime/vm/scavenger.h View 1 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/scavenger.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/stub_code.h View 1 2 chunks +1 line, -1 line 0 comments Download
M runtime/vm/stub_code_arm.cc View 1 7 chunks +13 lines, -14 lines 0 comments Download
M runtime/vm/stub_code_arm64.cc View 1 6 chunks +13 lines, -12 lines 0 comments Download
M runtime/vm/stub_code_ia32.cc View 1 5 chunks +11 lines, -9 lines 0 comments Download
M runtime/vm/stub_code_mips.cc View 1 6 chunks +12 lines, -10 lines 0 comments Download
M runtime/vm/stub_code_x64.cc View 1 5 chunks +13 lines, -12 lines 0 comments Download

Messages

Total messages: 11 (2 generated)
Florian Schneider
5 years, 5 months ago (2015-07-15 10:45:02 UTC) #2
Florian Schneider
Hold off with reviewing this for now until I upload a new version.
5 years, 5 months ago (2015-07-15 12:25:37 UTC) #3
Florian Schneider
PTAL. This includes https://codereview.chromium.org/1235433004/, which is necessary to make the allocation code shareable between isolates ...
5 years, 5 months ago (2015-07-16 13:33:01 UTC) #5
koda
DBC for future thought https://chromiumcodereview.appspot.com/1241863002/diff/20001/runtime/vm/assembler_arm.cc File runtime/vm/assembler_arm.cc (right): https://chromiumcodereview.appspot.com/1241863002/diff/20001/runtime/vm/assembler_arm.cc#newcode3363 runtime/vm/assembler_arm.cc:3363: LoadIsolate(dest); In this branch, one ...
5 years, 5 months ago (2015-07-16 15:45:18 UTC) #6
Cutch
LGTM with some comments: It would be nice to have a flag controlling the global ...
5 years, 5 months ago (2015-07-16 15:47:23 UTC) #7
Florian Schneider
On 2015/07/16 15:47:23, Cutch wrote: > LGTM with some comments: > > It would be ...
5 years, 5 months ago (2015-07-17 07:36:45 UTC) #8
Florian Schneider
https://chromiumcodereview.appspot.com/1241863002/diff/20001/runtime/vm/assembler_arm.cc File runtime/vm/assembler_arm.cc (right): https://chromiumcodereview.appspot.com/1241863002/diff/20001/runtime/vm/assembler_arm.cc#newcode3363 runtime/vm/assembler_arm.cc:3363: LoadIsolate(dest); On 2015/07/16 15:45:18, koda wrote: > In this ...
5 years, 5 months ago (2015-07-17 07:40:40 UTC) #9
Florian Schneider
Committed patchset #3 (id:40001) manually as 0cf617ef1392d206b2f5484927de29d541b13119 (presubmit successful).
5 years, 5 months ago (2015-07-17 13:15:39 UTC) #10
koda
5 years, 5 months ago (2015-07-17 13:20:24 UTC) #11
Message was sent while issue was closed.
On 2015/07/17 07:40:40, Florian Schneider wrote:
>
https://chromiumcodereview.appspot.com/1241863002/diff/20001/runtime/vm/assem...
> File runtime/vm/assembler_arm.cc (right):
> 
>
https://chromiumcodereview.appspot.com/1241863002/diff/20001/runtime/vm/assem...
> runtime/vm/assembler_arm.cc:3363: LoadIsolate(dest);
> On 2015/07/16 15:45:18, koda wrote:
> > In this branch, one must not use "class_table", nor "table_ptr", so it would
> be
> > more robust if those locals were not even visible here.
> > 
> > In general, how fast/obviously will we fail if someone by mistake inlines
> > isolate-specific things during precompilation?
> > 
> > I think we should consider funneling these "reinterpret_cast" through some
> > interface that can assert that we're not precompiling.
> 
> Ok, I'll try to rearrange the code accordingly by checking
> 
> if (inline_isolate) first.
> 
> 
> Often you just get a segfault. We have to check all places where we do
something
> like Immediate(reinterpret_cast<uword|int32_t|int64_t>some_ptr)

Yes, we have quite a few of those naked reinterpret_casts. Ideally, we should
have both:
1. a single interface for embedding C++ pointers as immediates (which will check
any flag/mode)
2. a paranoid assert that looks for any immediate that is within the .text
segment of the running process without having gone through the above interface

Powered by Google App Engine
This is Rietveld 408576698