From b47dd2b58cc5549c910e472e5e4fc253a07cc8e3 Mon Sep 17 00:00:00 2001 From: "mstarzinger@chromium.org" Date: Tue, 22 Oct 2013 08:24:35 +0000 Subject: [PATCH] Make PropertyCell::UpdatedType return a handle. R=rossberg@chromium.org Review URL: https://codereview.chromium.org/31933003 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17312 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/objects.cc | 14 +++++++------- src/objects.h | 5 ++--- src/stub-cache.cc | 3 +-- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/objects.cc b/src/objects.cc index aec412c..f82e92c 100644 --- a/src/objects.cc +++ b/src/objects.cc @@ -16310,8 +16310,8 @@ void PropertyCell::set_type(Type* type, WriteBarrierMode ignored) { } -Type* PropertyCell::UpdatedType(Handle cell, - Handle value) { +Handle PropertyCell::UpdatedType(Handle cell, + Handle value) { Isolate* isolate = cell->GetIsolate(); Handle old_type(cell->type(), isolate); // TODO(2803): Do not track ConsString as constant because they cannot be @@ -16321,17 +16321,17 @@ Type* PropertyCell::UpdatedType(Handle cell, : 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 @@ void PropertyCell::SetValueInferType(Handle cell, Handle value) { cell->set_value(*value); if (!Type::Any()->Is(cell->type())) { - Type* new_type = UpdatedType(cell, value); - cell->set_type(new_type); + Handle new_type = UpdatedType(cell, value); + cell->set_type(*new_type); } } diff --git a/src/objects.h b/src/objects.h index 165261b..4d633f8 100644 --- a/src/objects.h +++ b/src/objects.h @@ -9197,9 +9197,8 @@ class PropertyCell: public Cell { // 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 cell, - Handle value); + static Handle UpdatedType(Handle cell, + Handle value); void AddDependentCompilationInfo(CompilationInfo* info); diff --git a/src/stub-cache.cc b/src/stub-cache.cc index bac274c..67002a3 100644 --- a/src/stub-cache.cc +++ b/src/stub-cache.cc @@ -267,8 +267,7 @@ Handle StubCache::ComputeStoreGlobal(Handle name, Handle cell, Handle value, StrictModeFlag strict_mode) { - Isolate* isolate = cell->GetIsolate(); - Handle union_type(PropertyCell::UpdatedType(cell, value), isolate); + Handle union_type = PropertyCell::UpdatedType(cell, value); bool is_constant = union_type->IsConstant(); StoreGlobalStub stub(strict_mode, is_constant); -- 2.7.4