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 2818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2829 // the empty string when searching for the property. It cannot be part of the | 2829 // the empty string when searching for the property. It cannot be part of the |
2830 // loop above because it needs to be allocated manually with the special | 2830 // loop above because it needs to be allocated manually with the special |
2831 // hash code in place. The hash code for the hidden_string is zero to ensure | 2831 // hash code in place. The hash code for the hidden_string is zero to ensure |
2832 // that it will always be at the first entry in property descriptors. | 2832 // that it will always be at the first entry in property descriptors. |
2833 { MaybeObject* maybe_obj = AllocateOneByteInternalizedString( | 2833 { MaybeObject* maybe_obj = AllocateOneByteInternalizedString( |
2834 OneByteVector("", 0), String::kEmptyStringHash); | 2834 OneByteVector("", 0), String::kEmptyStringHash); |
2835 if (!maybe_obj->ToObject(&obj)) return false; | 2835 if (!maybe_obj->ToObject(&obj)) return false; |
2836 } | 2836 } |
2837 hidden_string_ = String::cast(obj); | 2837 hidden_string_ = String::cast(obj); |
2838 | 2838 |
2839 // Allocate the foreign for __proto__. | |
2840 { MaybeObject* maybe_obj = | |
2841 AllocateForeign((Address) &Accessors::ObjectPrototype); | |
2842 if (!maybe_obj->ToObject(&obj)) return false; | |
2843 } | |
2844 set_prototype_accessors(Foreign::cast(obj)); | |
2845 | |
2846 // Allocate the code_stubs dictionary. The initial size is set to avoid | 2839 // Allocate the code_stubs dictionary. The initial size is set to avoid |
2847 // expanding the dictionary during bootstrapping. | 2840 // expanding the dictionary during bootstrapping. |
2848 { MaybeObject* maybe_obj = UnseededNumberDictionary::Allocate(this, 128); | 2841 { MaybeObject* maybe_obj = UnseededNumberDictionary::Allocate(this, 128); |
2849 if (!maybe_obj->ToObject(&obj)) return false; | 2842 if (!maybe_obj->ToObject(&obj)) return false; |
2850 } | 2843 } |
2851 set_code_stubs(UnseededNumberDictionary::cast(obj)); | 2844 set_code_stubs(UnseededNumberDictionary::cast(obj)); |
2852 | 2845 |
2853 | 2846 |
2854 // Allocate the non_monomorphic_cache used in stub-cache.cc. The initial size | 2847 // Allocate the non_monomorphic_cache used in stub-cache.cc. The initial size |
2855 // is set to avoid expanding the dictionary during bootstrapping. | 2848 // is set to avoid expanding the dictionary during bootstrapping. |
(...skipping 4964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7820 static_cast<int>(object_sizes_last_time_[index])); | 7813 static_cast<int>(object_sizes_last_time_[index])); |
7821 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) | 7814 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) |
7822 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 7815 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
7823 | 7816 |
7824 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 7817 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
7825 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 7818 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
7826 ClearObjectStats(); | 7819 ClearObjectStats(); |
7827 } | 7820 } |
7828 | 7821 |
7829 } } // namespace v8::internal | 7822 } } // namespace v8::internal |
OLD | NEW |