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

Unified 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, 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/assembler_mips.h ('k') | runtime/vm/flow_graph_compiler_mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_mips.cc
===================================================================
--- runtime/vm/assembler_mips.cc (revision 20924)
+++ runtime/vm/assembler_mips.cc (working copy)
@@ -131,6 +131,41 @@
}
+void Assembler::LoadClassId(Register result, Register object) {
+ ASSERT(RawObject::kClassIdTagBit == 16);
+ ASSERT(RawObject::kClassIdTagSize == 16);
+ const intptr_t class_id_offset = Object::tags_offset() +
+ RawObject::kClassIdTagBit / kBitsPerByte;
+ lhu(result, FieldAddress(object, class_id_offset));
+}
+
+
+void Assembler::LoadClassById(Register result, Register class_id) {
+ ASSERT(result != class_id);
+ lw(result, FieldAddress(CTX, Context::isolate_offset()));
+ const intptr_t table_offset_in_isolate =
+ Isolate::class_table_offset() + ClassTable::table_offset();
+ lw(result, Address(result, table_offset_in_isolate));
+ sll(TMP, class_id, 2);
+ addu(result, result, TMP);
+ lw(result, Address(result));
+}
+
+
+void Assembler::LoadClass(Register result, Register object, Register scratch) {
+ ASSERT(scratch != result);
+ LoadClassId(scratch, object);
+
+ lw(result, FieldAddress(CTX, Context::isolate_offset()));
+ const intptr_t table_offset_in_isolate =
+ Isolate::class_table_offset() + ClassTable::table_offset();
+ lw(result, Address(result, table_offset_in_isolate));
+ sll(scratch, scratch, 2);
+ addu(result, result, scratch);
+ lw(result, Address(result));
+}
+
+
void Assembler::EnterStubFrame() {
addiu(SP, SP, Immediate(-3 * kWordSize));
sw(ZR, Address(SP, 2 * kWordSize)); // PC marker is 0 in stubs.
« 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