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

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: adding more tests Created 4 years, 8 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
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 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after
1230 1230
1231 Object* context = native_contexts_list(); 1231 Object* context = native_contexts_list();
1232 while (!context->IsUndefined()) { 1232 while (!context->IsUndefined()) {
1233 // GC can happen when the context is not fully initialized, 1233 // GC can happen when the context is not fully initialized,
1234 // so the cache can be undefined. 1234 // so the cache can be undefined.
1235 Object* cache = 1235 Object* cache =
1236 Context::cast(context)->get(Context::NORMALIZED_MAP_CACHE_INDEX); 1236 Context::cast(context)->get(Context::NORMALIZED_MAP_CACHE_INDEX);
1237 if (!cache->IsUndefined()) { 1237 if (!cache->IsUndefined()) {
1238 NormalizedMapCache::cast(cache)->Clear(); 1238 NormalizedMapCache::cast(cache)->Clear();
1239 } 1239 }
1240 context = Context::cast(context)->get(Context::NEXT_CONTEXT_LINK); 1240 context = Context::cast(context)->next_context_link();
1241 } 1241 }
1242 } 1242 }
1243 1243
1244 1244
1245 void Heap::UpdateSurvivalStatistics(int start_new_space_size) { 1245 void Heap::UpdateSurvivalStatistics(int start_new_space_size) {
1246 if (start_new_space_size == 0) return; 1246 if (start_new_space_size == 0) return;
1247 1247
1248 promotion_ratio_ = (static_cast<double>(promoted_objects_size_) / 1248 promotion_ratio_ = (static_cast<double>(promoted_objects_size_) /
1249 static_cast<double>(start_new_space_size) * 100); 1249 static_cast<double>(start_new_space_size) * 100);
1250 1250
(...skipping 1652 matching lines...) Expand 10 before | Expand all | Expand 10 after
2903 set_empty_script(*script); 2903 set_empty_script(*script);
2904 2904
2905 Handle<PropertyCell> cell = factory->NewPropertyCell(); 2905 Handle<PropertyCell> cell = factory->NewPropertyCell();
2906 cell->set_value(Smi::FromInt(Isolate::kArrayProtectorValid)); 2906 cell->set_value(Smi::FromInt(Isolate::kArrayProtectorValid));
2907 set_array_protector(*cell); 2907 set_array_protector(*cell);
2908 2908
2909 cell = factory->NewPropertyCell(); 2909 cell = factory->NewPropertyCell();
2910 cell->set_value(the_hole_value()); 2910 cell->set_value(the_hole_value());
2911 set_empty_property_cell(*cell); 2911 set_empty_property_cell(*cell);
2912 2912
2913 Handle<PropertyCell> species_cell = factory->NewPropertyCell(); 2913 Handle<Cell> is_concat_spreadable_cell = factory->NewCell(
2914 species_cell->set_value(Smi::FromInt(Isolate::kArrayProtectorValid)); 2914 handle(Smi::FromInt(Isolate::kArrayProtectorValid), isolate()));
2915 set_array_is_concat_spreadable_protector(*is_concat_spreadable_cell);
2916
2917 Handle<Cell> species_cell = factory->NewCell(
2918 handle(Smi::FromInt(Isolate::kArrayProtectorValid), isolate()));
2915 set_species_protector(*species_cell); 2919 set_species_protector(*species_cell);
2916 2920
2917 set_weak_stack_trace_list(Smi::FromInt(0)); 2921 set_weak_stack_trace_list(Smi::FromInt(0));
2918 2922
2919 set_noscript_shared_function_infos(Smi::FromInt(0)); 2923 set_noscript_shared_function_infos(Smi::FromInt(0));
2920 2924
2921 // Initialize keyed lookup cache. 2925 // Initialize keyed lookup cache.
2922 isolate_->keyed_lookup_cache()->Clear(); 2926 isolate_->keyed_lookup_cache()->Clear();
2923 2927
2924 // Initialize context slot cache. 2928 // Initialize context slot cache.
(...skipping 3547 matching lines...) Expand 10 before | Expand all | Expand 10 after
6472 } 6476 }
6473 6477
6474 6478
6475 // static 6479 // static
6476 int Heap::GetStaticVisitorIdForMap(Map* map) { 6480 int Heap::GetStaticVisitorIdForMap(Map* map) {
6477 return StaticVisitorBase::GetVisitorId(map); 6481 return StaticVisitorBase::GetVisitorId(map);
6478 } 6482 }
6479 6483
6480 } // namespace internal 6484 } // namespace internal
6481 } // namespace v8 6485 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/incremental-marking.cc » ('j') | src/isolate.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698