Revision: 20756
Author:   [email protected]
Date:     Tue Apr 15 10:14:50 2014 UTC
Log: Handlify AddDependentCode(), AddDependentCompilationInfo() and AddDependentIC().

[email protected]

Review URL: https://codereview.chromium.org/236193014
http://code.google.com/p/v8/source/detail?r=20756

Modified:
 /branches/bleeding_edge/src/hydrogen-instructions.cc
 /branches/bleeding_edge/src/hydrogen-instructions.h
 /branches/bleeding_edge/src/hydrogen.cc
 /branches/bleeding_edge/src/hydrogen.h
 /branches/bleeding_edge/src/ic.cc
 /branches/bleeding_edge/src/lithium-codegen.cc
 /branches/bleeding_edge/src/objects.cc
 /branches/bleeding_edge/src/objects.h

=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.cc Tue Apr 15 07:36:47 2014 UTC +++ /branches/bleeding_edge/src/hydrogen-instructions.cc Tue Apr 15 10:14:50 2014 UTC
@@ -3407,8 +3407,8 @@
     // TODO(titzer): collect dependent map checks into a list.
     check_map->omit_ = true;
     if (map->CanTransition()) {
-      map->AddDependentCompilationInfo(
-          DependentCode::kPrototypeCheckGroup, info);
+      Map::AddDependentCompilationInfo(
+          map, DependentCode::kPrototypeCheckGroup, info);
     }
   }
   return check_map;
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.h Tue Apr 15 07:36:47 2014 UTC +++ /branches/bleeding_edge/src/hydrogen-instructions.h Tue Apr 15 10:14:50 2014 UTC
@@ -6601,7 +6601,8 @@
     ASSERT(!has_transition());  // Only set once.
Handle<Map> map = Handle<Map>::cast(map_constant->handle(info->isolate()));
     if (map->CanBeDeprecated()) {
- map->AddDependentCompilationInfo(DependentCode::kTransitionGroup, info);
+      Map::AddDependentCompilationInfo(
+          map, DependentCode::kTransitionGroup, info);
     }
     SetOperandAt(2, map_constant);
     has_transition_ = true;
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc     Tue Apr 15 07:36:47 2014 UTC
+++ /branches/bleeding_edge/src/hydrogen.cc     Tue Apr 15 10:14:50 2014 UTC
@@ -4925,7 +4925,7 @@
         Handle<GlobalObject> global(current_info()->global_object());
         Handle<PropertyCell> cell(global->GetPropertyCell(&lookup));
         if (cell->type()->IsConstant()) {
-          cell->AddDependentCompilationInfo(top_info());
+          PropertyCell::AddDependentCompilationInfo(cell, top_info());
           Handle<Object> constant_object = cell->type()->AsConstant();
           if (constant_object->IsConsString()) {
             constant_object =
@@ -5552,11 +5552,12 @@
     Handle<Map> field_map = field_type->AsClass();
     if (field_map->is_stable()) {
       field_map_ = field_map;
-      field_map_->AddDependentCompilationInfo(
-          DependentCode::kPrototypeCheckGroup, top_info());
+      Map::AddDependentCompilationInfo(
+          field_map_, DependentCode::kPrototypeCheckGroup, top_info());

       // Add dependency on the map that introduced the field.
-      lookup_.GetFieldOwnerFromMap(*map)->AddDependentCompilationInfo(
+      Map::AddDependentCompilationInfo(
+          handle(lookup_.GetFieldOwnerFromMap(*map), isolate()),
           DependentCode::kFieldTypeGroup, top_info());
     }
   }
@@ -6826,16 +6827,16 @@
HInstruction* HGraphBuilder::BuildConstantMapCheck(Handle<JSObject> constant,
                                                    CompilationInfo* info) {
   HConstant* constant_value = New<HConstant>(constant);
+  Handle<Map> map(constant->map(), info->isolate());

   if (constant->map()->CanOmitMapChecks()) {
-    constant->map()->AddDependentCompilationInfo(
-        DependentCode::kPrototypeCheckGroup, info);
+    Map::AddDependentCompilationInfo(
+        map, DependentCode::kPrototypeCheckGroup, info);
     return constant_value;
   }

   AddInstruction(constant_value);
-  HCheckMaps* check =
-      Add<HCheckMaps>(constant_value, handle(constant->map()), info);
+  HCheckMaps* check = Add<HCheckMaps>(constant_value, map, info);
   check->ClearDependsOnFlag(kElementsKind);
   return check;
 }
=======================================
--- /branches/bleeding_edge/src/hydrogen.h      Tue Apr 15 07:36:47 2014 UTC
+++ /branches/bleeding_edge/src/hydrogen.h      Tue Apr 15 10:14:50 2014 UTC
@@ -438,9 +438,11 @@
   void MarkDependsOnEmptyArrayProtoElements() {
     // Add map dependency if not already added.
     if (depends_on_empty_array_proto_elements_) return;
- isolate()->initial_object_prototype()->map()->AddDependentCompilationInfo(
+    Map::AddDependentCompilationInfo(
+        handle(isolate()->initial_object_prototype()->map()),
         DependentCode::kElementsCantBeAddedGroup, info());
- isolate()->initial_array_prototype()->map()->AddDependentCompilationInfo(
+    Map::AddDependentCompilationInfo(
+        handle(isolate()->initial_array_prototype()->map()),
         DependentCode::kElementsCantBeAddedGroup, info());
     depends_on_empty_array_proto_elements_ = true;
   }
=======================================
--- /branches/bleeding_edge/src/ic.cc   Tue Apr 15 07:36:47 2014 UTC
+++ /branches/bleeding_edge/src/ic.cc   Tue Apr 15 10:14:50 2014 UTC
@@ -442,7 +442,7 @@
     MapHandleList maps;
     stub->FindAllMaps(&maps);
     if (maps.length() == 1 && stub->IsWeakObjectInIC(*maps.at(0))) {
-      maps.at(0)->AddDependentIC(stub);
+      Map::AddDependentIC(maps.at(0), stub);
       stub->mark_as_weak_stub();
       if (FLAG_enable_ool_constant_pool) {
         stub->constant_pool()->set_weak_object_state(
=======================================
--- /branches/bleeding_edge/src/lithium-codegen.cc Fri Apr 11 10:36:09 2014 UTC +++ /branches/bleeding_edge/src/lithium-codegen.cc Tue Apr 15 10:14:50 2014 UTC
@@ -211,7 +211,7 @@
   NoWeakObjectVerificationScope disable_verification_of_embedded_objects;
 #endif
   for (int i = 0; i < maps.length(); i++) {
-    maps.at(i)->AddDependentCode(DependentCode::kWeakCodeGroup, code);
+    Map::AddDependentCode(maps.at(i), DependentCode::kWeakCodeGroup, code);
   }
   for (int i = 0; i < objects.length(); i++) {
     AddWeakObjectToCodeDependency(isolate()->heap(), objects.at(i), code);
=======================================
--- /branches/bleeding_edge/src/objects.cc      Tue Apr 15 08:15:33 2014 UTC
+++ /branches/bleeding_edge/src/objects.cc      Tue Apr 15 10:14:50 2014 UTC
@@ -11689,35 +11689,41 @@
 }


-void Map::AddDependentCompilationInfo(DependentCode::DependencyGroup group,
+// static
+void Map::AddDependentCompilationInfo(Handle<Map> map,
+                                      DependentCode::DependencyGroup group,
                                       CompilationInfo* info) {
-  Handle<DependentCode> dep(dependent_code());
   Handle<DependentCode> codes =
-      DependentCode::Insert(dep, group, info->object_wrapper());
-  if (*codes != dependent_code()) set_dependent_code(*codes);
-  info->dependencies(group)->Add(Handle<HeapObject>(this), info->zone());
+      DependentCode::Insert(handle(map->dependent_code(), info->isolate()),
+                            group, info->object_wrapper());
+  if (*codes != map->dependent_code()) map->set_dependent_code(*codes);
+  info->dependencies(group)->Add(map, info->zone());
 }


-void Map::AddDependentCode(DependentCode::DependencyGroup group,
+// static
+void Map::AddDependentCode(Handle<Map> map,
+                           DependentCode::DependencyGroup group,
                            Handle<Code> code) {
   Handle<DependentCode> codes = DependentCode::Insert(
-      Handle<DependentCode>(dependent_code()), group, code);
-  if (*codes != dependent_code()) set_dependent_code(*codes);
+      Handle<DependentCode>(map->dependent_code()), group, code);
+  if (*codes != map->dependent_code()) map->set_dependent_code(*codes);
 }


-void Map::AddDependentIC(Handle<Code> stub) {
+// static
+void Map::AddDependentIC(Handle<Map> map,
+                         Handle<Code> stub) {
   ASSERT(stub->next_code_link()->IsUndefined());
-  int n = dependent_code()->number_of_entries(DependentCode::kWeakICGroup);
+ int n = map->dependent_code()->number_of_entries(DependentCode::kWeakICGroup);
   if (n == 0) {
// Slow path: insert the head of the list with possible heap allocation.
-    AddDependentCode(DependentCode::kWeakICGroup, stub);
+    Map::AddDependentCode(map, DependentCode::kWeakICGroup, stub);
   } else {
// Fast path: link the stub to the existing head of the list without any
     // heap allocation.
     ASSERT(n == 1);
-    dependent_code()->AddToDependentICList(stub);
+    map->dependent_code()->AddToDependentICList(stub);
   }
 }

@@ -16604,14 +16610,16 @@
 }


-void PropertyCell::AddDependentCompilationInfo(CompilationInfo* info) {
-  Handle<DependentCode> dep(dependent_code());
+// static
+void PropertyCell::AddDependentCompilationInfo(Handle<PropertyCell> cell,
+                                               CompilationInfo* info) {
   Handle<DependentCode> codes =
-      DependentCode::Insert(dep, DependentCode::kPropertyCellChangedGroup,
+ DependentCode::Insert(handle(cell->dependent_code(), info->isolate()),
+                            DependentCode::kPropertyCellChangedGroup,
                             info->object_wrapper());
-  if (*codes != dependent_code()) set_dependent_code(*codes);
+  if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes);
   info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add(
-      Handle<HeapObject>(this), info->zone());
+      cell, info->zone());
 }


=======================================
--- /branches/bleeding_edge/src/objects.h       Tue Apr 15 08:59:51 2014 UTC
+++ /branches/bleeding_edge/src/objects.h       Tue Apr 15 10:14:50 2014 UTC
@@ -6558,12 +6558,15 @@

   inline bool CanOmitMapChecks();

-  void AddDependentCompilationInfo(DependentCode::DependencyGroup group,
-                                   CompilationInfo* info);
+  static void AddDependentCompilationInfo(Handle<Map> map,
+ DependentCode::DependencyGroup group,
+                                          CompilationInfo* info);

-  void AddDependentCode(DependentCode::DependencyGroup group,
-                        Handle<Code> code);
-  void AddDependentIC(Handle<Code> stub);
+  static void AddDependentCode(Handle<Map> map,
+                               DependentCode::DependencyGroup group,
+                               Handle<Code> code);
+  static void AddDependentIC(Handle<Map> map,
+                             Handle<Code> stub);

   bool IsMapInArrayPrototypeChain();

@@ -9806,9 +9809,8 @@
   static Handle<HeapType> UpdatedType(Handle<PropertyCell> cell,
                                       Handle<Object> value);

-  void AddDependentCompilationInfo(CompilationInfo* info);
-
-  void AddDependentCode(Handle<Code> code);
+  static void AddDependentCompilationInfo(Handle<PropertyCell> cell,
+                                          CompilationInfo* info);

   // Casting.
   static inline PropertyCell* cast(Object* obj);

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to