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

Unified Diff: src/factory.cc

Issue 1143813002: Reland "[strong] Object literals create strong objects" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix handlification bug Created 5 years, 7 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/factory.h ('k') | src/hydrogen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index e966e5ca949324294a70e7b4f3acc568790e0754..06373d2d8a39f62c0f98db6fd4978270f486f350 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -2339,14 +2339,18 @@ Handle<JSWeakMap> Factory::NewJSWeakMap() {
Handle<Map> Factory::ObjectLiteralMapFromCache(Handle<Context> context,
int number_of_properties,
+ bool is_strong,
bool* is_result_from_cache) {
const int kMapCacheSize = 128;
// We do not cache maps for too many properties or when running builtin code.
- if (number_of_properties > kMapCacheSize ||
+ // TODO(rossberg): cache strong maps properly
+ if (number_of_properties > kMapCacheSize || is_strong ||
isolate()->bootstrapper()->IsActive()) {
*is_result_from_cache = false;
- return Map::Create(isolate(), number_of_properties);
+ Handle<Map> map = Map::Create(isolate(), number_of_properties);
+ if (is_strong) map->set_is_strong(true);
+ return map;
}
*is_result_from_cache = true;
if (number_of_properties == 0) {
« no previous file with comments | « src/factory.h ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698