}
-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
: 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);
}
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);
}
}
// 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);
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);