Reviewers: fschneider,

Description:
Add new ARM macro assembler function CompareRoot left out of previous commit.

Please review this at http://codereview.chromium.org/6614015/

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
  M     src/arm/macro-assembler-arm.h
  M     src/arm/macro-assembler-arm.cc


Index: src/arm/macro-assembler-arm.cc
===================================================================
--- src/arm/macro-assembler-arm.cc      (revision 7041)
+++ src/arm/macro-assembler-arm.cc      (working copy)
@@ -1537,6 +1537,14 @@
 }


+void MacroAssembler::CompareRoot(Register obj,
+                                 Heap::RootListIndex index) {
+  ASSERT(!obj.is(ip));
+  LoadRoot(ip, index);
+  cmp(obj, ip);
+}
+
+
 void MacroAssembler::CheckMap(Register obj,
                               Register scratch,
                               Handle<Map> map,
@@ -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);
 }

Index: src/arm/macro-assembler-arm.h
===================================================================
--- src/arm/macro-assembler-arm.h       (revision 7041)
+++ src/arm/macro-assembler-arm.h       (working copy)
@@ -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