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

Side by Side Diff: src/heap.cc

Issue 11575007: Make embedded maps in optimized code weak. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix skipping of maps in visitors. Created 7 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/lithium.h » ('j') | src/objects.h » ('J')
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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 2150 matching lines...) Expand 10 before | Expand all | Expand 10 after
2161 map->set_map_no_write_barrier(meta_map()); 2161 map->set_map_no_write_barrier(meta_map());
2162 map->set_instance_type(instance_type); 2162 map->set_instance_type(instance_type);
2163 map->set_visitor_id( 2163 map->set_visitor_id(
2164 StaticVisitorBase::GetVisitorId(instance_type, instance_size)); 2164 StaticVisitorBase::GetVisitorId(instance_type, instance_size));
2165 map->set_prototype(null_value(), SKIP_WRITE_BARRIER); 2165 map->set_prototype(null_value(), SKIP_WRITE_BARRIER);
2166 map->set_constructor(null_value(), SKIP_WRITE_BARRIER); 2166 map->set_constructor(null_value(), SKIP_WRITE_BARRIER);
2167 map->set_instance_size(instance_size); 2167 map->set_instance_size(instance_size);
2168 map->set_inobject_properties(0); 2168 map->set_inobject_properties(0);
2169 map->set_pre_allocated_property_fields(0); 2169 map->set_pre_allocated_property_fields(0);
2170 map->set_code_cache(empty_fixed_array(), SKIP_WRITE_BARRIER); 2170 map->set_code_cache(empty_fixed_array(), SKIP_WRITE_BARRIER);
2171 map->set_dependent_codes(DependentCodes::cast(empty_fixed_array()),
2172 SKIP_WRITE_BARRIER);
2171 map->init_back_pointer(undefined_value()); 2173 map->init_back_pointer(undefined_value());
2172 map->set_unused_property_fields(0); 2174 map->set_unused_property_fields(0);
2173 map->set_instance_descriptors(empty_descriptor_array()); 2175 map->set_instance_descriptors(empty_descriptor_array());
2174 map->set_bit_field(0); 2176 map->set_bit_field(0);
2175 map->set_bit_field2(1 << Map::kIsExtensible); 2177 map->set_bit_field2(1 << Map::kIsExtensible);
2176 int bit_field3 = Map::EnumLengthBits::encode(Map::kInvalidEnumCache) | 2178 int bit_field3 = Map::EnumLengthBits::encode(Map::kInvalidEnumCache) |
2177 Map::OwnsDescriptors::encode(true); 2179 Map::OwnsDescriptors::encode(true);
2178 map->set_bit_field3(bit_field3); 2180 map->set_bit_field3(bit_field3);
2179 map->set_elements_kind(elements_kind); 2181 map->set_elements_kind(elements_kind);
2180 2182
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
2296 ASSERT(!InNewSpace(undefined_value())); 2298 ASSERT(!InNewSpace(undefined_value()));
2297 2299
2298 // Allocate the empty descriptor array. 2300 // Allocate the empty descriptor array.
2299 { MaybeObject* maybe_obj = AllocateEmptyFixedArray(); 2301 { MaybeObject* maybe_obj = AllocateEmptyFixedArray();
2300 if (!maybe_obj->ToObject(&obj)) return false; 2302 if (!maybe_obj->ToObject(&obj)) return false;
2301 } 2303 }
2302 set_empty_descriptor_array(DescriptorArray::cast(obj)); 2304 set_empty_descriptor_array(DescriptorArray::cast(obj));
2303 2305
2304 // Fix the instance_descriptors for the existing maps. 2306 // Fix the instance_descriptors for the existing maps.
2305 meta_map()->set_code_cache(empty_fixed_array()); 2307 meta_map()->set_code_cache(empty_fixed_array());
2308 meta_map()->set_dependent_codes(DependentCodes::cast(empty_fixed_array()));
2306 meta_map()->init_back_pointer(undefined_value()); 2309 meta_map()->init_back_pointer(undefined_value());
2307 meta_map()->set_instance_descriptors(empty_descriptor_array()); 2310 meta_map()->set_instance_descriptors(empty_descriptor_array());
2308 2311
2309 fixed_array_map()->set_code_cache(empty_fixed_array()); 2312 fixed_array_map()->set_code_cache(empty_fixed_array());
2313 fixed_array_map()->set_dependent_codes(
2314 DependentCodes::cast(empty_fixed_array()));
2310 fixed_array_map()->init_back_pointer(undefined_value()); 2315 fixed_array_map()->init_back_pointer(undefined_value());
2311 fixed_array_map()->set_instance_descriptors(empty_descriptor_array()); 2316 fixed_array_map()->set_instance_descriptors(empty_descriptor_array());
2312 2317
2313 oddball_map()->set_code_cache(empty_fixed_array()); 2318 oddball_map()->set_code_cache(empty_fixed_array());
2319 oddball_map()->set_dependent_codes(DependentCodes::cast(empty_fixed_array()));
2314 oddball_map()->init_back_pointer(undefined_value()); 2320 oddball_map()->init_back_pointer(undefined_value());
2315 oddball_map()->set_instance_descriptors(empty_descriptor_array()); 2321 oddball_map()->set_instance_descriptors(empty_descriptor_array());
2316 2322
2317 // Fix prototype object for existing maps. 2323 // Fix prototype object for existing maps.
2318 meta_map()->set_prototype(null_value()); 2324 meta_map()->set_prototype(null_value());
2319 meta_map()->set_constructor(null_value()); 2325 meta_map()->set_constructor(null_value());
2320 2326
2321 fixed_array_map()->set_prototype(null_value()); 2327 fixed_array_map()->set_prototype(null_value());
2322 fixed_array_map()->set_constructor(null_value()); 2328 fixed_array_map()->set_constructor(null_value());
2323 2329
(...skipping 1426 matching lines...) Expand 10 before | Expand all | Expand 10 after
3750 code->set_flags(flags); 3756 code->set_flags(flags);
3751 if (code->is_call_stub() || code->is_keyed_call_stub()) { 3757 if (code->is_call_stub() || code->is_keyed_call_stub()) {
3752 code->set_check_type(RECEIVER_MAP_CHECK); 3758 code->set_check_type(RECEIVER_MAP_CHECK);
3753 } 3759 }
3754 code->set_deoptimization_data(empty_fixed_array(), SKIP_WRITE_BARRIER); 3760 code->set_deoptimization_data(empty_fixed_array(), SKIP_WRITE_BARRIER);
3755 code->InitializeTypeFeedbackInfoNoWriteBarrier(undefined_value()); 3761 code->InitializeTypeFeedbackInfoNoWriteBarrier(undefined_value());
3756 code->set_handler_table(empty_fixed_array(), SKIP_WRITE_BARRIER); 3762 code->set_handler_table(empty_fixed_array(), SKIP_WRITE_BARRIER);
3757 code->set_gc_metadata(Smi::FromInt(0)); 3763 code->set_gc_metadata(Smi::FromInt(0));
3758 code->set_ic_age(global_ic_age_); 3764 code->set_ic_age(global_ic_age_);
3759 code->set_prologue_offset(kPrologueOffsetNotSet); 3765 code->set_prologue_offset(kPrologueOffsetNotSet);
3766 if (code->kind() == Code::OPTIMIZED_FUNCTION) {
3767 code->set_marked_for_deoptimization(false);
3768 }
3760 // Allow self references to created code object by patching the handle to 3769 // Allow self references to created code object by patching the handle to
3761 // point to the newly allocated Code object. 3770 // point to the newly allocated Code object.
3762 if (!self_reference.is_null()) { 3771 if (!self_reference.is_null()) {
3763 *(self_reference.location()) = code; 3772 *(self_reference.location()) = code;
3764 } 3773 }
3765 // Migrate generated code. 3774 // Migrate generated code.
3766 // The generated code can contain Object** values (typically from handles) 3775 // The generated code can contain Object** values (typically from handles)
3767 // that are dereferenced during the copy to point directly to the actual heap 3776 // that are dereferenced during the copy to point directly to the actual heap
3768 // objects. These pointers can include references to the code object itself, 3777 // objects. These pointers can include references to the code object itself,
3769 // through the self_reference parameter. 3778 // through the self_reference parameter.
(...skipping 3636 matching lines...) Expand 10 before | Expand all | Expand 10 after
7406 static_cast<int>(object_sizes_last_time_[index])); 7415 static_cast<int>(object_sizes_last_time_[index]));
7407 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) 7416 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT)
7408 #undef ADJUST_LAST_TIME_OBJECT_COUNT 7417 #undef ADJUST_LAST_TIME_OBJECT_COUNT
7409 7418
7410 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 7419 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
7411 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 7420 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
7412 ClearObjectStats(); 7421 ClearObjectStats();
7413 } 7422 }
7414 7423
7415 } } // namespace v8::internal 7424 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/lithium.h » ('j') | src/objects.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698