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 2667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2678 CodeCache* code_cache; | 2678 CodeCache* code_cache; |
2679 { MaybeObject* maybe_code_cache = AllocateStruct(CODE_CACHE_TYPE); | 2679 { MaybeObject* maybe_code_cache = AllocateStruct(CODE_CACHE_TYPE); |
2680 if (!maybe_code_cache->To(&code_cache)) return maybe_code_cache; | 2680 if (!maybe_code_cache->To(&code_cache)) return maybe_code_cache; |
2681 } | 2681 } |
2682 code_cache->set_default_cache(empty_fixed_array(), SKIP_WRITE_BARRIER); | 2682 code_cache->set_default_cache(empty_fixed_array(), SKIP_WRITE_BARRIER); |
2683 code_cache->set_normal_type_cache(undefined_value(), SKIP_WRITE_BARRIER); | 2683 code_cache->set_normal_type_cache(undefined_value(), SKIP_WRITE_BARRIER); |
2684 return code_cache; | 2684 return code_cache; |
2685 } | 2685 } |
2686 | 2686 |
2687 | 2687 |
| 2688 MaybeObject* Heap::AllocatePolymorphicCodeCache() { |
| 2689 return AllocateStruct(POLYMORPHIC_CODE_CACHE_TYPE); |
| 2690 } |
| 2691 |
| 2692 |
| 2693 MaybeObject* Heap::AllocateAliasedArgumentsEntry(int aliased_context_slot) { |
| 2694 AliasedArgumentsEntry* entry; |
| 2695 { MaybeObject* maybe_entry = AllocateStruct(ALIASED_ARGUMENTS_ENTRY_TYPE); |
| 2696 if (!maybe_entry->To(&entry)) return maybe_entry; |
| 2697 } |
| 2698 entry->set_aliased_context_slot(aliased_context_slot); |
| 2699 return entry; |
| 2700 } |
| 2701 |
| 2702 |
2688 const Heap::StringTypeTable Heap::string_type_table[] = { | 2703 const Heap::StringTypeTable Heap::string_type_table[] = { |
2689 #define STRING_TYPE_ELEMENT(type, size, name, camel_name) \ | 2704 #define STRING_TYPE_ELEMENT(type, size, name, camel_name) \ |
2690 {type, size, k##camel_name##MapRootIndex}, | 2705 {type, size, k##camel_name##MapRootIndex}, |
2691 STRING_TYPE_LIST(STRING_TYPE_ELEMENT) | 2706 STRING_TYPE_LIST(STRING_TYPE_ELEMENT) |
2692 #undef STRING_TYPE_ELEMENT | 2707 #undef STRING_TYPE_ELEMENT |
2693 }; | 2708 }; |
2694 | 2709 |
2695 | 2710 |
2696 const Heap::ConstantStringTable Heap::constant_string_table[] = { | 2711 const Heap::ConstantStringTable Heap::constant_string_table[] = { |
2697 #define CONSTANT_STRING_ELEMENT(name, contents) \ | 2712 #define CONSTANT_STRING_ELEMENT(name, contents) \ |
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3223 set_code_stubs(UnseededNumberDictionary::cast(obj)); | 3238 set_code_stubs(UnseededNumberDictionary::cast(obj)); |
3224 | 3239 |
3225 | 3240 |
3226 // Allocate the non_monomorphic_cache used in stub-cache.cc. The initial size | 3241 // Allocate the non_monomorphic_cache used in stub-cache.cc. The initial size |
3227 // is set to avoid expanding the dictionary during bootstrapping. | 3242 // is set to avoid expanding the dictionary during bootstrapping. |
3228 { MaybeObject* maybe_obj = UnseededNumberDictionary::Allocate(this, 64); | 3243 { MaybeObject* maybe_obj = UnseededNumberDictionary::Allocate(this, 64); |
3229 if (!maybe_obj->ToObject(&obj)) return false; | 3244 if (!maybe_obj->ToObject(&obj)) return false; |
3230 } | 3245 } |
3231 set_non_monomorphic_cache(UnseededNumberDictionary::cast(obj)); | 3246 set_non_monomorphic_cache(UnseededNumberDictionary::cast(obj)); |
3232 | 3247 |
3233 { MaybeObject* maybe_obj = AllocateStruct(POLYMORPHIC_CODE_CACHE_TYPE); | 3248 { MaybeObject* maybe_obj = AllocatePolymorphicCodeCache(); |
3234 if (!maybe_obj->ToObject(&obj)) return false; | 3249 if (!maybe_obj->ToObject(&obj)) return false; |
3235 } | 3250 } |
3236 set_polymorphic_code_cache(PolymorphicCodeCache::cast(obj)); | 3251 set_polymorphic_code_cache(PolymorphicCodeCache::cast(obj)); |
3237 | 3252 |
3238 set_instanceof_cache_function(Smi::FromInt(0)); | 3253 set_instanceof_cache_function(Smi::FromInt(0)); |
3239 set_instanceof_cache_map(Smi::FromInt(0)); | 3254 set_instanceof_cache_map(Smi::FromInt(0)); |
3240 set_instanceof_cache_answer(Smi::FromInt(0)); | 3255 set_instanceof_cache_answer(Smi::FromInt(0)); |
3241 | 3256 |
3242 CreateFixedStubs(); | 3257 CreateFixedStubs(); |
3243 | 3258 |
(...skipping 4445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7689 static_cast<int>(object_sizes_last_time_[index])); | 7704 static_cast<int>(object_sizes_last_time_[index])); |
7690 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 7705 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
7691 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 7706 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
7692 | 7707 |
7693 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 7708 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
7694 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 7709 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
7695 ClearObjectStats(); | 7710 ClearObjectStats(); |
7696 } | 7711 } |
7697 | 7712 |
7698 } } // namespace v8::internal | 7713 } } // namespace v8::internal |
OLD | NEW |