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

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: fixing 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 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after
1235 1235
1236 Object* context = native_contexts_list(); 1236 Object* context = native_contexts_list();
1237 while (!context->IsUndefined()) { 1237 while (!context->IsUndefined()) {
1238 // GC can happen when the context is not fully initialized, 1238 // GC can happen when the context is not fully initialized,
1239 // so the cache can be undefined. 1239 // so the cache can be undefined.
1240 Object* cache = 1240 Object* cache =
1241 Context::cast(context)->get(Context::NORMALIZED_MAP_CACHE_INDEX); 1241 Context::cast(context)->get(Context::NORMALIZED_MAP_CACHE_INDEX);
1242 if (!cache->IsUndefined()) { 1242 if (!cache->IsUndefined()) {
1243 NormalizedMapCache::cast(cache)->Clear(); 1243 NormalizedMapCache::cast(cache)->Clear();
1244 } 1244 }
1245 context = Context::cast(context)->get(Context::NEXT_CONTEXT_LINK); 1245 context = Context::cast(context)->next_context_link();
1246 } 1246 }
1247 } 1247 }
1248 1248
1249 1249
1250 void Heap::UpdateSurvivalStatistics(int start_new_space_size) { 1250 void Heap::UpdateSurvivalStatistics(int start_new_space_size) {
1251 if (start_new_space_size == 0) return; 1251 if (start_new_space_size == 0) return;
1252 1252
1253 promotion_ratio_ = (static_cast<double>(promoted_objects_size_) / 1253 promotion_ratio_ = (static_cast<double>(promoted_objects_size_) /
1254 static_cast<double>(start_new_space_size) * 100); 1254 static_cast<double>(start_new_space_size) * 100);
1255 1255
(...skipping 1615 matching lines...) Expand 10 before | Expand all | Expand 10 after
2871 set_empty_script(*script); 2871 set_empty_script(*script);
2872 2872
2873 Handle<PropertyCell> cell = factory->NewPropertyCell(); 2873 Handle<PropertyCell> cell = factory->NewPropertyCell();
2874 cell->set_value(Smi::FromInt(Isolate::kArrayProtectorValid)); 2874 cell->set_value(Smi::FromInt(Isolate::kArrayProtectorValid));
2875 set_array_protector(*cell); 2875 set_array_protector(*cell);
2876 2876
2877 cell = factory->NewPropertyCell(); 2877 cell = factory->NewPropertyCell();
2878 cell->set_value(the_hole_value()); 2878 cell->set_value(the_hole_value());
2879 set_empty_property_cell(*cell); 2879 set_empty_property_cell(*cell);
2880 2880
2881 Handle<PropertyCell> species_cell = factory->NewPropertyCell(); 2881 Handle<Cell> is_concat_spreadable_cell = factory->NewCell(
2882 species_cell->set_value(Smi::FromInt(Isolate::kArrayProtectorValid)); 2882 handle(Smi::FromInt(Isolate::kArrayProtectorValid), isolate()));
2883 set_array_is_concat_spreadable_protector(*is_concat_spreadable_cell);
2884
2885 Handle<Cell> species_cell = factory->NewCell(
2886 handle(Smi::FromInt(Isolate::kArrayProtectorValid), isolate()));
2883 set_species_protector(*species_cell); 2887 set_species_protector(*species_cell);
2884 2888
2885 set_weak_stack_trace_list(Smi::FromInt(0)); 2889 set_weak_stack_trace_list(Smi::FromInt(0));
2886 2890
2887 set_noscript_shared_function_infos(Smi::FromInt(0)); 2891 set_noscript_shared_function_infos(Smi::FromInt(0));
2888 2892
2889 // Initialize keyed lookup cache. 2893 // Initialize keyed lookup cache.
2890 isolate_->keyed_lookup_cache()->Clear(); 2894 isolate_->keyed_lookup_cache()->Clear();
2891 2895
2892 // Initialize context slot cache. 2896 // Initialize context slot cache.
(...skipping 3544 matching lines...) Expand 10 before | Expand all | Expand 10 after
6437 } 6441 }
6438 6442
6439 6443
6440 // static 6444 // static
6441 int Heap::GetStaticVisitorIdForMap(Map* map) { 6445 int Heap::GetStaticVisitorIdForMap(Map* map) {
6442 return StaticVisitorBase::GetVisitorId(map); 6446 return StaticVisitorBase::GetVisitorId(map);
6443 } 6447 }
6444 6448
6445 } // namespace internal 6449 } // namespace internal
6446 } // namespace v8 6450 } // namespace v8
OLDNEW
« src/builtins.cc ('K') | « 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