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 2898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2909 // the empty string when searching for the property. It cannot be part of the | 2909 // the empty string when searching for the property. It cannot be part of the |
2910 // loop above because it needs to be allocated manually with the special | 2910 // loop above because it needs to be allocated manually with the special |
2911 // hash code in place. The hash code for the hidden_string is zero to ensure | 2911 // hash code in place. The hash code for the hidden_string is zero to ensure |
2912 // that it will always be at the first entry in property descriptors. | 2912 // that it will always be at the first entry in property descriptors. |
2913 { MaybeObject* maybe_obj = AllocateOneByteInternalizedString( | 2913 { MaybeObject* maybe_obj = AllocateOneByteInternalizedString( |
2914 OneByteVector("", 0), String::kEmptyStringHash); | 2914 OneByteVector("", 0), String::kEmptyStringHash); |
2915 if (!maybe_obj->ToObject(&obj)) return false; | 2915 if (!maybe_obj->ToObject(&obj)) return false; |
2916 } | 2916 } |
2917 hidden_string_ = String::cast(obj); | 2917 hidden_string_ = String::cast(obj); |
2918 | 2918 |
2919 // Allocate the code_stubs dictionary. The initial size is set to avoid | 2919 // Create the code_stubs dictionary. The initial size is set to avoid |
2920 // expanding the dictionary during bootstrapping. | 2920 // expanding the dictionary during bootstrapping. |
2921 { MaybeObject* maybe_obj = UnseededNumberDictionary::Allocate(this, 128); | 2921 set_code_stubs(*UnseededNumberDictionary::New(isolate(), 128)); |
2922 if (!maybe_obj->ToObject(&obj)) return false; | |
2923 } | |
2924 set_code_stubs(UnseededNumberDictionary::cast(obj)); | |
2925 | 2922 |
2926 | 2923 // Create the non_monomorphic_cache used in stub-cache.cc. The initial size |
2927 // Allocate the non_monomorphic_cache used in stub-cache.cc. The initial size | |
2928 // is set to avoid expanding the dictionary during bootstrapping. | 2924 // is set to avoid expanding the dictionary during bootstrapping. |
2929 { MaybeObject* maybe_obj = UnseededNumberDictionary::Allocate(this, 64); | 2925 set_non_monomorphic_cache(*UnseededNumberDictionary::New(isolate(), 64)); |
2930 if (!maybe_obj->ToObject(&obj)) return false; | |
2931 } | |
2932 set_non_monomorphic_cache(UnseededNumberDictionary::cast(obj)); | |
2933 | 2926 |
2934 { MaybeObject* maybe_obj = AllocatePolymorphicCodeCache(); | 2927 { MaybeObject* maybe_obj = AllocatePolymorphicCodeCache(); |
2935 if (!maybe_obj->ToObject(&obj)) return false; | 2928 if (!maybe_obj->ToObject(&obj)) return false; |
2936 } | 2929 } |
2937 set_polymorphic_code_cache(PolymorphicCodeCache::cast(obj)); | 2930 set_polymorphic_code_cache(PolymorphicCodeCache::cast(obj)); |
2938 | 2931 |
2939 set_instanceof_cache_function(Smi::FromInt(0)); | 2932 set_instanceof_cache_function(Smi::FromInt(0)); |
2940 set_instanceof_cache_map(Smi::FromInt(0)); | 2933 set_instanceof_cache_map(Smi::FromInt(0)); |
2941 set_instanceof_cache_answer(Smi::FromInt(0)); | 2934 set_instanceof_cache_answer(Smi::FromInt(0)); |
2942 | 2935 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3030 } | 3023 } |
3031 Symbol::cast(obj)->set_is_private(true); | 3024 Symbol::cast(obj)->set_is_private(true); |
3032 set_uninitialized_symbol(Symbol::cast(obj)); | 3025 set_uninitialized_symbol(Symbol::cast(obj)); |
3033 | 3026 |
3034 { MaybeObject* maybe_obj = AllocateSymbol(); | 3027 { MaybeObject* maybe_obj = AllocateSymbol(); |
3035 if (!maybe_obj->ToObject(&obj)) return false; | 3028 if (!maybe_obj->ToObject(&obj)) return false; |
3036 } | 3029 } |
3037 Symbol::cast(obj)->set_is_private(true); | 3030 Symbol::cast(obj)->set_is_private(true); |
3038 set_megamorphic_symbol(Symbol::cast(obj)); | 3031 set_megamorphic_symbol(Symbol::cast(obj)); |
3039 | 3032 |
3040 { MaybeObject* maybe_obj = SeededNumberDictionary::Allocate(this, 0, TENURED); | 3033 { |
3041 if (!maybe_obj->ToObject(&obj)) return false; | 3034 Handle<SeededNumberDictionary> dict = |
| 3035 SeededNumberDictionary::New(isolate(), 0, TENURED); |
| 3036 dict->set_requires_slow_elements(); |
| 3037 set_empty_slow_element_dictionary(*dict); |
3042 } | 3038 } |
3043 SeededNumberDictionary::cast(obj)->set_requires_slow_elements(); | |
3044 set_empty_slow_element_dictionary(SeededNumberDictionary::cast(obj)); | |
3045 | 3039 |
3046 { MaybeObject* maybe_obj = AllocateSymbol(); | 3040 { MaybeObject* maybe_obj = AllocateSymbol(); |
3047 if (!maybe_obj->ToObject(&obj)) return false; | 3041 if (!maybe_obj->ToObject(&obj)) return false; |
3048 } | 3042 } |
3049 Symbol::cast(obj)->set_is_private(true); | 3043 Symbol::cast(obj)->set_is_private(true); |
3050 set_observed_symbol(Symbol::cast(obj)); | 3044 set_observed_symbol(Symbol::cast(obj)); |
3051 | 3045 |
3052 { MaybeObject* maybe_obj = AllocateFixedArray(0, TENURED); | 3046 { MaybeObject* maybe_obj = AllocateFixedArray(0, TENURED); |
3053 if (!maybe_obj->ToObject(&obj)) return false; | 3047 if (!maybe_obj->ToObject(&obj)) return false; |
3054 } | 3048 } |
(...skipping 3620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6675 static_cast<int>(object_sizes_last_time_[index])); | 6669 static_cast<int>(object_sizes_last_time_[index])); |
6676 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6670 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
6677 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6671 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
6678 | 6672 |
6679 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6673 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
6680 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6674 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
6681 ClearObjectStats(); | 6675 ClearObjectStats(); |
6682 } | 6676 } |
6683 | 6677 |
6684 } } // namespace v8::internal | 6678 } } // namespace v8::internal |
OLD | NEW |