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

Unified Diff: src/objects.h

Issue 24250005: AllocationSites for all literals (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE 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
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 4eb4539af116cb7715d60e15a8420a1822b4d0e0..861023448c3ba44581d7235163eeb799db5a8a88 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -2032,6 +2032,8 @@ class JSReceiver: public HeapObject {
DISALLOW_IMPLICIT_CONSTRUCTORS(JSReceiver);
};
+class AllocationSiteContext;
+
// The JSObject describes real heap allocated JavaScript objects with
// properties.
// Note that the map of JSObject changes during execution to enable inline
@@ -2541,8 +2543,13 @@ class JSObject: public JSReceiver {
MUST_USE_RESULT MaybeObject* SetObserved(Isolate* isolate);
// Copy object.
+ static Handle<JSObject> Copy(Handle<JSObject> object,
+ AllocationSiteContext* site_context);
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,6 +7915,13 @@ 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());
return static_cast<ElementsKind>(Smi::cast(transition_info())->value());
@@ -7921,7 +7935,7 @@ class AllocationSite: public Struct {
// 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();
+ return transition_info()->IsJSArray() || transition_info()->IsJSObject();
}
DECLARE_PRINTER(AllocationSite)
« src/allocation-site-scopes.cc ('K') | « src/hydrogen.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698