Version 3.23.12

Performance and stability improvements on all platforms.

git-svn-id: http://v8.googlecode.com/svn/trunk@18076 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/allocation-site-scopes.h b/src/allocation-site-scopes.h
index 1c3afdf..f106c5e 100644
--- a/src/allocation-site-scopes.h
+++ b/src/allocation-site-scopes.h
@@ -45,7 +45,6 @@
     isolate_ = isolate;
     activated_ = activated;
   };
-  virtual ~AllocationSiteContext() {}
 
   Handle<AllocationSite> top() { return top_; }
   Handle<AllocationSite> current() { return current_; }
@@ -53,19 +52,13 @@
   // If activated, then recursively create mementos
   bool activated() const { return activated_; }
 
-  // Returns the AllocationSite that matches this scope.
-  virtual Handle<AllocationSite> EnterNewScope() = 0;
-
-  // scope_site should be the handle returned by the matching EnterNewScope()
-  virtual void ExitScope(Handle<AllocationSite> scope_site,
-                         Handle<JSObject> object) = 0;
+  Isolate* isolate() { return isolate_; }
 
  protected:
   void update_current_site(AllocationSite* site) {
     *(current_.location()) = site;
   }
 
-  Isolate* isolate() { return isolate_; }
   void InitializeTraversal(Handle<AllocationSite> site) {
     top_ = site;
     current_ = Handle<AllocationSite>(*top_, isolate());
@@ -86,9 +79,8 @@
   explicit AllocationSiteCreationContext(Isolate* isolate)
       : AllocationSiteContext(isolate, true) { }
 
-  virtual Handle<AllocationSite> EnterNewScope() V8_OVERRIDE;
-  virtual void ExitScope(Handle<AllocationSite> site,
-                         Handle<JSObject> object) V8_OVERRIDE;
+  Handle<AllocationSite> EnterNewScope();
+  void ExitScope(Handle<AllocationSite> site, Handle<JSObject> object);
 };
 
 
@@ -101,9 +93,25 @@
       : AllocationSiteContext(isolate, activated),
         top_site_(site) { }
 
-  virtual Handle<AllocationSite> EnterNewScope() V8_OVERRIDE;
-  virtual void ExitScope(Handle<AllocationSite> site,
-                         Handle<JSObject> object) V8_OVERRIDE;
+  inline Handle<AllocationSite> EnterNewScope() {
+    if (top().is_null()) {
+      InitializeTraversal(top_site_);
+    } else {
+      // Advance current site
+      Object* nested_site = current()->nested_site();
+      // Something is wrong if we advance to the end of the list here.
+      ASSERT(nested_site->IsAllocationSite());
+      update_current_site(AllocationSite::cast(nested_site));
+    }
+    return Handle<AllocationSite>(*current(), isolate());
+  }
+
+  inline void ExitScope(Handle<AllocationSite> scope_site,
+                        Handle<JSObject> object) {
+    // This assert ensures that we are pointing at the right sub-object in a
+    // recursive walk of a nested literal.
+    ASSERT(object.is_null() || *object == scope_site->transition_info());
+  }
 
  private:
   Handle<AllocationSite> top_site_;