Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 83 template<typename T> T Load(int position) { | 83 template<typename T> T Load(int position) { |
| 84 ASSERT(position >= 0 && position <= (Size() - static_cast<int>(sizeof(T)))); | 84 ASSERT(position >= 0 && position <= (Size() - static_cast<int>(sizeof(T)))); |
| 85 return *reinterpret_cast<T*>(contents_ + position); | 85 return *reinterpret_cast<T*>(contents_ + position); |
| 86 } | 86 } |
| 87 | 87 |
| 88 template<typename T> void Store(int position, T value) { | 88 template<typename T> void Store(int position, T value) { |
| 89 ASSERT(position >= 0 && position <= (Size() - static_cast<int>(sizeof(T)))); | 89 ASSERT(position >= 0 && position <= (Size() - static_cast<int>(sizeof(T)))); |
| 90 *reinterpret_cast<T*>(contents_ + position) = value; | 90 *reinterpret_cast<T*>(contents_ + position) = value; |
| 91 } | 91 } |
| 92 | 92 |
| 93 template<typename T> void Backup() { | |
|
Ivan Posva
2013/03/07 16:57:41
If you have a better suggestions for this name, su
zra
2013/03/07 17:11:34
Remit?
| |
| 94 ASSERT(Size() >= static_cast<intptr_t>(sizeof(T))); | |
| 95 cursor_ -= sizeof(T); | |
| 96 } | |
| 97 | |
| 93 const ZoneGrowableArray<int>& pointer_offsets() const { | 98 const ZoneGrowableArray<int>& pointer_offsets() const { |
| 94 #if defined(DEBUG) | 99 #if defined(DEBUG) |
| 95 ASSERT(fixups_processed_); | 100 ASSERT(fixups_processed_); |
| 96 #endif | 101 #endif |
| 97 return *pointer_offsets_; | 102 return *pointer_offsets_; |
| 98 } | 103 } |
| 99 | 104 |
| 100 // Emit an object pointer directly in the code. | 105 // Emit an object pointer directly in the code. |
| 101 void EmitObject(const Object& object); | 106 void EmitObject(const Object& object); |
| 102 | 107 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 200 #include "vm/assembler_x64.h" | 205 #include "vm/assembler_x64.h" |
| 201 #elif defined(TARGET_ARCH_ARM) | 206 #elif defined(TARGET_ARCH_ARM) |
| 202 #include "vm/assembler_arm.h" | 207 #include "vm/assembler_arm.h" |
| 203 #elif defined(TARGET_ARCH_MIPS) | 208 #elif defined(TARGET_ARCH_MIPS) |
| 204 #include "vm/assembler_mips.h" | 209 #include "vm/assembler_mips.h" |
| 205 #else | 210 #else |
| 206 #error Unknown architecture. | 211 #error Unknown architecture. |
| 207 #endif | 212 #endif |
| 208 | 213 |
| 209 #endif // VM_ASSEMBLER_H_ | 214 #endif // VM_ASSEMBLER_H_ |
| OLD | NEW |