Revision: 7042
Author: [email protected]
Date: Thu Mar  3 04:21:37 2011
Log: Add new ARM macro assembler function CompareRoot left out of previous commit.
Review URL: http://codereview.chromium.org/6614015
http://code.google.com/p/v8/source/detail?r=7042

Modified:
 /branches/bleeding_edge/src/arm/macro-assembler-arm.cc
 /branches/bleeding_edge/src/arm/macro-assembler-arm.h

=======================================
--- /branches/bleeding_edge/src/arm/macro-assembler-arm.cc Wed Mar 2 06:40:38 2011 +++ /branches/bleeding_edge/src/arm/macro-assembler-arm.cc Thu Mar 3 04:21:37 2011
@@ -1535,6 +1535,14 @@
   ldrb(type_reg, FieldMemOperand(map, Map::kInstanceTypeOffset));
   cmp(type_reg, Operand(type));
 }
+
+
+void MacroAssembler::CompareRoot(Register obj,
+                                 Heap::RootListIndex index) {
+  ASSERT(!obj.is(ip));
+  LoadRoot(ip, index);
+  cmp(obj, ip);
+}


 void MacroAssembler::CheckMap(Register obj,
@@ -2342,9 +2350,7 @@
 void MacroAssembler::AbortIfNotRootValue(Register src,
Heap::RootListIndex root_value_index,
                                          const char* message) {
-  ASSERT(!src.is(ip));
-  LoadRoot(ip, root_value_index);
-  cmp(src, ip);
+  CompareRoot(src, root_value_index);
   Assert(eq, message);
 }

=======================================
--- /branches/bleeding_edge/src/arm/macro-assembler-arm.h Wed Mar 2 01:31:42 2011 +++ /branches/bleeding_edge/src/arm/macro-assembler-arm.h Thu Mar 3 04:21:37 2011
@@ -577,6 +577,11 @@
                 bool is_heap_object);


+  // Compare the object in a register to a value from the root list.
+  // Uses the ip register as scratch.
+  void CompareRoot(Register obj, Heap::RootListIndex index);
+
+
   // Load and check the instance type of an object for being a string.
   // Loads the type into the second argument register.
   // Returns a condition that will be enabled if the object was a string.

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to