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

Unified Diff: src/api-natives.cc

Issue 1753643002: [api] Use shallow copy for the template instantiation cache (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 4 years, 10 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/api.cc ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api-natives.cc
diff --git a/src/api-natives.cc b/src/api-natives.cc
index d2cb49e33de40b1b287574cc0824b331082e1327..d2cacbdaf8de16a881cf5cee8dc2c789b3eff8c0 100644
--- a/src/api-natives.cc
+++ b/src/api-natives.cc
@@ -300,9 +300,7 @@ MaybeHandle<JSObject> InstantiateObject(Isolate* isolate,
if (entry != UnseededNumberDictionary::kNotFound) {
Object* boilerplate = cache->ValueAt(entry);
result = handle(JSObject::cast(boilerplate), isolate);
- ASSIGN_RETURN_ON_EXCEPTION(
- isolate, result, JSObject::DeepCopyApiBoilerplate(result), JSObject);
- return result;
+ return isolate->factory()->CopyJSObject(result);
}
}
// Enter a new scope. Recursion could otherwise create a lot of handles.
@@ -326,8 +324,7 @@ MaybeHandle<JSObject> InstantiateObject(Isolate* isolate,
if (serial_number) {
CacheTemplateInstantiation(isolate, serial_number, result);
- ASSIGN_RETURN_ON_EXCEPTION(
- isolate, result, JSObject::DeepCopyApiBoilerplate(result), JSObject);
+ result = isolate->factory()->CopyJSObject(result);
}
return scope.CloseAndEscape(result);
}
« no previous file with comments | « src/api.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698