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
This commit is contained in:
mstarzinger@chromium.org 2013-10-22 08:24:35 +00:00
parent 06985eac89
commit b47dd2b58c
3 changed files with 10 additions and 12 deletions

View File

@ -16310,8 +16310,8 @@ void PropertyCell::set_type(Type* type, WriteBarrierMode ignored) {
}
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* PropertyCell::UpdatedType(Handle<PropertyCell> 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<PropertyCell> cell,
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);
}
}

View File

@ -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<PropertyCell> cell,
Handle<Object> value);
static Handle<Type> UpdatedType(Handle<PropertyCell> cell,
Handle<Object> value);
void AddDependentCompilationInfo(CompilationInfo* info);

View File

@ -267,8 +267,7 @@ Handle<Code> StubCache::ComputeStoreGlobal(Handle<Name> name,
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);