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

Side by Side Diff: src/factory.cc

Issue 893073006: Add map-based read barrier to WeakCell Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix merge Created 5 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 unified diff | Download patch
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/heap/heap.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/factory.h" 5 #include "src/factory.h"
6 6
7 #include "src/allocation-site-scopes.h" 7 #include "src/allocation-site-scopes.h"
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/conversions.h" 9 #include "src/conversions.h"
10 #include "src/isolate-inl.h" 10 #include "src/isolate-inl.h"
(...skipping 2256 matching lines...) Expand 10 before | Expand all | Expand 10 after
2267 Handle<FixedArray> new_cache = NewFixedArray(kMapCacheSize, TENURED); 2267 Handle<FixedArray> new_cache = NewFixedArray(kMapCacheSize, TENURED);
2268 context->set_map_cache(*new_cache); 2268 context->set_map_cache(*new_cache);
2269 } 2269 }
2270 // Check to see whether there is a matching element in the cache. 2270 // Check to see whether there is a matching element in the cache.
2271 Handle<FixedArray> cache(FixedArray::cast(context->map_cache())); 2271 Handle<FixedArray> cache(FixedArray::cast(context->map_cache()));
2272 { 2272 {
2273 Object* result = cache->get(cache_index); 2273 Object* result = cache->get(cache_index);
2274 if (result->IsWeakCell()) { 2274 if (result->IsWeakCell()) {
2275 WeakCell* cell = WeakCell::cast(result); 2275 WeakCell* cell = WeakCell::cast(result);
2276 if (!cell->cleared()) { 2276 if (!cell->cleared()) {
2277 return handle(Map::cast(cell->value()), isolate()); 2277 return handle(Map::cast(cell->value(isolate()->heap())), isolate());
2278 } 2278 }
2279 } 2279 }
2280 } 2280 }
2281 // Create a new map and add it to the cache. 2281 // Create a new map and add it to the cache.
2282 Handle<Map> map = Map::Create(isolate(), number_of_properties); 2282 Handle<Map> map = Map::Create(isolate(), number_of_properties);
2283 Handle<WeakCell> cell = NewWeakCell(map); 2283 Handle<WeakCell> cell = NewWeakCell(map);
2284 cache->set(cache_index, *cell); 2284 cache->set(cache_index, *cell);
2285 return map; 2285 return map;
2286 } 2286 }
2287 2287
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
2329 return Handle<Object>::null(); 2329 return Handle<Object>::null();
2330 } 2330 }
2331 2331
2332 2332
2333 Handle<Object> Factory::ToBoolean(bool value) { 2333 Handle<Object> Factory::ToBoolean(bool value) {
2334 return value ? true_value() : false_value(); 2334 return value ? true_value() : false_value();
2335 } 2335 }
2336 2336
2337 2337
2338 } } // namespace v8::internal 2338 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/heap/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698