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

Unified Diff: src/objects.cc

Issue 238113003: Use a wrapper for copying object. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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') | no next file » | 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 5a1daa2fc201301b311fc25f3ae28bcbf5784075..f43f76d9225f7b535401a013492a1bb32d9b7364 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -5824,10 +5824,22 @@ void JSObject::SetObserved(Handle<JSObject> object) {
}
+Handle<JSObject> JSObject::Copy(Handle<JSObject> object,
+ Handle<AllocationSite> site) {
+ Isolate* isolate = object->GetIsolate();
+ CALL_HEAP_FUNCTION(isolate,
+ isolate->heap()->CopyJSObject(
+ *object,
+ site.is_null() ? NULL : *site),
+ JSObject);
+}
+
+
Handle<JSObject> JSObject::Copy(Handle<JSObject> object) {
Isolate* isolate = object->GetIsolate();
CALL_HEAP_FUNCTION(isolate,
- isolate->heap()->CopyJSObject(*object), JSObject);
+ isolate->heap()->CopyJSObject(*object, NULL),
+ JSObject);
}
@@ -5898,14 +5910,7 @@ Handle<JSObject> JSObjectWalkVisitor<ContextObject>::StructureWalk(
if (site_context()->ShouldCreateMemento(object)) {
site_to_pass = site_context()->current();
}
- CALL_AND_RETRY_OR_DIE(isolate,
- isolate->heap()->CopyJSObject(*object,
- site_to_pass.is_null() ? NULL : *site_to_pass),
- { copy = Handle<JSObject>(JSObject::cast(__object__),
- isolate);
- break;
- },
- return Handle<JSObject>());
+ copy = JSObject::Copy(object, site_to_pass);
} else {
copy = object;
}
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698