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

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

Issue 13619008: Implements type checking in MIPS needed for FindCodeObject test. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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/flow_graph_compiler_mips.cc » ('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/runtime_entry.h" 9 #include "vm/runtime_entry.h"
10 #include "vm/simulator.h" 10 #include "vm/simulator.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 } 124 }
125 125
126 126
127 void Assembler::CompareObject(Register rd, Register rn, const Object& object) { 127 void Assembler::CompareObject(Register rd, Register rn, const Object& object) {
128 ASSERT(rn != TMP); 128 ASSERT(rn != TMP);
129 LoadObject(TMP, object); 129 LoadObject(TMP, object);
130 subu(rd, rn, TMP); 130 subu(rd, rn, TMP);
131 } 131 }
132 132
133 133
134 void Assembler::LoadClassId(Register result, Register object) {
135 ASSERT(RawObject::kClassIdTagBit == 16);
136 ASSERT(RawObject::kClassIdTagSize == 16);
137 const intptr_t class_id_offset = Object::tags_offset() +
138 RawObject::kClassIdTagBit / kBitsPerByte;
139 lhu(result, FieldAddress(object, class_id_offset));
140 }
141
142
143 void Assembler::LoadClassById(Register result, Register class_id) {
144 ASSERT(result != class_id);
145 lw(result, FieldAddress(CTX, Context::isolate_offset()));
146 const intptr_t table_offset_in_isolate =
147 Isolate::class_table_offset() + ClassTable::table_offset();
148 lw(result, Address(result, table_offset_in_isolate));
149 sll(TMP, class_id, 2);
150 addu(result, result, TMP);
151 lw(result, Address(result));
152 }
153
154
155 void Assembler::LoadClass(Register result, Register object, Register scratch) {
156 ASSERT(scratch != result);
157 LoadClassId(scratch, object);
158
159 lw(result, FieldAddress(CTX, Context::isolate_offset()));
160 const intptr_t table_offset_in_isolate =
161 Isolate::class_table_offset() + ClassTable::table_offset();
162 lw(result, Address(result, table_offset_in_isolate));
163 sll(scratch, scratch, 2);
164 addu(result, result, scratch);
165 lw(result, Address(result));
166 }
167
168
134 void Assembler::EnterStubFrame() { 169 void Assembler::EnterStubFrame() {
135 addiu(SP, SP, Immediate(-3 * kWordSize)); 170 addiu(SP, SP, Immediate(-3 * kWordSize));
136 sw(ZR, Address(SP, 2 * kWordSize)); // PC marker is 0 in stubs. 171 sw(ZR, Address(SP, 2 * kWordSize)); // PC marker is 0 in stubs.
137 sw(RA, Address(SP, 1 * kWordSize)); 172 sw(RA, Address(SP, 1 * kWordSize));
138 sw(FP, Address(SP, 0 * kWordSize)); 173 sw(FP, Address(SP, 0 * kWordSize));
139 mov(FP, SP); 174 mov(FP, SP);
140 } 175 }
141 176
142 177
143 void Assembler::LeaveStubFrame() { 178 void Assembler::LeaveStubFrame() {
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 b(&stop); 280 b(&stop);
246 Emit(reinterpret_cast<int32_t>(message)); 281 Emit(reinterpret_cast<int32_t>(message));
247 Bind(&stop); 282 Bind(&stop);
248 break_(Instr::kStopMessageCode); 283 break_(Instr::kStopMessageCode);
249 } 284 }
250 285
251 } // namespace dart 286 } // namespace dart
252 287
253 #endif // defined TARGET_ARCH_MIPS 288 #endif // defined TARGET_ARCH_MIPS
254 289
OLDNEW
« no previous file with comments | « runtime/vm/assembler_mips.h ('k') | runtime/vm/flow_graph_compiler_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698