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/spaces.cc b/src/spaces.cc
index e8f460c..d1aaceb 100644
--- a/src/spaces.cc
+++ b/src/spaces.cc
@@ -1706,7 +1706,7 @@
 // with ']'.  RelocIterator 'it' must point to a comment reloc info.
 static void CollectCommentStatistics(RelocIterator* it) {
   ASSERT(!it->done());
-  ASSERT(it->rinfo()->rmode() == comment);
+  ASSERT(it->rinfo()->rmode() == RelocInfo::COMMENT);
   const char* tmp = reinterpret_cast<const char*>(it->rinfo()->data());
   if (tmp[0] != '[') {
     // Not a nested comment; skip
@@ -1723,7 +1723,7 @@
     // All nested comments must be terminated properly, and therefore exit
     // from loop.
     ASSERT(!it->done());
-    if (it->rinfo()->rmode() == comment) {
+    if (it->rinfo()->rmode() == RelocInfo::COMMENT) {
       const char* const txt =
           reinterpret_cast<const char*>(it->rinfo()->data());
       flat_delta += it->rinfo()->pc() - prev_pc;
@@ -1753,7 +1753,7 @@
       int delta = 0;
       const byte* prev_pc = code->instruction_start();
       while (!it.done()) {
-        if (it.rinfo()->rmode() == comment) {
+        if (it.rinfo()->rmode() == RelocInfo::COMMENT) {
           delta += it.rinfo()->pc() - prev_pc;
           CollectCommentStatistics(&it);
           prev_pc = it.rinfo()->pc();