Chromium Code Reviews| Index: src/objects-inl.h |
| diff --git a/src/objects-inl.h b/src/objects-inl.h |
| index 700ae041cea4708833a419ec159145b042dd7ef2..3ff5e4402bd6f76cfd5b9260a67c214d579725be 100644 |
| --- a/src/objects-inl.h |
| +++ b/src/objects-inl.h |
| @@ -1529,20 +1529,36 @@ int HeapObject::Size() { |
| } |
| -bool HeapObject::MayContainRawValues() { |
| +HeapObjectContents HeapObject::ContentType() { |
| InstanceType type = map()->instance_type(); |
| if (type <= LAST_NAME_TYPE) { |
| if (type == SYMBOL_TYPE) { |
| - return false; |
| + return HeapObjectContents::kTaggedValues; |
| } |
| DCHECK(type < FIRST_NONSTRING_TYPE); |
| // There are four string representations: sequential strings, external |
| // strings, cons strings, and sliced strings. |
| // Only the former two contain raw values and no heap pointers (besides the |
| // map-word). |
| - return ((type & kIsIndirectStringMask) != kIsIndirectStringTag); |
| + if (((type & kIsIndirectStringMask) != kIsIndirectStringTag)) |
| + return HeapObjectContents::kRawValues; |
| + else |
| + return HeapObjectContents::kTaggedValues; |
| +#if 0 |
| + // TODO(jochen): Enable eventually. |
| + } else if (type == JS_FUNCTION_TYPE) { |
| + return HeapObjectContents::kMixedValues; |
| +#endif |
| + } else if (type <= LAST_DATA_TYPE) { |
| + // TODO(jochen): Why do we claim that Code and Map contain only raw values? |
|
Igor Sheludko
2015/06/08 10:45:12
I guess because we never called MayContainRawValue
jochen (gone - plz use gerrit)
2015/06/08 11:04:58
I'd rather keep this patch as refactoring only, we
|
| + return HeapObjectContents::kRawValues; |
| + } else { |
| +#if V8_DOUBLE_FIELDS_UNBOXING |
|
Igor Sheludko
2015/06/08 10:45:12
I think it is better to use "if (FLAG_unbox_double
|
| + LayoutDescriptorHelper helper(map()); |
| + if (!helper.all_fields_tagged()) return HeapObjectContents::kMixedValues; |
| +#endif |
| + return HeapObjectContents::kTaggedValues; |
| } |
| - return (type <= LAST_DATA_TYPE); |
| } |