Improved handling of relocation information to enable more peep-hole optimizations.

Optimized switch statements where all labels are constant small integers.

Optimized String.prototype.indexOf for common cases.

Fixed more build issues (issue 80).

Fixed a couple of profiler issues.

Fixed bug where the body of a function created using the Function constructor was not allowed to end with a single-line comment (issue 85).

Improved handling of object literals by canonicalizing object literal maps.  This will allow JSON objects with the same set of properties to share the same map making inline caching work better for JSON objects.



git-svn-id: http://v8.googlecode.com/svn/trunk@373 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/objects-debug.cc b/src/objects-debug.cc
index dd656e0..d280153 100644
--- a/src/objects-debug.cc
+++ b/src/objects-debug.cc
@@ -118,6 +118,7 @@
       break;
     case JS_OBJECT_TYPE:  // fall through
     case JS_ARRAY_TYPE:
+    case JS_REGEXP_TYPE:
       JSObject::cast(this)->JSObjectPrint();
       break;
     case ODDBALL_TYPE:
@@ -206,6 +207,9 @@
     case JS_ARRAY_TYPE:
       JSArray::cast(this)->JSArrayVerify();
       break;
+    case JS_REGEXP_TYPE:
+      JSRegExp::cast(this)->JSRegExpVerify();
+      break;
     case FILLER_TYPE:
       break;
     case PROXY_TYPE:
@@ -375,6 +379,7 @@
     case JS_FUNCTION_TYPE: return "JS_FUNCTION";
     case CODE_TYPE: return "CODE";
     case JS_ARRAY_TYPE: return "JS_ARRAY";
+    case JS_REGEXP_TYPE: return "JS_REGEXP";
     case JS_VALUE_TYPE: return "JS_VALUE";
     case JS_GLOBAL_OBJECT_TYPE: return "JS_GLOBAL_OBJECT";
     case JS_BUILTINS_OBJECT_TYPE: return "JS_BUILTINS_OBJECT";
@@ -607,7 +612,7 @@
   for (RelocIterator it(this); !it.done(); it.next()) {
     it.rinfo()->Verify();
     // Ensure that GC will not iterate twice over the same pointer.
-    if (is_gc_reloc_mode(it.rinfo()->rmode())) {
+    if (RelocInfo::IsGCRelocMode(it.rinfo()->rmode())) {
       CHECK(it.rinfo()->pc() != last_gc_pc);
       last_gc_pc = it.rinfo()->pc();
     }
@@ -622,6 +627,13 @@
 }
 
 
+void JSRegExp::JSRegExpVerify() {
+  JSObjectVerify();
+  ASSERT(type()->IsSmi() || type()->IsUndefined());
+  ASSERT(data()->IsUndefined() || data()->IsFixedArray());
+}
+
+
 void Proxy::ProxyPrint() {
   PrintF("proxy to %p", proxy());
 }