OLD | NEW |
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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 intptr_t Heap::SizeOfObjects() { | 460 intptr_t Heap::SizeOfObjects() { |
461 intptr_t total = 0; | 461 intptr_t total = 0; |
462 AllSpaces spaces(this); | 462 AllSpaces spaces(this); |
463 for (Space* space = spaces.next(); space != NULL; space = spaces.next()) { | 463 for (Space* space = spaces.next(); space != NULL; space = spaces.next()) { |
464 total += space->SizeOfObjects(); | 464 total += space->SizeOfObjects(); |
465 } | 465 } |
466 return total; | 466 return total; |
467 } | 467 } |
468 | 468 |
469 | 469 |
| 470 void Heap::ClearAllKeyedStoreICs() { |
| 471 HeapObjectIterator it(code_space()); |
| 472 |
| 473 for (Object* object = it.Next(); object != NULL; object = it.Next()) { |
| 474 Code* code = Code::cast(object); |
| 475 code->ClearInlineCaches(Code::KEYED_STORE_IC); |
| 476 } |
| 477 } |
| 478 |
| 479 |
470 void Heap::RepairFreeListsAfterBoot() { | 480 void Heap::RepairFreeListsAfterBoot() { |
471 PagedSpaces spaces(this); | 481 PagedSpaces spaces(this); |
472 for (PagedSpace* space = spaces.next(); | 482 for (PagedSpace* space = spaces.next(); |
473 space != NULL; | 483 space != NULL; |
474 space = spaces.next()) { | 484 space = spaces.next()) { |
475 space->RepairFreeListsAfterBoot(); | 485 space->RepairFreeListsAfterBoot(); |
476 } | 486 } |
477 } | 487 } |
478 | 488 |
479 | 489 |
(...skipping 1966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2446 reinterpret_cast<Map*>(result)->set_visitor_id( | 2456 reinterpret_cast<Map*>(result)->set_visitor_id( |
2447 StaticVisitorBase::GetVisitorId(instance_type, instance_size)); | 2457 StaticVisitorBase::GetVisitorId(instance_type, instance_size)); |
2448 reinterpret_cast<Map*>(result)->set_inobject_properties(0); | 2458 reinterpret_cast<Map*>(result)->set_inobject_properties(0); |
2449 reinterpret_cast<Map*>(result)->set_pre_allocated_property_fields(0); | 2459 reinterpret_cast<Map*>(result)->set_pre_allocated_property_fields(0); |
2450 reinterpret_cast<Map*>(result)->set_unused_property_fields(0); | 2460 reinterpret_cast<Map*>(result)->set_unused_property_fields(0); |
2451 reinterpret_cast<Map*>(result)->set_bit_field(0); | 2461 reinterpret_cast<Map*>(result)->set_bit_field(0); |
2452 reinterpret_cast<Map*>(result)->set_bit_field2(0); | 2462 reinterpret_cast<Map*>(result)->set_bit_field2(0); |
2453 int bit_field3 = Map::EnumLengthBits::encode(Map::kInvalidEnumCache) | | 2463 int bit_field3 = Map::EnumLengthBits::encode(Map::kInvalidEnumCache) | |
2454 Map::OwnsDescriptors::encode(true); | 2464 Map::OwnsDescriptors::encode(true); |
2455 reinterpret_cast<Map*>(result)->set_bit_field3(bit_field3); | 2465 reinterpret_cast<Map*>(result)->set_bit_field3(bit_field3); |
| 2466 reinterpret_cast<Map*>(result)->set_bit_field4(0); |
2456 return result; | 2467 return result; |
2457 } | 2468 } |
2458 | 2469 |
2459 | 2470 |
2460 MaybeObject* Heap::AllocateMap(InstanceType instance_type, | 2471 MaybeObject* Heap::AllocateMap(InstanceType instance_type, |
2461 int instance_size, | 2472 int instance_size, |
2462 ElementsKind elements_kind) { | 2473 ElementsKind elements_kind) { |
2463 Object* result; | 2474 Object* result; |
2464 MaybeObject* maybe_result = AllocateRawMap(); | 2475 MaybeObject* maybe_result = AllocateRawMap(); |
2465 if (!maybe_result->To(&result)) return maybe_result; | 2476 if (!maybe_result->To(&result)) return maybe_result; |
(...skipping 13 matching lines...) Expand all Loading... |
2479 SKIP_WRITE_BARRIER); | 2490 SKIP_WRITE_BARRIER); |
2480 map->init_back_pointer(undefined_value()); | 2491 map->init_back_pointer(undefined_value()); |
2481 map->set_unused_property_fields(0); | 2492 map->set_unused_property_fields(0); |
2482 map->set_instance_descriptors(empty_descriptor_array()); | 2493 map->set_instance_descriptors(empty_descriptor_array()); |
2483 map->set_bit_field(0); | 2494 map->set_bit_field(0); |
2484 map->set_bit_field2(1 << Map::kIsExtensible); | 2495 map->set_bit_field2(1 << Map::kIsExtensible); |
2485 int bit_field3 = Map::EnumLengthBits::encode(Map::kInvalidEnumCache) | | 2496 int bit_field3 = Map::EnumLengthBits::encode(Map::kInvalidEnumCache) | |
2486 Map::OwnsDescriptors::encode(true); | 2497 Map::OwnsDescriptors::encode(true); |
2487 map->set_bit_field3(bit_field3); | 2498 map->set_bit_field3(bit_field3); |
2488 map->set_elements_kind(elements_kind); | 2499 map->set_elements_kind(elements_kind); |
| 2500 map->set_bit_field4(0); |
2489 | 2501 |
2490 return map; | 2502 return map; |
2491 } | 2503 } |
2492 | 2504 |
2493 | 2505 |
2494 MaybeObject* Heap::AllocateCodeCache() { | 2506 MaybeObject* Heap::AllocateCodeCache() { |
2495 CodeCache* code_cache; | 2507 CodeCache* code_cache; |
2496 { MaybeObject* maybe_code_cache = AllocateStruct(CODE_CACHE_TYPE); | 2508 { MaybeObject* maybe_code_cache = AllocateStruct(CODE_CACHE_TYPE); |
2497 if (!maybe_code_cache->To(&code_cache)) return maybe_code_cache; | 2509 if (!maybe_code_cache->To(&code_cache)) return maybe_code_cache; |
2498 } | 2510 } |
(...skipping 5439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7938 if (FLAG_concurrent_recompilation) { | 7950 if (FLAG_concurrent_recompilation) { |
7939 heap_->relocation_mutex_->Lock(); | 7951 heap_->relocation_mutex_->Lock(); |
7940 #ifdef DEBUG | 7952 #ifdef DEBUG |
7941 heap_->relocation_mutex_locked_by_optimizer_thread_ = | 7953 heap_->relocation_mutex_locked_by_optimizer_thread_ = |
7942 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); | 7954 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); |
7943 #endif // DEBUG | 7955 #endif // DEBUG |
7944 } | 7956 } |
7945 } | 7957 } |
7946 | 7958 |
7947 } } // namespace v8::internal | 7959 } } // namespace v8::internal |
OLD | NEW |