| 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::ClearAllICsByKind(Code::Kind kind) { | 
 |   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::Kind current_kind = code->kind(); | 
 |   476     // TODO(mvstanton): are these kinds enough? | 
 |   477     if (current_kind == Code::FUNCTION || | 
 |   478         current_kind == Code::OPTIMIZED_FUNCTION) { | 
 |   479       code->ClearInlineCaches(kind); | 
 |   480     } | 
 |   481   } | 
 |   482 } | 
 |   483  | 
 |   484  | 
|   470 void Heap::RepairFreeListsAfterBoot() { |   485 void Heap::RepairFreeListsAfterBoot() { | 
|   471   PagedSpaces spaces(this); |   486   PagedSpaces spaces(this); | 
|   472   for (PagedSpace* space = spaces.next(); |   487   for (PagedSpace* space = spaces.next(); | 
|   473        space != NULL; |   488        space != NULL; | 
|   474        space = spaces.next()) { |   489        space = spaces.next()) { | 
|   475     space->RepairFreeListsAfterBoot(); |   490     space->RepairFreeListsAfterBoot(); | 
|   476   } |   491   } | 
|   477 } |   492 } | 
|   478  |   493  | 
|   479  |   494  | 
| (...skipping 1966 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  2446   reinterpret_cast<Map*>(result)->set_visitor_id( |  2461   reinterpret_cast<Map*>(result)->set_visitor_id( | 
|  2447         StaticVisitorBase::GetVisitorId(instance_type, instance_size)); |  2462         StaticVisitorBase::GetVisitorId(instance_type, instance_size)); | 
|  2448   reinterpret_cast<Map*>(result)->set_inobject_properties(0); |  2463   reinterpret_cast<Map*>(result)->set_inobject_properties(0); | 
|  2449   reinterpret_cast<Map*>(result)->set_pre_allocated_property_fields(0); |  2464   reinterpret_cast<Map*>(result)->set_pre_allocated_property_fields(0); | 
|  2450   reinterpret_cast<Map*>(result)->set_unused_property_fields(0); |  2465   reinterpret_cast<Map*>(result)->set_unused_property_fields(0); | 
|  2451   reinterpret_cast<Map*>(result)->set_bit_field(0); |  2466   reinterpret_cast<Map*>(result)->set_bit_field(0); | 
|  2452   reinterpret_cast<Map*>(result)->set_bit_field2(0); |  2467   reinterpret_cast<Map*>(result)->set_bit_field2(0); | 
|  2453   int bit_field3 = Map::EnumLengthBits::encode(Map::kInvalidEnumCache) | |  2468   int bit_field3 = Map::EnumLengthBits::encode(Map::kInvalidEnumCache) | | 
|  2454                    Map::OwnsDescriptors::encode(true); |  2469                    Map::OwnsDescriptors::encode(true); | 
|  2455   reinterpret_cast<Map*>(result)->set_bit_field3(bit_field3); |  2470   reinterpret_cast<Map*>(result)->set_bit_field3(bit_field3); | 
 |  2471   reinterpret_cast<Map*>(result)->set_bit_field4(0); | 
|  2456   return result; |  2472   return result; | 
|  2457 } |  2473 } | 
|  2458  |  2474  | 
|  2459  |  2475  | 
|  2460 MaybeObject* Heap::AllocateMap(InstanceType instance_type, |  2476 MaybeObject* Heap::AllocateMap(InstanceType instance_type, | 
|  2461                                int instance_size, |  2477                                int instance_size, | 
|  2462                                ElementsKind elements_kind) { |  2478                                ElementsKind elements_kind) { | 
|  2463   Object* result; |  2479   Object* result; | 
|  2464   MaybeObject* maybe_result = AllocateRaw(Map::kSize, MAP_SPACE, MAP_SPACE); |  2480   MaybeObject* maybe_result = AllocateRaw(Map::kSize, MAP_SPACE, MAP_SPACE); | 
|  2465   if (!maybe_result->To(&result)) return maybe_result; |  2481   if (!maybe_result->To(&result)) return maybe_result; | 
| (...skipping 13 matching lines...) Expand all  Loading... | 
|  2479                           SKIP_WRITE_BARRIER); |  2495                           SKIP_WRITE_BARRIER); | 
|  2480   map->init_back_pointer(undefined_value()); |  2496   map->init_back_pointer(undefined_value()); | 
|  2481   map->set_unused_property_fields(0); |  2497   map->set_unused_property_fields(0); | 
|  2482   map->set_instance_descriptors(empty_descriptor_array()); |  2498   map->set_instance_descriptors(empty_descriptor_array()); | 
|  2483   map->set_bit_field(0); |  2499   map->set_bit_field(0); | 
|  2484   map->set_bit_field2(1 << Map::kIsExtensible); |  2500   map->set_bit_field2(1 << Map::kIsExtensible); | 
|  2485   int bit_field3 = Map::EnumLengthBits::encode(Map::kInvalidEnumCache) | |  2501   int bit_field3 = Map::EnumLengthBits::encode(Map::kInvalidEnumCache) | | 
|  2486                    Map::OwnsDescriptors::encode(true); |  2502                    Map::OwnsDescriptors::encode(true); | 
|  2487   map->set_bit_field3(bit_field3); |  2503   map->set_bit_field3(bit_field3); | 
|  2488   map->set_elements_kind(elements_kind); |  2504   map->set_elements_kind(elements_kind); | 
 |  2505   map->set_bit_field4(0); | 
|  2489  |  2506  | 
|  2490   return map; |  2507   return map; | 
|  2491 } |  2508 } | 
|  2492  |  2509  | 
|  2493  |  2510  | 
|  2494 MaybeObject* Heap::AllocateCodeCache() { |  2511 MaybeObject* Heap::AllocateCodeCache() { | 
|  2495   CodeCache* code_cache; |  2512   CodeCache* code_cache; | 
|  2496   { MaybeObject* maybe_code_cache = AllocateStruct(CODE_CACHE_TYPE); |  2513   { MaybeObject* maybe_code_cache = AllocateStruct(CODE_CACHE_TYPE); | 
|  2497     if (!maybe_code_cache->To(&code_cache)) return maybe_code_cache; |  2514     if (!maybe_code_cache->To(&code_cache)) return maybe_code_cache; | 
|  2498   } |  2515   } | 
| (...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  3282   { MaybeObject* maybe_obj = AllocateSymbol(); |  3299   { MaybeObject* maybe_obj = AllocateSymbol(); | 
|  3283     if (!maybe_obj->ToObject(&obj)) return false; |  3300     if (!maybe_obj->ToObject(&obj)) return false; | 
|  3284   } |  3301   } | 
|  3285   set_frozen_symbol(Symbol::cast(obj)); |  3302   set_frozen_symbol(Symbol::cast(obj)); | 
|  3286  |  3303  | 
|  3287   { MaybeObject* maybe_obj = AllocateSymbol(); |  3304   { MaybeObject* maybe_obj = AllocateSymbol(); | 
|  3288     if (!maybe_obj->ToObject(&obj)) return false; |  3305     if (!maybe_obj->ToObject(&obj)) return false; | 
|  3289   } |  3306   } | 
|  3290   set_elements_transition_symbol(Symbol::cast(obj)); |  3307   set_elements_transition_symbol(Symbol::cast(obj)); | 
|  3291  |  3308  | 
 |  3309   { MaybeObject* maybe_obj = AllocateSymbol(); | 
 |  3310     if (!maybe_obj->ToObject(&obj)) return false; | 
 |  3311   } | 
 |  3312   set_element_callbacks_symbol(Symbol::cast(obj)); | 
 |  3313  | 
|  3292   { MaybeObject* maybe_obj = SeededNumberDictionary::Allocate(this, 0, TENURED); |  3314   { MaybeObject* maybe_obj = SeededNumberDictionary::Allocate(this, 0, TENURED); | 
|  3293     if (!maybe_obj->ToObject(&obj)) return false; |  3315     if (!maybe_obj->ToObject(&obj)) return false; | 
|  3294   } |  3316   } | 
|  3295   SeededNumberDictionary::cast(obj)->set_requires_slow_elements(); |  3317   SeededNumberDictionary::cast(obj)->set_requires_slow_elements(); | 
|  3296   set_empty_slow_element_dictionary(SeededNumberDictionary::cast(obj)); |  3318   set_empty_slow_element_dictionary(SeededNumberDictionary::cast(obj)); | 
|  3297  |  3319  | 
|  3298   { MaybeObject* maybe_obj = AllocateSymbol(); |  3320   { MaybeObject* maybe_obj = AllocateSymbol(); | 
|  3299     if (!maybe_obj->ToObject(&obj)) return false; |  3321     if (!maybe_obj->ToObject(&obj)) return false; | 
|  3300   } |  3322   } | 
|  3301   set_observed_symbol(Symbol::cast(obj)); |  3323   set_observed_symbol(Symbol::cast(obj)); | 
| (...skipping 4665 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  7967   if (FLAG_concurrent_recompilation) { |  7989   if (FLAG_concurrent_recompilation) { | 
|  7968     heap_->relocation_mutex_->Lock(); |  7990     heap_->relocation_mutex_->Lock(); | 
|  7969 #ifdef DEBUG |  7991 #ifdef DEBUG | 
|  7970     heap_->relocation_mutex_locked_by_optimizer_thread_ = |  7992     heap_->relocation_mutex_locked_by_optimizer_thread_ = | 
|  7971         heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); |  7993         heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); | 
|  7972 #endif  // DEBUG |  7994 #endif  // DEBUG | 
|  7973   } |  7995   } | 
|  7974 } |  7996 } | 
|  7975  |  7997  | 
|  7976 } }  // namespace v8::internal |  7998 } }  // namespace v8::internal | 
| OLD | NEW |