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

Side by Side Diff: src/heap.cc

Issue 652119: Refactor the code cache to handle large number of properties on the global ob... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 10 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 | « src/heap.h ('k') | src/objects.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after
1199 1199
1200 Map* map = reinterpret_cast<Map*>(result); 1200 Map* map = reinterpret_cast<Map*>(result);
1201 map->set_map(meta_map()); 1201 map->set_map(meta_map());
1202 map->set_instance_type(instance_type); 1202 map->set_instance_type(instance_type);
1203 map->set_prototype(null_value()); 1203 map->set_prototype(null_value());
1204 map->set_constructor(null_value()); 1204 map->set_constructor(null_value());
1205 map->set_instance_size(instance_size); 1205 map->set_instance_size(instance_size);
1206 map->set_inobject_properties(0); 1206 map->set_inobject_properties(0);
1207 map->set_pre_allocated_property_fields(0); 1207 map->set_pre_allocated_property_fields(0);
1208 map->set_instance_descriptors(empty_descriptor_array()); 1208 map->set_instance_descriptors(empty_descriptor_array());
1209 map->set_code_cache(empty_fixed_array()); 1209 map->set_code_cache(undefined_value());
1210 map->set_unused_property_fields(0); 1210 map->set_unused_property_fields(0);
1211 map->set_bit_field(0); 1211 map->set_bit_field(0);
1212 map->set_bit_field2(1 << Map::kIsExtensible); 1212 map->set_bit_field2(1 << Map::kIsExtensible);
1213 1213
1214 // If the map object is aligned fill the padding area with Smi 0 objects. 1214 // If the map object is aligned fill the padding area with Smi 0 objects.
1215 if (Map::kPadStart < Map::kSize) { 1215 if (Map::kPadStart < Map::kSize) {
1216 memset(reinterpret_cast<byte*>(map) + Map::kPadStart - kHeapObjectTag, 1216 memset(reinterpret_cast<byte*>(map) + Map::kPadStart - kHeapObjectTag,
1217 0, 1217 0,
1218 Map::kSize - Map::kPadStart); 1218 Map::kSize - Map::kPadStart);
1219 } 1219 }
1220 return map; 1220 return map;
1221 } 1221 }
1222 1222
1223 1223
1224 Object* Heap::AllocateCodeCache() {
1225 Object* result = AllocateStruct(CODE_CACHE_TYPE);
1226 if (result->IsFailure()) return result;
1227 CodeCache* code_cache = CodeCache::cast(result);
1228 code_cache->set_default_cache(empty_fixed_array());
1229 code_cache->set_normal_type_cache(undefined_value());
1230 return code_cache;
1231 }
1232
1233
1224 const Heap::StringTypeTable Heap::string_type_table[] = { 1234 const Heap::StringTypeTable Heap::string_type_table[] = {
1225 #define STRING_TYPE_ELEMENT(type, size, name, camel_name) \ 1235 #define STRING_TYPE_ELEMENT(type, size, name, camel_name) \
1226 {type, size, k##camel_name##MapRootIndex}, 1236 {type, size, k##camel_name##MapRootIndex},
1227 STRING_TYPE_LIST(STRING_TYPE_ELEMENT) 1237 STRING_TYPE_LIST(STRING_TYPE_ELEMENT)
1228 #undef STRING_TYPE_ELEMENT 1238 #undef STRING_TYPE_ELEMENT
1229 }; 1239 };
1230 1240
1231 1241
1232 const Heap::ConstantSymbolTable Heap::constant_symbol_table[] = { 1242 const Heap::ConstantSymbolTable Heap::constant_symbol_table[] = {
1233 #define CONSTANT_SYMBOL_ELEMENT(name, contents) \ 1243 #define CONSTANT_SYMBOL_ELEMENT(name, contents) \
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
1270 if (obj->IsFailure()) return false; 1280 if (obj->IsFailure()) return false;
1271 set_null_value(obj); 1281 set_null_value(obj);
1272 1282
1273 // Allocate the empty descriptor array. 1283 // Allocate the empty descriptor array.
1274 obj = AllocateEmptyFixedArray(); 1284 obj = AllocateEmptyFixedArray();
1275 if (obj->IsFailure()) return false; 1285 if (obj->IsFailure()) return false;
1276 set_empty_descriptor_array(DescriptorArray::cast(obj)); 1286 set_empty_descriptor_array(DescriptorArray::cast(obj));
1277 1287
1278 // Fix the instance_descriptors for the existing maps. 1288 // Fix the instance_descriptors for the existing maps.
1279 meta_map()->set_instance_descriptors(empty_descriptor_array()); 1289 meta_map()->set_instance_descriptors(empty_descriptor_array());
1280 meta_map()->set_code_cache(empty_fixed_array()); 1290 meta_map()->set_code_cache(undefined_value());
1281 1291
1282 fixed_array_map()->set_instance_descriptors(empty_descriptor_array()); 1292 fixed_array_map()->set_instance_descriptors(empty_descriptor_array());
1283 fixed_array_map()->set_code_cache(empty_fixed_array()); 1293 fixed_array_map()->set_code_cache(undefined_value());
1284 1294
1285 oddball_map()->set_instance_descriptors(empty_descriptor_array()); 1295 oddball_map()->set_instance_descriptors(empty_descriptor_array());
1286 oddball_map()->set_code_cache(empty_fixed_array()); 1296 oddball_map()->set_code_cache(undefined_value());
1287 1297
1288 // Fix prototype object for existing maps. 1298 // Fix prototype object for existing maps.
1289 meta_map()->set_prototype(null_value()); 1299 meta_map()->set_prototype(null_value());
1290 meta_map()->set_constructor(null_value()); 1300 meta_map()->set_constructor(null_value());
1291 1301
1292 fixed_array_map()->set_prototype(null_value()); 1302 fixed_array_map()->set_prototype(null_value());
1293 fixed_array_map()->set_constructor(null_value()); 1303 fixed_array_map()->set_constructor(null_value());
1294 1304
1295 oddball_map()->set_prototype(null_value()); 1305 oddball_map()->set_prototype(null_value());
1296 oddball_map()->set_constructor(null_value()); 1306 oddball_map()->set_constructor(null_value());
(...skipping 2922 matching lines...) Expand 10 before | Expand all | Expand 10 after
4219 void ExternalStringTable::TearDown() { 4229 void ExternalStringTable::TearDown() {
4220 new_space_strings_.Free(); 4230 new_space_strings_.Free();
4221 old_space_strings_.Free(); 4231 old_space_strings_.Free();
4222 } 4232 }
4223 4233
4224 4234
4225 List<Object*> ExternalStringTable::new_space_strings_; 4235 List<Object*> ExternalStringTable::new_space_strings_;
4226 List<Object*> ExternalStringTable::old_space_strings_; 4236 List<Object*> ExternalStringTable::old_space_strings_;
4227 4237
4228 } } // namespace v8::internal 4238 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698