| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |