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

Side by Side Diff: src/heap/heap.cc

Issue 1409123003: [runtime] Avoid @@isConcatSpreadable lookup for fast path Array.prototype.concat (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: merging with master Created 4 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 unified diff | Download patch
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/incremental-marking.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/heap/heap.h" 5 #include "src/heap/heap.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/ast/scopeinfo.h" 9 #include "src/ast/scopeinfo.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 1202 matching lines...) Expand 10 before | Expand all | Expand 10 after
1213 1213
1214 Object* context = native_contexts_list(); 1214 Object* context = native_contexts_list();
1215 while (!context->IsUndefined()) { 1215 while (!context->IsUndefined()) {
1216 // GC can happen when the context is not fully initialized, 1216 // GC can happen when the context is not fully initialized,
1217 // so the cache can be undefined. 1217 // so the cache can be undefined.
1218 Object* cache = 1218 Object* cache =
1219 Context::cast(context)->get(Context::NORMALIZED_MAP_CACHE_INDEX); 1219 Context::cast(context)->get(Context::NORMALIZED_MAP_CACHE_INDEX);
1220 if (!cache->IsUndefined()) { 1220 if (!cache->IsUndefined()) {
1221 NormalizedMapCache::cast(cache)->Clear(); 1221 NormalizedMapCache::cast(cache)->Clear();
1222 } 1222 }
1223 context = Context::cast(context)->get(Context::NEXT_CONTEXT_LINK); 1223 context = Context::cast(context)->next_context_link();
1224 } 1224 }
1225 } 1225 }
1226 1226
1227 1227
1228 void Heap::UpdateSurvivalStatistics(int start_new_space_size) { 1228 void Heap::UpdateSurvivalStatistics(int start_new_space_size) {
1229 if (start_new_space_size == 0) return; 1229 if (start_new_space_size == 0) return;
1230 1230
1231 promotion_ratio_ = (static_cast<double>(promoted_objects_size_) / 1231 promotion_ratio_ = (static_cast<double>(promoted_objects_size_) /
1232 static_cast<double>(start_new_space_size) * 100); 1232 static_cast<double>(start_new_space_size) * 100);
1233 1233
(...skipping 1595 matching lines...) Expand 10 before | Expand all | Expand 10 after
2829 set_empty_script(*script); 2829 set_empty_script(*script);
2830 2830
2831 Handle<PropertyCell> cell = factory->NewPropertyCell(); 2831 Handle<PropertyCell> cell = factory->NewPropertyCell();
2832 cell->set_value(Smi::FromInt(Isolate::kArrayProtectorValid)); 2832 cell->set_value(Smi::FromInt(Isolate::kArrayProtectorValid));
2833 set_array_protector(*cell); 2833 set_array_protector(*cell);
2834 2834
2835 cell = factory->NewPropertyCell(); 2835 cell = factory->NewPropertyCell();
2836 cell->set_value(the_hole_value()); 2836 cell->set_value(the_hole_value());
2837 set_empty_property_cell(*cell); 2837 set_empty_property_cell(*cell);
2838 2838
2839 Handle<PropertyCell> species_cell = factory->NewPropertyCell(); 2839 Handle<Cell> is_concat_spreadable_cell = factory->NewCell(
2840 species_cell->set_value(Smi::FromInt(Isolate::kArrayProtectorValid)); 2840 handle(Smi::FromInt(Isolate::kArrayProtectorValid), isolate()));
2841 set_is_concat_spreadable_protector(*is_concat_spreadable_cell);
2842
2843 Handle<Cell> species_cell = factory->NewCell(
2844 handle(Smi::FromInt(Isolate::kArrayProtectorValid), isolate()));
2841 set_species_protector(*species_cell); 2845 set_species_protector(*species_cell);
2842 2846
2843 set_weak_stack_trace_list(Smi::FromInt(0)); 2847 set_weak_stack_trace_list(Smi::FromInt(0));
2844 2848
2845 set_noscript_shared_function_infos(Smi::FromInt(0)); 2849 set_noscript_shared_function_infos(Smi::FromInt(0));
2846 2850
2847 // Initialize keyed lookup cache. 2851 // Initialize keyed lookup cache.
2848 isolate_->keyed_lookup_cache()->Clear(); 2852 isolate_->keyed_lookup_cache()->Clear();
2849 2853
2850 // Initialize context slot cache. 2854 // Initialize context slot cache.
(...skipping 3496 matching lines...) Expand 10 before | Expand all | Expand 10 after
6347 } 6351 }
6348 6352
6349 6353
6350 // static 6354 // static
6351 int Heap::GetStaticVisitorIdForMap(Map* map) { 6355 int Heap::GetStaticVisitorIdForMap(Map* map) {
6352 return StaticVisitorBase::GetVisitorId(map); 6356 return StaticVisitorBase::GetVisitorId(map);
6353 } 6357 }
6354 6358
6355 } // namespace internal 6359 } // namespace internal
6356 } // namespace v8 6360 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/incremental-marking.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698