OLD | NEW |
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/context-slot-cache.h" | 9 #include "src/ast/context-slot-cache.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 2805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2816 // Handling of script id generation is in Heap::NextScriptId(). | 2816 // Handling of script id generation is in Heap::NextScriptId(). |
2817 set_last_script_id(Smi::FromInt(v8::UnboundScript::kNoScriptId)); | 2817 set_last_script_id(Smi::FromInt(v8::UnboundScript::kNoScriptId)); |
2818 set_next_template_serial_number(Smi::kZero); | 2818 set_next_template_serial_number(Smi::kZero); |
2819 | 2819 |
2820 // Allocate the empty script. | 2820 // Allocate the empty script. |
2821 Handle<Script> script = factory->NewScript(factory->empty_string()); | 2821 Handle<Script> script = factory->NewScript(factory->empty_string()); |
2822 script->set_type(Script::TYPE_NATIVE); | 2822 script->set_type(Script::TYPE_NATIVE); |
2823 set_empty_script(*script); | 2823 set_empty_script(*script); |
2824 | 2824 |
2825 Handle<PropertyCell> cell = factory->NewPropertyCell(); | 2825 Handle<PropertyCell> cell = factory->NewPropertyCell(); |
2826 cell->set_value(Smi::FromInt(Isolate::kArrayProtectorValid)); | 2826 cell->set_value(Smi::FromInt(Isolate::kProtectorValid)); |
2827 set_array_protector(*cell); | 2827 set_array_protector(*cell); |
2828 | 2828 |
2829 cell = factory->NewPropertyCell(); | 2829 cell = factory->NewPropertyCell(); |
2830 cell->set_value(the_hole_value()); | 2830 cell->set_value(the_hole_value()); |
2831 set_empty_property_cell(*cell); | 2831 set_empty_property_cell(*cell); |
2832 | 2832 |
2833 cell = factory->NewPropertyCell(); | 2833 cell = factory->NewPropertyCell(); |
2834 cell->set_value(Smi::FromInt(Isolate::kArrayProtectorValid)); | 2834 cell->set_value(Smi::FromInt(Isolate::kProtectorValid)); |
2835 set_has_instance_protector(*cell); | 2835 set_has_instance_protector(*cell); |
2836 | 2836 |
2837 Handle<Cell> is_concat_spreadable_cell = factory->NewCell( | 2837 Handle<Cell> is_concat_spreadable_cell = factory->NewCell( |
2838 handle(Smi::FromInt(Isolate::kArrayProtectorValid), isolate())); | 2838 handle(Smi::FromInt(Isolate::kProtectorValid), isolate())); |
2839 set_is_concat_spreadable_protector(*is_concat_spreadable_cell); | 2839 set_is_concat_spreadable_protector(*is_concat_spreadable_cell); |
2840 | 2840 |
2841 Handle<Cell> species_cell = factory->NewCell( | 2841 Handle<Cell> species_cell = factory->NewCell( |
2842 handle(Smi::FromInt(Isolate::kArrayProtectorValid), isolate())); | 2842 handle(Smi::FromInt(Isolate::kProtectorValid), isolate())); |
2843 set_species_protector(*species_cell); | 2843 set_species_protector(*species_cell); |
2844 | 2844 |
2845 cell = factory->NewPropertyCell(); | 2845 cell = factory->NewPropertyCell(); |
2846 cell->set_value(Smi::FromInt(Isolate::kArrayProtectorValid)); | 2846 cell->set_value(Smi::FromInt(Isolate::kProtectorValid)); |
2847 set_string_length_protector(*cell); | 2847 set_string_length_protector(*cell); |
2848 | 2848 |
2849 Handle<Cell> fast_array_iteration_cell = factory->NewCell( | 2849 Handle<Cell> fast_array_iteration_cell = factory->NewCell( |
2850 handle(Smi::FromInt(Isolate::kArrayProtectorValid), isolate())); | 2850 handle(Smi::FromInt(Isolate::kProtectorValid), isolate())); |
2851 set_fast_array_iteration_protector(*fast_array_iteration_cell); | 2851 set_fast_array_iteration_protector(*fast_array_iteration_cell); |
2852 | 2852 |
| 2853 Handle<Cell> array_iterator_cell = factory->NewCell( |
| 2854 handle(Smi::FromInt(Isolate::kProtectorValid), isolate())); |
| 2855 set_array_iterator_protector(*array_iterator_cell); |
| 2856 |
2853 set_serialized_templates(empty_fixed_array()); | 2857 set_serialized_templates(empty_fixed_array()); |
2854 | 2858 |
2855 set_weak_stack_trace_list(Smi::kZero); | 2859 set_weak_stack_trace_list(Smi::kZero); |
2856 | 2860 |
2857 set_noscript_shared_function_infos(Smi::kZero); | 2861 set_noscript_shared_function_infos(Smi::kZero); |
2858 | 2862 |
2859 // Initialize context slot cache. | 2863 // Initialize context slot cache. |
2860 isolate_->context_slot_cache()->Clear(); | 2864 isolate_->context_slot_cache()->Clear(); |
2861 | 2865 |
2862 // Initialize descriptor cache. | 2866 // Initialize descriptor cache. |
(...skipping 3603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6466 } | 6470 } |
6467 | 6471 |
6468 | 6472 |
6469 // static | 6473 // static |
6470 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6474 int Heap::GetStaticVisitorIdForMap(Map* map) { |
6471 return StaticVisitorBase::GetVisitorId(map); | 6475 return StaticVisitorBase::GetVisitorId(map); |
6472 } | 6476 } |
6473 | 6477 |
6474 } // namespace internal | 6478 } // namespace internal |
6475 } // namespace v8 | 6479 } // namespace v8 |
OLD | NEW |