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

Side by Side Diff: runtime/vm/code_patcher.cc

Issue 2974233002: VM: Re-format to use at most one newline between functions (Closed)
Patch Set: Rebase and merge Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/code_patcher.h ('k') | runtime/vm/code_patcher_arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/code_patcher.h" 5 #include "vm/code_patcher.h"
6 #include "vm/cpu.h" 6 #include "vm/cpu.h"
7 #include "vm/instructions.h" 7 #include "vm/instructions.h"
8 #include "vm/object.h" 8 #include "vm/object.h"
9 #include "vm/virtual_memory.h" 9 #include "vm/virtual_memory.h"
10 10
11 namespace dart { 11 namespace dart {
12 12
13 DEFINE_FLAG(bool, write_protect_code, true, "Write protect jitted code"); 13 DEFINE_FLAG(bool, write_protect_code, true, "Write protect jitted code");
14 14
15
16 WritableInstructionsScope::WritableInstructionsScope(uword address, 15 WritableInstructionsScope::WritableInstructionsScope(uword address,
17 intptr_t size) 16 intptr_t size)
18 : address_(address), size_(size) { 17 : address_(address), size_(size) {
19 if (FLAG_write_protect_code) { 18 if (FLAG_write_protect_code) {
20 bool status = VirtualMemory::Protect(reinterpret_cast<void*>(address), size, 19 bool status = VirtualMemory::Protect(reinterpret_cast<void*>(address), size,
21 VirtualMemory::kReadWrite); 20 VirtualMemory::kReadWrite);
22 ASSERT(status); 21 ASSERT(status);
23 } 22 }
24 } 23 }
25 24
26
27 WritableInstructionsScope::~WritableInstructionsScope() { 25 WritableInstructionsScope::~WritableInstructionsScope() {
28 if (FLAG_write_protect_code) { 26 if (FLAG_write_protect_code) {
29 bool status = VirtualMemory::Protect(reinterpret_cast<void*>(address_), 27 bool status = VirtualMemory::Protect(reinterpret_cast<void*>(address_),
30 size_, VirtualMemory::kReadExecute); 28 size_, VirtualMemory::kReadExecute);
31 ASSERT(status); 29 ASSERT(status);
32 } 30 }
33 } 31 }
34 32
35 } // namespace dart 33 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/code_patcher.h ('k') | runtime/vm/code_patcher_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698