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

Side by Side Diff: runtime/vm/assembler.h

Issue 1150633002: Track prologue offset of Code and use for more precise return addresses (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 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 | « no previous file | runtime/vm/assembler_ia32.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) 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 #ifndef VM_ASSEMBLER_H_ 5 #ifndef VM_ASSEMBLER_H_
6 #define VM_ASSEMBLER_H_ 6 #define VM_ASSEMBLER_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/allocation.h" 9 #include "vm/allocation.h"
10 #include "vm/globals.h" 10 #include "vm/globals.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 ASSERT(HasEnsuredCapacity()); 82 ASSERT(HasEnsuredCapacity());
83 *reinterpret_cast<T*>(cursor_) = value; 83 *reinterpret_cast<T*>(cursor_) = value;
84 cursor_ += sizeof(T); 84 cursor_ += sizeof(T);
85 } 85 }
86 86
87 template<typename T> void Remit() { 87 template<typename T> void Remit() {
88 ASSERT(Size() >= static_cast<intptr_t>(sizeof(T))); 88 ASSERT(Size() >= static_cast<intptr_t>(sizeof(T)));
89 cursor_ -= sizeof(T); 89 cursor_ -= sizeof(T);
90 } 90 }
91 91
92 // Return address to code at |position| bytes.
93 uword Address(intptr_t position) {
94 return reinterpret_cast<uword>(contents_ + position);
95 }
96
92 template<typename T> T Load(intptr_t position) { 97 template<typename T> T Load(intptr_t position) {
93 ASSERT(position >= 0 && 98 ASSERT(position >= 0 &&
94 position <= (Size() - static_cast<intptr_t>(sizeof(T)))); 99 position <= (Size() - static_cast<intptr_t>(sizeof(T))));
95 return *reinterpret_cast<T*>(contents_ + position); 100 return *reinterpret_cast<T*>(contents_ + position);
96 } 101 }
97 102
98 template<typename T> void Store(intptr_t position, T value) { 103 template<typename T> void Store(intptr_t position, T value) {
99 ASSERT(position >= 0 && 104 ASSERT(position >= 0 &&
100 position <= (Size() - static_cast<intptr_t>(sizeof(T)))); 105 position <= (Size() - static_cast<intptr_t>(sizeof(T))));
101 *reinterpret_cast<T*>(contents_ + position) = value; 106 *reinterpret_cast<T*>(contents_ + position) = value;
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 #include "vm/assembler_arm.h" 304 #include "vm/assembler_arm.h"
300 #elif defined(TARGET_ARCH_ARM64) 305 #elif defined(TARGET_ARCH_ARM64)
301 #include "vm/assembler_arm64.h" 306 #include "vm/assembler_arm64.h"
302 #elif defined(TARGET_ARCH_MIPS) 307 #elif defined(TARGET_ARCH_MIPS)
303 #include "vm/assembler_mips.h" 308 #include "vm/assembler_mips.h"
304 #else 309 #else
305 #error Unknown architecture. 310 #error Unknown architecture.
306 #endif 311 #endif
307 312
308 #endif // VM_ASSEMBLER_H_ 313 #endif // VM_ASSEMBLER_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/assembler_ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698