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

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

Issue 12623002: - Allow the use of branch delay slots. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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 | « no previous file | runtime/vm/assembler_mips.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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 AssemblerBuffer(); 73 AssemblerBuffer();
74 ~AssemblerBuffer(); 74 ~AssemblerBuffer();
75 75
76 // Basic support for emitting, loading, and storing. 76 // Basic support for emitting, loading, and storing.
77 template<typename T> void Emit(T value) { 77 template<typename T> void Emit(T value) {
78 ASSERT(HasEnsuredCapacity()); 78 ASSERT(HasEnsuredCapacity());
79 *reinterpret_cast<T*>(cursor_) = value; 79 *reinterpret_cast<T*>(cursor_) = value;
80 cursor_ += sizeof(T); 80 cursor_ += sizeof(T);
81 } 81 }
82 82
83 template<typename T> void Remit() {
84 ASSERT(Size() >= static_cast<intptr_t>(sizeof(T)));
85 cursor_ -= sizeof(T);
86 }
87
83 template<typename T> T Load(int position) { 88 template<typename T> T Load(int position) {
84 ASSERT(position >= 0 && position <= (Size() - static_cast<int>(sizeof(T)))); 89 ASSERT(position >= 0 && position <= (Size() - static_cast<int>(sizeof(T))));
85 return *reinterpret_cast<T*>(contents_ + position); 90 return *reinterpret_cast<T*>(contents_ + position);
86 } 91 }
87 92
88 template<typename T> void Store(int position, T value) { 93 template<typename T> void Store(int position, T value) {
89 ASSERT(position >= 0 && position <= (Size() - static_cast<int>(sizeof(T)))); 94 ASSERT(position >= 0 && position <= (Size() - static_cast<int>(sizeof(T))));
90 *reinterpret_cast<T*>(contents_ + position) = value; 95 *reinterpret_cast<T*>(contents_ + position) = value;
91 } 96 }
92 97
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/assembler_mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698