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

Unified Diff: runtime/vm/assembler_ia32.cc

Issue 392343002: Cleanup of class id loading sequences. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 5 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_ia32.h ('k') | runtime/vm/assembler_ia32_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_ia32.cc
===================================================================
--- runtime/vm/assembler_ia32.cc (revision 38317)
+++ runtime/vm/assembler_ia32.cc (working copy)
@@ -1415,6 +1415,15 @@
}
+void Assembler::cmpb(const Address& address, const Immediate& imm) {
+ ASSERT(imm.is_int8());
+ AssemblerBuffer::EnsureCapacity ensured(&buffer_);
+ EmitUint8(0x80);
+ EmitOperand(7, address);
+ EmitUint8(imm.value() & 0xFF);
+}
+
+
void Assembler::testl(Register reg1, Register reg2) {
AssemblerBuffer::EnsureCapacity ensured(&buffer_);
EmitUint8(0x85);
@@ -2712,27 +2721,19 @@
}
-void Assembler::LoadTaggedClassIdMayBeSmi(
- Register result, Register object, Register tmp) {
- ASSERT(object != tmp);
- ASSERT(result != tmp);
+void Assembler::LoadTaggedClassIdMayBeSmi(Register result, Register object) {
+ ASSERT(result != object);
static const intptr_t kSmiCidSource = kSmiCid << RawObject::kClassIdTagPos;
- if (result == object) {
- movl(tmp, object);
- } else {
- tmp = object;
- }
-
// Make a dummy "Object" whose cid is kSmiCid.
movl(result, Immediate(reinterpret_cast<int32_t>(&kSmiCidSource) + 1));
// Check if object (in tmp) is a Smi.
- testl(tmp, Immediate(kSmiTagMask));
+ testl(object, Immediate(kSmiTagMask));
// If the object is not a Smi, use the original object to load the cid.
// Otherwise, the dummy object is used, and the result is kSmiCid.
- cmovne(result, tmp);
+ cmovne(result, object);
LoadClassId(result, result);
// Tag the result.
« no previous file with comments | « runtime/vm/assembler_ia32.h ('k') | runtime/vm/assembler_ia32_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698