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

Side by Side Diff: runtime/vm/assembler_mips.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: 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
« no previous file with comments | « runtime/vm/assembler_mips.h ('k') | runtime/vm/assembler_x64.h » ('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) 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_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/longjump.h" 9 #include "vm/longjump.h"
10 #include "vm/runtime_entry.h" 10 #include "vm/runtime_entry.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 EncodeLoadImmediate(dest >> 16, high); 99 EncodeLoadImmediate(dest >> 16, high);
100 100
101 region.Store<int32_t>(position, encoded_high); 101 region.Store<int32_t>(position, encoded_high);
102 region.Store<int32_t>(position + Instr::kInstrSize, encoded_low); 102 region.Store<int32_t>(position + Instr::kInstrSize, encoded_low);
103 return; 103 return;
104 } 104 }
105 // If the offset loading instructions aren't there, we must have replaced 105 // If the offset loading instructions aren't there, we must have replaced
106 // the far branch with a near one, and so these instructions should be NOPs. 106 // the far branch with a near one, and so these instructions should be NOPs.
107 ASSERT((high == Instr::kNopInstruction) && (low == Instr::kNopInstruction)); 107 ASSERT((high == Instr::kNopInstruction) && (low == Instr::kNopInstruction));
108 } 108 }
109
110 virtual bool IsPointerOffset() const { return false; }
109 }; 111 };
110 112
111 113
112 void Assembler::EmitFarJump(int32_t offset, bool link) { 114 void Assembler::EmitFarJump(int32_t offset, bool link) {
113 ASSERT(use_far_branches()); 115 ASSERT(use_far_branches());
114 const uint16_t low = Utils::Low16Bits(offset); 116 const uint16_t low = Utils::Low16Bits(offset);
115 const uint16_t high = Utils::High16Bits(offset); 117 const uint16_t high = Utils::High16Bits(offset);
116 buffer_.EmitFixup(new PatchFarJump()); 118 buffer_.EmitFixup(new PatchFarJump());
117 lui(T9, Immediate(high)); 119 lui(T9, Immediate(high));
118 ori(T9, T9, Immediate(low)); 120 ori(T9, T9, Immediate(low));
(...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after
1053 Emit(reinterpret_cast<int32_t>(message)); 1055 Emit(reinterpret_cast<int32_t>(message));
1054 Bind(&msg); 1056 Bind(&msg);
1055 break_(Instr::kMsgMessageCode); 1057 break_(Instr::kMsgMessageCode);
1056 } 1058 }
1057 #endif 1059 #endif
1058 } 1060 }
1059 1061
1060 } // namespace dart 1062 } // namespace dart
1061 1063
1062 #endif // defined TARGET_ARCH_MIPS 1064 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/assembler_mips.h ('k') | runtime/vm/assembler_x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698