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

Issue 136563002: Landing: Write protect executable pages in the VM. (Closed)

Created:
6 years, 11 months ago by Florian Schneider
Modified:
6 years, 9 months ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org, Anders Johnsen
Visibility:
Public.

Description

Landing: Write protect executable pages in the VM. Change executable pages to be read/execute but not writable by default. All pages are made temporarily writable just before a full GC, because both the mark and sweep phases write to the pages. When allocating in a page and when patching code, the pages are made temporarily writable. The order of allocation of Code and Instructions objects is changed so that a GC will not occur after Instructions is allocated. (A full GC would render the Instructions unwritable.) A scoped object is used to make memory protection simpler. Original CL: https://codereview.chromium.org/106593002/ I added a cc test that is expected to crash.

Patch Set 1 #

Total comments: 4

Patch Set 2 : Fixed issue with region boundaries on Windows #

Patch Set 3 : Fixed typo and removed debug printing #

Total comments: 5

Patch Set 4 : Addressed comments #

Patch Set 5 : #

Patch Set 6 : rebased again #

Patch Set 7 : fixed merge issues #

Patch Set 8 : Added command line flag #

Total comments: 21

Patch Set 9 : try remove rwx #

Patch Set 10 : #

Patch Set 11 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+557 lines, -170 lines) Patch
M runtime/tests/vm/vm.status View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/assembler.h View 1 2 3 4 5 6 7 8 9 2 chunks +6 lines, -0 lines 0 comments Download
M runtime/vm/assembler.cc View 1 2 3 4 5 6 7 8 9 1 chunk +13 lines, -0 lines 0 comments Download
M runtime/vm/assembler_arm.h View 1 2 3 4 5 6 7 8 9 1 chunk +5 lines, -0 lines 0 comments Download
M runtime/vm/assembler_arm.cc View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M runtime/vm/assembler_ia32.h View 1 2 3 4 5 6 7 8 9 1 chunk +6 lines, -0 lines 0 comments Download
M runtime/vm/assembler_ia32.cc View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M runtime/vm/assembler_mips.h View 1 2 3 4 5 6 7 8 9 1 chunk +7 lines, -0 lines 0 comments Download
M runtime/vm/assembler_mips.cc View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M runtime/vm/assembler_x64.h View 1 2 3 4 5 6 7 8 9 1 chunk +7 lines, -0 lines 0 comments Download
M runtime/vm/code_generator.cc View 1 2 3 4 5 6 7 8 9 3 chunks +21 lines, -7 lines 0 comments Download
M runtime/vm/code_patcher.h View 1 2 3 4 5 6 7 8 9 1 chunk +16 lines, -0 lines 0 comments Download
M runtime/vm/code_patcher.cc View 1 2 3 4 5 6 7 8 9 3 chunks +47 lines, -9 lines 0 comments Download
M runtime/vm/dart.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/debugger_arm.cc View 1 2 3 4 5 6 7 8 9 2 chunks +32 lines, -24 lines 0 comments Download
M runtime/vm/debugger_ia32.cc View 1 2 3 4 5 6 7 8 9 2 chunks +32 lines, -24 lines 0 comments Download
M runtime/vm/debugger_mips.cc View 1 2 3 4 5 6 7 8 9 2 chunks +32 lines, -24 lines 0 comments Download
M runtime/vm/debugger_x64.cc View 1 2 3 4 5 6 7 8 9 2 chunks +36 lines, -26 lines 0 comments Download
M runtime/vm/freelist.h View 1 2 3 4 5 6 7 8 9 3 chunks +10 lines, -2 lines 0 comments Download
M runtime/vm/freelist.cc View 1 2 3 4 5 6 7 8 9 7 chunks +102 lines, -8 lines 0 comments Download
M runtime/vm/freelist_test.cc View 1 2 3 4 5 6 7 8 9 1 chunk +10 lines, -9 lines 0 comments Download
M runtime/vm/instructions_arm_test.cc View 1 2 3 4 5 6 7 8 9 1 chunk +7 lines, -0 lines 0 comments Download
M runtime/vm/instructions_ia32_test.cc View 1 2 3 4 5 6 7 8 9 2 chunks +9 lines, -0 lines 0 comments Download
M runtime/vm/instructions_mips_test.cc View 1 2 3 4 5 6 7 8 9 1 chunk +7 lines, -0 lines 0 comments Download
M runtime/vm/instructions_x64_test.cc View 1 2 3 4 5 6 7 8 9 1 chunk +7 lines, -0 lines 0 comments Download
M runtime/vm/object.cc View 1 2 3 4 5 6 7 8 9 5 chunks +16 lines, -8 lines 0 comments Download
M runtime/vm/object_test.cc View 1 2 3 4 5 6 7 8 9 1 chunk +25 lines, -0 lines 0 comments Download
M runtime/vm/pages.cc View 1 2 3 4 5 6 7 8 9 6 chunks +51 lines, -7 lines 0 comments Download
M runtime/vm/virtual_memory.h View 1 2 3 4 5 6 7 8 9 3 chunks +7 lines, -2 lines 0 comments Download
M runtime/vm/virtual_memory.cc View 1 2 3 4 5 6 7 8 9 1 chunk +6 lines, -0 lines 0 comments Download
M runtime/vm/virtual_memory_android.cc View 1 2 3 4 5 6 7 8 9 2 chunks +7 lines, -5 lines 0 comments Download
M runtime/vm/virtual_memory_linux.cc View 1 2 3 4 5 6 7 8 9 2 chunks +8 lines, -5 lines 0 comments Download
M runtime/vm/virtual_memory_macos.cc View 1 2 3 4 5 6 7 8 9 2 chunks +7 lines, -5 lines 0 comments Download
M runtime/vm/virtual_memory_win.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +10 lines, -5 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
Florian Schneider
This working on Windows, Linux. I will test Mac as well. https://codereview.chromium.org/136563002/diff/1/runtime/vm/freelist.cc File runtime/vm/freelist.cc (right): ...
6 years, 11 months ago (2014-01-16 13:12:38 UTC) #1
srdjan
https://codereview.chromium.org/136563002/diff/160001/runtime/vm/assembler.cc File runtime/vm/assembler.cc (right): https://codereview.chromium.org/136563002/diff/160001/runtime/vm/assembler.cc#newcode160 runtime/vm/assembler.cc:160: intptr_t AssemblerBuffer::CountPointerOffsets() const { IMO, PointerOffsetsCount or NumberOfPointerOffsets sounds ...
6 years, 11 months ago (2014-01-16 17:38:12 UTC) #2
Florian Schneider
https://codereview.chromium.org/136563002/diff/160001/runtime/vm/code_patcher.h File runtime/vm/code_patcher.h (right): https://codereview.chromium.org/136563002/diff/160001/runtime/vm/code_patcher.h#newcode32 runtime/vm/code_patcher.h:32: intptr_t size_; On 2014/01/16 17:38:12, srdjan wrote: > Both ...
6 years, 11 months ago (2014-01-17 10:46:59 UTC) #3
Florian Schneider
Rebased and added a command line flag to control write protection.
6 years, 10 months ago (2014-01-28 16:42:03 UTC) #4
srdjan
6 years, 10 months ago (2014-01-31 17:24:12 UTC) #5
srdjan
lgtm
6 years, 10 months ago (2014-01-31 17:24:14 UTC) #6
Ivan Posva
https://codereview.chromium.org/136563002/diff/350035/runtime/vm/assembler_mips.h File runtime/vm/assembler_mips.h (right): https://codereview.chromium.org/136563002/diff/350035/runtime/vm/assembler_mips.h#newcode170 runtime/vm/assembler_mips.h:170: return buffer_.CountPointerOffsets(); Does MIPS code really contain pointer offsets? ...
6 years, 10 months ago (2014-02-03 05:44:35 UTC) #7
Florian Schneider
https://codereview.chromium.org/136563002/diff/350035/runtime/vm/assembler_x64.h File runtime/vm/assembler_x64.h (right): https://codereview.chromium.org/136563002/diff/350035/runtime/vm/assembler_x64.h#newcode765 runtime/vm/assembler_x64.h:765: return buffer_.CountPointerOffsets(); On 2014/02/03 05:44:35, Ivan Posva wrote: > ...
6 years, 10 months ago (2014-02-10 11:56:17 UTC) #8
Florian Schneider
6 years, 10 months ago (2014-02-10 12:18:29 UTC) #9
Message was sent while issue was closed.
Committed patchset #11 manually as r32493 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698