| 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/v8.h" | 5 #include "src/v8.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/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
| (...skipping 2459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2470 map->set_instance_type(instance_type); | 2470 map->set_instance_type(instance_type); |
| 2471 map->set_prototype(null_value(), SKIP_WRITE_BARRIER); | 2471 map->set_prototype(null_value(), SKIP_WRITE_BARRIER); |
| 2472 map->set_constructor_or_backpointer(null_value(), SKIP_WRITE_BARRIER); | 2472 map->set_constructor_or_backpointer(null_value(), SKIP_WRITE_BARRIER); |
| 2473 map->set_instance_size(instance_size); | 2473 map->set_instance_size(instance_size); |
| 2474 map->set_inobject_properties(0); | 2474 map->set_inobject_properties(0); |
| 2475 map->set_pre_allocated_property_fields(0); | 2475 map->set_pre_allocated_property_fields(0); |
| 2476 map->set_code_cache(empty_fixed_array(), SKIP_WRITE_BARRIER); | 2476 map->set_code_cache(empty_fixed_array(), SKIP_WRITE_BARRIER); |
| 2477 map->set_dependent_code(DependentCode::cast(empty_fixed_array()), | 2477 map->set_dependent_code(DependentCode::cast(empty_fixed_array()), |
| 2478 SKIP_WRITE_BARRIER); | 2478 SKIP_WRITE_BARRIER); |
| 2479 map->set_weak_cell_cache(Smi::FromInt(0)); | 2479 map->set_weak_cell_cache(Smi::FromInt(0)); |
| 2480 map->init_transitions(undefined_value()); | 2480 map->set_raw_transitions(Smi::FromInt(0)); |
| 2481 map->set_unused_property_fields(0); | 2481 map->set_unused_property_fields(0); |
| 2482 map->set_instance_descriptors(empty_descriptor_array()); | 2482 map->set_instance_descriptors(empty_descriptor_array()); |
| 2483 if (FLAG_unbox_double_fields) { | 2483 if (FLAG_unbox_double_fields) { |
| 2484 map->set_layout_descriptor(LayoutDescriptor::FastPointerLayout()); | 2484 map->set_layout_descriptor(LayoutDescriptor::FastPointerLayout()); |
| 2485 } | 2485 } |
| 2486 // Must be called only after |instance_type|, |instance_size| and | 2486 // Must be called only after |instance_type|, |instance_size| and |
| 2487 // |layout_descriptor| are set. | 2487 // |layout_descriptor| are set. |
| 2488 map->set_visitor_id(StaticVisitorBase::GetVisitorId(map)); | 2488 map->set_visitor_id(StaticVisitorBase::GetVisitorId(map)); |
| 2489 map->set_bit_field(0); | 2489 map->set_bit_field(0); |
| 2490 map->set_bit_field2(1 << Map::kIsExtensible); | 2490 map->set_bit_field2(1 << Map::kIsExtensible); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2604 // Allocate the constant pool array. | 2604 // Allocate the constant pool array. |
| 2605 { | 2605 { |
| 2606 AllocationResult allocation = AllocateEmptyConstantPoolArray(); | 2606 AllocationResult allocation = AllocateEmptyConstantPoolArray(); |
| 2607 if (!allocation.To(&obj)) return false; | 2607 if (!allocation.To(&obj)) return false; |
| 2608 } | 2608 } |
| 2609 set_empty_constant_pool_array(ConstantPoolArray::cast(obj)); | 2609 set_empty_constant_pool_array(ConstantPoolArray::cast(obj)); |
| 2610 | 2610 |
| 2611 // Fix the instance_descriptors for the existing maps. | 2611 // Fix the instance_descriptors for the existing maps. |
| 2612 meta_map()->set_code_cache(empty_fixed_array()); | 2612 meta_map()->set_code_cache(empty_fixed_array()); |
| 2613 meta_map()->set_dependent_code(DependentCode::cast(empty_fixed_array())); | 2613 meta_map()->set_dependent_code(DependentCode::cast(empty_fixed_array())); |
| 2614 meta_map()->init_transitions(undefined_value()); | 2614 meta_map()->set_raw_transitions(Smi::FromInt(0)); |
| 2615 meta_map()->set_instance_descriptors(empty_descriptor_array()); | 2615 meta_map()->set_instance_descriptors(empty_descriptor_array()); |
| 2616 if (FLAG_unbox_double_fields) { | 2616 if (FLAG_unbox_double_fields) { |
| 2617 meta_map()->set_layout_descriptor(LayoutDescriptor::FastPointerLayout()); | 2617 meta_map()->set_layout_descriptor(LayoutDescriptor::FastPointerLayout()); |
| 2618 } | 2618 } |
| 2619 | 2619 |
| 2620 fixed_array_map()->set_code_cache(empty_fixed_array()); | 2620 fixed_array_map()->set_code_cache(empty_fixed_array()); |
| 2621 fixed_array_map()->set_dependent_code( | 2621 fixed_array_map()->set_dependent_code( |
| 2622 DependentCode::cast(empty_fixed_array())); | 2622 DependentCode::cast(empty_fixed_array())); |
| 2623 fixed_array_map()->init_transitions(undefined_value()); | 2623 fixed_array_map()->set_raw_transitions(Smi::FromInt(0)); |
| 2624 fixed_array_map()->set_instance_descriptors(empty_descriptor_array()); | 2624 fixed_array_map()->set_instance_descriptors(empty_descriptor_array()); |
| 2625 if (FLAG_unbox_double_fields) { | 2625 if (FLAG_unbox_double_fields) { |
| 2626 fixed_array_map()->set_layout_descriptor( | 2626 fixed_array_map()->set_layout_descriptor( |
| 2627 LayoutDescriptor::FastPointerLayout()); | 2627 LayoutDescriptor::FastPointerLayout()); |
| 2628 } | 2628 } |
| 2629 | 2629 |
| 2630 undefined_map()->set_code_cache(empty_fixed_array()); | 2630 undefined_map()->set_code_cache(empty_fixed_array()); |
| 2631 undefined_map()->set_dependent_code(DependentCode::cast(empty_fixed_array())); | 2631 undefined_map()->set_dependent_code(DependentCode::cast(empty_fixed_array())); |
| 2632 undefined_map()->init_transitions(undefined_value()); | 2632 undefined_map()->set_raw_transitions(Smi::FromInt(0)); |
| 2633 undefined_map()->set_instance_descriptors(empty_descriptor_array()); | 2633 undefined_map()->set_instance_descriptors(empty_descriptor_array()); |
| 2634 if (FLAG_unbox_double_fields) { | 2634 if (FLAG_unbox_double_fields) { |
| 2635 undefined_map()->set_layout_descriptor( | 2635 undefined_map()->set_layout_descriptor( |
| 2636 LayoutDescriptor::FastPointerLayout()); | 2636 LayoutDescriptor::FastPointerLayout()); |
| 2637 } | 2637 } |
| 2638 | 2638 |
| 2639 null_map()->set_code_cache(empty_fixed_array()); | 2639 null_map()->set_code_cache(empty_fixed_array()); |
| 2640 null_map()->set_dependent_code(DependentCode::cast(empty_fixed_array())); | 2640 null_map()->set_dependent_code(DependentCode::cast(empty_fixed_array())); |
| 2641 null_map()->init_transitions(undefined_value()); | 2641 null_map()->set_raw_transitions(Smi::FromInt(0)); |
| 2642 null_map()->set_instance_descriptors(empty_descriptor_array()); | 2642 null_map()->set_instance_descriptors(empty_descriptor_array()); |
| 2643 if (FLAG_unbox_double_fields) { | 2643 if (FLAG_unbox_double_fields) { |
| 2644 null_map()->set_layout_descriptor(LayoutDescriptor::FastPointerLayout()); | 2644 null_map()->set_layout_descriptor(LayoutDescriptor::FastPointerLayout()); |
| 2645 } | 2645 } |
| 2646 | 2646 |
| 2647 constant_pool_array_map()->set_code_cache(empty_fixed_array()); | 2647 constant_pool_array_map()->set_code_cache(empty_fixed_array()); |
| 2648 constant_pool_array_map()->set_dependent_code( | 2648 constant_pool_array_map()->set_dependent_code( |
| 2649 DependentCode::cast(empty_fixed_array())); | 2649 DependentCode::cast(empty_fixed_array())); |
| 2650 constant_pool_array_map()->init_transitions(undefined_value()); | 2650 constant_pool_array_map()->set_raw_transitions(Smi::FromInt(0)); |
| 2651 constant_pool_array_map()->set_instance_descriptors(empty_descriptor_array()); | 2651 constant_pool_array_map()->set_instance_descriptors(empty_descriptor_array()); |
| 2652 if (FLAG_unbox_double_fields) { | 2652 if (FLAG_unbox_double_fields) { |
| 2653 constant_pool_array_map()->set_layout_descriptor( | 2653 constant_pool_array_map()->set_layout_descriptor( |
| 2654 LayoutDescriptor::FastPointerLayout()); | 2654 LayoutDescriptor::FastPointerLayout()); |
| 2655 } | 2655 } |
| 2656 | 2656 |
| 2657 // Fix prototype object for existing maps. | 2657 // Fix prototype object for existing maps. |
| 2658 meta_map()->set_prototype(null_value()); | 2658 meta_map()->set_prototype(null_value()); |
| 2659 meta_map()->set_constructor_or_backpointer(null_value()); | 2659 meta_map()->set_constructor_or_backpointer(null_value()); |
| 2660 | 2660 |
| (...skipping 3884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6545 static_cast<int>(object_sizes_last_time_[index])); | 6545 static_cast<int>(object_sizes_last_time_[index])); |
| 6546 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6546 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
| 6547 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6547 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
| 6548 | 6548 |
| 6549 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6549 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
| 6550 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6550 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
| 6551 ClearObjectStats(); | 6551 ClearObjectStats(); |
| 6552 } | 6552 } |
| 6553 } | 6553 } |
| 6554 } // namespace v8::internal | 6554 } // namespace v8::internal |
| OLD | NEW |