Added support for running tests on the ARM simulator.

Fixed bug in the 'in' operator where negative indices were not treated correctly.

Fixed build issues on gcc-4.3.1.

Changed Date.prototype.toLocaleTimeString to not print the timezone part of the time.

Renamed debug.h to v8-debug.h to reduce the risk of name conflicts with user code.


git-svn-id: http://v8.googlecode.com/svn/trunk@138 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/codegen-arm.cc b/src/codegen-arm.cc
index 4ada0ad..c4d3f38 100644
--- a/src/codegen-arm.cc
+++ b/src/codegen-arm.cc
@@ -285,6 +285,7 @@
   virtual void GenerateSquashFrame(ZoneList<Expression*>* args);
   virtual void GenerateExpandFrame(ZoneList<Expression*>* args);
   virtual void GenerateIsSmi(ZoneList<Expression*>* args);
+  virtual void GenerateIsNonNegativeSmi(ZoneList<Expression*>* args);
   virtual void GenerateIsArray(ZoneList<Expression*>* args);
 
   virtual void GenerateArgumentsLength(ZoneList<Expression*>* args);
@@ -901,18 +902,17 @@
   // Check that the object isn't a smi.
   __ tst(r1, Operand(kSmiTagMask));
   __ b(eq, &slow);
-  // Check that the object is some kind of JS object.
+
+  // Check that the object is some kind of JS object EXCEPT JS Value type.
+  // In the case that the object is a value-wrapper object,
+  // we enter the runtime system to make sure that indexing into string
+  // objects work as intended.
+  ASSERT(JS_OBJECT_TYPE > JS_VALUE_TYPE);
   __ ldr(r2, FieldMemOperand(r1, HeapObject::kMapOffset));
   __ ldrb(r2, FieldMemOperand(r2, Map::kInstanceTypeOffset));
   __ cmp(r2, Operand(JS_OBJECT_TYPE));
   __ b(lt, &slow);
 
-  // Check if the object is a value-wrapper object. In that case we
-  // enter the runtime system to make sure that indexing into string
-  // objects work as intended.
-  __ cmp(r2, Operand(JS_VALUE_TYPE));
-  __ b(eq, &slow);
-
   // Get the elements array of the object.
   __ ldr(r1, FieldMemOperand(r1, JSObject::kElementsOffset));
   // Check that the object is in fast mode (not dictionary).
@@ -979,7 +979,7 @@
   __ cmp(r2, Operand(JS_ARRAY_TYPE));
   __ b(eq, &array);
   // Check that the object is some kind of JS object.
-  __ cmp(r2, Operand(JS_OBJECT_TYPE));
+  __ cmp(r2, Operand(FIRST_JS_OBJECT_TYPE));
   __ b(lt, &slow);
 
 
@@ -2692,7 +2692,7 @@
   __ b(eq, &primitive);
   __ ldr(r1, FieldMemOperand(r0, HeapObject::kMapOffset));
   __ ldrb(r1, FieldMemOperand(r1, Map::kInstanceTypeOffset));
-  __ cmp(r1, Operand(JS_OBJECT_TYPE));
+  __ cmp(r1, Operand(FIRST_JS_OBJECT_TYPE));
   __ b(hs, &jsobject);
 
   __ bind(&primitive);
@@ -3238,6 +3238,7 @@
         // r2 may be loaded with context; used below in RecordWrite.
         __ pop(r0);
         __ str(r0, SlotOperand(node, r2));
+        __ push(r0);
         if (node->type() == Slot::CONTEXT) {
           // Skip write barrier if the written value is a smi.
           Label exit;
@@ -3249,7 +3250,6 @@
           __ RecordWrite(r2, r3, r1);
           __ bind(&exit);
         }
-        __ push(r0);
         break;
       }
     }
@@ -3939,6 +3939,16 @@
 }
 
 
+void ArmCodeGenerator::GenerateIsNonNegativeSmi(ZoneList<Expression*>* args) {
+  ASSERT(args->length() == 1);
+  Load(args->at(0));
+  __ pop(r0);
+  __ tst(r0, Operand(kSmiTagMask | 0x80000000));
+  cc_reg_ = eq;
+}
+
+
+
 // This should generate code that performs a charCodeAt() call or returns
 // undefined in order to trigger the slow case, Runtime_StringCharCodeAt.
 // It is not yet implemented on ARM, so it always goes to the slow case.