Revision: 17312
Author:   [email protected]
Date:     Tue Oct 22 08:24:35 2013 UTC
Log:      Make PropertyCell::UpdatedType return a handle.

[email protected]

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

Modified:
 /branches/bleeding_edge/src/objects.cc
 /branches/bleeding_edge/src/objects.h
 /branches/bleeding_edge/src/stub-cache.cc

=======================================
--- /branches/bleeding_edge/src/objects.cc      Mon Oct 21 13:55:24 2013 UTC
+++ /branches/bleeding_edge/src/objects.cc      Tue Oct 22 08:24:35 2013 UTC
@@ -16310,8 +16310,8 @@
 }


-Type* PropertyCell::UpdatedType(Handle<PropertyCell> cell,
-                                Handle<Object> value) {
+Handle<Type> PropertyCell::UpdatedType(Handle<PropertyCell> cell,
+                                       Handle<Object> value) {
   Isolate* isolate = cell->GetIsolate();
   Handle<Type> old_type(cell->type(), isolate);
   // TODO(2803): Do not track ConsString as constant because they cannot be
@@ -16321,17 +16321,17 @@
                         : Type::Constant(value, isolate), isolate);

   if (new_type->Is(old_type)) {
-    return *old_type;
+    return old_type;
   }

   cell->dependent_code()->DeoptimizeDependentCodeGroup(
       isolate, DependentCode::kPropertyCellChangedGroup);

   if (old_type->Is(Type::None()) || old_type->Is(Type::Undefined())) {
-    return *new_type;
+    return new_type;
   }

-  return Type::Any();
+  return handle(Type::Any(), isolate);
 }


@@ -16339,8 +16339,8 @@
                                      Handle<Object> value) {
   cell->set_value(*value);
   if (!Type::Any()->Is(cell->type())) {
-    Type* new_type = UpdatedType(cell, value);
-    cell->set_type(new_type);
+    Handle<Type> new_type = UpdatedType(cell, value);
+    cell->set_type(*new_type);
   }
 }

=======================================
--- /branches/bleeding_edge/src/objects.h       Mon Oct 21 13:55:24 2013 UTC
+++ /branches/bleeding_edge/src/objects.h       Tue Oct 22 08:24:35 2013 UTC
@@ -9197,9 +9197,8 @@

   // Computes the new type of the cell's contents for the given value, but
   // without actually modifying the 'type' field.
-  // TODO(mstarzinger): Return value should be handlified.
-  static Type* UpdatedType(Handle<PropertyCell> cell,
-                           Handle<Object> value);
+  static Handle<Type> UpdatedType(Handle<PropertyCell> cell,
+                                  Handle<Object> value);

   void AddDependentCompilationInfo(CompilationInfo* info);

=======================================
--- /branches/bleeding_edge/src/stub-cache.cc   Mon Oct 21 13:55:24 2013 UTC
+++ /branches/bleeding_edge/src/stub-cache.cc   Tue Oct 22 08:24:35 2013 UTC
@@ -267,8 +267,7 @@
                                            Handle<PropertyCell> cell,
                                            Handle<Object> value,
                                            StrictModeFlag strict_mode) {
-  Isolate* isolate = cell->GetIsolate();
-  Handle<Type> union_type(PropertyCell::UpdatedType(cell, value), isolate);
+  Handle<Type> union_type = PropertyCell::UpdatedType(cell, value);
   bool is_constant = union_type->IsConstant();
   StoreGlobalStub stub(strict_mode, is_constant);

--
--
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/groups/opt_out.

Reply via email to