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

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

Issue 1174673003: Fix 64-bit build (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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_arm64.cc ('k') | no next file » | 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/globals.h" // Needed here to get TARGET_ARCH_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/code_patcher.h" 9 #include "vm/code_patcher.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 reinterpret_cast<uint8_t*>(return_address - kCallPatternSize); 114 reinterpret_cast<uint8_t*>(return_address - kCallPatternSize);
115 return (code_bytes[0] == 0x41) && (code_bytes[1] == 0xFF) && 115 return (code_bytes[0] == 0x41) && (code_bytes[1] == 0xFF) &&
116 (code_bytes[2] == 0x97); 116 (code_bytes[2] == 0x97);
117 } 117 }
118 118
119 intptr_t pp_index() const { 119 intptr_t pp_index() const {
120 return InstructionPattern::IndexFromPPLoad(start_ + 3); 120 return InstructionPattern::IndexFromPPLoad(start_ + 3);
121 } 121 }
122 122
123 uword Target() const { 123 uword Target() const {
124 return reinterpret_cast<uword>(object_pool_.RawValueAt(pp_index())); 124 return object_pool_.RawValueAt(pp_index());
125 } 125 }
126 126
127 void SetTarget(uword target) const { 127 void SetTarget(uword target) const {
128 object_pool_.SetRawValueAt(pp_index(), target); 128 object_pool_.SetRawValueAt(pp_index(), target);
129 // No need to flush the instruction cache, since the code is not modified. 129 // No need to flush the instruction cache, since the code is not modified.
130 } 130 }
131 131
132 protected: 132 protected:
133 uword start_; 133 uword start_;
134 const ObjectPool& object_pool_; 134 const ObjectPool& object_pool_;
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 238
239 RawObject* CodePatcher::GetEdgeCounterAt(uword pc, const Code& code) { 239 RawObject* CodePatcher::GetEdgeCounterAt(uword pc, const Code& code) {
240 ASSERT(code.ContainsInstructionAt(pc)); 240 ASSERT(code.ContainsInstructionAt(pc));
241 EdgeCounter counter(pc, code); 241 EdgeCounter counter(pc, code);
242 return counter.edge_counter(); 242 return counter.edge_counter();
243 } 243 }
244 244
245 } // namespace dart 245 } // namespace dart
246 246
247 #endif // defined TARGET_ARCH_X64 247 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/code_patcher_arm64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698