Chromium Code Reviews| Index: src/objects.h |
| diff --git a/src/objects.h b/src/objects.h |
| index 4eb4539af116cb7715d60e15a8420a1822b4d0e0..0221109af02c43b484bf7973541f13efb45d83df 100644 |
| --- a/src/objects.h |
| +++ b/src/objects.h |
| @@ -863,8 +863,8 @@ enum CompareResult { |
| inline void set_##name(type* value, \ |
| WriteBarrierMode mode = UPDATE_WRITE_BARRIER); \ |
| - |
| class AccessorPair; |
| +class AllocationSiteContext; |
| class DictionaryElementsAccessor; |
| class ElementsAccessor; |
| class Failure; |
| @@ -872,6 +872,7 @@ class FixedArrayBase; |
| class ObjectVisitor; |
| class StringStream; |
| class Type; |
| +class AllocationSite; |
|
Hannes Payer (out of office)
2013/10/15 13:53:20
alphabetic order
|
| struct ValueInfo : public Malloced { |
| ValueInfo() : type(FIRST_TYPE), ptr(NULL), str(NULL), number(0) { } |
| @@ -2541,8 +2542,13 @@ class JSObject: public JSReceiver { |
| MUST_USE_RESULT MaybeObject* SetObserved(Isolate* isolate); |
| // Copy object. |
| + static Handle<JSObject> Copy(Handle<JSObject> object, |
| + Handle<AllocationSite> site); |
| static Handle<JSObject> Copy(Handle<JSObject> object); |
| - static Handle<JSObject> DeepCopy(Handle<JSObject> object); |
| + static Handle<JSObject> DeepCopy(Handle<JSObject> object, |
| + AllocationSiteContext* site_context); |
| + static Handle<JSObject> DeepWalk(Handle<JSObject> object, |
| + AllocationSiteContext* site_context); |
| // Casting. |
| static inline JSObject* cast(Object* obj); |
| @@ -7908,8 +7914,15 @@ class AllocationSite: public Struct { |
| inline void Initialize(); |
| + bool HasNestedSites() { |
| + return nested_site()->IsAllocationSite(); |
| + } |
| + |
| + // This method is expensive, it should only be called for reporting. |
| + bool IsNestedSite(); |
| + |
| ElementsKind GetElementsKind() { |
| - ASSERT(!IsLiteralSite()); |
| + ASSERT(!SitePointsToLiteral()); |
| return static_cast<ElementsKind>(Smi::cast(transition_info())->value()); |
| } |
| @@ -7917,11 +7930,11 @@ class AllocationSite: public Struct { |
| set_transition_info(Smi::FromInt(static_cast<int>(kind))); |
| } |
| - bool IsLiteralSite() { |
| + bool SitePointsToLiteral() { |
| // If transition_info is a smi, then it represents an ElementsKind |
| // for a constructed array. Otherwise, it must be a boilerplate |
| - // for an array literal |
| - return transition_info()->IsJSArray(); |
| + // for an object or array literal. |
| + return transition_info()->IsJSArray() || transition_info()->IsJSObject(); |
| } |
| DECLARE_PRINTER(AllocationSite) |