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

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

Issue 136563002: Landing: Write protect executable pages in the VM. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Added command line flag Created 6 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/code_generator.h" 9 #include "vm/code_generator.h"
10 #include "vm/heap.h" 10 #include "vm/heap.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 74
75 class DirectCallRelocation : public AssemblerFixup { 75 class DirectCallRelocation : public AssemblerFixup {
76 public: 76 public:
77 void Process(const MemoryRegion& region, intptr_t position) { 77 void Process(const MemoryRegion& region, intptr_t position) {
78 // Direct calls are relative to the following instruction on x86. 78 // Direct calls are relative to the following instruction on x86.
79 int32_t pointer = region.Load<int32_t>(position); 79 int32_t pointer = region.Load<int32_t>(position);
80 int32_t delta = region.start() + position + sizeof(int32_t); 80 int32_t delta = region.start() + position + sizeof(int32_t);
81 region.Store<int32_t>(position, pointer - delta); 81 region.Store<int32_t>(position, pointer - delta);
82 } 82 }
83
84 virtual bool IsPointerOffset() const { return false; }
83 }; 85 };
84 86
85 87
86 int32_t Assembler::jit_cookie() { 88 int32_t Assembler::jit_cookie() {
87 if (jit_cookie_ == 0) { 89 if (jit_cookie_ == 0) {
88 jit_cookie_ = static_cast<int32_t>( 90 jit_cookie_ = static_cast<int32_t>(
89 Isolate::Current()->random()->NextUInt32()); 91 Isolate::Current()->random()->NextUInt32());
90 } 92 }
91 return jit_cookie_; 93 return jit_cookie_;
92 } 94 }
(...skipping 2503 matching lines...) Expand 10 before | Expand all | Expand 10 after
2596 2598
2597 const char* Assembler::FpuRegisterName(FpuRegister reg) { 2599 const char* Assembler::FpuRegisterName(FpuRegister reg) {
2598 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); 2600 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters));
2599 return xmm_reg_names[reg]; 2601 return xmm_reg_names[reg];
2600 } 2602 }
2601 2603
2602 2604
2603 } // namespace dart 2605 } // namespace dart
2604 2606
2605 #endif // defined TARGET_ARCH_IA32 2607 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698