Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(380)

Unified Diff: src/objects.cc

Issue 31933003: Make PropertyCell::UpdatedType return a handle. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects.h ('k') | src/stub-cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index aec412c5d8bc846dd0218defc99a09400ae75fc0..f82e92c904adcea112e05778334a7f036c5ee212 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<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);
}
}
« no previous file with comments | « src/objects.h ('k') | src/stub-cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698